Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c654ab3
Squash initial work on streaming Dory PCS
jprider63 Jul 23, 2025
b4c40fc
first pass over compilation errors.
zutshi Aug 6, 2025
3749754
added back RamRa in generate_streaming_witness.
zutshi Aug 6, 2025
e6f4e33
Streaming PCS API refactor compiles
jprider63 Aug 7, 2025
badb889
Streaming lambdas
jprider63 Aug 11, 2025
87b9167
Move ram_d
jprider63 Aug 11, 2025
6a91dc1
Work on streaming OneHot polynomials
jprider63 Aug 11, 2025
9011b49
Pass through K's for OneHot polynomials
jprider63 Aug 11, 2025
8f187ab
debugging ALL_COMMITTED_POLYNOMIALS is uninitialized
zutshi Aug 14, 2025
acd9bfc
passed ram_d as a parameter to make streaming work.
zutshi Aug 15, 2025
afe94cd
added debug prints
zutshi Aug 20, 2025
c2404d4
More debug
jprider63 Aug 20, 2025
abc43b5
Potential fix for finalizing one hots
jprider63 Aug 20, 2025
2bd73bf
removed ram_d todo and modified debug prints
zutshi Aug 21, 2025
dc7aa5a
Print debugs for PCS hints
jprider63 Aug 21, 2025
da5964b
fixed hints for non-one-hot polynmomials.
zutshi Aug 21, 2025
e483698
Fix j computation in streaming Dory
jprider63 Aug 22, 2025
7423fc4
Instruction one hot matches
jprider63 Aug 22, 2025
884f896
PCS matches if we pad out lazy trace
jprider63 Aug 22, 2025
a51027a
Cleanup
jprider63 Aug 27, 2025
823a197
WIP parallelize over row chunks
jprider63 Aug 27, 2025
dfd943c
Scaffolding for parallelized streaming Dory
jprider63 Aug 27, 2025
7b498e7
Refactor process_chunk
jprider63 Aug 27, 2025
bf77d1f
Streaming finalize
jprider63 Aug 28, 2025
d6c59b2
Added in implementations of transpose and ChunksWithPeek
zutshi Sep 2, 2025
bac7db1
Fixed chunking with peek. Debugging par_bridge issue.
zutshi Sep 2, 2025
f750df8
removed comments
zutshi Sep 4, 2025
692b7ca
added debug, clone and partialEq constraints for debugging and assert…
zutshi Sep 4, 2025
141360f
switched it back to original value for fib
zutshi Sep 4, 2025
f0472b4
added debug, clone and partialEq constraints for debugging and assert…
zutshi Sep 4, 2025
5bfa8a8
added debug, clone and partialEq constraints for debugging and assert…
zutshi Sep 4, 2025
55ef4c2
parallelized computing commitments.
zutshi Sep 4, 2025
e6f2e58
parallellized process_chunk
zutshi Sep 8, 2025
0ca71ec
process_chunk vectorized
zutshi Sep 9, 2025
f86ee06
moved ram_d into state_manager.
zutshi Sep 9, 2025
513a3b9
cleaned up debug prints and removed dead code.
zutshi Sep 17, 2025
6f197cc
Cleanup, warnings, and unwrap slices
jprider63 Sep 19, 2025
c0da995
Use bytemuck to peel newtype wrappers
jprider63 Sep 19, 2025
97de7cf
Share affine G1's between polynomials
jprider63 Sep 19, 2025
868b509
Format
jprider63 Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jolt-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ rand_distr = "0.4.3"
anyhow = "1.0.97"
derive_more = { version = "2.0.1", features = ["from"] }
paste = "1.0.15"
# dory = { git = "https://github.com/spaceandtimefdn/sxt-dory", branch = "dev/twist-shout" }
dory = { git = "https://github.com/spaceandtimefdn/sxt-dory", branch = "feat/return_row_commitments" }
# dory = { git = "https://github.com/GaloisInc/sxt-dory", branch = "feat/return_row_commitments_streaming" }
# dory = { path = "../../sxt-dory" }
lazy_static = "1.5.0"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion jolt-core/src/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn prove_example(
let mut tasks = Vec::new();
let mut program = host::Program::new(example_name);
let (bytecode, init_memory_state, _) = program.decode();
let (_, _, program_io) = program.trace(&serialized_input);
let (_, _, _, program_io) = program.trace(&serialized_input);

let task = move || {
let preprocessing = JoltRV32IM::prover_preprocess(
Expand Down
12 changes: 9 additions & 3 deletions jolt-core/src/host/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use rayon::prelude::*;
use tracer::{
emulator::memory::Memory,
instruction::{RV32IMCycle, RV32IMInstruction, VirtualInstructionSequence},
LazyTraceIterator,
};

use crate::field::JoltField;
Expand Down Expand Up @@ -202,7 +203,10 @@ impl Program {

// TODO(moodlezoup): Make this generic over InstructionSet
#[tracing::instrument(skip_all, name = "Program::trace")]
pub fn trace(&mut self, inputs: &[u8]) -> (Vec<RV32IMCycle>, Memory, JoltDevice) {
pub fn trace(
&mut self,
inputs: &[u8],
) -> (LazyTraceIterator, Vec<RV32IMCycle>, Memory, JoltDevice) {
self.build(DEFAULT_TARGET_DIR);
let elf = self.elf.as_ref().unwrap();
let mut elf_file =
Expand All @@ -221,12 +225,14 @@ impl Program {
max_output_size: self.max_output_size,
bytecode_size: Some(bytecode_size),
};
tracer::trace(elf_contents, inputs, &memory_config)
let l = tracer::trace_lazy(elf_contents.clone(), inputs, &memory_config);
let r = tracer::trace(elf_contents, inputs, &memory_config);
(l, r.0, r.1, r.2)
}

pub fn trace_analyze<F: JoltField>(mut self, inputs: &[u8]) -> ProgramSummary {
let (bytecode, init_memory_state, _) = self.decode();
let (trace, _, io_device) = self.trace(inputs);
let (_, trace, _, io_device) = self.trace(inputs);

ProgramSummary {
trace,
Expand Down
49 changes: 43 additions & 6 deletions jolt-core/src/poly/commitment/commitment_scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use std::borrow::Borrow;
use std::fmt::Debug;

use crate::poly::commitment::dory::JoltG1Wrapper;
use crate::poly::compact_polynomial::StreamingCompactWitness;
use crate::poly::dense_mlpoly::StreamingDenseWitness;
use crate::poly::multilinear_polynomial::Multilinear;
use crate::poly::one_hot_polynomial::StreamingOneHotWitness;
use crate::utils::transcript::Transcript;
use crate::zkvm::witness::CommittedPolynomial;
use crate::{
field::JoltField,
poly::multilinear_polynomial::MultilinearPolynomial,
Expand All @@ -27,7 +33,7 @@ pub trait CommitmentScheme: Clone + Sync + Send + 'static {
/// A hint that helps the prover compute an opening proof. Typically some byproduct of
/// the commitment computation, e.g. for Dory the Pedersen commitments to the rows can be
/// used as a hint for the opening proof.
type OpeningProofHint: Sync + Send + Clone + Debug;
type OpeningProofHint: Sync + Send + Clone + Debug + PartialEq;

/// Generates the prover setup for this PCS. `max_num_vars` is the maximum number of
/// variables of any polynomial that will be committed using this setup.
Expand Down Expand Up @@ -123,10 +129,41 @@ pub trait CommitmentScheme: Clone + Sync + Send + 'static {
fn protocol_name() -> &'static [u8];
}

pub trait StreamingCommitmentScheme: CommitmentScheme {
type State<'a>; // : Clone + Debug;
pub trait StreamingCommitmentScheme_: CommitmentScheme {
type State<'a>: Sync;
type ChunkState: Send;

fn initialize<'a>(size: usize, setup: &'a Self::ProverSetup) -> Self::State<'a>;
fn process<'a>(state: Self::State<'a>, eval: Self::Field) -> Self::State<'a>;
fn finalize<'a>(state: Self::State<'a>) -> Self::Commitment;
fn initialize<'a>(poly: Multilinear, size: usize, setup: &'a Self::ProverSetup) -> Self::State<'a>;
fn process<'a>(poly: Multilinear, state: Self::State<'a>, eval: Self::Field) -> Self::State<'a>;
fn process_chunk<'a, T>(state: &Self::State<'a>, chunk: &[T]) -> Self::ChunkState where Self: StreamingProcessChunk<T>;
fn finalize<'a>(state: Self::State<'a>, chunks: &[Self::ChunkState]) -> (Self::Commitment, Self::OpeningProofHint);
}

/// This trait abstraction allows us to use the optimized version of MSMs for small scalars.
// JP: Does `VariableBaseMSM` make sense instead of this?
pub trait StreamingProcessChunk<T>: StreamingCommitmentScheme_ {
fn process_chunk_t<'a>(s: &Self::State<'a>, chunk: &[T]) -> Self::ChunkState;
}

pub trait StreamingCommitmentScheme :
StreamingCommitmentScheme_ +
StreamingProcessChunk<StreamingDenseWitness<<Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u8, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u16, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u32, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u64, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<i64, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingOneHotWitness<<Self as CommitmentScheme>::Field>>
{}

impl<PCS> StreamingCommitmentScheme for PCS
where
PCS: StreamingCommitmentScheme_ +
StreamingProcessChunk<StreamingDenseWitness<<Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u8, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u16, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u32, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<u64, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingCompactWitness<i64, <Self as CommitmentScheme>::Field>>
+ StreamingProcessChunk<StreamingOneHotWitness<<Self as CommitmentScheme>::Field>>,
{}
Loading