From 8afd06cfdd4db635c9523a93a0ac3be8a46875fe Mon Sep 17 00:00:00 2001 From: Robin Salen Date: Fri, 29 Sep 2023 11:24:36 -0400 Subject: [PATCH] Fix description of Range-Check columns in STARK modules --- evm/src/arithmetic/columns.rs | 7 ++----- evm/src/byte_packing/columns.rs | 7 ++----- evm/src/memory/columns.rs | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/evm/src/arithmetic/columns.rs b/evm/src/arithmetic/columns.rs index f2646fc5..36eb983e 100644 --- a/evm/src/arithmetic/columns.rs +++ b/evm/src/arithmetic/columns.rs @@ -104,12 +104,9 @@ pub(crate) const MODULAR_AUX_INPUT_HI: Range = AUX_REGISTER_2; // Must be set to MOD_IS_ZERO for DIV operation i.e. MOD_IS_ZERO * lv[IS_DIV] pub(crate) const MODULAR_DIV_DENOM_IS_ZERO: usize = AUX_REGISTER_2.end; -// Need one column for the table, then two columns for every value -// that needs to be range checked in the trace, namely the permutation -// of the column and the permutation of the range. The two -// permutations associated to column i will be in columns RC_COLS[2i] -// and RC_COLS[2i+1]. +/// The counter column (used for the range check) starts from 0 and increments. pub(crate) const RANGE_COUNTER: usize = START_SHARED_COLS + NUM_SHARED_COLS; +/// The frequencies column used in logUp. pub(crate) const RC_FREQUENCIES: usize = RANGE_COUNTER + 1; pub const NUM_ARITH_COLUMNS: usize = START_SHARED_COLS + NUM_SHARED_COLS + 2; diff --git a/evm/src/byte_packing/columns.rs b/evm/src/byte_packing/columns.rs index fdaa4621..4eff0df8 100644 --- a/evm/src/byte_packing/columns.rs +++ b/evm/src/byte_packing/columns.rs @@ -33,12 +33,9 @@ pub(crate) const fn value_bytes(i: usize) -> usize { BYTES_VALUES_START + i } -// We need one column for the table, then two columns for every value -// that needs to be range checked in the trace (all written bytes), -// namely the permutation of the column and the permutation of the range. -// The two permutations associated to the byte in column i will be in -// columns RC_COLS[2i] and RC_COLS[2i+1]. +/// The counter column (used for the range check) starts from 0 and increments. pub(crate) const RANGE_COUNTER: usize = BYTES_VALUES_START + NUM_BYTES; +/// The frequencies column used in logUp. pub(crate) const RC_FREQUENCIES: usize = RANGE_COUNTER + 1; pub(crate) const NUM_COLUMNS: usize = RANGE_COUNTER + 2; diff --git a/evm/src/memory/columns.rs b/evm/src/memory/columns.rs index 56b121e1..9a413232 100644 --- a/evm/src/memory/columns.rs +++ b/evm/src/memory/columns.rs @@ -29,9 +29,9 @@ pub(crate) const VIRTUAL_FIRST_CHANGE: usize = SEGMENT_FIRST_CHANGE + 1; // We use a range check to enforce the ordering. pub(crate) const RANGE_CHECK: usize = VIRTUAL_FIRST_CHANGE + 1; -// The counter column (used for the range check) starts from 0 and increments. +/// The counter column (used for the range check) starts from 0 and increments. pub(crate) const COUNTER: usize = RANGE_CHECK + 1; -// The frequencies column used in logUp. +/// The frequencies column used in logUp. pub(crate) const FREQUENCIES: usize = COUNTER + 1; pub(crate) const NUM_COLUMNS: usize = FREQUENCIES + 1;