Skip to content

bench(jolt-sumcheck): add criterion benchmarks for verifier paths#1520

Open
wstran wants to merge 1 commit into
a16z:mainfrom
wstran:bench/jolt-sumcheck-verifier
Open

bench(jolt-sumcheck): add criterion benchmarks for verifier paths#1520
wstran wants to merge 1 commit into
a16z:mainfrom
wstran:bench/jolt-sumcheck-verifier

Conversation

@wstran
Copy link
Copy Markdown
Contributor

@wstran wstran commented May 11, 2026

Summary

jolt-sumcheck is the only modular crate with fuzz coverage but no
criterion benchmarks (the four crates already in
bench-crates.ymljolt-crypto, jolt-field, jolt-poly,
jolt-transcript — all publish baselines). This PR adds a
benches/sumcheck_verifier.rs covering both verifier entry points and
wires the crate into the existing matrix so future regressions show up
on PR via the critcmp diff against the main baseline.

Benches

  • SumcheckVerifier::verify/{8,14,18,22} — single-instance honest-proof
    verification across realistic round counts.
  • BatchedSumcheckVerifier::verify/same_size/{n_vars=14,18}/{n_claims=2,4}
    — front-loaded RLC batching path.

Each bench builds an honest proof with a minimal in-bench reference
prover (mirroring the honest_prove helper from
crates/jolt-sumcheck/src/tests.rs) so the verifier exercises the
full Fiat-Shamir loop end-to-end, not just round-0 rejection.

Local numbers

apple-darwin (M1), --warm-up-time 1 --measurement-time 3 --sample-size 10:

Bench Time (median)
SumcheckVerifier::verify/8 3.32 µs
SumcheckVerifier::verify/14 5.68 µs
SumcheckVerifier::verify/18 7.32 µs
SumcheckVerifier::verify/22 8.89 µs
BatchedSumcheckVerifier::verify/n_vars=14/n_claims=2 6.10 µs
BatchedSumcheckVerifier::verify/n_vars=14/n_claims=4 6.39 µs
BatchedSumcheckVerifier::verify/n_vars=18/n_claims=2 7.73 µs
BatchedSumcheckVerifier::verify/n_vars=18/n_claims=4 7.99 µs

CI

Adds jolt-sumcheck to both the baseline (push to main) and PR
runs in .github/workflows/bench-crates.yml, mirroring the existing
four-crate matrix.

Test plan

  • cargo fmt -q
  • cargo clippy -p jolt-sumcheck --all-targets -- -D warnings
  • cargo clippy -p jolt-core --features host --all-targets -- -D warnings
  • cargo clippy -p jolt-core --features host,zk --all-targets -- -D warnings
  • cargo nextest run -p jolt-sumcheck — 42/42 pass
  • cargo nextest run -p jolt-core muldiv --features host — pass
  • cargo nextest run -p jolt-core muldiv --features host,zk — pass
  • cargo bench -p jolt-sumcheck --bench sumcheck_verifier -- --warm-up-time 1 --measurement-time 3 --sample-size 10 — numbers above

`jolt-sumcheck` was the only modular crate with fuzz coverage but no
benchmarks. This adds a `benches/sumcheck_verifier.rs` covering both
verifier entry points and wires the crate into the existing
`bench-crates.yml` matrix so future regressions are caught on PR via
critcmp diffing against the `main` baseline.

## Benches

- `SumcheckVerifier::verify/{8,14,18,22}` — single-instance honest-proof
  verification across realistic round counts.
- `BatchedSumcheckVerifier::verify/same_size/{n_vars=14,18}/{n_claims=2,4}`
  — front-loaded RLC batching path.

Each bench builds an honest proof with a minimal in-bench reference prover
(mirroring the unit-test helper) so the verifier exercises the full
Fiat-Shamir loop end-to-end, not just round-0 rejection.

## Local numbers (apple-darwin M1, 10 samples, 3s measurement)

```
SumcheckVerifier::verify/8                                3.32 µs
SumcheckVerifier::verify/14                               5.68 µs
SumcheckVerifier::verify/18                               7.32 µs
SumcheckVerifier::verify/22                               8.89 µs
BatchedSumcheckVerifier::verify/same_size/n_vars=14/n_claims=2   6.10 µs
BatchedSumcheckVerifier::verify/same_size/n_vars=14/n_claims=4   6.39 µs
BatchedSumcheckVerifier::verify/same_size/n_vars=18/n_claims=2   7.73 µs
BatchedSumcheckVerifier::verify/same_size/n_vars=18/n_claims=4   7.99 µs
```

## CI

Adds `jolt-sumcheck` to both the baseline and PR runs in
`.github/workflows/bench-crates.yml`, alongside the four crates that
already publish criterion baselines (`jolt-crypto`, `jolt-field`,
`jolt-poly`, `jolt-transcript`).

## Validation

- `cargo build -p jolt-sumcheck --benches` — clean
- `cargo nextest run -p jolt-sumcheck` — 42/42 pass
- `cargo nextest run -p jolt-core muldiv --features host` — pass
- `cargo nextest run -p jolt-core muldiv --features host,zk` — pass
- `cargo clippy -p jolt-sumcheck --all-targets -- -D warnings` — clean
- `cargo clippy -p jolt-core --features host --all-targets -- -D warnings` — clean
- `cargo clippy -p jolt-core --features host,zk --all-targets -- -D warnings` — clean
- `cargo fmt -q` — clean
@github-actions github-actions Bot added the no-spec PR has no spec file label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-spec PR has no spec file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant