Skip to content

Random perf improvement - #645

Merged
TomWambsgans merged 3 commits into
mainfrom
random-perf-improvement
Oct 23, 2026
Merged

TomWambsgans merged 3 commits into
mainfrom
random-perf-improvement

Conversation

@TomWambsgans

Copy link
Copy Markdown
Collaborator

No description provided.

TomWambsgans and others added 3 commits October 23, 2026 00:26
Prover, with proofs byte-identical to before for the same guest:
- execution: memory in 2 MB pages with access counts as exponents, trace
  rows in fixed chunks, witness streams looked up once per run;
- witness: columns through a line buffer with streaming stores, memory and
  count columns in one pass, bytecode columns in one parallel pass, the
  interpreter's g-power table reused;
- constraints: bus-form products sharing a column factored (`RowForm`);
- bus: 8-lane AVX-512 field kernels (`primitives::field::x8`) and GKR rounds
  on the transposed layout, eq split in two tables, the three trees folded
  in one dispatch, leaves built once by table with levels 2 and 4 in cache,
  identity rows skipped, g^z on the fly, split-eq evaluations at zeta;
- PCS: a masked vector for the NTT lanes that do not fill one, the pass plan
  saving a sweep, the first pass reading scattered rows once per residue,
  the transposed induce in two sweeps.

Recursion guest: the bus block selectors and Index MLE unrolled through
matches, the novel-basis coefficient factored out of the residual, Merkle
offsets as immediates and the cap check unrolled, read once and its
activity propagated downward, level-0 WHIR queries and the residual two an
iteration, Merkle pairs selected additively, two and four bus GKR rounds a
loop step, tensor row weights at every WHIR level, the ring-switch rows
folded eight an iteration in Horner form and its coordinates walked two an
iteration, WHIR query dots batched in 1/lam, the column selectors read a
nibble at a time off shared tables, the OOD squeezes and eq prefix chains
unrolled, grind_check's bit count at compile time, and leanSPHINCS's
counter and unused digest bits rebuilt from hinted bytes with marks
carrying their tree and subtree. A test feeds the guest forged leanSPHINCS
digest fields.

On the Ryzen 7 PRO 8700GE (Zen 4), against 3a37fb6, interleaved runs:
aggregate --xmss 900 1.85 s to 1.60 s, --sphincs 420 1.09 s to 0.96 s
(900,350 to 842,668 cycles), recursion --n 2 --xmss-per-leaf 900 0.63 s
to 0.53 s (599,523 to 457,176 cycles), --sphincs-per-leaf 420 0.72 s to
0.53 s (660,023 to 510,185 cycles). The guest's bytecode grows from
244,706 to 286,892 instructions, now padded to 2^19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- pcs: the NTT pass plan no longer subtracts below zero where the L2 budget
  exceeds the L3 one (Apple silicon), which panicked in debug builds and
  could wrap to an oversized deep pass in release.
- bus: the identity runs are sorted by offset, as the binary search over
  them assumes, so the GKR rounds skip the groups they cover.
- constraints: a product sharing no column is evaluated as one product
  times its coefficient, not through a one-term group.
- execution: a compile-time check that the step limit keeps every access
  count within the u32 exponent.
- leaf: `BusForm::eval_unreduced`, no longer called, removed.

Proofs are unchanged (aggregate --xmss 900, --sphincs 420, recursion,
and a mixed run with blobs at rate 3 hash identically).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TomWambsgans
TomWambsgans merged commit 25703e0 into main Oct 23, 2026
@TomWambsgans
TomWambsgans deleted the random-perf-improvement branch October 23, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant