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

No cell names. #2571

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions executor/src/witgen/jit/block_machine_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl<'a, T: FieldElement> BlockMachineProcessor<'a, T> {
queue_items.push(QueueItem::variable_assignment(
value,
Variable::IntermediateCell(Cell {
column_name: name.clone(),
column_name: "cell",
id: poly_id.id,
row_offset,
}),
Expand Down Expand Up @@ -219,12 +219,12 @@ impl<'a, T: FieldElement> BlockMachineProcessor<'a, T> {
for (column_id, row_offsets) in written_rows_per_column(&code) {
for (outside, inside) in self.conflicting_row_offsets(&row_offsets) {
let first_var = Variable::WitnessCell(Cell {
column_name: String::new(),
column_name: "cell",
id: column_id,
row_offset: outside,
});
let second_var = Variable::WitnessCell(Cell {
column_name: String::new(),
column_name: "cell",
id: column_id,
row_offset: inside,
});
Expand Down
4 changes: 2 additions & 2 deletions executor/src/witgen/jit/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ mod tests {

fn cell(column_name: &str, id: u64, row_offset: i32) -> Variable {
Variable::WitnessCell(Cell {
column_name: column_name.to_string(),
column_name: "cell",
row_offset,
id,
})
Expand Down Expand Up @@ -1011,7 +1011,7 @@ extern \"C\" fn witgen(
fn fixed_column_access() {
let a = cell("a", 0, 0);
let x = Variable::FixedCell(Cell {
column_name: "X".to_string(),
column_name: "cell",
id: 15,
row_offset: 6,
});
Expand Down
2 changes: 1 addition & 1 deletion executor/src/witgen/jit/effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ mod test {

fn var(id: u64) -> Variable {
Variable::WitnessCell(Cell {
column_name: format!("v{id}"),
column_name: "cell",
id,
row_offset: 0,
})
Expand Down
4 changes: 2 additions & 2 deletions executor/src/witgen/jit/single_step_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl<'a, T: FieldElement> SingleStepProcessor<'a, T> {
queue_items.push(QueueItem::variable_assignment(
value,
Variable::IntermediateCell(Cell {
column_name: name.clone(),
column_name: "cell",
id: poly_id.id,
row_offset,
}),
Expand All @@ -115,7 +115,7 @@ impl<'a, T: FieldElement> SingleStepProcessor<'a, T> {

fn cell(&self, id: PolyID, row_offset: i32) -> Variable {
Variable::WitnessCell(Cell {
column_name: self.fixed_data.column_name(&id).to_string(),
column_name: "cell",
id: id.id,
row_offset,
})
Expand Down
6 changes: 4 additions & 2 deletions executor/src/witgen/jit/variable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::{
fmt::{self, Display, Formatter},
hash::{Hash, Hasher},
rc::Rc,
sync::Arc,
};

use powdr_ast::analyzed::{AlgebraicReference, PolyID, PolynomialType};
Expand Down Expand Up @@ -43,7 +45,7 @@ impl Variable {
/// Create a variable from an algebraic reference.
pub fn from_reference(r: &AlgebraicReference, row_offset: i32) -> Self {
let cell = Cell {
column_name: r.name.clone(),
column_name: "cell",
id: r.poly_id.id,
row_offset: r.next as i32 + row_offset,
};
Expand Down Expand Up @@ -88,7 +90,7 @@ pub struct MachineCallVariable {
#[derive(Debug, Clone, Eq)]
pub struct Cell {
/// Name of the column, used only for display purposes.
pub column_name: String,
pub column_name: &'static str,
pub id: u64,
pub row_offset: i32,
}
Expand Down
4 changes: 3 additions & 1 deletion executor/src/witgen/jit/witgen_inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ impl<T: FieldElement, Q: QueryCallback<T>> CanProcessCall<T> for &MutableState<'

#[cfg(test)]
mod test {
use std::sync::Arc;

use powdr_ast::analyzed::{PolyID, PolynomialIdentity, PolynomialType};
use powdr_number::GoldilocksField;
use pretty_assertions::assert_eq;
Expand Down Expand Up @@ -693,7 +695,7 @@ mod test {
let known_cells = known_cells.iter().map(|(name, row_offset)| {
let id = fixed_data.try_column_by_name(name).unwrap().id;
Variable::WitnessCell(Cell {
column_name: name.to_string(),
column_name: "cell",
id,
row_offset: *row_offset,
})
Expand Down
Loading