Use NativeSumcheck for calculating initial_sum#1249
Use NativeSumcheck for calculating initial_sum#1249
NativeSumcheck for calculating initial_sum#1249Conversation
|
Please check scroll-tech/openvm#30 for new semantic of |
|
Confirmed total trace cell dropped to previous level after latest change |
3d6f615 to
706bc16
Compare
There was a problem hiding this comment.
by latest benchmark, e2e will be degraded if we move initial sum calculation to native sumcheck. Here is result
https://github.com/scroll-tech/ceno-reth-benchmark/actions/runs/22661172708
As recursion will degraded for ~2s
I think probably we just make this PR scope smaller with only fix the soundness: second sumcheck_eval_layers read from array.
There was a problem hiding this comment.
Pull request overview
This PR optimizes the tower verification step in the recursive ZKVM verifier by replacing custom dot-product logic for calculating initial_sum with the NativeSumcheck chip, and flattening evaluation arrays to use HintSlice for more efficient witness loading. Additionally, it extracts the aggregate_internal_proofs method from generate_root_proof for reuse, adds a corresponding test, and updates the OpenVM dependency branch.
Changes:
- Replace manual initial sum dot-product computation in tower verify with
NativeSumchecknative opcode, using hint space IDs for evaluation inputs instead of loading concrete witness arrays - Flatten
r_out_evals,w_out_evals, andlk_out_evalsfromVec<Vec<E>>toVec<E>and useHintSlicefor serialization/deserialization, removing now-unusedevaluate_at_point_degree_1andnested_productutilities - Extract
aggregate_internal_proofsas a standalone public method and add corresponding test infrastructure
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ceno_recursion/src/tower_verifier/program.rs |
Core change: replace manual initial_sum computation with NativeSumcheck via sumcheck_layer_eval, add hint ID mode support, flatten out eval array handling |
ceno_recursion/src/zkvm_verifier/verifier.rs |
Adapt to new verify_tower_proof signature, compute chip_logup_sum after tower proof verification using flattened arrays, update prod_r/prod_w accumulation |
ceno_recursion/src/zkvm_verifier/binding.rs |
Change eval arrays from nested Vec<Vec<E>> / Array<C, Array<C, ...>> to flat Vec<E> / HintSlice<C>, merge r/w evals into rw_out_evals |
ceno_recursion/src/arithmetics/mod.rs |
Remove unused evaluate_at_point_degree_1 and nested_product functions |
ceno_recursion/src/aggregation/mod.rs |
Extract aggregate_internal_proofs, add test, update VM_MAX_TRACE_HEIGHTS |
ceno_recursion/src/aggregation/internal.rs |
Minor whitespace cleanup |
ceno_zkvm/src/scheme/verifier.rs |
Cosmetic blank line addition |
Cargo.toml |
Update OpenVM dependency branch to feat/hint_bridge |
Cargo.lock |
Lockfile update for OpenVM branch change |
.gitignore |
Add .srs file extension to gitignore |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| builder.set(&input_ctx, 5, Usize::from(1)); | ||
| builder.set(&input_ctx, 6, Usize::from(4)); | ||
| builder.set(&input_ctx, 7, Usize::from(0)); | ||
| builder.set(&input_ctx, 8, Usize::from(999)); |
There was a problem hiding this comment.
The value 999 is used as a magic sentinel for input_ctx[8] (num_variables). While this likely works because input_ctx[7] (in_round flag) is 0 so this value may not be consumed, using an unexplained magic number is fragile. If the sumcheck_layer_eval implementation changes or the value is unexpectedly read, this could cause subtle bugs. Consider using a named constant or adding a comment explaining why this placeholder is safe to use.
Optimization for Calculating Initial Sum in tower verify.
initial_sum. UseNativeSumcheckinstead.Optimization for
NativeSumcheckNativeSumcheckchip that allows passing in hint space IDs for evaluation inputs instead of loading concrete witness arrays. This significantly reduces cycles involved in loading witnesses.