perf(prover): batch-invert COMMIT bus fingerprints; doc/dedup fixes#607
Conversation
compute_commit_bus_offset — batch inversion - The COMMIT-bus offset loop inverted one fingerprint per public-output byte: N separate cubic-extension inversions (each a Fermat-chain exponentiation). Collect the N fingerprints and `inplace_batch_inverse` instead — 1 inversion + O(3N) muls. This runs on the verify path (`verify_with_options` → `compute_expected_commit_bus_balance`), which matters for the RISC-V recursion guest. Behaviour-identical: a zero fingerprint still yields `None` (batch inverse `Err`s on any zero). TableCounts::total — fix copy-pasted doc - `total()`'s doc comment was `validate()`'s text verbatim plus the real one-liner tacked on the end. Replaced with just the accurate summary. replay_transcript_phase_a — drop duplicated arm - Both branches of the `if air.is_preprocessed()` ended with the same `append_bytes(main_merkle_root)`. Hoisted it out; transcript order is unchanged. 273 prover lib tests pass; lint clean.
Codex Code ReviewFound one issue. Medium - DoS via unbounded verifier allocation
Actionable fix: in No other issues found in the changed diff. |
Review: batch-invert COMMIT bus fingerprints; doc/dedup fixesNo security issues, bugs, or significant concerns found. Changes reviewed
|
compute_commit_bus_offset — batch inversion
inplace_batch_inverseinstead — 1 inversion + O(3N) muls. This runs on the verify path (verify_with_options→compute_expected_commit_bus_balance), which matters for the RISC-V recursion guest. Behaviour-identical: a zero fingerprint still yieldsNone(batch inverseErrs on any zero).TableCounts::total — fix copy-pasted doc
total()'s doc comment wasvalidate()'s text verbatim plus the real one-liner tacked on the end. Replaced with just the accurate summary.replay_transcript_phase_a — drop duplicated arm
if air.is_preprocessed()ended with the sameappend_bytes(main_merkle_root). Hoisted it out; transcript order is unchanged.273 prover lib tests pass; lint clean.