Documentation

CslibFrontier.Algorithms.WordRAM.ExactTriangle.RecordBoxProduct.Exec

Complete native per-record product execution #

Scalar preparation and the threshold-aware patch precede a native direct-to-snapshot gather. Every returned word answers its original occurrence; the whole producer catalogue remains below the owned window and is preserved. These are internal readback composition rules; the producer client discharges their descriptor and source-span assertions from its actual initialized execution.

Conservative per-record instruction upper bound, expressed in terms of CallableBoxProduct.timeBound and linear staging terms.

Per-record gather allowance covering scalar preparation (prepare), four pointer deliveries, PointerBoxProduct.program, and copying the returned physical pointer; bounded above by timeBound.

Exact ledger relating timeBound plus PointerBoxProduct.gatherTime and three pointer-delivery steps to gatherTimeBound plus the RecordProduct.prepare array-copy term and the translated snapshot-copy term.

gatherTimeBound is at most the conservative timeBound envelope. This compares proved upper bounds, and does not measure the difference of execution times.

theorem Cslib.Algorithms.WordRAM.ExactTriangle.RecordBoxProduct.exec {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]) (hsb : s + n * MatrixMultiplication.Schonhage.D m ≤ b) (htb : t + n * MatrixMultiplication.Schonhage.D m ≤ b) (hqb : q + 2 * qs.length ≤ b) (hleft : ∀ a < n * MatrixMultiplication.Schonhage.D m, x.mem (s + a) = (WordRAM.State.init (MatrixMultiplication.Schonhage.QueriedProduct.input true (19 * m) X Y qs)).data.mem (5 + a)) (hright : ∀ a < n * MatrixMultiplication.Schonhage.D m, x.mem (t + a) = (WordRAM.State.init (MatrixMultiplication.Schonhage.QueriedProduct.input true (19 * m) X Y qs)).data.mem (5 + n * MatrixMultiplication.Schonhage.D m + a)) (hqueries : ∀ a < 2 * qs.length, x.mem (q + a) = (WordRAM.State.init (MatrixMultiplication.Schonhage.QueriedProduct.input true (19 * m) X Y qs)).data.mem (5 + 2 * (n * MatrixMultiplication.Schonhage.D m) + a)) (hX : ∀ (a : Fin n) (k : Fin (MatrixMultiplication.Schonhage.D m)), 0 ≤ X a k ∧ X a k ≤ 1) (hY : ∀ (k : Fin (MatrixMultiplication.Schonhage.D m)) (a : Fin n), 0 ≤ Y k a ∧ Y k a ≤ 1) (hN : MatrixMultiplication.Schonhage.D m ^ 18 ≤ n) (hfit : WordRAM.Fits W (2 * b + 4 * MatrixMultiplication.Schonhage.CallableProduct.windowSize n qs.length + 1024)) :
RecordProduct.ExecPost program (21 * m) W b (timeBound qs) X Y qs x

Actual record-to-product execution, with only original input/readback premises and no solver/run/time oracle. The final initialized client derives these premises from the producer.

@[reducible, inline]

The RecordBoxProduct backend at tensor level 21 * m.