Native sparse box-query controller #
Each pending prefix occupies five actual words: depth, completed decimal prefix, number of non-P0 inner terms, initial inner-P0 count, and power of ten. At an outer coordinate only the private term is pushed. At an inner coordinate P0 is always pushed, with the nine other terms only while the threshold permits them. The stack therefore visits the contributing prefixes of order at most the threshold directly.
Low-order leaves read and multiply actual encoding words. Exact-threshold leaves
read the previously constructed compact box table, with key stars*10^L+completion.
Every signed arithmetic operation is the existing native unsigned implementation.
The shared geometry/table are constructed once, outside the reusable query routine.
This worklist implementation is original. It realizes the finite query expression of [AlmanWilliams2026, Section 4.2] using the existing boxes and native term numbering; it does not copy the primary source's bounded-nine-string successor or trie machine.
The same fixed bank as the shared box-table constructor.
Original output code in the existing least-significant-first numbering.
Computed work-stack base, after the retained compact table.
Number of occupied native stack records.
Current stack-record address.
Depth of the popped prefix, incremented before producing children.
Existing native decimal index of the popped prefix.
Number of indexed inner terms already chosen.
Initial inner P0 count, the canonical box's eventual star count.
Power of ten at the popped prefix's depth.
Current output digit, before fixed finite child dispatch.
Completed child decimal prefix.
Child's indexed-inner count.
Child's initial-P0 count.
Arithmetic temporary outside the signed workspace.
Canonical signed query accumulator and returned result.
Native stack record width, reusing a finished table-stage temporary.
Child power, reusing the finished table-stage stride register.
Store every word of one newly occupied stack record before it can be read.
Pop and read one actual complete five-word task.
One fixed indexed term; code generation unrolls nine terms, not the input depth.
Compute and store one indexed child.
Fixed finite dispatch, preserving the genuine constant register count.
Indexed children are pushed in reverse order, so P0 then digits zero through eight pop first.
Compute the P0 child and its exact initial-P0 count.
P0 is the final pushed child and the first visited one.
Compute the only child at an outer output coordinate.
Fixed outer terms introduce no additional query branching.
Decode the real next output digit and calculate the child depth and power once.
Branch only on the original output digit and already used non-P0 inner count.
Load and multiply the actual low-order leaf entries.
Deliver the real leaf product as the right signed addend.
Compute the canonical box key, actual directory rank, and stored signed addend.
Add one real low product or stored box value to the canonical signed accumulator.
Low-order leaves multiply; exact-threshold leaves use one canonical stored box.
Pop one genuine task, then either expand it or consume its complete-leaf value.
Compute the stack base and initialize all five actual root fields.
Initialize every scalar read by the stack controller, including all five root words.
Reusable query from already constructed geometry and one retained actual value table.
Read the ordinary depth, order/threshold headers and original output code.
The fourth header shifts the two original arrays by one word relative to table-only input.
Actual original-input adaptation, using the existing power code.
Complete original-input adaptation and actual shared geometry/value construction.
Complete constructor and one query: no supplied table, catalogue or execution certificate.