Skip to content

Efficient bytecode commitment with dory precommitted geometry#1344

Open
RadNi wants to merge 22 commits intoa16z:mainfrom
LayerZero-Research:amir/bytecode-commitment-merged
Open

Efficient bytecode commitment with dory precommitted geometry#1344
RadNi wants to merge 22 commits intoa16z:mainfrom
LayerZero-Research:amir/bytecode-commitment-merged

Conversation

@RadNi
Copy link
Copy Markdown
Contributor

@RadNi RadNi commented Mar 17, 2026

Summary

This PR adds committed-program support for bytecode and program-image openings throughout the zkVM flow. This allows prover to efficiently prove bytecode / program-image polynomials openings instead of verifier directly evaluating them which significantly reduces the recursion cycles.

The main changes are:

  • add committed preprocessing and commitment plumbing for bytecode chunks and the program image
  • add bytecode and program-image claim reductions so these openings can be reduced into the shared Stage 8 Dory opening flow
  • introduce precommitted Dory geometry and total-var sizing across prover and verifier
  • split stage 6 into 6a and 6b to separate address and cycle phases
  • update SDK preprocessing helpers, examples, and docs for committed-bytecode flows
  • add bytecode committed variant of preprocessing to sdk and updated all the examples to support it

RadNi and others added 6 commits March 17, 2026 16:04
Use phase-specific stage6a/stage6b sumcheck params and proof wiring so zk transcript and constraints stay aligned after splitting stage6. This preserves the split design while fixing zk failures without introducing bytecode-commitment features.

Made-with: Cursor

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
…rifier

Adopt embedded-main Dory scheduling with shared precommitted claim-reduction plumbing so stage 6/8 can handle dominant precommitted contexts consistently in both zk and non-zk flows.

Made-with: Cursor
Add committed bytecode/program-image claim-reduction and opening-flow updates so verifier-side checks stay consistent with staged precommitted claims. Extend SDK macro helpers for committed prover/verifier preprocessing and align guest/shared verifier preprocessing construction.

Made-with: Cursor

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
… constraints

Introduce committed program/bytecode helpers (`program.rs`, `bytecode/chunks.rs`) and wire bytecode/program-image claim reductions into the zk verifier constraint path. Also update Dory geometry/one-hot integration and related tests to keep committed-mode openings and challenge binding consistent.

Co-authored-by: Quang Dao <qvd@andrew.cmu.edu>
Wire Stage 6a into global BlindFold stage verification so address-phase bridge constraints are enforced in ZK mode, and refactor Booleanity/BytecodeReadRaf into explicit address/cycle phase paths to remove legacy monolithic implementations and duplicated logic. Removed debugger artifacts from committed-mode Stage 8 opening handling, update wasm preprocessing wiring, and remove the obsolete fibonacci2 example workspace entries.

Made-with: Cursor
@RadNi RadNi force-pushed the amir/bytecode-commitment-merged branch from e1f40a4 to 95d0a6a Compare March 17, 2026 23:05
RadNi added 4 commits March 17, 2026 17:38
Move total-variable sizing into `JoltSharedPreprocessing` so prover and verifier use the same precommitted candidate and max-var calculations.
Document how precommitted polynomials fit into the shared Dory geometry, how the final opening point is derived across layouts, and why the precommitted variable permutation is needed to preserve low-to-high binding.
Add support for processing committed bytecode in various examples by introducing a command-line argument to specify the bytecode chunk. Minor bug fix for program-image in committed mode.
@RadNi RadNi force-pushed the amir/bytecode-commitment-merged branch from b732431 to a0ca612 Compare March 19, 2026 21:25
RadNi added 3 commits March 19, 2026 14:30
Canonicalize odd/even Dory setup sizes that map to the same generator bucket so repeated proofs reuse a consistent setup instead of mixing cached prepared points from different URS files. Also stop full-mode preprocessing from sizing prover setups against committed bytecode and program-image dimensions.
@RadNi RadNi marked this pull request as ready for review March 20, 2026 22:21
Comment on lines +494 to +504
if debug_bytecode_reduction_enabled() {
tracing::info!(
"BytecodeClaimReduction cache cycle len={} bound_value={} bound_eq={} scale={} cycle_claim={} synced_cycle_claim={}",
self.value_poly.len(),
self.value_poly.get_bound_coeff(0),
self.eq_poly.get_bound_coeff(0),
self.scale,
c_mid,
synced_cycle_claim,
);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like there's still a lot of debugging leftovers in the PR

Comment on lines +18 to +22
let bytecode_chunk = std::env::args()
.skip_while(|arg| arg != "--committed-bytecode")
.nth(1)
.map(|arg| arg.parse().unwrap());
#[cfg(any(feature = "nostd", feature = "std"))]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't include this in every example. I'd prefer to have one new example with committed bytecode in fib.

@0xAndoroid
Copy link
Copy Markdown
Collaborator

Also, it's worth noting about #1260 effort that's being done right now. Given that #1260 is a rewrite of the codebase, rather than refactor, it might be better to adapt these changes into there once 1260 is merged.

RadNi and others added 6 commits March 24, 2026 13:55
Delete unused binary test files to clean up the repository.
…er evaluation path.

Removed leftover debugging instruments.
Updated wasm-pack installation URL.
Expose Dory opening-hint accessors and a preprocessing constructor that accepts precomputed generators. This lets jolt-cpp serialize Dory hints and reuse loaded prover setup without carrying ad hoc local patches in the submodule consumer.

Made-with: Cursor
quangvdao and others added 3 commits March 28, 2026 08:23
Required by the gen_inlines tool to pre-allocate Reg{40} before
generating inline sequences, matching INLINE::trace()'s rd=0
remapping at runtime.

Made-with: Cursor
…d output check

When phase1_num_rounds < log_T, the input_claim for RafEvaluation and
OutputCheck sumchecks is pre-scaled by 2^(phase3_cycle_rounds) to
pre-compensate for the gap-round halvings. However, the raw polynomial
evaluations computed from the witness data sum to the unscaled claim.
This mismatch causes UniPoly reconstruction to produce an incorrect
polynomial, failing the verifier's poly(0) + poly(1) == previous_claim
check.

Scale the raw evaluations by 2^(phase3_cycle_rounds) before polynomial
reconstruction so they are consistent with the pre-scaled previous_claim.

Made-with: Cursor
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.

3 participants