Fixed native controller for one Chan–He recursion tree #
The controller pops actual seven-word records, skips zero fuel or empty inputs, computes the modulus, constructs the complete heavy and packed outputs, records the packed pointer, and pushes the three children. Children are pushed third, second, first so the existing native stack visits them in the mathematical preorder. Fresh allocations follow every live node; all earlier arrays, the prime bitmap, stack reservation and output table precede the heap.
This module defines executable code. Its correctness and resource proofs belong to the traversal development; these definitions alone do not certify a native preprocessing bound. The frontend and initialized-input composition remain separate.
Main definitions #
oneRoot: the finite native traversal controller, independent of fuel, input sizes and width.visit: complete native modulus and node construction, including output delivery.pushChildren: actual reverse-order stack pushes preserving the original three descriptors.
The native code is original and reuses the existing finite Chan–He construction.
The complete node kernels occupy registers 0–63.
Instances For
The supplied candidate-prime bound.
Instances For
The supplied label-bit parameter.
Instances For
The common input-magnitude bound of the tree.
Instances For
The common number of packed four-cell groups.
Instances For
The prime bitmap, retained below the heap.
Instances For
The exact number of candidate primes.
Instances For
The current fresh allocation base.
Instances For
The reserved output-pointer table.
Instances For
Accumulated output count; this is not reset between roots.
Instances For
The reserved word-stack base.
Instances For
The reserved word-stack capacity, used by the safety specification.
Instances For
Controller constant zero.
Instances For
Controller constant one.
Instances For
Controller address temporary.
Instances For
The computed unsigned modulus.
Instances For
The three computed heavy lengths.
Instances For
The three computed heavy bases.
Instances For
Current packed-array base.
Instances For
One-past-end of the current node allocation.
Instances For
Saved original descriptor words, outside both kernels and the stack dispatcher.
Instances For
Fourteen actual instructions deliver the modulus program's complete caller ABI.
Instances For
Ten actual copies deliver the complete node builder's caller ABI.
Instances For
Read the three actual count cells, record the packed pointer, and advance the fresh heap.
Instances For
Complete actual native calls, with argument preparation, modulus copy and output delivery.
Instances For
Decrease fuel, retain both descriptors needed for restoration, and prepare the third child.
Instances For
Restore the third original descriptor and prepare the second child.
Instances For
Restore the second original descriptor and prepare the first child.
Instances For
Push third, second, first. Every child retains the two other original set descriptors.
Instances For
A popped record either skips exactly the mathematical guard or executes the complete node.
Instances For
The actual pending-word stack, including zero-fuel and empty entries, controls the loop.
Instances For
The complete finite native controller for one supplied root. It appends to the caller's output table, retaining the accumulated count and advancing the fresh allocation base.
Instances For
The same finite controller is used at every admitted word width.
The native controller has a fixed finite instruction list, independent of recursion fuel.
Registers 109–127 are retained for the outer frontend-forest controller.