diff --git a/executor/src/witgen/data_structures/finalizable_data.rs b/executor/src/witgen/data_structures/finalizable_data.rs index affbb779f..b119a5db1 100644 --- a/executor/src/witgen/data_structures/finalizable_data.rs +++ b/executor/src/witgen/data_structures/finalizable_data.rs @@ -95,17 +95,17 @@ impl CompactData { pub fn set(&mut self, row: usize, new_row: Row) { 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); } } } diff --git a/executor/src/witgen/jit/block_machine_processor.rs b/executor/src/witgen/jit/block_machine_processor.rs index 3dd52c0b2..059ea0fe8 100644 --- a/executor/src/witgen/jit/block_machine_processor.rs +++ b/executor/src/witgen/jit/block_machine_processor.rs @@ -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));