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
1010use crypto:: fiat_shamir:: default_transcript:: DefaultTranscript ;
1111use 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 {
507507fn 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]
521521fn 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() {
533533fn 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() {
551551fn 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]
692692fn 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]
739739fn 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]
783783fn 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() {
885885fn 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() {
963963fn 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() {
10611061fn 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() {
10711071fn 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 ] ) ) ;
0 commit comments