Native ExactTriangle instance preparation #
The input header is (D,g,n,p), followed by the three signed weight matrices. The program first
computes the real class/chunk catalogue. It then visits each actual chunk and piece, reads that
chunk's descriptor, computes the piece boundaries and writes its record and two zero/one matrices.
The records share the already computed query arrays. Every visit uses the existing native
InstancePair.program rather than assuming a matrix-preparation routine.
The output records and matrices occupy consecutive variable-size blocks. Register output names
the first record, produced gives their actual number and heap is their final allocation end.
Each block has six record words followed by 2nD matrix words. This module prepares instances;
it does not choose a prime, evaluate their queried products or decide ExactTriangle.
Main definitions #
Instances.program: fixed sixty-four-register initialized instance-preparation program.Instances.visit: one computed class/chunk/piece visit, including both native matrix calls.Instances.timeBound: the catalogue cost plus the full native visit and loop budgets, including the final halt.Instances.Output: actual catalogue, record, matrix and frame readback.
Main results #
Instances.exec_at: complete native execution from the original header and weight arrays.Instances.exec_at_with_prefix: complete execution together with the post-catalogue/setup state shared with one-slot streaming callers.Instances.exec_visit: single-record chunk/piece construction step.
PreparationInput supplies the initialized flat-program interface and derived width bounds;
PreparationBounds proves the preparation time bound in the source's parameter regime.
Code-stage definitions and single-visit invariants (pairInput, visit_preserves,
budget_covers_loop) are exposed for interpreter and streaming clients; internal proof helpers are
private.
References #
The matrix geometry follows the pinned Theorem 17 matrix construction. The native controller and resource proofs are original.
Outer matrix dimension.
Target padded middle dimension.
Residue modulus.
Computed maximum vertices per piece.
Computed number of pieces.
Actual number of nonempty query chunks.
Computed chunk-descriptor array.
First output record.
Number of completely written instance blocks.
Actual chunk count times piece count.
Next free output record.
Words per record and its two matrices.
Constant one.
Words per chunk descriptor.
Words per instance record.
Words in one matrix.
Original A–C residue matrix.
Original B–C residue matrix.
Descriptor/header address temporary.
Current chunk ordinal.
Current piece ordinal.
Residue loaded from the actual chunk descriptor.
Query pointer loaded from the actual chunk descriptor.
Query count loaded from the actual chunk descriptor.
First vertex of the current piece.
Actual length of the current piece.
Original weight-matrix area temporary.
Existing catalogue computation in the lower thirty-two registers.
Save the actual catalogue outputs and compute the allocation stride and residue bases.
Compute the chunk and piece ordinals, then load the real query reference and piece bounds.
Deliver every actual pointer, coordinate and count to the existing instance-pair ABI.
Existing native record and matrix-pair writer.
Advance only after the complete pair has been written.
One actual instance; every selection, argument-delivery and matrix instruction is native.
Prepare every actual chunk/piece pair after computing the catalogue.
The catalogue prefix, twenty-six setup instructions, each 40nD+66 visit and its two loop
instructions, the two loop-exit instructions and the final halt are accounted separately.
Original-header bound for all arithmetic and allocated addresses. The conservative maximum
p*n² chunk count and n pieces cover every actual catalogue entry. Signed weights have their
separate magnitude fit premise; no layout information is supplied by the caller.
One bounded instruction graph with no word-size reads.
Specification of the delivered metadata, not a runtime layout input. Scratch registers are irrelevant: the pair arguments and record words read only registers 17–28.
Execute one logical chunk/piece at the current heap pointer. Previous records and dirty scratch outside its destination span are unrestricted. All native argument delivery and both matrix calls are included in the charge.
Exact computed catalogue, record and raw zero/one matrix readback, with the complete input/output frame. The matrix predicates reuse the existing writer arguments and entry semantics.
Execute the complete preparation from the real header and signed matrices. Every output record refers to the actual computed query chunk, followed by its raw zero/one matrix pair. The only resource premises concern the original signed values and the explicit numeric budget; neither a catalogue nor a layout or execution certificate is an input. The final halt is excluded here and added by the initialized flat-program client.
Complete native preparation from the real original input, preserving the standalone all-record producer contract and halt-exclusive allowance.