recursion-v2: add PCS aggregation checks#1378
Merged
hero78119 merged 15 commits intoJul 8, 2026
Merged
Conversation
Update the hardcoded child VK digest for the generated keccak_syscall fixture so local aggregation tests no longer need CENO_REC_V2_REAL_VK_DIGEST.\n\nFix multi-shard recursion constraints across verifier PVS, VM PVS aggregation, selector point transcript routing, and ECC RT accounting so agg_prover_two_shards proves and verifies with the current AIR settings.
Collaborator
Author
|
Recursion-v2 aggregation timing update from the local Keccak fixture. Environment:
Verification:
Single-shard timing split:
Bottleneck by trace cells:
Conclusion: the ~100s single-shard runtime is dominated by the |
Merged
70a9ede
into
feat/recursion_batch_main_constraints
6 checks passed
kunxian-xia
added a commit
that referenced
this pull request
Jul 9, 2026
## Problem Stacked on #1378. Recursion v2 had CPU-side trace generation and proof wiring, but the CUDA path was not usable end to end for inner recursion proving. That left GPU proving unable to exercise the verifier, PCS, transcript, proof-shape, and public-value traces in the same path used by aggregation. ## Design Rationale The main design is to keep recursion proving backend selection behind the existing generic engine/backend type and enable the CUDA specialization under the `cuda` feature. CUDA tracegen receives explicit, typed inputs for proof shape, public values, PCS, transcript, and verifier data instead of duplicating host-side layout assumptions. For the OpenVM CUDA prover path, `PcsJaggedAssistQAir` is kept within degree 4 by materializing the high-degree factor in the trace. This avoids the logup zerocheck round0 5-coset CUDA limit while preserving the AIR relation through explicit constraints. ## Change Highlights - `ceno_recursion_v2`: add CUDA tracegen ABI, build wiring, fixtures, and test harness. - `ceno_recursion_v2`: wire CUDA inner tracegen/proving into `e2e_aggregate`. - `ceno_recursion_v2`: add CUDA layouts for proof shape, public values, transcript, verifier, PCS, and main recursion traces. - `ceno_recursion_v2`: reduce `PcsJaggedAssistQAir` max constraint degree for CUDA proving compatibility. ## Benchmark / Performance Impact This PR enables GPU recursion proving. There is no direct `master` baseline for the CUDA recursion path because the path was not functional before this PR. ### Operation | Operation | master (s) | this PR (s) | Improve (master -> this PR) | |-----------|------------|-------------|-----------------------------| | recursion aggregation prove, fibonacci | N/A | 0.235 | enables CUDA path | | recursion aggregation verify, fibonacci | N/A | 0.037 | enables CUDA path | | recursion aggregation prove, keccak_syscall | N/A | 0.185 | enables CUDA path | | recursion aggregation verify, keccak_syscall | N/A | 0.033 | enables CUDA path | ### Layer | Layer | master (s) | this PR (s) | Improve (master -> this PR) | |-------|------------|-------------|-----------------------------| | CUDA inner recursion proving | N/A | 0.185-0.235 | new working path | Benchmark command(s): ```sh RUST_LOG=openvm_cuda_backend::logup_zerocheck=debug,ceno_recursion_v2::continuation::prover::inner=info RUST_MIN_STACK=67108864 cargo run --release --features cuda --bin e2e_aggregate -- /home/zbx/blockchain/ceno/examples/target/riscv32im-ceno-zkvm-elf/release/examples/fibonacci --platform ceno --max-cycle-per-shard 16000 --hints 10 --public-io 4191 RUST_LOG=openvm_cuda_backend::logup_zerocheck=debug,ceno_recursion_v2::continuation::prover::inner=info RUST_MIN_STACK=67108864 cargo run --release --features cuda --bin e2e_aggregate -- /home/zbx/blockchain/ceno/examples/target/riscv32im-ceno-zkvm-elf/release/examples/keccak_syscall --platform ceno --max-cycle-per-shard 16000 ``` Environment (CPU/GPU, core count, rust toolchain, commit hash): - local CUDA dev machine - commit: `25d8ec89` raw data: - master: CUDA recursion proving path not available - this PR: - fibonacci: proved recursion aggregation in 0.235s, verified in 0.037s; final exit is the known internal aggregation tree-reduction gap for 4 leaf proofs - keccak_syscall: proved recursion aggregation in 0.185s, verified in 0.033s; exit code 0 ## Testing ```sh cargo fmt --check git diff --check -- src/pcs/mod.rs src/bin/e2e_aggregate.rs RUST_MIN_STACK=67108864 cargo run --release --features cuda --bin e2e_aggregate -- /home/zbx/blockchain/ceno/examples/target/riscv32im-ceno-zkvm-elf/release/examples/keccak_syscall --platform ceno --max-cycle-per-shard 16000 RUST_MIN_STACK=67108864 cargo run --release --features cuda --bin e2e_aggregate -- /home/zbx/blockchain/ceno/examples/target/riscv32im-ceno-zkvm-elf/release/examples/fibonacci --platform ceno --max-cycle-per-shard 16000 --hints 10 --public-io 4191 ``` ## Risks and Rollout The main risk is CUDA/host layout drift. The PR mitigates this with typed ABI structs, generated fixtures, and CUDA tracegen tests. Rollout is feature-gated behind `cuda`, so CPU proving remains the fallback path. ## Follow-ups (optional) - Implement internal aggregation tree reduction for multiple leaf proofs. - Remove temporary CUDA diagnostic prints from the local OpenVM checkout or rebuild clean CUDA objects before collecting final benchmark logs. ## Copilot Reviewer Directive (keep this section) When Copilot reviews this PR, apply `.github/copilot-instructions.md` strictly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Recursion v2 aggregation needs to verify the child proof PCS opening path, not only the VM public values, main claims, and tower checks inherited from the base branch.
Design Rationale
This PR maps the native PCS verifier flow into explicit recursion-v2 preflight records, AIRs, and lookup/permutation buses. The design keeps transcript order and proof-shape data owned by preflight replay, then constrains each PCS phase with row-local checks plus cross-module bus bindings. This keeps the verifier logic auditable while avoiding a broad backend fork.
Change Highlights
ceno_recursion_v2: add PCS preflight records, buses, AIR modules, and circuit wiring for base input openings, Merkle paths, basefold queries, sumcheck claims, jagged helpers, and final claims.ceno_recursion_v2: bind PCS transcript values and commitment heights into the existing aggregation flow.ceno_zkvm: update test-only field constructors for the upgraded Plonky3/field trait surface.Benchmark / Performance Impact
Not a performance optimization PR. The new PCS AIRs add prover work; release shard runs remain the relevant sanity check.
Operation
Layer
Benchmark command(s):
# No benchmark comparison in this PR body.Environment (CPU/GPU, core count, rust toolchain, commit hash):
raw data:
Testing
Risks and Rollout
The main risk is verifier soundness from mismatched transcript or PCS phase ordering. Rollout should keep the current shard aggregation tests as the gate and treat new PCS AIR changes as verifier-path changes requiring focused proof fixtures.
Follow-ups (optional)
Copilot Reviewer Directive (keep this section)
When Copilot reviews this PR, apply
.github/copilot-instructions.mdstrictly.