Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preprocessed trace bug #1821

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion crates/core/machine/src/memory/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<F: PrimeField> MachineAir<F> for MemoryProgramChip {
let mut values = zeroed_f_vec(padded_nb_rows * NUM_MEMORY_PROGRAM_PREPROCESSED_COLS);
let chunk_size = std::cmp::max((nb_rows + 1) / num_cpus::get(), 1);

let memory = program.memory_image.iter().collect::<Vec<_>>();
let memory = program.memory_image.iter().sorted().collect::<Vec<_>>();
values
.chunks_mut(chunk_size * NUM_MEMORY_PROGRAM_PREPROCESSED_COLS)
.enumerate()
Expand Down
10 changes: 10 additions & 0 deletions crates/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,4 +1534,14 @@
setup_logger();
test_e2e_with_deferred_proofs_prover::<DefaultProverComponents>(SP1ProverOpts::default())
}

#[test]
fn test_deterministic_setup() {
setup_logger();
let prover = SP1Prover::<DefaultProverComponents>::new();
let program = test_artifacts::FIBONACCI_ELF;
let (pk, vk) = prover.setup(&program);

Check failure on line 1543 in crates/prover/src/lib.rs

View workflow job for this annotation

GitHub Actions / Formatting & Clippy

unused variable: `vk`

Check failure on line 1543 in crates/prover/src/lib.rs

View workflow job for this annotation

GitHub Actions / Formatting & Clippy

this expression creates a reference which is immediately dereferenced by the compiler

Check warning on line 1543 in crates/prover/src/lib.rs

View workflow job for this annotation

GitHub Actions / Test (x86-64)

unused variable: `vk`

Check warning on line 1543 in crates/prover/src/lib.rs

View workflow job for this annotation

GitHub Actions / Test (x86-64)

unused variable: `vk`
let pk2 = prover.setup(&program).0;

Check failure on line 1544 in crates/prover/src/lib.rs

View workflow job for this annotation

GitHub Actions / Formatting & Clippy

this expression creates a reference which is immediately dereferenced by the compiler
assert_eq!(pk.pk.commit, pk2.pk.commit);
}
}
Loading