Skip to content

bench: add Ceno batched main sumcheck benchmark#54

Merged
kunxian-xia merged 3 commits into
mainfrom
feat/ceno-bench
May 11, 2026
Merged

bench: add Ceno batched main sumcheck benchmark#54
kunxian-xia merged 3 commits into
mainfrom
feat/ceno-bench

Conversation

@hero78119
Copy link
Copy Markdown
Collaborator

@hero78119 hero78119 commented May 9, 2026

Problem

We need a benchmark shape closer to Ceno batched main sumcheck workloads, rather than only the smaller synthetic mixed-sum/product cases.

The existing devirgo_sumcheck benches are useful for focused frontload-vs-suffix comparisons, but they do not model a batched expression with many MLEs and heterogeneous product degrees across multiple chip-like groups.

Approach

Add a new Criterion bench target:

cargo bench -p sumcheck --bench ceno_batched_main

The benchmark builds a deterministic Ceno-like batched main sumcheck case with:

  • multiple chip shapes
  • many MLEs per chip
  • many terms per chip
  • product degrees mixed across 1, 2, 3, and 4
  • deterministic RNG seed for stable generated MLE data

The default shape is:

scale=default
max_vars=20
mles=52
terms=150

Environment knobs:

Variable Purpose
GKR_CENO_BENCH_SCALE Selects tiny, default, large, or ceno-ish shape.
GKR_CENO_BENCH_MAX_VARS Shifts the generated shape to a target max variable count.
GKR_CENO_BENCH_SAMPLES Sets Criterion sample size.
GKR_CENO_BENCH_SUFFIX=1 Also runs suffix legacy mode for comparison.

The PR also fixes clippy nits in the new bench so workspace clippy stays clean.

Benchmark Result

Command:

GKR_CENO_BENCH_SUFFIX=1 GKR_CENO_BENCH_SAMPLES=10 cargo bench -p sumcheck --bench ceno_batched_main

Shape:

ceno_batched_main/default/max_vars_20/mles_52/terms_150
Mode Mean
frontload 1.1678 s
suffix_legacy 8.9286 s

Frontload speedup vs suffix legacy: 7.65x.

Testing

Command Result
cargo fmt Pass
cargo make clippy Pass
GKR_CENO_BENCH_SUFFIX=1 GKR_CENO_BENCH_SAMPLES=10 cargo bench -p sumcheck --bench ceno_batched_main Pass; results above

Risk / Rollout

Risk Mitigation
Benchmark runtime Suffix mode is opt-in through GKR_CENO_BENCH_SUFFIX=1; default run benchmarks frontload only.
Shape mismatch Exposes scale and max-vars env overrides for quick local tuning.
Flaky randomness Uses deterministic RNG seed.
Clippy breakage cargo make clippy passes after the bench additions.

This PR only adds benchmark code and does not affect prover/verifier runtime behavior.

Copilot Reviewer Directive (keep this section)

When Copilot reviews this PR, apply .github/copilot-instructions.md strictly.

  • Perform review only; do not commit/push/propose code changes.
  • Prefer inline comments on changed lines for each actionable finding.
  • If inline comments are unavailable, use [severity] path:line (symbol) format.
  • Prioritize soundness, performance, and architecture risks over style.
  • Output order: findings by severity, then open questions, then brief summary.
  • If PR description is empty or missing key context, report PR metadata: description as a finding.

@hero78119 hero78119 changed the title bench: add ceno batched main sumcheck bench: add Ceno batched main sumcheck benchmark May 11, 2026
@kunxian-xia kunxian-xia merged commit b73d548 into main May 11, 2026
2 checks passed
@kunxian-xia kunxian-xia deleted the feat/ceno-bench branch May 11, 2026 11:23
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