Shared Word-RAM B-Tree Scratch Registers, Inner Loops, and Node-Header Scanner #
Internal infrastructure shared privately across the B-tree lookup, split, and insertion modules
(never re-exported publicly by CslibFrontier.DataStructure.BTree.WordRAM):
- Scratch register indices
rZero..rTmp2(Fin 20slots5..19). - Arena address bounds (
stride_le_arena,nodeAddr_add_le_arena) and slot-count order helpers (slotCount_le,keyAt_gt_of_slotCount_not_hit). - Bounded array-copy wrapper
copyArrayCode(copyArrayCode_spec), backward-shift loopshiftLoop(shiftLoop_spec), within-node key scanslotScanLoop(slotScanLoop_spec), and combined node-header + key-scan routineloadAndScan(loadAndScan_spec).
Scratch register holding constant 0.
Scratch register holding constant 1.
Scratch register holding nodeStride t = 6 * t.
Scratch register holding the current node index u.
Scratch register holding the child node index c.
Scratch register holding the allocated node count cnt.
Scratch register holding the scanned key slot slot.
Scratch register holding the current node's key count m.
Scratch register holding a source array address.
Scratch register holding a destination array address or upper bound.
Scratch register holding a loop limit N.
Scratch register holding a loop counter j.
Scratch register holding the loop-continuation flag (1 active, 0 done).
Temporary arithmetic/address scratch register 1.
Temporary arithmetic/address scratch register 2.
One node stride 6 * t fits inside any non-empty arena capacity 1 ≤ capNodes.
When slot = slotCount base t mem u k m is not an exact hit on a strictly sorted node, every
key at index i ≥ slot (i < m) is strictly greater than k.
Specification of copyArrayCode on separated or identical ranges of length N.
Specification of shiftLoop, matching shiftArrRight arrBase upper count.
Specification of slotScanLoop, computing slotCount base t x.mem u k m in rSlot.
Specification of loadAndScan on node u < capNodes.