fix(ram): keep dynamic init witness padding zero#1350
Merged
Conversation
27fe6db to
e3169ef
Compare
kunxian-xia
approved these changes
Jun 8, 2026
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
Dynamic RAM init could write non-zero values into committed witness padding rows. That violates the expected zero-padding invariant for RMM witness commitments and causes CPU shard verification to fail with
InvalidPcsOpen.Design Rationale
Keep the existing padded CPU proving flow and add the missing dynamic-init guard so only real instances populate committed witness rows. This preserves the RMM zero-padding contract without changing verifier logic.
Related: scroll-tech/gkr-backend#62
Change Highlights
ceno_zkvm: guard dynamic RAM init witness writes withi < num_instancesso padded witness rows remain zero.Benchmark / Performance Impact
Operation
CPU benchmark: block
23587691, shard0,CENO_MAX_CELL_PER_SHARD=805306368.Layer
Benchmark command(s):
Baseline used the same benchmark with Ceno patched to
902b3e3c^(7d8086c2) and remotegkr-backendtagv1.0.0-alpha.31.Environment (CPU/GPU, core count, rust toolchain, commit hash):
rustc 1.93.0-nightly (07bdbaedc 2025-11-19)7d8086c2, remotegkr-backend v1.0.0-alpha.31902b3e3craw data:
sanity_23587691_shard0_cpu_fresh_baseline_remote_gkr_no_guard_maxcell805306368_20260608.log, failed verification withInvalidPcsOpensanity_23587691_shard0_cpu_dynamic_guard_no_gkrzero_maxcell805306368_20260608.log, passed verificationTesting
Risks and Rollout
Low risk: the change only skips dynamic RAM init writes for rows outside
num_instances. Rollback is reverting this guard.Follow-ups (optional)
None.
Copilot Reviewer Directive (keep this section)
When Copilot reviews this PR, apply
.github/copilot-instructions.mdstrictly.