Record decoding without low-payload staging #
Only the selected record, logarithm and five scalar/header words are prepared, followed by the
ordinary threshold patch. Raw matrices and query occurrences remain at their physical source
pointers. Contiguous-input preparation with low-payload array copies is provided separately by
RecordProduct.prepare.
Read and decode an actual record, then initialize only the scalar header and threshold.
theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordBoxProduct.exec_prepare {W b m n i out rho piece s t q : ℕ} (X : Matrix (Fin n) (Fin (MatrixMultiplication.Schonhage.D m)) ℤ) (Y : Matrix (Fin (MatrixMultiplication.Schonhage.D m)) (Fin n) ℤ) (qs : List (Fin n × Fin n)) (x : WordRAM.Data 320) (hD : x.mem 1 = MatrixMultiplication.Schonhage.D m) (hn : x.mem 3 = n) (hi : x.regs RecordProduct.Reg.ordinal = i) (hout : x.regs 39 = out) (hb : x.regs 42 = b) (hrec : out + i * (6 + 2 * (n * MatrixMultiplication.Schonhage.D m)) + 6 ≤ b) (hrecord :
{ base := out + i * (6 + 2 * (n * MatrixMultiplication.Schonhage.D m)), length := 6 }.Realizes x.mem
![rho, piece, q, qs.length, s, t]) (hfit :
WordRAM.Fits W
(2 * b + 2 * (n * MatrixMultiplication.Schonhage.D m) + 2 * qs.length + 20 * m + MatrixMultiplication.Schonhage.D m + n + 256)) :
∃ (y : WordRAM.Data 320),
WordRAM.ExecWithin W prepare x y (8 * m + 64) ∧ y.regs RecordProduct.Reg.base = b ∧ y.regs RecordProduct.Reg.left = s ∧ y.regs RecordProduct.Reg.right = t ∧ y.regs RecordProduct.Reg.queries = q ∧ (∀ a < 5,
y.mem (b + a) = (WordRAM.State.init
(MatrixMultiplication.Schonhage.BoxProduct.input true (21 * m) (m / 9) X Y qs)).data.mem
a) ∧ y.mem (b + MatrixMultiplication.Schonhage.QueriedProduct.inputEnd m n qs.length) = m / 9 ∧ (∀ (a : ℕ),
a < b ∨ b + MatrixMultiplication.Schonhage.QueriedProduct.inputEnd m n qs.length + 1 ≤ a →
y.mem a = x.mem a) ∧ ∀ (j : Fin 320), ↑j < 65 → y.regs j = x.regs j
Actual pointer preparation has no matrix or coordinate copying stage.