Skip to content

Integrate redesigned Efficient Sumcheck#24

Merged
z-tech merged 7 commits into
mainfrom
z-tech/fresh-effsc
May 2, 2026
Merged

Integrate redesigned Efficient Sumcheck#24
z-tech merged 7 commits into
mainfrom
z-tech/fresh-effsc

Conversation

@z-tech
Copy link
Copy Markdown
Collaborator

@z-tech z-tech commented Apr 19, 2026

What does this PR do?

Based on microbench: Goldilocks hashchain, n=4096, l1=4, s=8, t=7, hash_chain_size=10, 30 iters + 2 warmup.

Phase Original Current Change
rs_encode (FFT) ~2.5ms ~2.1ms -16%
pesat_merkle_tree ~1.5ms ~1.5ms
twin_constraint_sumcheck ~7.2ms ~2.2ms -69%
eval_bundled_r1cs ~0.6ms ~0.2ms -67%
merkle_commit ~1.0ms ~1.0ms
eq_poly_evals + ood_evals_vec ~3.9ms ~0.2ms -95%
batching_sumcheck (inner product) ~0.06ms ~0.06ms
Total (constrained_code_accumulate) ~12.9ms ~3.8ms -71%
Total (incl. pesat_reduce) ~16.9ms ~7.4ms -56%

I have a very large rewrite coming after this btw.

@z-tech z-tech changed the title integrate new effsc API Integrate redesigned Efficient Sumcheck Apr 19, 2026
@z-tech
Copy link
Copy Markdown
Collaborator Author

z-tech commented Apr 19, 2026

Pr looks big but it's really only ~100 lines that are different and like a few hundred that are a tiny bit modified to use the API.

Bucket Insertions Notes
Import block rewrite ~20 pure line-for-line swap (old effsc paths → new)
TwinConstraintEvaluator struct+impl ~50 replaces the 40-line twin_constraint_round_poly closure in main — net **+10**
accumulate_sparse_evaluations + batched_constraint_poly ~35 genuinely new — effsc dropped them
prove() sumcheck call-site rewrites ~15 coefficient_sumcheck(|tw, pw| …)CoefficientProverLSB::new + sumcheck(…); same for inner-product
prove() eq-evals helper swaps ~20 per-point loops → compute_hypercube_eq_evals(…)
verify() transcript reads ~3 two helper calls (pre-TC, between)
verify() sumcheck_verify + oracle checks ~25 replaces the per-round manual reductions in main (~20 deletions on the other side)
verify() misc (MSB→LSB reverse, proximity reorder, etc.) ~5 needed because InnerProductProver is MSB half-split
Doc comments and blank lines ~80 inflation from the above — every refactored hunk took more space in code-review-style comment blocks

I think the right decision in the end is to not have accumulate_sparse_evaluations + batched_constraint_poly in effsc but if it comes up again we could consider something like a crate for hyperplonk-utils.

@z-tech z-tech requested review from dmpierre and winderica April 19, 2026 22:38
@z-tech z-tech marked this pull request as ready for review April 19, 2026 22:38
Copy link
Copy Markdown
Collaborator

@winderica winderica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super sorry for the delay & awesome work as always!

The changes make perfect sense, and I only have a few (nitpicky) comments about removing unnecessary memory copies, which may or may not make things faster. It's totally fine to ignore them if you think the improvement is marginal!

Comment thread src/lib.rs
Comment thread src/lib.rs
Comment thread src/lib.rs Outdated
Comment thread src/lib.rs Outdated
z-tech and others added 2 commits April 28, 2026 13:48
Co-authored-by: winderica <winderica@gmail.com>
@z-tech
Copy link
Copy Markdown
Collaborator Author

z-tech commented May 2, 2026

Thanks again for the very helpful comments @winderica ! Merging this now

@z-tech z-tech merged commit 655e7d5 into main May 2, 2026
4 checks passed
z-tech added a commit that referenced this pull request May 12, 2026
Integrate redesigned Efficient Sumcheck
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.

2 participants