Skip to content

feat(zkvm): share witness/fixed Jagged inner opening#1341

Merged
hero78119 merged 88 commits into
masterfrom
feat/jagged_single_commit
May 20, 2026
Merged

feat(zkvm): share witness/fixed Jagged inner opening#1341
hero78119 merged 88 commits into
masterfrom
feat/jagged_single_commit

Conversation

@hero78119
Copy link
Copy Markdown
Collaborator

@hero78119 hero78119 commented May 19, 2026

Problem

Ceno opens witness and fixed Jagged commitments in the same proof, but the previous integration still paid for separate inner Basefold openings. That duplicates inner query/opening proof bytes even though witness/fixed can share the same inner Basefold query set.

Design Rationale

Keep the outer Jagged protocol literally separate while sharing only the inner Basefold opening:

  • witness and fixed keep separate Jagged commitments and separate Merkle roots
  • witness and fixed keep separate Jagged sumcheck/assist rounds
  • each round keeps its own q' shape and reshape height from its existing commitment lifecycle
  • Ceno collects each Jagged round's inner opening claims and calls one Basefold batch_open_with_trace_materializer
  • the resulting JaggedProof contains all Jagged rounds plus one required shared inner_proof

This is intentionally surgical: it does not refactor witness lifecycle, q' ownership, q' residency, or fixed/witness commit paths. The only integration change is moving inner Basefold opening from per-Jagged-round execution to one batched inner opening after all Jagged reductions.

Soundness/correctness rationale: prover and verifier transcript order is aligned with gkr-backend: absorb all Jagged round reductions first, then absorb/verify one inner Basefold opening over all inner claims. Commitments remain independent, so sharing the inner proof does not merge witness/fixed roots.

Change Highlights

  • ceno_zkvm/src/scheme/gpu/mod.rs
    • GPU Jagged opening now collects (round_proof, rho_row, col_evals) for each Jagged round.
    • Builds per-round inner opening claims without changing q' lifecycle.
    • Calls one shared GPU Basefold batch_open_with_trace_materializer for witness/fixed inner claims.
  • ceno_zkvm/src/scheme.rs
    • Extends existing proof-size display to include PCS-specific nested breakdowns.
  • Cargo.toml
    • Pins gkr-backend and ceno-gpu dependencies to feat/jagged_single_commit.

Benchmark / Performance Impact

Operation

Operation master (s) this PR (s) Improve (master -> this PR)
reth-block 11.143 11.087 +0.056s
app.prove 10.579 10.559 +0.020s
create_proof_of_shard 6.315 6.509 -0.194s
commit_traces 1.354 1.535 -0.181s
pcs_opening 1.492 1.483 +0.009s
shard-0 proof size 6.15 MiB 5.48 MiB +0.67 MiB smaller (-10.96%)

Layer

Layer master (s) this PR (s) Improve (master -> this PR)
Basefold witness commit/query 0.423 / 0.270 0.427 / 0.269 approximately flat
Basefold fixed commit/query 0.0147 / 0.00325 folded into shared opening removes separate inner proof
Jagged outer rounds separate witness/fixed separate witness/fixed unchanged by design

Proof-size breakdown, shard 0

Sizes are MiB, computed as bytes / 2^20. Percent is relative to the after proof file (5.48 MiB).

Component Size % of Proof
Proof file app_proof.bitcode 5.48 MiB 100.00%
mpcs_opening.total 1.09 MiB 19.95%
mpcs_opening.rounds 0.008 MiB 0.14%
round[0] witness Jagged round 0.005 MiB 0.09%
round[1] fixed Jagged round 0.003 MiB 0.05%
shared inner_proof 1.09 MiB 19.81%
inner_proof.query_opening_proof 1.08 MiB 19.78%
inner_proof.commits 0.001 MiB 0.01%
inner_proof.sumcheck_proof 0.001 MiB 0.02%
inner_proof.final_message 0.0003 MiB 0.01%

Raw proof-size data:

Metric Before After Delta
Shard 0 proof file 6,453,943 B 5,746,603 B -707,340 B (-10.96%)
Single proof object n/a 5,746,602 B n/a
mpcs_opening.total n/a 1,146,525 B n/a
shared inner_proof n/a 1,138,405 B n/a

Testing

cargo fmt -p ceno_zkvm
cargo check -p ceno_zkvm --features gpu

Additional dependency checks:

# gkr-backend
cargo fmt -p mpcs
cargo check -p mpcs
cargo check -p mpcs --all-targets

# ceno-gpu
cargo fmt -p cuda_hal
cargo check -p cuda_hal --features bb31

E2E validation:

  • ../ceno-reth-benchmark, block 23587691, shard 0, GPU, prove-app, verifier passed.

Risks and Rollout

Risk is transcript/order mismatch because inner Basefold proof generation moved out of each Jagged round and into one shared call after all Jagged reductions. The verifier mirrors this order in gkr-backend, and shard-0 e2e verification passed.

Performance risk is low: proof size improves materially while pcs_opening is flat on the measured shard. commit_traces varied upward in this run, but this PR does not change commit lifecycle or q' materialization.

Rollback is localized: restore the previous per-Jagged-round inner opening path and the old dependency pins.

Follow-ups (optional)

None required for this PR. Broader cleanup can later remove temporary local benchmark patching once dependency branches are merged.

Copilot Reviewer Directive (keep this section)

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

@hero78119 hero78119 changed the title feat(zkvm): batch jagged inner openings feat(zkvm): share witness/fixed Jagged inner opening May 19, 2026
Base automatically changed from feat/witgen_gpu to master May 19, 2026 14:53
@hero78119 hero78119 force-pushed the feat/jagged_single_commit branch from 7e4cbf8 to 3d4cc63 Compare May 20, 2026 07:01
@hero78119 hero78119 added this pull request to the merge queue May 20, 2026
Merged via the queue into master with commit f684154 May 20, 2026
5 checks passed
@hero78119 hero78119 deleted the feat/jagged_single_commit branch May 20, 2026 09:20
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