Skip to content
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
22 changes: 20 additions & 2 deletions prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ use crate::tables::types::BusId;
use crate::test_utils::{
E, F, VmAir, create_bitwise_air, create_branch_air, create_commit_air, create_cpu_air,
create_decode_air, create_dvrm_air, create_halt_air, create_load_air, create_lt_air,
create_memw_air, create_memw_aligned_air, create_mul_air, create_page_air, create_register_air,
create_shift_air,
create_memw_air, create_memw_aligned_air, create_memw_register_air, create_mul_air,
create_page_air, create_register_air, create_shift_air,
};

use stark::proof::options::{GoldilocksCubicProofOptions, ProofOptions};
Expand Down Expand Up @@ -73,6 +73,7 @@ pub struct TableCounts {
pub dvrm: usize,
pub shift: usize,
pub branch: usize,
pub memw_register: usize,
}

impl TableCounts {
Expand All @@ -91,6 +92,7 @@ impl TableCounts {
+ self.dvrm
+ self.shift
+ self.branch
+ self.memw_register
}

/// Validate that all required tables have at least one chunk.
Expand All @@ -108,6 +110,7 @@ impl TableCounts {
("dvrm", self.dvrm),
("shift", self.shift),
("branch", self.branch),
("memw_register", self.memw_register),
];
for (name, count) in checks {
if count == 0 {
Expand Down Expand Up @@ -195,6 +198,7 @@ pub(crate) struct VmAirs {
pub commit: VmAir,
pub register: VmAir,
pub pages: Vec<VmAir>,
pub memw_registers: Vec<VmAir>,
}

impl VmAirs {
Expand Down Expand Up @@ -242,6 +246,13 @@ impl VmAirs {
for (air, trace) in self.pages.iter().zip(traces.pages.iter_mut()) {
pairs.push((air, trace, &()));
}
for (air, trace) in self
.memw_registers
.iter()
.zip(traces.memw_registers.iter_mut())
{
pairs.push((air, trace, &()));
}

pairs
}
Expand Down Expand Up @@ -286,6 +297,9 @@ impl VmAirs {
for air in &self.pages {
refs.push(air);
}
for air in &self.memw_registers {
refs.push(air);
}

refs
}
Expand Down Expand Up @@ -358,6 +372,9 @@ impl VmAirs {
)
})
.collect();
let memw_registers: Vec<_> = (0..table_counts.memw_register)
.map(|i| create_memw_register_air(proof_options).with_name(&format!("MEMW_R[{}]", i)))
.collect();

#[cfg(feature = "debug-checks")]
debug_report::print_bus_legend();
Expand All @@ -378,6 +395,7 @@ impl VmAirs {
commit,
register,
pages,
memw_registers,
}
}
}
Expand Down
Loading
Loading