Native Strassen child layout and explicit frame push #
The six buffer calculations and the parent/child frame stores are actual native execution.
The frame readback is proved from Cslib.WordRAM.storeRecord_exec; it is not supplied as an
algorithm input. Only one parent phase cell and seven newly pushed frame words change memory.
theorem Cslib.Algorithms.WordRAM.Strassen.exec_locateChild {w : ℕ} (x : WordRAM.Data 64) (h1 : x.regs Reg.one = 1) (h4 : x.regs Reg.four = 4) (hw : WordRAM.Fits w (x.regs Reg.scratch + x.regs Reg.size + x.regs Reg.depth + 4)) :
∃ (y : WordRAM.Data 64),
WordRAM.ExecWithin w locateChild x y 6 ∧ y.mem = x.mem ∧ y.regs Reg.quarter = x.regs Reg.size / 4 ∧ y.regs Reg.formA = x.regs Reg.scratch ∧ y.regs Reg.formB = x.regs Reg.scratch + x.regs Reg.size / 4 ∧ y.regs Reg.product = x.regs Reg.scratch + 2 * (x.regs Reg.size / 4) ∧ y.regs Reg.childScratch = x.regs Reg.scratch + 3 * (x.regs Reg.size / 4) ∧ y.regs Reg.childDepth = x.regs Reg.depth - 1 ∧ ∀ (i : Fin 64),
i ≠ Reg.quarter →
i ≠ Reg.formA →
i ≠ Reg.formB →
i ≠ Reg.product → i ≠ Reg.childScratch → i ≠ Reg.childDepth → y.regs i = x.regs i
Six native arithmetic/copy instructions derive every child buffer and depth.
Only current frame fields, its pointer, address scratch and dispatch tag change on push.
Instances For
@[instance_reducible]
theorem Cslib.Algorithms.WordRAM.Strassen.exec_push {w : ℕ} (phase : Fin 8) (x : WordRAM.Data 64) (h1 : x.regs Reg.one = 1) (h7 : x.regs Reg.frameWidth = 7) (hw : WordRAM.Fits w (x.regs Reg.frame + 14)) :
∃ (y : WordRAM.Data 64),
WordRAM.ExecWithin w (push ↑phase) x y 26 ∧ y.regs Reg.frame = x.regs Reg.frame + 7 ∧ y.regs Reg.inputA = x.regs Reg.formA ∧ y.regs Reg.inputB = x.regs Reg.formB ∧ y.regs Reg.output = x.regs Reg.product ∧ y.regs Reg.scratch = x.regs Reg.childScratch ∧ y.regs Reg.depth = x.regs Reg.childDepth ∧ y.regs Reg.size = x.regs Reg.quarter ∧ y.regs Reg.phase = 0 ∧ (∀ (j : Fin 7), y.mem (y.regs Reg.frame + ↑j) = y.regs (field j)) ∧ y.mem (x.regs Reg.frame + 6) = ↑phase ∧ (∀ (a : ℕ), a < x.regs Reg.frame + 6 ∨ x.regs Reg.frame + 14 ≤ a → y.mem a = x.mem a) ∧ ∀ (i : Fin 64), ¬PushLocal i → y.regs i = x.regs i
Push a real child in twenty-six instructions, preserving the old parent fields except its phase and writing the entire new frame. All child fields come from actual controller words.