Two tree walkers recurse per nesting level while each frame holds a live ~1MB buffer with no depth cap: keep_walk_tree maps u8bMap(tbuf, 1<<20) per level and recurses before unmapping; walk_tree_dive carves a_carve(u8, tbuf, 1<<20) and recurses bare so each BASS carve survives across the child fetch. A pathologically deep directory chain (a legal git tree shape) drives recursion to the SHA cap (~65536) for keep_walk_tree → C-stack overflow, or exhausts the per-thread BASS arena for walk_tree_dive (graceful WALKNOROOM). The goal is to bound depth and stop stacking one big buffer per level.
Per-level recursion with a 1MB buffer live across the recursive call; no depth cap.
keeper/KEEP.c:2632 keep_walk_tree recurses with tbuf (1MB, mapped :2606) still mapped until :2638; only *n>=cap (cap=65536) bounds SHAs, not depth → ~65536 frames → stack overflow.keeper/WALK.c:96 walk_tree_dive bare recursive call (deliberately not in call()), so each a_carve(u8,tbuf,1<<20) (:45) stacks on BASS with no rewind; deep tree → arena exhaustion (WALKNOROOM).UNPK_MAX_CHAIN); content-addressing precludes true cycles but deep nesting is constructible.None.
-v Depth cap: walk_tree_dive returns WALKBADFMT at WALK_MAX_DEPTH (4096) — keeper/WALK.c:50, WALK.h:56 (0eb0afab KEEP-001). -v Per-level buffer shrunk 1MB→64KiB (keeper/WALK.c:60) and subtree recursion goes through try() so each child's BASS scratch rewinds on return (WALK.c:142-144) — 0eb0afab + 49039f36 GET-020. -v keep_walk_tree (KEEP.c) no longer exists — converged with 3 other walkers into KEEPWalkTree (0eb0afab KEEP-001). -v Repro: keeper/test/WALK.c Test 7 "deep tree terminates cleanly, cap holds (KEEP-001)".
0eb0afab KEEP-001: converged 4 tree-walkers into KEEPWalkTree; walk_tree_dive gets the WALK_MAX_DEPTH=4096 cap and a right-sized 64KiB per-level carve (1MB only on >64KiB re-inflate).49039f36 GET-020: try()-wraps the tree-walk recursion so per-subtree BASS scratch is rewound (no more one-live-carve-per-level).