Reduce duplicate bootstrap batch probes · Entire

Reduce duplicate bootstrap batch probes

709a9b8→main·

Soph·3mo ago·2 files·+7 added/-1 removed

Sessions

28372368f4e8View transcript

[?
Can you take a look at the go code (wasm) in /Users/soph/Work/entire/devenv/entire-io-worktree1 based a bit on that I wonder if something like this can be build:Codex·GPT-5.4·1 step](/content/gh/entireio/git-sync/session/019d6d29-8cf7-7fe3-adc9-8c3e4d9d5603#timeline-28372368f4e8/index.html)

Changes

2

304 unmodified lines

305
306
307
308
308
309
310
311

304 unmodified lines

- Rewrite branch should significantly reduce HTTP round-trips during batch planning.

Current rewrite note:
- The rewrite adds an initial commit-count heuristic to reduce probing, but still performs fetch-and-discard sizing probes in the bootstrap planner.
- The rewrite adds an initial commit-count heuristic and now memoizes repeated equivalent probe results within a planning run, but it still performs fetch-and-discard sizing probes in the bootstrap planner.

### 15. Materialized fallback path does not scale to large repos

Mdocs/rewrite-issue-list.md+1/-1

329 unmodified lines

330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347

329 unmodified lines

prevIdx := -1
    prevHash := plumbing.ZeroHash
    prevSpan := initialSpan
    probeCache := make(map[string]bool)
    for prevIdx < len(chain)-1 {
        bestIdx, err := planner.SampledCheckpointUnderLimit(chain, prevIdx, prevSpan, func(idx int) (bool, error) {
            cacheKey := prevHash.String() + ":" + strconv.Itoa(idx)
            if tooLarge, ok := probeCache[cacheKey]; ok {
                return tooLarge, nil
            }
            ooLarge, err := packExceedsLimit(ctx, p, ref, chain[idx], prevHash, p.BatchMaxPack)
            if err != nil {
                return false, fmt.Errorf("measure bootstrap batch for %s at %s: %w", ref.TargetRef, planner.ShortHash(chain[idx]), err)
            }
            probeCache[cacheKey] = tooLarge
            return tooLarge, nil
        })
        if err != nil {