Closed
Conversation
- Add BytecodeReadRafAddressSumcheckProver/Verifier and BytecodeReadRafCycleSumcheckProver/Verifier - Add BooleanityAddressSumcheckProver/Verifier and BooleanityCycleSumcheckProver/Verifier - Add SumcheckId variants: BytecodeReadRafAddressPhase, BooleanityAddressPhase, BytecodeClaimReductionCyclePhase, BytecodeClaimReduction - Add VirtualPolynomial variants: BytecodeValStage, BytecodeReadRafAddrClaim, BooleanityAddrClaim, BytecodeClaimReductionIntermediate - Update prover: prove_stage6a() and prove_stage6b() - Update verifier: verify_stage6a() and verify_stage6b() - Update JoltProof: stage6a_sumcheck_proof and stage6b_sumcheck_proof - Add bytecode-commitment-progress.md planning doc
- BooleanityAddressSumcheckProver: now has its own state (B, G, F, gamma_powers) - BooleanityCycleSumcheckProver: now has its own state (D, H, eq_r_r, gamma_powers) - BytecodeReadRafAddressSumcheckProver: now has its own state (F, val_polys, int_poly) - BytecodeReadRafCycleSumcheckProver: now has its own state (ra, gruen_eq_polys, bound_val_evals) The into_cycle_prover() method now transfers only the necessary state rather than wrapping an inner shared struct. This makes the separation cleaner and prepares for potential future changes where the two phases might diverge further.
…d modes - BytecodePreprocessing::preprocess() now returns Self (caller wraps in Arc) - JoltSharedPreprocessing::new() takes &BytecodePreprocessing, stores bytecode_size - JoltProverPreprocessing stores Arc<BytecodePreprocessing> + optional commitments - JoltVerifierPreprocessing uses VerifierBytecode<PCS> enum (Full or Committed) - Added TrustedBytecodeCommitments<PCS> for type-safe commitment handling - Updated SDK macros to return (shared, bytecode) tuple - Updated all tests, guest/*, and benchmarks This refactor enables Committed mode where verifier only receives bytecode commitments instead of full O(K) bytecode data. Actual commitment computation is TODO for a future PR.
- Create jolt-core/src/zkvm/tests.rs with E2ETestConfig infrastructure - Port all 15 e2e tests from prover.rs to unified test runner - Add committed bytecode mode tests (ignored until verifier ready) - Wire verifier Stage 6a to branch on BytecodeMode (committed path) - Update read_raf_checking for optional bytecode preprocessing - Update bytecode-commitment-progress.md with status
- Add macro-generated preprocess_<func> and keep verifier preprocessing derived from prover - Update examples and host template to the new 2-call workflow - Fold bytecode preprocessing refactor notes into bytecode-commitment-progress.md (single authoritative doc) - Fix bigint inline assembly gating to avoid host build failures
Expose compute_bytecode_vmp_contribution for external callers (e.g., GPU prover) and remove #[cfg(test)] restriction from set_layout.
Delegate to compute_bytecode_vmp_contribution to eliminate code duplication.
…lding - Initialize bytecode Dory context using main matrix dimensions to support embedding in Stage 8. - Update VMP contribution logic to use correct column count. - Handle trailing dummy rounds in BytecodeClaimReductionProver for batched sumcheck alignment. - Pass max_trace_len to TrustedBytecodeCommitments derivation.
Contributor
Author
|
Close in lieu of #1221 |
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.
Overview
This PR introduces Committed Bytecode Mode, a new verification mode where the verifier only needs bytecode commitments instead of full bytecode data. This enables succinct verification independent of program size by using claim reductions and folded openings.
Key Difficulties & Tradeoffs
1. Trace Length Must Be ≥ Bytecode Size
Constraint: In Committed mode,
padded_trace_length >= bytecode_sizeis required.Why: Stage 8 folds bytecode chunk openings into the joint opening proof by embedding bytecode polynomials (defined over
log_Kcycle variables) into the main opening domain (defined overlog_Tcycle variables). This embedding uses a Lagrange selector∏(1 - r_extra)over the "missing" cycle variables, which only works whenlog_T >= log_K.Alternative not pursued: Supporting arbitrary
log_Kvslog_Twould require:max(log_T, log_K)roundsThis is a cross-cutting change affecting sumcheck, Stage 6b scheduling, Dory context sizing, Stage 8 claims, and streaming VMV paths. Given scope and risk, we enforce
T >= Kinstead.2. Bytecode Commitment Chunking (448 Lanes →
k_chunkChunks)Structure: Bytecode fields are organized into 448 "lanes":
Chunking depends on
log_k_chunk:k_chunk=16(small traces): 448/16 = 28 commitmentsk_chunk=256(large traces): 448/256 = 2 commitmentsTradeoff: More chunks means more commitment overhead but matches the existing one-hot RA polynomial structure. The
log_k_chunkvalue is derived from trace length (4iflog_T < 16, else8), so small traces incur more bytecode commitments.3. AddressMajor Layout Requires Coefficient Permutation
Problem: Under
DoryLayout::AddressMajor, bytecode chunk coefficients are stored in "cycle-major" index order (cycle * K + address), which makesBindingOrder::LowToHighbind lane/address bits first. ButBytecodeClaimReductionPhase 1 (Stage 6b) must bind cycle bits first to match the stagedr_bcsemantics from Stage 6a.Solution: In
BytecodeClaimReductionProver::initialize, we permute AddressMajor chunk coefficients into CycleMajor order before running the reduction sumcheck. This is a pure index permutation (variable renaming); the resulting evaluations match the committed polynomial when the opening point is interpreted in the unified[lane || cycle]order.This mirrors the approach used in
AdviceClaimReductionwhere advice polynomials are also permuted for correct variable binding order.4. Stage 6 Split Required for Mid-Stage Claim Emission
Problem: The verifier's
O(K)work happens when computingVal_s(r_bc)evaluations. To eliminate this, we need to emit these claims right after binding the bytecode address variablesr_bc, before the cycle-phase rounds begin.Solution: Split Stage 6 into:
r_bcfor bytecode,r_addressfor booleanity)This required splitting both
BytecodeReadRafandBooleanityinto separate address/cycle sumcheck instances, with intermediate claims cached in the opening accumulator to chain the phases.Key Changes
1. New Bytecode Mode Enum
File:
jolt-core/src/zkvm/config.rsBytecodeModeenum with two variants:Full(default): Verifier materializes bytecode-dependent polynomials (O(K) work)Committed: Uses staged Val claims + claim reduction + folded Stage 8 openingOneHotConfig::from_log_k_chunk()constructor for explicit chunk size specification2. Bytecode Chunk Infrastructure
New file:
jolt-core/src/zkvm/bytecode/chunks.rstotal_lanes(): Returns 448 total lanes for bytecode fields (3×32 register one-hots + 2 fields + flags + lookup table flags + RAF flag)lane_value(): Maps a global lane index to the corresponding bytecode field valuebuild_bytecode_chunks(): Builds per-chunk multilinear polynomials B_i(lane, k) for bytecode commitment3. Bytecode Preprocessing Refactor
File:
jolt-core/src/zkvm/bytecode/mod.rsTrustedBytecodeCommitments<PCS>struct for type-safe trusted bytecode commitmentsderive()method computes commitments from full bytecode (offline preprocessing)log_k_chunk, andbytecode_lenVerifierBytecode<PCS>enum:Full(Arc<BytecodePreprocessing>): Verifier has full bytecodeCommitted(TrustedBytecodeCommitments<PCS>): Verifier only has commitmentscode_sizefromBytecodePreprocessingtoJoltSharedPreprocessing.bytecode_size4. Bytecode Claim Reduction
New file:
jolt-core/src/zkvm/claim_reductions/bytecode.rsTwo-phase claim reduction that batches 5 bytecode Val-stage claims:
Key components:
BytecodeReductionPhaseenum:CycleVariables/LaneVariablesBytecodeClaimReductionParams: Stores η powers, lane weights, challengesBytecodeClaimReductionProver/Verifier: Runs the two-phase sumcheckcompute_chunk_lane_weights(): Computes per-chunk lane weight tables from Val stage gammas5. Stage 6 Split: 6a (Address) + 6b (Cycle)
Files:
jolt-core/src/zkvm/prover.rsandverifier.rsSplits Stage 6 into two phases to support bytecode claim reduction:
New provers/verifiers:
BytecodeReadRafAddressSumcheckProver/Verifier(address phase)BytecodeReadRafCycleSumcheckProver/Verifier(cycle phase)BooleanityAddressSumcheckProver/Verifier(address phase)BooleanityCycleSumcheckProver/Verifier(cycle phase)6. Prover/Verifier Preprocessing Updates
JoltProverPreprocessingchanges:bytecode: Arc<BytecodePreprocessing>(prover always has full access)bytecode_commitments: Option<TrustedBytecodeCommitments<PCS>>bytecode_commitment_hints: Option<Vec<PCS::OpeningProofHint>>new()(Full mode) andnew_committed()(Committed mode)is_committed_mode()helper methodJoltSharedPreprocessingchanges:bytecode: Arc<BytecodePreprocessing>bytecode_size: usizeas the single source of truth for bytecode sizeJoltVerifierPreprocessingchanges:bytecode: VerifierBytecode<PCS>fieldnew_full()andnew_committed()7. Proof Serialization Updates
File:
jolt-core/src/zkvm/proof_serialization.rsstage6_sumcheck_proof→stage6a_sumcheck_proof+stage6b_sumcheck_proofbytecode_mode: BytecodeModetoJoltProofCommittedPolynomial::BytecodeChunk(usize)variantVirtualPolynomialvariants for claim reduction8. RLC Polynomial / Stage 8 Integration
File:
jolt-core/src/poly/rlc_polynomial.rsbytecode_polystoStreamingRLCContextvmp_bytecode_contribution()for bytecode chunk VMP computation9. Booleanity Sumcheck Split
File:
jolt-core/src/subprotocols/booleanity.rsSplit the booleanity sumcheck into address and cycle phases:
BooleanityAddressSumcheckProver: Handles firstlog_k_chunkroundsBooleanityCycleSumcheckProver: Handles remaininglog_trounds (reconstructs state from accumulator)10. SDK/Macro Updates
File:
jolt-sdk/macros/src/lib.rsNew generated functions:
preprocess_<fn>()- Full mode preprocessingpreprocess_committed_<fn>()- Committed mode preprocessingpreprocess_shared_<fn>()- Returns(JoltSharedPreprocessing, BytecodePreprocessing)tuplebuild_prover_committed_<fn>()- Build prover closure for committed modeprove_committed_<fn>()- Prove function for committed mode11. Test Infrastructure
New file:
jolt-core/src/zkvm/tests.rsMoved e2e tests from
prover.rsto dedicated module with new test infrastructure:E2ETestConfigbuilder for test configurationrun_e2e_test()unified test runner12. Example Updates
All examples updated to use new preprocessing API:
preprocess_shared_*+preprocess_prover_*+preprocess_verifier_*withpreprocess_*+verifier_preprocessing_from_prover_*--committed-bytecodeCLI flag13. Error Handling
File:
jolt-core/src/utils/errors.rsNew error variants:
InvalidBytecodeConfig(String)- Bytecode configuration mismatchBytecodeTypeMismatch(String)- Wrong VerifierBytecode variant accessUsage
CLI example: