diff --git a/crates/vm/src/system/memory/controller/mod.rs b/crates/vm/src/system/memory/controller/mod.rs index d47200f3b2..ee9f150fc6 100644 --- a/crates/vm/src/system/memory/controller/mod.rs +++ b/crates/vm/src/system/memory/controller/mod.rs @@ -704,10 +704,7 @@ pub struct MemoryAuxColsFactory { // NOTE[jpw]: The `make_*_aux_cols` functions should be thread-safe so they can be used in parallelized trace generation. impl MemoryAuxColsFactory { - pub fn make_read_aux_cols( - &self, - read: &MemoryRecord, - ) -> MemoryReadAuxCols { + pub fn make_read_aux_cols(&self, read: &MemoryRecord) -> MemoryReadAuxCols { assert!( !read.address_space.is_zero(), "cannot make `MemoryReadAuxCols` for address space 0" diff --git a/crates/vm/src/system/memory/offline_checker/bridge.rs b/crates/vm/src/system/memory/offline_checker/bridge.rs index 64031d13c1..96cac29179 100644 --- a/crates/vm/src/system/memory/offline_checker/bridge.rs +++ b/crates/vm/src/system/memory/offline_checker/bridge.rs @@ -49,7 +49,7 @@ impl MemoryBridge { address: MemoryAddress, impl Into>, data: [impl Into; N], timestamp: impl Into, - aux: &'a MemoryReadAuxCols, + aux: &'a MemoryReadAuxCols, ) -> MemoryReadOperation<'a, T, V, N> { MemoryReadOperation { offline_checker: self.offline_checker, @@ -110,7 +110,7 @@ pub struct MemoryReadOperation<'a, T, V, const N: usize> { address: MemoryAddress, data: [T; N], timestamp: T, - aux: &'a MemoryReadAuxCols, + aux: &'a MemoryReadAuxCols, } /// The max degree of constraints is: diff --git a/crates/vm/src/system/memory/offline_checker/columns.rs b/crates/vm/src/system/memory/offline_checker/columns.rs index e9036017f3..0255e87ded 100644 --- a/crates/vm/src/system/memory/offline_checker/columns.rs +++ b/crates/vm/src/system/memory/offline_checker/columns.rs @@ -68,11 +68,11 @@ impl MemoryWriteAuxCols { /// the address space, pointer, and data must be provided. #[repr(C)] #[derive(Clone, Copy, Debug, AlignedBorrow)] -pub struct MemoryReadAuxCols { +pub struct MemoryReadAuxCols { pub(super) base: MemoryBaseAuxCols, } -impl MemoryReadAuxCols { +impl MemoryReadAuxCols { pub fn new(prev_timestamp: u32, clk_lt_aux: LessThanAuxCols) -> Self { Self { base: MemoryBaseAuxCols { @@ -83,7 +83,7 @@ impl MemoryReadAuxCols { } } -impl MemoryReadAuxCols { +impl MemoryReadAuxCols { pub const fn disabled() -> Self { Self { base: MemoryBaseAuxCols { diff --git a/crates/vm/src/system/memory/tests.rs b/crates/vm/src/system/memory/tests.rs index 43828653cb..9a73601535 100644 --- a/crates/vm/src/system/memory/tests.rs +++ b/crates/vm/src/system/memory/tests.rs @@ -56,9 +56,9 @@ struct MemoryRequesterCols { timestamp: T, write_1_aux: MemoryWriteAuxCols, write_4_aux: MemoryWriteAuxCols, - read_1_aux: MemoryReadAuxCols, - read_4_aux: MemoryReadAuxCols, - read_max_aux: MemoryReadAuxCols, + read_1_aux: MemoryReadAuxCols, + read_4_aux: MemoryReadAuxCols, + read_max_aux: MemoryReadAuxCols, is_write_1: T, is_write_4: T, is_read_1: T, diff --git a/extensions/keccak256/circuit/src/air.rs b/extensions/keccak256/circuit/src/air.rs index d5ecaa3e6e..f8733264bc 100644 --- a/extensions/keccak256/circuit/src/air.rs +++ b/extensions/keccak256/circuit/src/air.rs @@ -407,7 +407,7 @@ impl KeccakVmAir { &self, builder: &mut AB, local: &KeccakVmCols, - register_aux: &[MemoryReadAuxCols; KECCAK_REGISTER_READS], + register_aux: &[MemoryReadAuxCols; KECCAK_REGISTER_READS], ) -> AB::Expr { let instruction = local.instruction; // Only receive opcode if: @@ -514,7 +514,7 @@ impl KeccakVmAir { builder: &mut AB, local: &KeccakVmCols, start_read_timestamp: AB::Expr, - mem_aux: &[MemoryReadAuxCols; KECCAK_ABSORB_READS], + mem_aux: &[MemoryReadAuxCols; KECCAK_ABSORB_READS], ) -> AB::Expr { let partial_block = &local.mem_oc.partial_block; // Only read input from memory when it is an opcode-related row diff --git a/extensions/keccak256/circuit/src/columns.rs b/extensions/keccak256/circuit/src/columns.rs index edb28fa8ed..8c52f9938b 100644 --- a/extensions/keccak256/circuit/src/columns.rs +++ b/extensions/keccak256/circuit/src/columns.rs @@ -96,8 +96,8 @@ pub struct KeccakSpongeCols { #[repr(C)] #[derive(Clone, Debug, AlignedBorrow)] pub struct KeccakMemoryCols { - pub register_aux: [MemoryReadAuxCols; KECCAK_REGISTER_READS], - pub absorb_reads: [MemoryReadAuxCols; KECCAK_ABSORB_READS], + pub register_aux: [MemoryReadAuxCols; KECCAK_REGISTER_READS], + pub absorb_reads: [MemoryReadAuxCols; KECCAK_ABSORB_READS], pub digest_writes: [MemoryWriteAuxCols; KECCAK_DIGEST_WRITES], /// The input bytes are batch read in blocks of private constant KECCAK_WORD_SIZE bytes. However /// if the input length is not a multiple of KECCAK_WORD_SIZE, we read into diff --git a/extensions/native/circuit/src/adapters/convert_adapter.rs b/extensions/native/circuit/src/adapters/convert_adapter.rs index bc67d20463..4757ce2570 100644 --- a/extensions/native/circuit/src/adapters/convert_adapter.rs +++ b/extensions/native/circuit/src/adapters/convert_adapter.rs @@ -73,7 +73,7 @@ pub struct ConvertAdapterCols; 1], - pub reads_aux: [MemoryReadAuxCols; 1], + pub reads_aux: [MemoryReadAuxCols; 1], } #[derive(Clone, Copy, Debug, derive_new::new)] diff --git a/extensions/native/circuit/src/adapters/loadstore_native_adapter.rs b/extensions/native/circuit/src/adapters/loadstore_native_adapter.rs index 6cdd27533a..1f6ee469f4 100644 --- a/extensions/native/circuit/src/adapters/loadstore_native_adapter.rs +++ b/extensions/native/circuit/src/adapters/loadstore_native_adapter.rs @@ -106,8 +106,8 @@ pub struct NativeLoadStoreAdapterCols { pub data_write_as: T, pub data_write_pointer: T, - pub pointer_read_aux_cols: MemoryReadAuxCols, - pub data_read_aux_cols: MemoryReadAuxCols, + pub pointer_read_aux_cols: MemoryReadAuxCols, + pub data_read_aux_cols: MemoryReadAuxCols, pub data_write_aux_cols: MemoryWriteAuxCols, } diff --git a/extensions/native/circuit/src/adapters/native_vectorized_adapter.rs b/extensions/native/circuit/src/adapters/native_vectorized_adapter.rs index c3bae1cee1..1741270e35 100644 --- a/extensions/native/circuit/src/adapters/native_vectorized_adapter.rs +++ b/extensions/native/circuit/src/adapters/native_vectorized_adapter.rs @@ -70,7 +70,7 @@ pub struct NativeVectorizedAdapterCols { pub b_pointer: T, pub c_pointer: T, pub c_as: T, - pub reads_aux: [MemoryReadAuxCols; 2], + pub reads_aux: [MemoryReadAuxCols; 2], pub writes_aux: [MemoryWriteAuxCols; 1], } diff --git a/extensions/native/circuit/src/fri/mod.rs b/extensions/native/circuit/src/fri/mod.rs index 256beb2bb7..eedb919b86 100644 --- a/extensions/native/circuit/src/fri/mod.rs +++ b/extensions/native/circuit/src/fri/mod.rs @@ -58,13 +58,13 @@ pub struct FriReducedOpeningCols { pub alpha_ptr: T, pub alpha_pow_ptr: T, - pub a_ptr_aux: MemoryReadAuxCols, - pub b_ptr_aux: MemoryReadAuxCols, - pub a_aux: MemoryReadAuxCols, - pub b_aux: MemoryReadAuxCols, + pub a_ptr_aux: MemoryReadAuxCols, + pub b_ptr_aux: MemoryReadAuxCols, + pub a_aux: MemoryReadAuxCols, + pub b_aux: MemoryReadAuxCols, pub result_aux: MemoryWriteAuxCols, - pub length_aux: MemoryReadAuxCols, - pub alpha_aux: MemoryReadAuxCols, + pub length_aux: MemoryReadAuxCols, + pub alpha_aux: MemoryReadAuxCols, pub alpha_pow_aux: MemoryBaseAuxCols, pub a_ptr: T, diff --git a/extensions/native/circuit/src/poseidon2/columns.rs b/extensions/native/circuit/src/poseidon2/columns.rs index 904fe66ed6..12b591a761 100644 --- a/extensions/native/circuit/src/poseidon2/columns.rs +++ b/extensions/native/circuit/src/poseidon2/columns.rs @@ -32,10 +32,10 @@ pub struct NativePoseidon2MemoryCols { pub rd_ptr: T, pub rs_val: [T; 2], pub rd_val: T, - pub rs_read_aux: [MemoryReadAuxCols; 2], - pub rd_read_aux: MemoryReadAuxCols, + pub rs_read_aux: [MemoryReadAuxCols; 2], + pub rd_read_aux: MemoryReadAuxCols, - pub chunk_read_aux: [MemoryReadAuxCols; 2], + pub chunk_read_aux: [MemoryReadAuxCols; 2], pub chunk_write_aux: [MemoryWriteAuxCols; 2], } diff --git a/extensions/rv32-adapters/src/eq_mod.rs b/extensions/rv32-adapters/src/eq_mod.rs index 81883ea9b1..6accd11afa 100644 --- a/extensions/rv32-adapters/src/eq_mod.rs +++ b/extensions/rv32-adapters/src/eq_mod.rs @@ -59,8 +59,8 @@ pub struct Rv32IsEqualModAdapterCols< pub rs_ptr: [T; NUM_READS], pub rs_val: [[T; RV32_REGISTER_NUM_LIMBS]; NUM_READS], - pub rs_read_aux: [MemoryReadAuxCols; NUM_READS], - pub heap_read_aux: [[MemoryReadAuxCols; BLOCKS_PER_READ]; NUM_READS], + pub rs_read_aux: [MemoryReadAuxCols; NUM_READS], + pub heap_read_aux: [[MemoryReadAuxCols; BLOCKS_PER_READ]; NUM_READS], pub rd_ptr: T, pub writes_aux: MemoryWriteAuxCols, diff --git a/extensions/rv32-adapters/src/heap_branch.rs b/extensions/rv32-adapters/src/heap_branch.rs index bd4baa9cac..6f37d6f9d4 100644 --- a/extensions/rv32-adapters/src/heap_branch.rs +++ b/extensions/rv32-adapters/src/heap_branch.rs @@ -51,9 +51,9 @@ pub struct Rv32HeapBranchAdapterCols; NUM_READS], + pub rs_read_aux: [MemoryReadAuxCols; NUM_READS], - pub heap_read_aux: [MemoryReadAuxCols; NUM_READS], + pub heap_read_aux: [MemoryReadAuxCols; NUM_READS], } #[derive(Clone, Copy, Debug, derive_new::new)] diff --git a/extensions/rv32-adapters/src/vec_heap.rs b/extensions/rv32-adapters/src/vec_heap.rs index a237cdef93..36e987b365 100644 --- a/extensions/rv32-adapters/src/vec_heap.rs +++ b/extensions/rv32-adapters/src/vec_heap.rs @@ -144,10 +144,10 @@ pub struct Rv32VecHeapAdapterCols< pub rs_val: [[T; RV32_REGISTER_NUM_LIMBS]; NUM_READS], pub rd_val: [T; RV32_REGISTER_NUM_LIMBS], - pub rs_read_aux: [MemoryReadAuxCols; NUM_READS], - pub rd_read_aux: MemoryReadAuxCols, + pub rs_read_aux: [MemoryReadAuxCols; NUM_READS], + pub rd_read_aux: MemoryReadAuxCols, - pub reads_aux: [[MemoryReadAuxCols; BLOCKS_PER_READ]; NUM_READS], + pub reads_aux: [[MemoryReadAuxCols; BLOCKS_PER_READ]; NUM_READS], pub writes_aux: [MemoryWriteAuxCols; BLOCKS_PER_WRITE], } diff --git a/extensions/rv32-adapters/src/vec_heap_two_reads.rs b/extensions/rv32-adapters/src/vec_heap_two_reads.rs index 6f896c3392..a96864f8c1 100644 --- a/extensions/rv32-adapters/src/vec_heap_two_reads.rs +++ b/extensions/rv32-adapters/src/vec_heap_two_reads.rs @@ -158,12 +158,12 @@ pub struct Rv32VecHeapTwoReadsAdapterCols< pub rs2_val: [T; RV32_REGISTER_NUM_LIMBS], pub rd_val: [T; RV32_REGISTER_NUM_LIMBS], - pub rs1_read_aux: MemoryReadAuxCols, - pub rs2_read_aux: MemoryReadAuxCols, - pub rd_read_aux: MemoryReadAuxCols, + pub rs1_read_aux: MemoryReadAuxCols, + pub rs2_read_aux: MemoryReadAuxCols, + pub rd_read_aux: MemoryReadAuxCols, - pub reads1_aux: [MemoryReadAuxCols; BLOCKS_PER_READ1], - pub reads2_aux: [MemoryReadAuxCols; BLOCKS_PER_READ2], + pub reads1_aux: [MemoryReadAuxCols; BLOCKS_PER_READ1], + pub reads2_aux: [MemoryReadAuxCols; BLOCKS_PER_READ2], pub writes_aux: [MemoryWriteAuxCols; BLOCKS_PER_WRITE], } diff --git a/extensions/rv32im/circuit/src/adapters/alu.rs b/extensions/rv32im/circuit/src/adapters/alu.rs index bef2568c5d..de8dff1ff4 100644 --- a/extensions/rv32im/circuit/src/adapters/alu.rs +++ b/extensions/rv32im/circuit/src/adapters/alu.rs @@ -89,7 +89,7 @@ pub struct Rv32BaseAluAdapterCols { pub rs2: T, /// 1 if rs2 was a read, 0 if an immediate pub rs2_as: T, - pub reads_aux: [MemoryReadAuxCols; 2], + pub reads_aux: [MemoryReadAuxCols; 2], pub writes_aux: MemoryWriteAuxCols, } @@ -311,7 +311,7 @@ impl VmAdapterChip for Rv32BaseAluAdapterChip { row_slice.rs2_as = F::ZERO; row_slice.reads_aux = [ aux_cols_factory.make_read_aux_cols(rs1), - MemoryReadAuxCols::::disabled(), + MemoryReadAuxCols::::disabled(), ]; } row_slice.writes_aux = aux_cols_factory.make_write_aux_cols(rd); diff --git a/extensions/rv32im/circuit/src/adapters/branch.rs b/extensions/rv32im/circuit/src/adapters/branch.rs index a30b302874..eeadd7e441 100644 --- a/extensions/rv32im/circuit/src/adapters/branch.rs +++ b/extensions/rv32im/circuit/src/adapters/branch.rs @@ -73,7 +73,7 @@ pub struct Rv32BranchAdapterCols { pub from_state: ExecutionState, pub rs1_ptr: T, pub rs2_ptr: T, - pub reads_aux: [MemoryReadAuxCols; 2], + pub reads_aux: [MemoryReadAuxCols; 2], } #[derive(Clone, Copy, Debug, derive_new::new)] diff --git a/extensions/rv32im/circuit/src/adapters/hintstore.rs b/extensions/rv32im/circuit/src/adapters/hintstore.rs index 562750e824..14b143f424 100644 --- a/extensions/rv32im/circuit/src/adapters/hintstore.rs +++ b/extensions/rv32im/circuit/src/adapters/hintstore.rs @@ -89,7 +89,7 @@ pub struct Rv32HintStoreAdapterCols { pub from_state: ExecutionState, pub rs1_ptr: T, pub rs1_data: [T; RV32_REGISTER_NUM_LIMBS], - pub rs1_aux_cols: MemoryReadAuxCols, + pub rs1_aux_cols: MemoryReadAuxCols, pub imm: T, pub imm_sign: T, diff --git a/extensions/rv32im/circuit/src/adapters/jalr.rs b/extensions/rv32im/circuit/src/adapters/jalr.rs index ee639dbd46..42669a6fb3 100644 --- a/extensions/rv32im/circuit/src/adapters/jalr.rs +++ b/extensions/rv32im/circuit/src/adapters/jalr.rs @@ -69,7 +69,7 @@ pub struct Rv32JalrWriteRecord { pub struct Rv32JalrAdapterCols { pub from_state: ExecutionState, pub rs1_ptr: T, - pub rs1_aux_cols: MemoryReadAuxCols, + pub rs1_aux_cols: MemoryReadAuxCols, pub rd_ptr: T, pub rd_aux_cols: MemoryWriteAuxCols, pub needs_write: T, diff --git a/extensions/rv32im/circuit/src/adapters/loadstore.rs b/extensions/rv32im/circuit/src/adapters/loadstore.rs index 69646ed73d..005742c9c8 100644 --- a/extensions/rv32im/circuit/src/adapters/loadstore.rs +++ b/extensions/rv32im/circuit/src/adapters/loadstore.rs @@ -153,11 +153,11 @@ pub struct Rv32LoadStoreAdapterCols { pub from_state: ExecutionState, pub rs1_ptr: T, pub rs1_data: [T; RV32_REGISTER_NUM_LIMBS], - pub rs1_aux_cols: MemoryReadAuxCols, + pub rs1_aux_cols: MemoryReadAuxCols, /// Will write to rd when Load and read from rs2 when Store pub rd_rs2_ptr: T, - pub read_data_aux: MemoryReadAuxCols, + pub read_data_aux: MemoryReadAuxCols, pub imm: T, pub imm_sign: T, /// mem_ptr is the intermediate memory pointer limbs, needed to check the correct addition diff --git a/extensions/rv32im/circuit/src/adapters/mul.rs b/extensions/rv32im/circuit/src/adapters/mul.rs index da03c70fe2..96cf8155f2 100644 --- a/extensions/rv32im/circuit/src/adapters/mul.rs +++ b/extensions/rv32im/circuit/src/adapters/mul.rs @@ -75,7 +75,7 @@ pub struct Rv32MultAdapterCols { pub rd_ptr: T, pub rs1_ptr: T, pub rs2_ptr: T, - pub reads_aux: [MemoryReadAuxCols; 2], + pub reads_aux: [MemoryReadAuxCols; 2], pub writes_aux: MemoryWriteAuxCols, } diff --git a/extensions/sha256/circuit/src/sha256_chip/columns.rs b/extensions/sha256/circuit/src/sha256_chip/columns.rs index c75f2b0b6e..a06295168d 100644 --- a/extensions/sha256/circuit/src/sha256_chip/columns.rs +++ b/extensions/sha256/circuit/src/sha256_chip/columns.rs @@ -8,7 +8,7 @@ use openvm_circuit_primitives::AlignedBorrow; use openvm_instructions::riscv::RV32_REGISTER_NUM_LIMBS; use openvm_sha256_air::{Sha256DigestCols, Sha256RoundCols}; -use super::{SHA256_READ_SIZE, SHA256_REGISTER_READS, SHA256_WRITE_SIZE}; +use super::{SHA256_REGISTER_READS, SHA256_WRITE_SIZE}; /// the first 16 rows of every SHA256 block will be of type Sha256VmRoundCols and the last row will be of type Sha256VmDigestCols #[repr(C)] @@ -16,7 +16,7 @@ use super::{SHA256_READ_SIZE, SHA256_REGISTER_READS, SHA256_WRITE_SIZE}; pub struct Sha256VmRoundCols { pub control: Sha256VmControlCols, pub inner: Sha256RoundCols, - pub read_aux: MemoryReadAuxCols, + pub read_aux: MemoryReadAuxCols, } #[repr(C)] @@ -33,7 +33,7 @@ pub struct Sha256VmDigestCols { pub dst_ptr: [T; RV32_REGISTER_NUM_LIMBS], pub src_ptr: [T; RV32_REGISTER_NUM_LIMBS], pub len_data: [T; RV32_REGISTER_NUM_LIMBS], - pub register_reads_aux: [MemoryReadAuxCols; SHA256_REGISTER_READS], + pub register_reads_aux: [MemoryReadAuxCols; SHA256_REGISTER_READS], pub writes_aux: MemoryWriteAuxCols, }