Beagle SCM
CODE-056: repsOf: the WALK_CAP truncates silently, once per path per tip
- Now
- OPEN
- Sev
- MED
- Rep
- ///bee
- Ask
- gritzko
- Rev
- ///bee#8cb69a0
- See
- BEE-005
- See
- CODE-068
Context
index/dag.js:103:~c with :12 WALK_CAP (65536) stops the ancestor walk and says
nothing. On /src/linux drivers/gpu/drm/i915/i915_drv.c (deleted at HEAD,
1458 revs) gets 0 reps at the default cap and 27 at 400k: zero reps drops the
path into the degraded empty-seed fold, and a PARTIAL truncation is worse — a
wrong floor and spurious hunks with no message. The walk is also redone per
path per tip with no parentsOf memo (375 ms per capped walk on linux, 75 s
before any folding for a 100-path diff); view/status.js:223:vX,379 builds full
ancestors sets through the same cap. Found in the 2026-09-18 review.
Goals
One commit-DAG walk per diff serving every path, stopping at the frontier of
found reps rather than at a global commit count, and a loud note when a cap
does bite.
WIP
TODOs
- [x] repro: deep deleted path answers 0 reps under the cap
- [x] shared walk per diff; cap reported
Design decisions
- The reps walk gets a bound of its own, REP_CAP (2^21), apart
from WALK_CAP: it stops at the FRONTIER of the revs found, so
the bound is a brake and not the rule. Only a commit the walk
EXPANDS spends it, and past it the queue is still read for
revs: a bite costs depth, never a rev already in hand.
- A bite is io.log'd and left on the result as
capped, so the
empty-seed fold in index/weave.js:203:KB is never silent again.
- parentsOf memoises its CPAR rows per index handle (a WeakMap),
so one diff walks the commit dag once for every path it folds.
- repsOf answers the MAXIMAL revs it found, not every one: a rev
another found rev descends from already rides in that one's
closure, so it stands for nothing of its own. On linux that
is 345 -> 28 reps for i915_drv.c, 4045 -> 107 for MAINTAINERS.
CODE-068 plans the same reduction inside floorRev; with this
one in repsOf, that half of CODE-068 has nothing left to do.
Blockers and bummers
- The complete walk for a path deleted 417743 commits ago costs
8.1 s and 673 MB RSS on ~/src/linux, paid once per diff (the
next two paths cost 2.3 s and 1.1 s off the memo). That is
the price of an answer where there was none at all, and
REP_CAP is the one constant to turn if the trade is wrong.
- view/status.js:223:vX only NOTES its cap: ahead/behind still
truncate at WALK_CAP, since a full ancestor set is what the
divergence algorithm itself wants — its own ticket, not this.
Outcome