Skip to content

Commit 5ac81ec

Browse files
authored
feat: Remove support for 64-cell accesses (#1466)
1 parent 20a8436 commit 5ac81ec

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

crates/vm/src/arch/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub struct MemoryConfig {
5656

5757
impl Default for MemoryConfig {
5858
fn default() -> Self {
59-
Self::new(3, 1, 29, 29, 17, 64, 1 << 24)
59+
Self::new(3, 1, 29, 29, 17, 32, 1 << 24)
6060
}
6161
}
6262

crates/vm/src/system/memory/adapter/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ impl<F> AccessAdapterInventory<F> {
4343
let mb = memory_bus;
4444
let cmb = clk_max_bits;
4545
let maan = max_access_adapter_n;
46+
assert!(matches!(maan, 2 | 4 | 8 | 16 | 32));
4647
let chips: Vec<_> = [
4748
Self::create_access_adapter_chip::<2>(rc.clone(), mb, cmb, maan),
4849
Self::create_access_adapter_chip::<4>(rc.clone(), mb, cmb, maan),
4950
Self::create_access_adapter_chip::<8>(rc.clone(), mb, cmb, maan),
5051
Self::create_access_adapter_chip::<16>(rc.clone(), mb, cmb, maan),
5152
Self::create_access_adapter_chip::<32>(rc.clone(), mb, cmb, maan),
52-
Self::create_access_adapter_chip::<64>(rc.clone(), mb, cmb, maan),
5353
]
5454
.into_iter()
5555
.flatten()
@@ -184,7 +184,6 @@ enum GenericAccessAdapterChip<F> {
184184
N8(AccessAdapterChip<F, 8>),
185185
N16(AccessAdapterChip<F, 16>),
186186
N32(AccessAdapterChip<F, 32>),
187-
N64(AccessAdapterChip<F, 64>),
188187
}
189188

190189
impl<F> GenericAccessAdapterChip<F> {
@@ -202,8 +201,7 @@ impl<F> GenericAccessAdapterChip<F> {
202201
8 => GenericAccessAdapterChip::N8(AccessAdapterChip::new(rc, mb, cmb)),
203202
16 => GenericAccessAdapterChip::N16(AccessAdapterChip::new(rc, mb, cmb)),
204203
32 => GenericAccessAdapterChip::N32(AccessAdapterChip::new(rc, mb, cmb)),
205-
64 => GenericAccessAdapterChip::N64(AccessAdapterChip::new(rc, mb, cmb)),
206-
_ => panic!("Only supports N in (2, 4, 8, 16, 32, 64)"),
204+
_ => panic!("Only supports N in (2, 4, 8, 16, 32)"),
207205
}
208206
}
209207

@@ -215,7 +213,6 @@ impl<F> GenericAccessAdapterChip<F> {
215213
GenericAccessAdapterChip::N8(chip) => &chip.records,
216214
GenericAccessAdapterChip::N16(chip) => &chip.records,
217215
GenericAccessAdapterChip::N32(chip) => &chip.records,
218-
GenericAccessAdapterChip::N64(chip) => &chip.records,
219216
}
220217
}
221218
}

crates/vm/src/system/memory/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use crate::{
4343
},
4444
};
4545

46-
const MAX: usize = 64;
46+
const MAX: usize = 32;
4747
const RANGE_CHECKER_BUS: BusIndex = 3;
4848

4949
#[repr(C)]

crates/vm/tests/integration_test.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn test_vm_initial_memory() {
321321
fn test_vm_1_persistent() {
322322
let engine = BabyBearPoseidon2Engine::new(FriParameters::standard_fast());
323323
let config = NativeConfig {
324-
system: SystemConfig::new(3, MemoryConfig::new(2, 1, 16, 29, 15, 64, 1024), 0),
324+
system: SystemConfig::new(3, MemoryConfig::new(2, 1, 16, 29, 15, 32, 1024), 0),
325325
native: Default::default(),
326326
}
327327
.with_continuations();
@@ -587,15 +587,15 @@ fn test_vm_max_access_adapter_8() {
587587
config.system.memory_config.max_access_adapter_n = 8;
588588
let chip_complex2 = config.create_chip_complex().unwrap();
589589
let mem_ctrl2 = chip_complex2.base.memory_controller;
590-
// AccessAdapterAir with N=16/32/64 are disabled.
591-
assert_eq!(mem_ctrl1.air_names().len(), mem_ctrl2.air_names().len() + 3);
590+
// AccessAdapterAir with N=16/32 are disabled.
591+
assert_eq!(mem_ctrl1.air_names().len(), mem_ctrl2.air_names().len() + 2);
592592
assert_eq!(
593593
mem_ctrl1.airs::<BabyBearPoseidon2Config>().len(),
594-
mem_ctrl2.airs::<BabyBearPoseidon2Config>().len() + 3
594+
mem_ctrl2.airs::<BabyBearPoseidon2Config>().len() + 2
595595
);
596596
assert_eq!(
597597
mem_ctrl1.current_trace_heights().len(),
598-
mem_ctrl2.current_trace_heights().len() + 3
598+
mem_ctrl2.current_trace_heights().len() + 2
599599
);
600600
}
601601
air_test(config, program);
@@ -622,7 +622,7 @@ fn test_vm_field_extension_arithmetic_persistent() {
622622

623623
let program = Program::from_instructions(&instructions);
624624
let config = NativeConfig {
625-
system: SystemConfig::new(3, MemoryConfig::new(2, 1, 16, 29, 15, 64, 1024), 0)
625+
system: SystemConfig::new(3, MemoryConfig::new(2, 1, 16, 29, 15, 32, 1024), 0)
626626
.with_continuations(),
627627
native: Default::default(),
628628
};

docs/specs/ISA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ to. Address space `0` is considered a read-only array with `[a]_0 = a` for any `
133133
#### Memory Accesses and Block Accesses
134134

135135
VM instructions can access (read or write) a contiguous list of cells (called a **block**) in a single address space.
136-
The block size must be in the set `{1, 2, 4, 8, 16, 32, 64}`, and the access does not need to be aligned, meaning that
136+
The block size must be in the set `{1, 2, 4, 8, 16, 32}`, and the access does not need to be aligned, meaning that
137137
it can start from any pointer address, even those not divisible by the block size. An access is called a **block access
138138
** if it has size greater than 1. Block accesses are not supported for address space `0`.
139139

0 commit comments

Comments
 (0)