Skip to content

perf(stark): hoist query-invariant deep-composition sums out of the FRI query loop#776

Open
Oppen wants to merge 1 commit into
perf/deep-reconstructionfrom
perf/deep-hoist
Open

perf(stark): hoist query-invariant deep-composition sums out of the FRI query loop#776
Oppen wants to merge 1 commit into
perf/deep-reconstructionfrom
perf/deep-hoist

Conversation

@Oppen

@Oppen Oppen commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Hoist sums that depend only on challenges and proof-level OOD/gamma data (ood_row_sum, number_of_parts, z_pow, h_sum_zpow) out of the per-query reconstruct_deep_composition_poly_evaluation_pair into a new once-per-proof compute_query_invariant_deep_terms, eliminating the O(num_queries × height × width) coeff * ood multiplies down to O(height × width).
  • Derive number_of_parts from proof.composition_poly_parts_ood_evaluation.len() (already validated against the AIR's degree bound in multi_verify_archived) instead of each query's own opening length, and check both regular/symmetric per-query openings against that fixed value — strictly stronger than the previous regular-vs-symmetric-only guard, since it also rejects a proof whose per-query opening length varies query to query.

Numbers

Metric Before After Change
Single-query total cycles 86,368,803 85,810,707 −0.65%
Single-query step3:fri ≈7.97M 7,807,225 ≈−2%
Multi-query total cycles 1,951,764,531 1,818,365,778 −6.84%
Multi-query step3:fri ≈652.1M 529,415,199 ≈−18.8%

Test plan

  • cargo check -p stark
  • cargo test -p stark (137 tests pass)
  • make test-ethrex
  • cargo test -p lambda-vm-prover --lib test_recursion_execute_1query -- --ignored --nocapture (in-VM verify accepted)
  • make test-profile-recursion-single / make test-profile-recursion-multi (cycle counts above)
  • Adversarial soundness review (independent Opus pass): confirmed no reject-path was weakened, the number_of_parts guard change is a genuine strengthening, and hoisted sums are algebraically identical to the per-query-recomputed values for honest proofs
  • Independent correctness, simplicity, and performance reviews: no issues found

…RI query loop

reconstruct_deep_composition_poly_evaluation_pair recomputed ood_row_sum,
z_pow, and h_sum_zpow from scratch on every one of the ~80 FRI queries per
proof, even though they depend only on challenges and proof-level OOD data.
Compute them once per proof in compute_query_invariant_deep_terms and reuse
across queries, removing the O(num_queries * height * width) coeff * ood
multiplies.

Derive number_of_parts from proof.composition_poly_parts_ood_evaluation.len()
(validated once against the AIR's degree bound) instead of each query's own
opening length, and check both openings against that fixed value per query —
strictly stronger than the previous regular-vs-symmetric-only guard, since it
also rejects a proof whose per-query opening length varies query to query.
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