Skip to content

Commit 3d28f9a

Browse files
committed
more restrictive MAX_LOG_N_ROWS_PER_TABLE
1 parent c9bfd1e commit 3d28f9a

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

crates/lean_vm/src/core/constants.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ pub const MAX_RUNNER_MEMORY_SIZE: usize = 1 << 24;
1515
/// Minimum and maximum number of rows per table (as powers of two), both inclusive
1616
pub const MIN_LOG_N_ROWS_PER_TABLE: usize = 8; // Zero padding will be added to each at least, if this minimum is not reached, (ensuring AIR / GKR work fine, with SIMD, without too much edge cases). Long term, we should find a more elegant solution.
1717
pub const MAX_LOG_N_ROWS_PER_TABLE: [(Table, usize); 3] = [
18-
(Table::execution(), 29),
19-
(Table::dot_product(), 24),
20-
(Table::poseidon16(), 23),
18+
(Table::execution(), 25),
19+
(Table::dot_product(), 22),
20+
(Table::poseidon16(), 21),
2121
];
2222

2323
/// Starting program counter
@@ -61,7 +61,7 @@ pub const ONE_VEC_PTR: usize = EXTENSION_BASIS_PTR;
6161
#[cfg(test)]
6262
mod tests {
6363
use multilinear_toolkit::prelude::PrimeField64;
64-
use p3_util::log2_ceil_usize;
64+
use p3_util::log2_ceil_u64;
6565

6666
use crate::{DIMENSION, F, MAX_LOG_N_ROWS_PER_TABLE, Table, TableT};
6767

@@ -88,7 +88,16 @@ mod tests {
8888
.find(|(table, _)| *table == Table::execution())
8989
.unwrap()
9090
.1
91-
< log2_ceil_usize(F::ORDER_U64 as usize)
91+
< log2_ceil_u64(F::ORDER_U64) as usize
9292
);
9393
}
94+
95+
#[test]
96+
fn ensure_not_too_big_commitment_surface() {
97+
let mut max_surface: u64 = 0;
98+
for (table, max_log_n_rows) in MAX_LOG_N_ROWS_PER_TABLE {
99+
max_surface += (table.n_committed_columns() as u64) << (max_log_n_rows as u64);
100+
}
101+
assert!(max_surface < F::ORDER_U64.next_power_of_two() / 2);
102+
}
94103
}

crates/rec_aggregation/recursion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def recursion(inner_public_memory_log_size, inner_public_memory, proof_transcrip
179179
pcs_values.push(DynArray([]))
180180
pcs_values[i].push(DynArray([]))
181181
total_num_cols = NUM_COLS_F_AIR[i] + DIM * NUM_COLS_EF_AIR[i]
182-
for col in unroll(0, total_num_cols):
182+
for _ in unroll(0, total_num_cols):
183183
pcs_values[i][0].push(DynArray([]))
184184

185185
for table_index in unroll(0, N_TABLES):

0 commit comments

Comments
 (0)