Actual fusion-tree traversal instructions #
The traversal uses eight caller registers, disjoint from both node routines. A width-indexed choice of node code is made at compilation. The stored tree, its keys and its query remain runtime inputs. Leaves return an option as a presence flag and a full-key value.
Main definitions #
QueryProgram.registers,QueryProgram.query,QueryProgram.pointer,QueryProgram.rank,QueryProgram.active,QueryProgram.found,QueryProgram.value,QueryProgram.one,QueryProgram.zero,QueryProgram.address,QueryProgram.tag,QueryProgram.offset: register allocation for the fusion-tree traversal.QueryProgram.setup,QueryProgram.leaf,QueryProgram.follow,QueryProgram.node,QueryProgram.internal,QueryProgram.body,QueryProgram.loop,QueryProgram.code,QueryProgram.program: initialization, leaf inspection, child-pointer descent, node dispatch, and the complete structured and flat query programs.QueryProgram.answer: the conventional two-register option encoding.QueryProgram.Entry,QueryProgram.initialized,QueryProgram.leafResult,QueryProgram.followResult: traversal register invariant and step-result data states.
Main results #
QueryProgram.exec_leaf: literal leaf loads and inclusive full-key comparison.QueryProgram.exec_follow: the actual stride-two child-pointer load.
References #
Both node subroutines use the same fixed register file.
Query key, preserved throughout traversal.
Current record pointer.
Inclusive rank returned by either node routine.
Loop flag.
Answer presence flag.
Answer full key, zero on absence.
Constant one.
Constant zero.
Address scratch.
Record tag, then leaf key.
Leaf presence or child-table offset.
Conventional presence/value representation, including key zero.
Constant-register installation is part of the charged query.
Inspect a literal leaf record; comparison is inclusive at equality.
Positive rank r selects pointer entry p + 19 + 2(r-1).
Code selection depends only on the physical word width.
Zero rank terminates with absence; positive rank follows an actual stored pointer.
One traversal iteration first loads the current record tag.
Descent terminates at a leaf or a zero child rank.
Actual width-indexed query code, with initialization included.
Flat query program; it halts with the value register, with presence retained in found.
Persistent registers before visiting a record. No scratch-register assumptions occur.
Initialization data, with arbitrary preexisting workspace and memory.
Five charged constant instructions establish all traversal constants.
Exact literal leaf execution data.
Charged presence/key loads and comparisons need at most twelve instructions.
Leaf execution stops, preserves memory and query, and returns a canonical option.
Literal register updates and load for the selected child pointer.
Six real instructions compute and load the interleaved pointer.
Following a child preserves the invariant, changing only the current record address.
Child-pointer traversal has no memory writes.