Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: byte multiplicity channel #800

Merged
merged 13 commits into from
May 23, 2024
Merged

feat: byte multiplicity channel #800

merged 13 commits into from
May 23, 2024

Conversation

tamirhemo
Copy link
Contributor

No description provided.

@kevjue kevjue changed the base branch from main to dev May 23, 2024 17:43
@@ -116,6 +119,8 @@ impl<F: PrimeField32> MachineAir<F> for LtChip {
let c = event.c.to_le_bytes();

cols.shard = F::from_canonical_u32(event.shard);
cols.channel = F::from_canonical_u32(event.channel);
cols.channel = F::from_canonical_u32(event.channel);
Copy link
Contributor

@kevjue kevjue May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dup

Comment on lines 241 to 242
cols.channel = F::from_canonical_u32(event.channel);
cols.channel = F::from_canonical_u32(event.channel);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cols.channel = F::from_canonical_u32(event.channel);
cols.channel = F::from_canonical_u32(event.channel);
cols.channel = F::from_canonical_u32(event.channel);

Copy link
Contributor

@kevjue kevjue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally LGTM. Added a few nit columns.

// Accumulate the reconstructed channel.
reconstruct_channel += selector.into() * AB::Expr::from_canonical_u32(i as u32);
}
// Asser that the reconstructed channel is the same as the channel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typo

Comment on lines 867 to 868
self.state.channel += 1;
self.state.channel %= NUM_BYTE_LOOKUP_CHANNELS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe collapse the two lines into one.

Suggested change
self.state.channel += 1;
self.state.channel %= NUM_BYTE_LOOKUP_CHANNELS;
self.state.channel = (self.state.channel + 1) % NUM_BYTE_LOOKUP_CHANNELS;

@@ -25,6 +25,9 @@ pub struct ExecutionState {
/// executed in this shard.
pub clk: u32,

/// The channel alternates between 0 and 1, used to controll byte lookup multiplicity.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Consider updating the column for NUM_BYTE_LOOKUP_CHANNELS.

@@ -23,6 +23,9 @@ use crate::bytes::trace::NUM_ROWS;
/// The number of different byte operations.
pub const NUM_BYTE_OPS: usize = 9;

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should this be changed to 4 to minimize the increase in columns on the CPU table (via the channel selector columns)?

@tamirhemo tamirhemo added this pull request to the merge queue May 23, 2024
Merged via the queue into dev with commit 0afe817 May 23, 2024
5 checks passed
@tamirhemo tamirhemo deleted the tamir/byte-mult-row-channel branch May 23, 2024 21:20
erabinov pushed a commit that referenced this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants