Native descriptor popping in the fused visitor #
The original seven-pop routine executes in the preprocessing register bank with the same exact clock. Its stack frame, actual descriptor readback and outer register frame are retained.
Main results #
theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.pop_entry {r w base capacity : ℕ} (x : WordRAM.Data (registerCount r)) (e : ChanHe.Traversal.Entry) (es : List ChanHe.Traversal.Entry) (h2 : WordRAM.Fits w 2) (hcap : WordRAM.Fits w (base + capacity)) (hr :
ChanHe.Traversal.WordStack.Rep w base capacity (List.flatMap ChanHe.Traversal.Entry.words (e :: es))
(WordRAM.Data.comap ChanHe.Traversal.registers (WordRAM.Data.comap (preprocessingRegisters r) x))) :
∃ (y : WordRAM.Data (registerCount r)),
WordRAM.Exec w (WordRAM.Code.rename (preprocessingRegisters r) ChanHe.Traversal.popFrame) x y 99 ∧ ChanHe.Traversal.WordStack.Rep w base capacity (List.flatMap ChanHe.Traversal.Entry.words es)
(WordRAM.Data.comap ChanHe.Traversal.registers (WordRAM.Data.comap (preprocessingRegisters r) y)) ∧ e.Loaded (WordRAM.Data.comap (preprocessingRegisters r) y) ∧ WordRAM.Modifies (ChanHe.Traversal.WordStack.footprint base capacity) x.mem y.mem ∧ (∀ (j : Fin 128),
ChanHe.Traversal.Outside j →
↑j < 64 ∨ 71 ≤ ↑j → y.regs (preprocessingRegisters r j) = x.regs (preprocessingRegisters r j)) ∧ ∀ (j : Fin 16), y.regs (controllerRegisters r j) = x.regs (controllerRegisters r j)
Lift the actual seven-pop program and all its readback/frame facts into the visitor.
theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.body_skip {r w : ℕ} {x y : WordRAM.Data (registerCount r)} {e : ChanHe.Traversal.Entry} (solver : WordRAM.Code WordRAM.Basis.standard (r + 7)) (hp : WordRAM.Exec w (WordRAM.Code.rename (preprocessingRegisters r) ChanHe.Traversal.popFrame) x y 99) (hl : e.Loaded (WordRAM.Data.comap (preprocessingRegisters r) y)) (hz : y.regs (preprocessingRegisters r ChanHe.Traversal.zero) = 0) (hskip : e.fuel = 0 ∨ (e.data 0).length = 0 ∨ (e.data 1).length = 0 ∨ (e.data 2).length = 0) :
WordRAM.ExecWithin w (body solver) x y 107
The actual dispatch preserves the pop result when fuel or any source column is empty.
theorem Cslib.Algorithms.WordRAM.ThreeSum.Decision.Visitor.body_live {r w T : ℕ} {x a y : WordRAM.Data (registerCount r)} {e : ChanHe.Traversal.Entry} (solver : WordRAM.Code WordRAM.Basis.standard (r + 7)) (hp : WordRAM.Exec w (WordRAM.Code.rename (preprocessingRegisters r) ChanHe.Traversal.popFrame) x a 99) (hl : e.Loaded (WordRAM.Data.comap (preprocessingRegisters r) a)) (hz : a.regs (preprocessingRegisters r ChanHe.Traversal.zero) = 0) (hf : e.fuel ≠ 0) (hn : ∀ (j : Fin 3), (e.data j).length ≠ 0) (hv : WordRAM.ExecWithin w (visit solver) a y T) :
A live descriptor takes all four actual negative guards before its complete visit.