Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8c4a0c7
don't run executor benches all the time
MauroToscano Mar 10, 2026
988d7c4
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 12, 2026
9042f27
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 13, 2026
b105e47
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 17, 2026
33eb6ca
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 19, 2026
c7eedec
Add MEMW_A aligned-memory fast path table
nicole-graus Mar 17, 2026
469f7b9
fix deviation from spec: is_half and is_byte assumptions
nicole-graus Mar 18, 2026
bc185a7
add comment
nicole-graus Mar 18, 2026
c7c7733
Add a prove_elf test
nicole-graus Mar 18, 2026
2d956a1
add prove_elf test using both MEMW and MEMW_A chips
nicole-graus Mar 18, 2026
98f6f15
fix comment: bus numbering
nicole-graus Mar 19, 2026
c6cac65
Use Multiplicity::Sum3 for w2 in MEMW_A to avoid heap allocation on h…
nicole-graus Mar 25, 2026
e209c96
change max_rows per chunk to 2^19 insted of 2^20
nicole-graus Mar 25, 2026
49bf320
Merge branch 'main' into feat/memw-aligned
nicole-graus Mar 27, 2026
ed766e0
Merge branch 'main' into feat/memw-aligned
MauroToscano Mar 28, 2026
b2b7ca2
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 28, 2026
3a58719
Merge branch 'main' into feat/memw-aligned
MauroToscano Mar 28, 2026
04089d8
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 28, 2026
34c2394
Merge branch 'main' into feat/memw-aligned
MauroToscano Mar 28, 2026
04dbe09
Merge branch 'feat/memw-aligned' of github.com:yetanotherco/lambda_vm…
MauroToscano Mar 31, 2026
af9a85f
Merge branch 'main' of github.com:yetanotherco/lambda_vm
MauroToscano Mar 31, 2026
8971b62
Merge branch 'main' into feat/memw-aligned
MauroToscano Mar 31, 2026
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
24 changes: 24 additions & 0 deletions executor/programs/asm/test_memw_split_ts.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.attribute 5, "rv64i2p1"
.globl main
main:
# Exercise both MEMW (split old_timestamp) and MEMW_A (aligned fast path).
#
# MEMW path: sb+sb then lh — the two bytes at sp+0 and sp+1 are written
# by separate instructions (different timestamps), so the lh read has
# mismatched old_timestamps and routes to MEMW.
#
# MEMW_A path: sw then lw — all 4 bytes are written by one instruction
# (same timestamp), so the lw read routes to MEMW_A.
addi sp, sp, -16 # allocate stack
addi t0, zero, 0x41 # t0 = 'A'
addi t1, zero, 0x42 # t1 = 'B'
sb t0, 0(sp) # write byte 0 at sp+0 (timestamp T3)
sb t1, 1(sp) # write byte 1 at sp+1 (timestamp T4 ≠ T3)
lh a0, 0(sp) # read 2 bytes: old_ts[0]=T3, old_ts[1]=T4 → MEMW
addi t2, zero, 0x7FF # t2 = word value
sw t2, 4(sp) # write 4 bytes at sp+4, all timestamp T7 → MEMW_A
lw a1, 4(sp) # read 4 bytes: all old_ts=T7 → MEMW_A
addi sp, sp, 16 # deallocate stack
li a0, 0
li a7, 93
ecall
30 changes: 28 additions & 2 deletions prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +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_mul_air, create_page_air, create_register_air, create_shift_air,
create_memw_air, create_memw_aligned_air, create_mul_air, create_page_air, create_register_air,
create_shift_air,
};

use stark::proof::options::{GoldilocksCubicProofOptions, ProofOptions};
Expand All @@ -66,6 +67,7 @@ pub struct TableCounts {
pub cpu: usize,
pub lt: usize,
pub memw: usize,
pub memw_aligned: usize,
pub load: usize,
pub mul: usize,
pub dvrm: usize,
Expand All @@ -80,7 +82,15 @@ impl TableCounts {
/// allowing a malicious prover to bypass soundness checks.
/// Sum of all chunk counts across split tables.
pub fn total(&self) -> usize {
self.cpu + self.lt + self.memw + self.load + self.mul + self.dvrm + self.shift + self.branch
self.cpu
+ self.lt
+ self.memw
+ self.memw_aligned
+ self.load
+ self.mul
+ self.dvrm
+ self.shift
+ self.branch
}

/// Validate that all required tables have at least one chunk.
Expand All @@ -92,6 +102,7 @@ impl TableCounts {
("cpu", self.cpu),
("lt", self.lt),
("memw", self.memw),
("memw_aligned", self.memw_aligned),
("load", self.load),
("mul", self.mul),
("dvrm", self.dvrm),
Expand Down Expand Up @@ -174,6 +185,7 @@ pub(crate) struct VmAirs {
pub lts: Vec<VmAir>,
pub shifts: Vec<VmAir>,
pub memws: Vec<VmAir>,
pub memw_aligneds: Vec<VmAir>,
pub loads: Vec<VmAir>,
pub decode: VmAir,
pub muls: Vec<VmAir>,
Expand Down Expand Up @@ -208,6 +220,13 @@ impl VmAirs {
for (air, trace) in self.memws.iter().zip(traces.memws.iter_mut()) {
pairs.push((air, trace, &()));
}
for (air, trace) in self
.memw_aligneds
.iter()
.zip(traces.memw_aligneds.iter_mut())
{
pairs.push((air, trace, &()));
}
for (air, trace) in self.loads.iter().zip(traces.loads.iter_mut()) {
pairs.push((air, trace, &()));
}
Expand Down Expand Up @@ -249,6 +268,9 @@ impl VmAirs {
for air in &self.memws {
refs.push(air);
}
for air in &self.memw_aligneds {
refs.push(air);
}
for air in &self.loads {
refs.push(air);
}
Expand Down Expand Up @@ -301,6 +323,9 @@ impl VmAirs {
let memws: Vec<_> = (0..table_counts.memw)
.map(|i| create_memw_air(proof_options).with_name(&format!("MEMW[{}]", i)))
.collect();
let memw_aligneds: Vec<_> = (0..table_counts.memw_aligned)
.map(|i| create_memw_aligned_air(proof_options).with_name(&format!("MEMW_A[{}]", i)))
.collect();
let loads: Vec<_> = (0..table_counts.load)
.map(|i| create_load_air(proof_options).with_name(&format!("LOAD[{}]", i)))
.collect();
Expand Down Expand Up @@ -343,6 +368,7 @@ impl VmAirs {
lts,
shifts,
memws,
memw_aligneds,
loads,
decode,
muls,
Expand Down
Loading
Loading