Shared native initialization of a Chan–He root #
The catalogue producer and in-place consumer execute the same four setup instructions and seven-word root push. This boundary proves their actual 68-instruction prefix once, retaining the root's word order, persistent registers and stack write frame.
Main definitions #
initializeRoot: the existing setup and root push, without a traversal loop.
Main results #
initializeRoot_exec: exact charged initialization and root-stack readback.
The common four-instruction setup and actual seven-word push.
theorem Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Traversal.initializeRoot_exec {a : Arena} {w : ℕ} (x : WordRAM.Data 128) (e : Entry) (hx : WordRAM.Data.Bounded w x) (hc : a.Controls x) (hl : e.Loaded x) (h2 : WordRAM.Fits w 2) (hcap : WordRAM.Fits w (a.stack + a.capacity)) (hcapacity : 7 ≤ a.capacity) :
∃ (b : WordRAM.Data 128),
WordRAM.Exec w initializeRoot x b 68 ∧ WordStack.Rep w a.stack a.capacity e.words (WordRAM.Data.comap registers b) ∧ a.Controls b ∧ WordRAM.Modifies (WordStack.footprint a.stack a.capacity) x.mem b.mem ∧ ∀ (i : Fin 128), Outside i → b.regs i = x.regs i
Initialize the existing stack from an actual loaded descriptor, preserving every register outside the stack dispatcher and changing memory only in its reserved footprint.