Skip to content

Commit

Permalink
Add Range128 preprocessed column (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoichi-nexus authored and sjudson committed Feb 5, 2025
1 parent 24d2122 commit d5e8077
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prover/src/machine2/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ pub enum PreprocessedColumn {
/// Timestamp for the third register access
#[size = 4]
Reg3TsCur,
/// Contains numbers from 0 to 127, and 0 afterwards.
#[size = 1]
Range128,
/// Contains numbers from 0 to 255, and 0 afterwards.
#[size = 1]
Range256,
Expand Down
6 changes: 6 additions & 0 deletions prover/src/machine2/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ impl Traces {
ret.fill_is_first32();
ret.fill_timestamps();
ret.fill_range256();
ret.fill_range128();
ret.fill_range32();
ret.fill_bitwise();
ret
Expand Down Expand Up @@ -361,6 +362,11 @@ impl Traces {
self.cols[PreprocessedColumn::Range32.offset()][row_idx] = BaseField::from(row_idx);
}
}
fn fill_range128(&mut self) {
for row_idx in 0..128 {
self.cols[PreprocessedColumn::Range128.offset()][row_idx] = BaseField::from(row_idx);
}
}
fn fill_timestamps(&mut self) {
// Make sure the last reg3_ts_cur computation doesn't overflow
debug_assert!(1 << self.log_size < (u32::MAX - 3) / 3);
Expand Down

0 comments on commit d5e8077

Please sign in to comment.