sonar

Scan files at memory bandwidth speed.
Log | Files | Refs

commit 05918e2de6bea36e9679c983aa138feb6bf1e831
parent 183118dae0d139cd30192c990ffa06f3839385a5
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Sun, 20 Sep 2026 07:43:50 -0300

main: stop a parent chain that leaves the tree

Rolling up in batch and rebuilding a path both stop when a parent points past the
last slot; charging a node incrementally did not. Every reachable parent is
clamped upstream today, so this is a guard rather than a repair, but it is the
one walk of the three that runs against a tree a reader is still filling, and it
indexes a slice sized to the count it does not check.

Diffstat:
Mrollup.odin | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/rollup.odin b/rollup.odin @@ -65,8 +65,11 @@ charge :: proc(r: ^Rollup, t: ^scan.Tree, i: u32) { append(&r.pending, i) return } - if c.parent == cur { - break // a root, or an orphan: the chain ends here + // A root, an orphan, or a parent that leaves the tree: the chain ends here. + // The batch roll-up and path rebuilding both stop on the same conditions, and + // this is the one that runs while a reader is still filling slots in. + if c.parent == cur || c.parent >= t.count { + break } chain[depth] = c.parent depth += 1