Skip to content

Commit

Permalink
chore: nit
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed Nov 21, 2024
1 parent d1a6a3b commit 51c8a58
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/brainfuck_prover/src/components/processor/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ pub struct ProcessorTableRow {
}

impl ProcessorTableRow {
/// Creates a row for the [`MemoryTable`] which is considered 'dummy'.
/// Creates a row for the [`ProcessorTable`] which is considered 'dummy'.
///
/// A 'dummy' row, is a row that is not part of the execution trace from the Brainfuck program
/// execution.
/// They are used for padding and filling the `clk` gaps after sorting by `mp`, to enforce the
/// They are used for padding and filling the gaps after sorting by `clk`, to enforce the
/// correct sorting.
pub fn new_dummy(clk: BaseField, ip: BaseField) -> Self {
Self { clk, ip, ..Default::default() }
Expand Down Expand Up @@ -103,15 +103,14 @@ impl ProcessorTable {

/// Pads the Processor table with dummy rows up to the next power of two length.
///
/// Each dummy row increase clk, preserve ip, set others to zero.
/// Each dummy row increase clk, copy the others from the last step
///
/// Does nothing if the table is empty.
fn pad(&mut self) {
if let Some(last_row) = self.table.last().cloned() {
let trace_len = self.table.len();
let padding_offset = (trace_len.next_power_of_two() - trace_len) as u32;
for i in 1..=padding_offset {
// TODO: i think ip should change in padding but trace returning like this
self.add_row(ProcessorTableRow::new_dummy(
last_row.clk + BaseField::from(i),
last_row.ip,
Expand Down

0 comments on commit 51c8a58

Please sign in to comment.