Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxBatch.InputLayout

Original input and allocation for a native query batch #

Four headers contain depth, inner count, threshold and wanted-query count. Both signed leaf arrays and the wanted codes follow. The table is constructed beyond these original words; the work stack and result array follow the retained values. Wanted codes are ordinary data, with their original order and repetitions preserved.

Original headers, signed leaf arrays, and ordinary wanted output codes.

First wanted code, immediately after both original arrays.

Shared geometry follows the entire wanted array.

Compact descriptors follow the shared directory.

Retained signed values follow the compact descriptors.

The work stack starts beyond all retained table words.

Results follow the entire uncleared work-stack allocation.

End of every potentially written word, including the result array.

One original-input scalar bound covers adaptation, construction and batch execution.

Shared construction is paid once; the final twelve instructions adapt the batch layout.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxBatch.input_readback {L : ℕ} (m t : ℕ) (qs : List (MatrixMultiplication.Schonhage.OutStr L)) (a b : Fin (10 ^ L) → ℤ) :
have x := (WordRAM.State.init (input m t qs a b)).data; x.mem 1 = L ∧ x.mem 2 = m ∧ x.mem 3 = t ∧ x.mem 4 = qs.length ∧ (∀ (i : Fin (10 ^ L)), x.mem (5 + ↑i) = WordRAM.Signed.encode (a i)) ∧ (∀ (i : Fin (10 ^ L)), x.mem (5 + 10 ^ L + ↑i) = WordRAM.Signed.encode (b i)) ∧ ∀ (i : Fin qs.length), x.mem (queryBase L + ↑i) = ↑(PrunedQuery.queryIndex qs[↑i])

Actual initialized scalar headers, source arrays and wanted codes.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxBatch.input_fits {w L m t A B : ℕ} (qs : List (MatrixMultiplication.Schonhage.OutStr L)) (a b : Fin (10 ^ L) → ℤ) (ha : ∀ (i : Fin (10 ^ L)), (a i).natAbs ≤ A) (hb : ∀ (i : Fin (10 ^ L)), (b i).natAbs ≤ B) (haddr : WordRAM.Fits (w + 2) (originalAddressBound L m t qs.length)) (hmag : GenericRAM.Signed.Fits w ↑(BoxQuery.magnitudeBound L A B)) :
WordRAM.InputFits (w + 2) (input m t qs a b)

Original scalar and source envelopes admit the complete physical input.

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BoxBatch.constructor_address_le (L m t N : ℕ) (hm : m ≤ L) :
100 * (directoryBase L N + 5 + (5 + 10 ^ L) + L + m + t + (m - t + 1) * 10 ^ L + 10) ≤ originalAddressBound L m t N

Original bounds cover the unchanged complete shared-table constructor.

Original bounds also cover the batch kernel, including every cursor increment.