Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxQuery.Program

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.

@[reducible, inline]

The same fixed bank as the shared box-table constructor.

@[reducible, inline]

Original output code in the existing least-significant-first numbering.

@[reducible, inline]

Computed work-stack base, after the retained compact table.

@[reducible, inline]

Number of occupied native stack records.

@[reducible, inline]

Depth of the popped prefix, incremented before producing children.

@[reducible, inline]

Existing native decimal index of the popped prefix.

@[reducible, inline]

Number of indexed inner terms already chosen.

@[reducible, inline]

Initial inner P0 count, the canonical box's eventual star count.

@[reducible, inline]

Power of ten at the popped prefix's depth.

@[reducible, inline]

Current output digit, before fixed finite child dispatch.

@[reducible, inline]

Arithmetic temporary outside the signed workspace.

@[reducible, inline]

Canonical signed query accumulator and returned result.

@[reducible, inline]

Native stack record width, reusing a finished table-stage temporary.

@[reducible, inline]

Child power, reusing the finished table-stage stride register.

Store every word of one newly occupied stack record before it can be read.

One fixed indexed term; code generation unrolls nine terms, not the input depth.

Indexed children are pushed in reverse order, so P0 then digits zero through eight pop first.

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.

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.

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.

The fourth header shifts the two original arrays by one word relative to table-only input.

Complete original-input adaptation and actual shared geometry/value construction.

Complete constructor and one query: no supplied table, catalogue or execution certificate.