Live frontend forest state for the in-place Chan–He visitor #
The outer proof state records completed root descriptors and the nodes already consumed. Every untouched frontend array remains live. Allocation credit reserves a separate complete recursion budget for each remaining root; no published packed-pointer table is retained.
Restrict one root to its allocation allowance without moving any physical region.
A smaller root allocation allowance retains the admitted native kernel envelope.
The caller's same value and address envelope covers every restricted root.
Proof state of the actual descriptor loop.
- index : ℕ
Number of actual root descriptors already consumed.
- nodes : List ThreeSum.ChanHe.Node
Exact ordered mathematical nodes already supplied to the native solver.
Exact pending mathematical preorder for the untouched frontend descriptors.
Outer traversal credit plus charges for the actual nodes still awaiting the solver.
Loading the next descriptor consumes precisely its recursion preorder before later roots.
Exact outer charge for one root, including descriptor loading, increment and loop control.
Actual descriptors, live memory and Boolean fold at the native outer loop header.
- bounded : WordRAM.Data.Bounded (w + 2) x
Every native word remains bounded, including used callee scratch.
Persistent traversal parameters survive every root.
- frontend : Frontend.Output l U rs x.mem
Actual frontend descriptors and compact arrays remain available.
Actual native descriptor base.
Actual native root count.
Actual next descriptor index.
Native shared recursion fuel.
Native descriptor stride.
Native outer-loop increment constant.
All roots up to this index have been executed.
Actual prime bitmap remains live.
Heap remains above shared reservations.
- heapBudget : x.regs (preprocessingRegisters r ChanHe.Traversal.heap) + (l.count - s.index) * (ChanHe.Traversal.Math.work a.fuel * ChanHe.Traversal.allocationSize a.n a.m a.N) ≤ a.ceiling
Every remaining root retains its own complete allocation allowance.
Actual common packed length.
Computed caller value envelope.
Native Boolean constant one.
Accumulated result is a raw Boolean.
- verdict : x.regs (controllerRegisters r answer) = 1 ↔ ∃ node ∈ s.nodes, ThreeSum.Convolution (4 * a.N) (node.oneArray a.U)
Every consumed node contributes exactly its Convolution verdict.
- exactOutput : s.nodes ++ s.remaining a l U rs = ChanHe.Traversal.Math.output a.m.primesLE a.Λ (List.map ChanHe.Traversal.Entry.task (ChanHe.Preprocessing.entries l U rs))
Consumed prefix and untouched roots retain the entire finite forest preorder.
Original frontend/source cells survive for every later root.
A live outer header can afford the one complete root it is about to execute.