Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgoergens committed Dec 9, 2024
1 parent d9cc59b commit 52418da
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ceno_zkvm/src/tables/ram/ram_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,10 @@ pub trait DynVolatileRamTable {
fn name() -> &'static str;

fn max_len(params: &ProgramParams) -> usize {
let max_size =
(Self::end_addr(params) - Self::offset_addr(params)).div_ceil(WORD_SIZE as u32) as Addr;
let max_len = 1 << (u32::BITS - 1 - max_size.leading_zeros()); // prev_power_of_2
let max_size = (Self::end_addr(params) - Self::offset_addr(params)) as usize;
let max_len: usize = max_size.next_power_of_two().div_ceil(WORD_SIZE);
assert!(
max_size as usize <= max_len,
max_size <= max_len,
"Did not round up {max_size} correctly, got {max_len}, which is smaller."
);
max_len
Expand Down

0 comments on commit 52418da

Please sign in to comment.