Native stack calls for Chan–He traversal records #
Traversal keeps a seven-word record in registers 64–70 and the existing bounded stack in registers 96–104. Registers below 64 remain available to the complete modulus and node programs. Each record contains fuel followed by three base/length pairs. The stack stores words, so a record is pushed in reverse order and popped in forward order.
The dispatcher, representation and memory frame are reused from Cslib.WordRAM.Stack.
Argument delivery and result copies here are actual native instructions and are charged.
Main definitions #
slot: the seven persistent traversal-record registers.registers: the existing nine-register stack dispatcher inside the 128-register controller.pushSlot: native argument delivery followed by the complete bounded-stack dispatcher.popSlot: native dispatch and result delivery to one traversal-record register.
Main results #
pushSlot_exec: a nine-instruction push, with the exact stack, memory and register frames.popSlot_exec: a fourteen-instruction nonempty pop with the same exact frames.pushFrame_exec,popFrame_exec: complete seven-word record transfers in 64 and 99 instructions.
The native controller and its composition proofs are original.
Fuel and the three base/length pairs, retained across both 64-register native kernels.
Instances For
Pointer word of the selected pending set.
Instances For
Length word of the selected pending set.
Instances For
The existing stack's workspace lies above every 64-register node-kernel register.
Instances For
Caller-owned registers outside the stack dispatcher.
Instances For
Deliver the push tag and actual record word, then execute the existing stack program.
Instances For
Each native push includes both argument instructions, not a host-level stack operation. Every register outside 96–104 and every memory cell outside the reserved stack is preserved.
Push all seven words in reverse order, so the next seven pops recover the record in order. The trailing self-copy gives the fixed empty suffix an ordinary native instruction.
Instances For
The complete native frame push charges all seven dispatches and argument delivery. There is no host-level record write, and the exact seven-word sequence is at the stack top.
Deliver the pop tag, execute the complete dispatcher, and copy its answer to the record.
Instances For
A nonempty native pop includes both argument instructions and the actual result copy. Only the selected record register, stack workspace and reserved stack memory may change.
Pop all seven words into the record, in forward order, using the native dispatcher.
Instances For
The complete record pop charges every argument, dispatch and result-copy instruction. The seven restored words have their original order; other caller registers are preserved.
Record transfers do not inspect the physical word width.