Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Product.Program

Actual producer, tile-kernel and reconstruction code #

Main definitions #

All three existing 96-register callees use the low bank. The caller's 64 additional registers (QueriedProduct.Reg) retain its scalar layout and counters without colliding with finite Schonhage names. Copying, initial directory clearing, header adaptation, raw-entry doubling, dispatch, reporting and restoration are real instructions. Supporting code definitions are exposed for execution proofs; they are implementation APIs.

Reuse each existing native program in the same low 96-register bank.

The unchanged copy routine uses the first seven low registers.

@[reducible, inline]

Original inner depth, determining the shared dimension 4^m.

@[reducible, inline]

Original outer matrix dimension.

@[reducible, inline]

Number of original request occurrences, including duplicates.

@[reducible, inline]

Computed shared dimension 4^m.

@[reducible, inline]

Number of masks visited by the actual subset-table scan.

@[reducible, inline]

Number of cells in each padded band array.

@[reducible, inline]

Number of leaf entries in each shared encoding.

@[reducible, inline]

Computed number of row bands, also used for column bands.

@[reducible, inline]

Number of tile calls, the square of the band count.

@[reducible, inline]

Length of the complete original memory prefix, including word zero.

@[reducible, inline]

Protected snapshot pointer used to restore the original input.

@[reducible, inline]

Protected copy of the router's immutable prefix offsets.

@[reducible, inline]

Protected copy of the actual grouped query codes.

@[reducible, inline]

Protected permutation from grouped positions to original occurrence indices.

@[reducible, inline]

Base of the grouped answers written by tile calls.

@[reducible, inline]

Base of the reconstructed original-order answers, returned by halt.

@[reducible, inline]

Base of reusable pruned-kernel stack and cache space.

@[reducible, inline]

Base of the timestamp directory shared by all tiles.

@[reducible, inline]

One past the complete caller and kernel allocation.

@[reducible, inline]

Returned kernel epoch propagated to the next tile.

@[reducible, inline]

Current tile, directory-entry or reporting-loop index.

@[reducible, inline]

First grouped position of the current tile's actual span.

@[reducible, inline]

One past the last grouped position of the current tile.

@[reducible, inline]

Row band computed by division of the current tile key.

@[reducible, inline]

Column band computed by remainder of the current tile key.

@[reducible, inline]

Actual shared left-encoding pointer for the current tile.

@[reducible, inline]

Actual shared right-encoding pointer for the current tile.

@[reducible, inline]

Actual grouped-query pointer passed to the kernel.

@[reducible, inline]

Current grouped-answer pointer passed to the kernel.

@[reducible, inline]

Source pointer supplied to a real native copy.

@[reducible, inline]

Destination pointer supplied to a real native copy.

@[reducible, inline]

Number of words supplied to a real native copy.

@[reducible, inline]

Temporary address for scalar loads, stores and reporting.

@[reducible, inline]

Temporary loaded matrix value, answer or original-position index.

@[reducible, inline]

Persistent loop-increment constant one.

@[reducible, inline]

Persistent multiplier two for raw-to-signed conversion.

@[reducible, inline]

Persistent constant four for header offsets and kernel stack sizing.

@[reducible, inline]

First original matrix-payload address, immediately after the four headers.

@[reducible, inline]

Persistent constant six used in the computed router allocation.

@[reducible, inline]

Total word count of both original matrix payloads.

@[reducible, inline]

Original coordinate-pair block address.

@[reducible, inline]

One past the actual router allocation.

@[reducible, inline]

One past the shared-band producer allocation.

@[reducible, inline]

Temporary product used while computing separated buffer addresses.

@[reducible, inline]

Base of the producer's shared two-sided encoding catalogue.

@[reducible, inline]

Persistent constant three used in the router allocation.

Compute genuine band scalars before selecting a protected caller area. No memory writes.

Preserve the computed original parameters and calculate every caller buffer address.

Real argument setup followed by the unchanged dynamic-length native copy.

Save the entire ordinary input, including its length word and coordinate list.

Put the original raw coordinate pairs in the actual Wanted input convention.

Preserve the computed arrays before the band producer reuses the low work area.

One actual load, unsigned doubling and store converts a raw nonnegative matrix entry.

Copy real matrix words into the band producer's adjacent front input blocks. The bit-input variant executes the conversion instruction at every entry.

Initialize the one timestamp directory by actual stores, once for the entire product.

Load actual group endpoints and compute both shared catalogue pointers and kernel ABI.

One real pruned-kernel call, with the returned epoch propagated to the next tile.

Compute all tiles from the actual group arrays; the zero-tile case never divides by zero.

Read one actual original index and scatter its computed answer into request order.

Every original occurrence is reconstructed by charged native reads and stores.

Restore the complete actual input after all private low-memory reuse has finished.

Complete actual routing preparation and protected preservation of the original input.

The complete fixed producer/consumer program. bits=false takes canonical signed matrix words; bits=true takes raw unsigned words of nonnegative entries and performs actual per-entry doubling.