Actual span capture and complete box-ABI restoration #
The existing checked native span arithmetic is reused. Its computed low pointers are captured before those registers are repurposed, and every scalar read by the retained box constructor is restored. Scratch values from earlier queries may be arbitrary.
theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxProduct.exec_tileArguments {w L m t N Q j a b : ℕ} (x : WordRAM.Data 160) (hp : QueriedProduct.Parameters L m N Q x) (hb : Parameters L m t N Q x) (hx : x.regs QueriedProduct.Reg.index = j) (hj : j < MatrixMultiplication.Schonhage.numBands L m N ^ 2) (ha : x.mem (QueriedProduct.offsetBase L m N Q + j) = a) (hstop : x.mem (QueriedProduct.offsetBase L m N Q + j + 1) = b) (hab : a ≤ b) (hbQ : b ≤ Q) (hfit : WordRAM.Fits w (wordBudget L m t N Q)) :
∃ (y : WordRAM.Data 160),
WordRAM.ExecWithin w tileArguments x y 44 ∧ QueriedProduct.Parameters L m N Q y ∧ Parameters L m t N Q y ∧ y.mem = x.mem ∧ y.regs QueriedProduct.Reg.index = j ∧ BoxTable.CatalogueParameters L (m - t) (directoryBase L m N Q) (recordBase L m t N Q)
(WordRAM.Data.comap boxBank y) ∧ (WordRAM.Data.comap boxBank y).regs BoxTable.Reg.inner = m ∧ (WordRAM.Data.comap boxBank y).regs BoxTable.Reg.threshold = t ∧ (WordRAM.Data.comap boxBank y).regs BoxTable.Reg.values = valueBase L m t N Q ∧ (WordRAM.Data.comap boxBank y).regs BoxTable.Reg.count = (MatrixMultiplication.Schonhage.boxes L m t).card ∧ (WordRAM.Data.comap boxBank y).regs BoxTable.Reg.arrayA = BandPreparation.catalogueBase L m N + j / MatrixMultiplication.Schonhage.numBands L m N * 10 ^ L ∧ (WordRAM.Data.comap boxBank y).regs BoxTable.Reg.arrayB = BandPreparation.catalogueBase L m N + (MatrixMultiplication.Schonhage.numBands L m N + j % MatrixMultiplication.Schonhage.numBands L m N) * 10 ^ L ∧ (WordRAM.Data.comap boxBank y).regs BoxBatch.Reg.next = QueriedProduct.codeBase L m N Q + a ∧ (WordRAM.Data.comap boxBank y).regs BoxBatch.Reg.stop = QueriedProduct.codeBase L m N Q + b ∧ (WordRAM.Data.comap boxBank y).regs BoxBatch.Reg.output = resultBase L m t N Q ∧ y.regs QueriedProduct.Reg.destination = QueriedProduct.groupedBase L m N Q + a ∧ y.regs QueriedProduct.Reg.length = b - a
Actual checked span arithmetic and complete box argument restoration, including the saved query cursors and real temporary-to-grouped copy arguments.