Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgwiese committed Dec 23, 2024
1 parent dd11658 commit 33a6bcb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 4 additions & 4 deletions executor/src/witgen/data_structures/finalizable_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ impl<T: FieldElement> CompactData<T> {

pub fn set(&mut self, row: usize, new_row: Row<T>) {
let idx = row * self.column_count;
for (i, col_id) in (self.first_column_id..(self.first_column_id + self.column_count as u64))
.enumerate()
for (i, col_id) in
(self.first_column_id..(self.first_column_id + self.column_count as u64)).enumerate()
{
if let Some(v) = new_row.value(&PolyID {
id: col_id,
ptype: PolynomialType::Committed,
}) {
self.data[idx + i] = v;
self.known_cells.set(row, col_id, true);
self.known_cells.set(row, i as u64, true);
} else {
self.known_cells.set(row, col_id, false);
self.known_cells.set(row, i as u64, false);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions executor/src/witgen/jit/block_machine_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ impl<'a, T: FieldElement> BlockMachineProcessor<'a, T> {
// In the latch row, set the RHS selector to 1.
witgen.assign_constant(&connection_rhs.selector, self.latch_row as i32, T::one());

// Set all other selectors to 0 in the latch row.
for other_connection in self.machine_parts.connections.values() {
if other_connection.right.selector != connection_rhs.selector {
witgen.assign_constant(
&other_connection.right.selector,
self.latch_row as i32,
T::zero(),
);
}
}

// For each argument, connect the expression on the RHS with the formal parameter.
for (index, expr) in connection_rhs.expressions.iter().enumerate() {
witgen.assign_variable(expr, self.latch_row as i32, Variable::Param(index));
Expand Down

0 comments on commit 33a6bcb

Please sign in to comment.