Skip to content

Commit 8988a92

Browse files
committed
fix build after merge
1 parent 8aff62d commit 8988a92

10 files changed

Lines changed: 36 additions & 36 deletions

File tree

bench_vs/lambda/recursion/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prover/src/continuation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
//! `ContinuationProof` bundle and `verify_continuation` checks it from the bundle
3535
//! and ELF alone (`prove_and_verify_continuation` is a thin wrapper over both).
3636
37-
use std::collections::HashMap;
37+
use crate::det_hash::HashMap;
3838

3939
use crypto::fiat_shamir::default_transcript::DefaultTranscript;
4040
use executor::elf::Elf;
@@ -533,7 +533,7 @@ fn prove_global(
533533
opts: &ProofOptions,
534534
) -> Result<MultiProof<F, E, ()>, Error> {
535535
// Each cell's final state (boundaries are in epoch order, so the last fini wins).
536-
let mut final_state: global_memory::FiniStateMap = HashMap::new();
536+
let mut final_state: global_memory::FiniStateMap = HashMap::default();
537537
for epoch in boundaries {
538538
for b in epoch {
539539
final_state.insert(

prover/src/paged_mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! An occupancy bitmap is tracked so [`PagedMem::iter`] can yield exactly the
1818
//! cells that were explicitly `set`.
1919
20-
use std::collections::HashMap;
20+
use crate::det_hash::HashMap;
2121

2222
use crate::tables::page::DEFAULT_PAGE_SIZE;
2323

prover/src/tables/global_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
//! | GM-GENESIS | GlobalMemory | `[address, init, GENESIS]` | 1 (sender) |
3535
//! | GM-FINAL | GlobalMemory | `[address, fini, fini_epoch]` | 1 (receiver) |
3636
37-
use std::collections::HashMap;
37+
use crate::det_hash::HashMap;
3838

3939
use stark::lookup::{BusInteraction, BusValue, LinearTerm, Multiplicity};
4040
use stark::trace::TraceTable;

prover/src/tables/local_to_global.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
//! by every variable-length table). `MU` is self-enforced: dropping a real row
5555
//! (`MU = 0`) breaks its telescoping link → bus imbalance.
5656
57-
use std::collections::HashMap;
57+
use crate::det_hash::HashMap;
5858

5959
use stark::lookup::{BusInteraction, BusValue, LinearTerm, Multiplicity, Packing};
6060
use stark::trace::TraceTable;
@@ -501,7 +501,7 @@ mod tests {
501501

502502
#[test]
503503
fn test_sparse_only_touched_cells() {
504-
let initial_memory = HashMap::from([(10, 5)]);
504+
let initial_memory = HashMap::from_iter([(10, 5)]);
505505
let epochs = vec![
506506
vec![(10, 7, 3), (20, 9, 4)], // epoch 0 touches 10 and 20
507507
vec![(10, 8, 10)], // epoch 1 touches only 10
@@ -520,7 +520,7 @@ mod tests {
520520

521521
#[test]
522522
fn test_genesis_init_for_first_touch() {
523-
let initial_memory = HashMap::from([(10, 5)]);
523+
let initial_memory = HashMap::from_iter([(10, 5)]);
524524
let epochs = vec![vec![(10, 7, 3), (20, 9, 4)]];
525525
let boundaries = epoch_boundaries(&initial_memory, &epochs);
526526

@@ -548,7 +548,7 @@ mod tests {
548548

549549
#[test]
550550
fn test_fini_records_current_epoch_label_and_timestamp() {
551-
let initial_memory = HashMap::from([(10, 5)]);
551+
let initial_memory = HashMap::from_iter([(10, 5)]);
552552
let epochs = vec![vec![(10, 7, 3)], vec![(10, 8, 10)]];
553553
let boundaries = epoch_boundaries(&initial_memory, &epochs);
554554

@@ -573,7 +573,7 @@ mod tests {
573573

574574
#[test]
575575
fn test_telescoping_consecutive_epochs() {
576-
let initial_memory = HashMap::from([(10, 5)]);
576+
let initial_memory = HashMap::from_iter([(10, 5)]);
577577
let epochs = vec![vec![(10, 7, 3)], vec![(10, 8, 10)]];
578578
let boundaries = epoch_boundaries(&initial_memory, &epochs);
579579

@@ -599,7 +599,7 @@ mod tests {
599599
#[test]
600600
fn test_telescoping_skips_untouched_epochs() {
601601
// Cell 20 is touched in epoch 0, skipped in epoch 1, touched again in 2.
602-
let initial_memory = HashMap::new();
602+
let initial_memory = HashMap::default();
603603
let epochs = vec![
604604
vec![(20, 9, 4)], // epoch 0 writes 20
605605
vec![(10, 1, 5)], // epoch 1 does not touch 20

prover/src/tables/trace_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ fn touched_cells_from_memory_state(memory_state: &MemoryState) -> local_to_globa
19331933
/// Bucket an initial-memory image into per-page byte arrays for PAGE init columns.
19341934
pub(crate) fn build_init_page_data<I: ImageSource>(image: &I) -> HashMap<u64, Vec<u8>> {
19351935
let page_size = page::DEFAULT_PAGE_SIZE;
1936-
let mut init_page_data: HashMap<u64, Vec<u8>> = HashMap::new();
1936+
let mut init_page_data: HashMap<u64, Vec<u8>> = HashMap::default();
19371937
for (addr, value) in image.image_iter() {
19381938
let page_base = page::page_base_for_address(addr);
19391939
let offset = page::offset_in_page(addr);

prover/src/tests/local_to_global_bus_tests.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! program-end receiver (final value of each cell). The bus balances iff every
66
//! epoch's `fini` matches the next epoch's `init` (the cross-epoch telescoping).
77
8-
use std::collections::HashMap;
8+
use crate::det_hash::HashMap;
99

1010
use crypto::fiat_shamir::default_transcript::DefaultTranscript;
1111
use math::field::element::FieldElement;
@@ -432,7 +432,7 @@ pub(crate) fn prove_global(boundaries: &[Vec<CellBoundary>]) -> MultiProof<F, E,
432432

433433
// Program-end anchor: a RECEIVE token for each cell's final fini (epochs are
434434
// in order, so the last write wins).
435-
let mut final_fini: HashMap<u64, Token> = HashMap::new();
435+
let mut final_fini: HashMap<u64, Token> = HashMap::default();
436436
for epoch in boundaries {
437437
for b in epoch {
438438
final_fini.insert(b.address, (b.address, b.fini.value, b.fini.epoch));
@@ -507,7 +507,7 @@ pub(crate) fn prove_and_verify(boundaries: &[Vec<CellBoundary>]) -> bool {
507507
fn test_global_memory_bus_balances() {
508508
// Cell 10 touched in epochs 0,1,2; cell 20 in epoch 0 then again epoch 2
509509
// (skipping 1); cell 30 once.
510-
let initial_memory = HashMap::from([(10u64, 5u64)]);
510+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
511511
let epochs = vec![
512512
vec![(10, 7, 3), (20, 9, 4)],
513513
vec![(10, 8, 10)],
@@ -519,7 +519,7 @@ fn test_global_memory_bus_balances() {
519519

520520
#[test]
521521
fn test_global_memory_bus_rejects_tampered_boundary() {
522-
let initial_memory = HashMap::from([(10u64, 5u64)]);
522+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
523523
let epochs = vec![vec![(10, 7, 3)], vec![(10, 8, 10)]];
524524
let mut boundaries = epoch_boundaries(&initial_memory, &epochs);
525525
assert!(prove_and_verify(&boundaries));
@@ -533,7 +533,7 @@ fn test_global_memory_bus_rejects_tampered_boundary() {
533533
fn test_l2g_binding_holds() {
534534
// Per-epoch L2G roots committed by the epoch proofs match the per-epoch L2G
535535
// sub-table roots in the final cross-epoch proof.
536-
let initial_memory = HashMap::from([(10u64, 5u64)]);
536+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
537537
let epochs = vec![
538538
vec![(10, 7, 3), (20, 9, 4)],
539539
vec![(10, 8, 10)],
@@ -551,7 +551,7 @@ fn test_l2g_binding_holds() {
551551
fn test_l2g_binding_rejects_mismatch() {
552552
// The final proof uses a DIFFERENT epoch-0 L2G table than the epoch proofs
553553
// committed, so the binding must reject it.
554-
let initial_memory = HashMap::from([(10u64, 5u64)]);
554+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
555555
let epochs = vec![
556556
vec![(10, 7, 3), (20, 9, 4)],
557557
vec![(10, 8, 10)],
@@ -620,7 +620,7 @@ fn prove_and_verify_global_with_traces(
620620
.map(|b| (b.address, b.init.value, b.init.originating_epoch))
621621
.collect();
622622

623-
let mut final_fini: HashMap<u64, Token> = HashMap::new();
623+
let mut final_fini: HashMap<u64, Token> = HashMap::default();
624624
for epoch in boundaries {
625625
for b in epoch {
626626
final_fini.insert(b.address, (b.address, b.fini.value, b.fini.epoch));
@@ -691,7 +691,7 @@ fn prove_and_verify_global_with_traces(
691691
#[test]
692692
fn test_l2g_mu_zero_on_real_row_rejects() {
693693
// Two touched cells; row 0 is real (MU=1). We forge row 0's MU to 0.
694-
let initial_memory = HashMap::from([(10u64, 5u64)]);
694+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
695695
let epochs = vec![vec![(10, 7, 3), (20, 9, 4)]];
696696
let boundaries = epoch_boundaries(&initial_memory, &epochs);
697697

@@ -738,7 +738,7 @@ fn test_l2g_mu_zero_on_real_row_rejects() {
738738
#[test]
739739
fn test_l2g_mu_one_on_padding_row_rejects_global_bus() {
740740
// 3 real rows → 4-row trace (padding row at index 3).
741-
let initial_memory = HashMap::new();
741+
let initial_memory = HashMap::default();
742742
let epochs = vec![vec![(10, 7, 3), (20, 9, 4), (30, 1, 5)]];
743743
let boundaries = epoch_boundaries(&initial_memory, &epochs);
744744
assert_eq!(boundaries[0].len(), 3, "expect 3 real rows");
@@ -781,7 +781,7 @@ fn test_l2g_mu_one_on_padding_row_rejects_global_bus() {
781781
/// for the "set MU to 2, assert reject" pattern.
782782
#[test]
783783
fn test_l2g_mu_nonboolean_rejects_global_bus() {
784-
let initial_memory = HashMap::from([(10u64, 5u64)]);
784+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
785785
let epochs = vec![vec![(10, 7, 3)]];
786786
let boundaries = epoch_boundaries(&initial_memory, &epochs);
787787

@@ -885,7 +885,7 @@ fn test_l2g_init_epoch_ordering_field_arithmetic() {
885885
fn test_l2g_init_epoch_ordering_live_is_b20_rejects() {
886886
// Epoch 1 consumes epoch 0's fini for cell 10. Honest ordering has
887887
// init_epoch=1, fini_epoch=2, so 2 - 1 - 1 = 0 is a valid IsB20 lookup.
888-
let initial_memory = HashMap::new();
888+
let initial_memory = HashMap::default();
889889
let epochs = vec![vec![(10, 7, 3)], vec![(10, 8, 10)]];
890890
let boundaries = epoch_boundaries(&initial_memory, &epochs);
891891
let boundary = &boundaries[1];
@@ -963,7 +963,7 @@ fn test_l2g_init_epoch_ordering_live_is_b20_rejects() {
963963
fn test_l2g_design_y_orphan_mu_zero_rejects() {
964964
// Cell 10 touched in epoch 0 (label 1, fini value=7, ts=3) and epoch 1
965965
// (label 2, fini value=8, ts=10). Cell 20 touched in epoch 0 only.
966-
let initial_memory = HashMap::from([(10u64, 5u64)]);
966+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
967967
let epochs = vec![vec![(10, 7, 3), (20, 9, 4)], vec![(10, 8, 10)]];
968968
let boundaries = epoch_boundaries(&initial_memory, &epochs);
969969

@@ -1061,7 +1061,7 @@ fn test_continuation_private_input_spans_epochs() {
10611061
fn test_local_memory_bus_balances() {
10621062
// For each touched byte, L2G's init-receive (ts=0) + fini-send cancel the
10631063
// MEMW chain's init-send + fini-receive: the epoch-local Memory bus balances.
1064-
let initial_memory = HashMap::from([(10u64, 5u64)]);
1064+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
10651065
let epochs = vec![vec![(10, 7, 3), (20, 9, 4)]];
10661066
let boundaries = epoch_boundaries(&initial_memory, &epochs);
10671067
assert!(prove_verify_memory(&boundaries[0], &boundaries[0]));
@@ -1071,7 +1071,7 @@ fn test_local_memory_bus_balances() {
10711071
fn test_local_memory_bus_rejects_tamper() {
10721072
// L2G claims the real fini value but the access chain ends on a different
10731073
// one — the Memory bus no longer balances.
1074-
let initial_memory = HashMap::from([(10u64, 5u64)]);
1074+
let initial_memory = HashMap::from_iter([(10u64, 5u64)]);
10751075
let epochs = vec![vec![(10, 7, 3)]];
10761076
let boundaries = epoch_boundaries(&initial_memory, &epochs);
10771077
assert!(prove_verify_memory(&boundaries[0], &boundaries[0]));

prover/src/tests/prove_elfs_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,7 @@ fn test_prove_second_epoch_from_snapshot() {
30123012
assert!(epochs.len() >= 3, "need an intermediate epoch 1");
30133013

30143014
// Epoch 1 starts from epoch 0's ending memory + register snapshot.
3015-
let image: std::collections::HashMap<u64, u8> = epochs[0].end_memory.iter_bytes().collect();
3015+
let image: crate::det_hash::HashMap<u64, u8> = epochs[0].end_memory.iter_bytes().collect();
30163016
let register_init =
30173017
register::register_init_from_snapshot(&epochs[0].end_registers, epochs[0].end_pc);
30183018

@@ -3084,7 +3084,7 @@ fn test_epoch_proof_commits_l2g() {
30843084
use crate::tables::register;
30853085
use crate::tables::trace_builder::{build_initial_image, epoch_touched_cells};
30863086
use crate::test_utils::asm_elf_bytes;
3087-
use std::collections::HashMap;
3087+
use crate::det_hash::HashMap;
30883088

30893089
let _ = env_logger::builder().is_test(true).try_init();
30903090
let elf_bytes = asm_elf_bytes("all_loadstore_32");
@@ -3207,7 +3207,7 @@ fn test_continuation_pipeline_end_to_end() {
32073207
use crate::tables::register;
32083208
use crate::tables::trace_builder::{build_initial_image, epoch_touched_cells};
32093209
use crate::test_utils::asm_elf_bytes;
3210-
use std::collections::HashMap;
3210+
use crate::det_hash::HashMap;
32113211

32123212
let _ = env_logger::builder().is_test(true).try_init();
32133213
let elf_bytes = asm_elf_bytes("all_loadstore_32");
@@ -3365,7 +3365,7 @@ fn test_epoch_memory_bus_with_l2g_bookend() {
33653365
use crate::tables::register;
33663366
use crate::tables::trace_builder::build_initial_image;
33673367
use crate::test_utils::asm_elf_bytes;
3368-
use std::collections::HashMap;
3368+
use crate::det_hash::HashMap;
33693369

33703370
let _ = env_logger::builder().is_test(true).try_init();
33713371
let elf_bytes = asm_elf_bytes("all_loadstore_32");

prover/src/tests/register_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn test_bus_interactions() {
8888

8989
#[test]
9090
fn test_fini_from_trace_reads_every_register() {
91-
let mut final_state = FinalRegisterStateMap::new();
91+
let mut final_state = FinalRegisterStateMap::default();
9292
final_state.insert(
9393
register_base_address(5), // addr 10
9494
FinalRegisterWordState {

prover/src/tests/trace_builder_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ fn test_epoch_end_memory_converts_to_image() {
883883
use crate::test_utils::asm_elf_bytes;
884884
use executor::elf::Elf;
885885
use executor::vm::execution::Executor;
886-
use std::collections::HashMap;
886+
use crate::det_hash::HashMap;
887887

888888
let elf_bytes = asm_elf_bytes("basic_program");
889889
let program = Elf::load(&elf_bytes).unwrap();
@@ -914,7 +914,7 @@ fn test_build_traces_for_all_epochs() {
914914
use crate::test_utils::asm_elf_bytes;
915915
use executor::elf::Elf;
916916
use executor::vm::execution::Executor;
917-
use std::collections::HashMap;
917+
use crate::det_hash::HashMap;
918918

919919
let elf_bytes = asm_elf_bytes("basic_program");
920920
let program = Elf::load(&elf_bytes).unwrap();
@@ -983,7 +983,7 @@ fn test_terminating_epoch_rejected_when_not_final() {
983983
use crate::test_utils::asm_elf_bytes;
984984
use executor::elf::Elf;
985985
use executor::vm::execution::Executor;
986-
use std::collections::HashMap;
986+
use crate::det_hash::HashMap;
987987

988988
let elf_bytes = asm_elf_bytes("basic_program");
989989
let program = Elf::load(&elf_bytes).unwrap();
@@ -1036,7 +1036,7 @@ fn test_local_to_global_traces_from_real_execution() {
10361036
use crate::test_utils::asm_elf_bytes;
10371037
use executor::elf::Elf;
10381038
use executor::vm::execution::Executor;
1039-
use std::collections::HashMap;
1039+
use crate::det_hash::HashMap;
10401040

10411041
// A program that exercises memory (loads/stores), so some cells are touched.
10421042
let elf_bytes = asm_elf_bytes("all_loadstore_32");

0 commit comments

Comments
 (0)