Skip to content

Commit

Permalink
fix: byte lookup channels
Browse files Browse the repository at this point in the history
  • Loading branch information
jtguibas committed Jun 3, 2024
1 parent 6449445 commit 4af108d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/bytes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::bytes::trace::NUM_ROWS;
pub const NUM_BYTE_OPS: usize = 9;

/// The number of different byte lookup channels.
pub const NUM_BYTE_LOOKUP_CHANNELS: u32 = 4;
pub const NUM_BYTE_LOOKUP_CHANNELS: u32 = 16;

/// A chip for computing byte operations.
///
Expand Down
17 changes: 17 additions & 0 deletions core/src/stark/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ where
air.eval(&mut builder);
let (sends, receives) = builder.interactions();

let nb_byte_sends = sends
.iter()
.filter(|s| s.kind == InteractionKind::Byte)
.count();
let nb_byte_receives = receives
.iter()
.filter(|r| r.kind == InteractionKind::Byte)
.count();
tracing::debug!(
"chip {} has {} byte interactions",
air.name(),
nb_byte_sends + nb_byte_receives
);
if nb_byte_sends + nb_byte_receives > 1 << 11 {
panic!("too many byte interactions : {}", air.name());
}

let mut max_constraint_degree =
get_max_constraint_degree(&air, air.preprocessed_width(), PROOF_MAX_NUM_PVS);

Expand Down

0 comments on commit 4af108d

Please sign in to comment.