Pure source-span readback for either record product #
prepared_record gives the prepared record, raw matrix blocks, and query coordinates.
producer_readback relates these to the original words of the queried product input.
The readback includes the six-word record descriptor, raw left and right zero/one matrix
spans, ordered query-coordinate words, heap bounds and occurrence sparsity from a genuine
Instances.Output, without importing or executing either per-record product backend.
raw_left_block and raw_right_block read a record's realized raw matrix blocks as the ordinary
product's original input; producer_readback and the box record caller both use them.
The raw descriptor and matrix blocks of one prepared record, together with its protected query coordinates. The coordinates lie before the producer's record region.
The entire physical record lies below or ends at the heap.
- queryEnd : recordQueries n D p idx + 2 * recordQueryCount n D p values idx ≤ y.regs Instances.output
The entire interleaved query span lies before the record region.
- descriptor : { base := base, length := 6 }.Realizes y.mem ![↑idx.residue, idx.piece, recordQueries n D p idx, recordQueryCount n D p values idx, base + 6, base + 6 + n * D]
The six physical descriptor fields at the selected record address.
- left : { base := base + 6, length := n * D }.Realizes y.mem fun (j : Fin { base := base + 6, length := n * D }.length) => WriteMatrices.entry false (matrixArgs n D g p (↑idx.residue) idx.piece) (fun (q : ℕ) => (values (2 * (n * n) + q) % ↑p).toNat) ↑j
The raw left matrix follows the descriptor.
- right : { base := base + 6 + n * D, length := n * D }.Realizes y.mem fun (j : Fin { base := base + 6 + n * D, length := n * D }.length) => WriteMatrices.entry true (matrixArgs n D g p (↑idx.residue) idx.piece) (fun (q : ℕ) => (values (n * n + q) % ↑p).toNat) ↑j
The raw right matrix follows the left matrix.
- queryCoordinates (j : ℕ) : j < recordQueryCount n D p values idx → y.mem (recordQueries n D p idx + 2 * j) < n ∧ y.mem (recordQueries n D p idx + 2 * j + 1) < n
Every word in the query span denotes an original vertex.
A finite instance selects an actual record and intact query span in the producer output.
A record's raw left block, as written by the producer, reads as the original left input of the ordinary queried product.
A record's raw right block, in its D×n storage order, reads as the original right input of
the ordinary queried product.
Derive both raw source matrices, ordered coordinate words, protected spans and occurrence sparsity from genuine producer output, without invoking either product backend.