diff --git a/crates/prover/src/constraint_framework/component.rs b/crates/prover/src/constraint_framework/component.rs index dee71d761c..5962ea74d0 100644 --- a/crates/prover/src/constraint_framework/component.rs +++ b/crates/prover/src/constraint_framework/component.rs @@ -1,9 +1,7 @@ use std::borrow::Cow; -use std::collections::HashMap; use std::fmt::{self, Display, Formatter}; use std::iter::zip; use std::ops::Deref; -use std::rc::Rc; use itertools::Itertools; #[cfg(feature = "parallel")] @@ -12,7 +10,6 @@ use tracing::{span, Level}; use super::cpu_domain::CpuDomainEvaluator; use super::logup::LogupSums; -use super::preprocessed_columns::PreprocessedColumn; use super::{ EvalAtRow, InfoEvaluator, PointEvaluator, SimdDomainEvaluator, PREPROCESSED_TRACE_IDX, }; @@ -50,7 +47,7 @@ pub struct TraceLocationAllocator { /// Mapping of tree index to next available column offset. next_tree_offsets: TreeVec, /// Mapping of preprocessed columns to their index. - preprocessed_columns: HashMap, usize>, + preprocessed_columns: Vec, /// Controls whether the preprocessed columns are dynamic or static (default=Dynamic). preprocessed_columns_allocation_mode: PreprocessedColumnsAllocationMode, } @@ -82,38 +79,23 @@ impl TraceLocationAllocator { } /// Create a new `TraceLocationAllocator` with fixed preprocessed columns setup. - pub fn new_with_preproccessed_columns( - preprocessed_columns: &[Rc], - ) -> Self { + pub fn new_with_preproccessed_columns(preprocessed_columns: &[String]) -> Self { Self { next_tree_offsets: Default::default(), - preprocessed_columns: preprocessed_columns - .iter() - .enumerate() - .map(|(i, col)| (col.clone(), i)) - .collect(), + preprocessed_columns: preprocessed_columns.to_vec(), preprocessed_columns_allocation_mode: PreprocessedColumnsAllocationMode::Static, } } - pub const fn preprocessed_columns(&self) -> &HashMap, usize> { + pub const fn preprocessed_columns(&self) -> &Vec { &self.preprocessed_columns } // validates that `self.preprocessed_columns` is consistent with // `preprocessed_columns`. // I.e. preprocessed_columns[i] == self.preprocessed_columns[i]. - pub fn validate_preprocessed_columns( - &self, - preprocessed_columns: &[Rc], - ) { - assert_eq!(preprocessed_columns.len(), self.preprocessed_columns.len()); - for (column, idx) in self.preprocessed_columns.iter() { - let preprocessed_column = preprocessed_columns - .get(*idx) - .expect("Preprocessed column is missing from preprocessed_columns"); - assert_eq!(column.id(), preprocessed_column.id()); - } + pub fn validate_preprocessed_columns(&self, preprocessed_columns: &[String]) { + assert_eq!(self.preprocessed_columns, preprocessed_columns); } } @@ -152,22 +134,25 @@ impl FrameworkComponent { .iter() .map(|col| { let next_column = location_allocator.preprocessed_columns.len(); - *location_allocator + if let Some(pos) = location_allocator .preprocessed_columns - .entry(col.clone()) - .or_insert_with(|| { - if matches!( - location_allocator.preprocessed_columns_allocation_mode, - PreprocessedColumnsAllocationMode::Static - ) { - panic!( - "Preprocessed column {:?} is missing from static alloction", - col - ); - } - - next_column - }) + .iter() + .position(|x| x == col) + { + pos + } else { + if matches!( + location_allocator.preprocessed_columns_allocation_mode, + PreprocessedColumnsAllocationMode::Static + ) { + panic!( + "Preprocessed column {:?} is missing from static allocation", + col + ); + } + location_allocator.preprocessed_columns.push(col.clone()); + next_column + } }) .collect(); Self { diff --git a/crates/prover/src/constraint_framework/expr/evaluator.rs b/crates/prover/src/constraint_framework/expr/evaluator.rs index 33605b7c70..10dce37d49 100644 --- a/crates/prover/src/constraint_framework/expr/evaluator.rs +++ b/crates/prover/src/constraint_framework/expr/evaluator.rs @@ -1,10 +1,7 @@ -use std::rc::Rc; - use num_traits::Zero; use super::{BaseExpr, ExtExpr}; use crate::constraint_framework::expr::ColumnExpr; -use crate::constraint_framework::preprocessed_columns::PreprocessedColumn; use crate::constraint_framework::{EvalAtRow, Relation, RelationEntry, INTERACTION_TRACE_IDX}; use crate::core::fields::m31; use crate::core::lookups::utils::Fraction; @@ -176,8 +173,8 @@ impl EvalAtRow for ExprEvaluator { intermediate } - fn get_preprocessed_column(&mut self, column: Rc) -> Self::F { - BaseExpr::Param(column.name().to_string()) + fn get_preprocessed_column(&mut self, column: String) -> Self::F { + BaseExpr::Param(column) } crate::constraint_framework::logup_proxy!(); @@ -210,7 +207,7 @@ mod tests { \ let constraint_1 = (QM31Impl::from_partial_evals([trace_2_column_3_offset_0, trace_2_column_4_offset_0, trace_2_column_5_offset_0, trace_2_column_6_offset_0]) \ - (QM31Impl::from_partial_evals([trace_2_column_3_offset_neg_1, trace_2_column_4_offset_neg_1, trace_2_column_5_offset_neg_1, trace_2_column_6_offset_neg_1]) \ - - ((total_sum) * (preprocessed_is_first)))) \ + - ((total_sum) * (preprocessed_is_first_16)))) \ * (intermediate1) \ - (qm31(1, 0, 0, 0));" .to_string(); diff --git a/crates/prover/src/constraint_framework/info.rs b/crates/prover/src/constraint_framework/info.rs index 6c960ed469..ab21d071e2 100644 --- a/crates/prover/src/constraint_framework/info.rs +++ b/crates/prover/src/constraint_framework/info.rs @@ -6,7 +6,6 @@ use std::rc::Rc; use num_traits::{One, Zero}; use super::logup::{LogupAtRow, LogupSums}; -use super::preprocessed_columns::PreprocessedColumn; use super::{EvalAtRow, INTERACTION_TRACE_IDX}; use crate::constraint_framework::PREPROCESSED_TRACE_IDX; use crate::core::fields::m31::BaseField; @@ -22,16 +21,12 @@ use crate::core::pcs::TreeVec; pub struct InfoEvaluator { pub mask_offsets: TreeVec>>, pub n_constraints: usize, - pub preprocessed_columns: Vec>, + pub preprocessed_columns: Vec, pub logup: LogupAtRow, pub arithmetic_counts: ArithmeticCounts, } impl InfoEvaluator { - pub fn new( - log_size: u32, - preprocessed_columns: Vec>, - logup_sums: LogupSums, - ) -> Self { + pub fn new(log_size: u32, preprocessed_columns: Vec, logup_sums: LogupSums) -> Self { Self { mask_offsets: Default::default(), n_constraints: Default::default(), @@ -70,7 +65,7 @@ impl EvalAtRow for InfoEvaluator { array::from_fn(|_| FieldCounter::one()) } - fn get_preprocessed_column(&mut self, column: Rc) -> Self::F { + fn get_preprocessed_column(&mut self, column: String) -> Self::F { self.preprocessed_columns.push(column); FieldCounter::one() } diff --git a/crates/prover/src/constraint_framework/mod.rs b/crates/prover/src/constraint_framework/mod.rs index 900375c6c6..88a2908c68 100644 --- a/crates/prover/src/constraint_framework/mod.rs +++ b/crates/prover/src/constraint_framework/mod.rs @@ -13,14 +13,12 @@ mod simd_domain; use std::array; use std::fmt::Debug; use std::ops::{Add, AddAssign, Mul, Neg, Sub}; -use std::rc::Rc; pub use assert::{assert_constraints, AssertEvaluator}; pub use component::{FrameworkComponent, FrameworkEval, TraceLocationAllocator}; pub use info::InfoEvaluator; use num_traits::{One, Zero}; pub use point::PointEvaluator; -use preprocessed_columns::PreprocessedColumn; pub use simd_domain::SimdDomainEvaluator; use crate::core::fields::m31::BaseField; @@ -88,7 +86,7 @@ pub trait EvalAtRow { mask_item } - fn get_preprocessed_column(&mut self, _column: Rc) -> Self::F { + fn get_preprocessed_column(&mut self, _column: String) -> Self::F { let [mask_item] = self.next_interaction_mask(PREPROCESSED_TRACE_IDX, [0]); mask_item } @@ -173,11 +171,12 @@ macro_rules! logup_proxy { () => { fn write_logup_frac(&mut self, fraction: Fraction) { if self.logup.fracs.is_empty() { - self.logup.is_first = self.get_preprocessed_column(std::rc::Rc::new( + self.logup.is_first = self.get_preprocessed_column( crate::constraint_framework::preprocessed_columns::IsFirst::new( self.logup.log_size, - ), - )); + ) + .id(), + ); self.logup.is_finalized = false; } self.logup.fracs.push(fraction.clone()); diff --git a/crates/prover/src/constraint_framework/preprocessed_columns.rs b/crates/prover/src/constraint_framework/preprocessed_columns.rs index 0f6e6fc716..8e5771d680 100644 --- a/crates/prover/src/constraint_framework/preprocessed_columns.rs +++ b/crates/prover/src/constraint_framework/preprocessed_columns.rs @@ -1,5 +1,5 @@ use std::fmt::Debug; -use std::hash::Hash; +// use std::hash::Hash; use std::simd::Simd; use num_traits::{One, Zero}; @@ -11,25 +11,6 @@ use crate::core::fields::m31::BaseField; use crate::core::poly::circle::{CanonicCoset, CircleEvaluation}; use crate::core::poly::BitReversedOrder; -pub trait PreprocessedColumn: Debug { - fn name(&self) -> &'static str; - /// Used for comparing preprocessed columns. - /// Column IDs must be unique in a given context. - fn id(&self) -> String; - fn log_size(&self) -> u32; -} -impl PartialEq for dyn PreprocessedColumn { - fn eq(&self, other: &Self) -> bool { - self.id() == other.id() - } -} -impl Eq for dyn PreprocessedColumn {} -impl Hash for dyn PreprocessedColumn { - fn hash(&self, state: &mut H) { - self.id().hash(state); - } -} - /// A column with `1` at the first position, and `0` elsewhere. #[derive(Debug, Clone)] pub struct IsFirst { @@ -62,18 +43,9 @@ impl IsFirst { col.set(0, BaseField::one()); CircleEvaluation::new(CanonicCoset::new(self.log_size).circle_domain(), col) } -} -impl PreprocessedColumn for IsFirst { - fn name(&self) -> &'static str { - "preprocessed_is_first" - } - - fn id(&self) -> String { - format!("IsFirst(log_size: {})", self.log_size) - } - fn log_size(&self) -> u32 { - self.log_size + pub fn id(&self) -> String { + format!("preprocessed_is_first_{}", self.log_size).to_string() } } diff --git a/crates/prover/src/examples/blake/air.rs b/crates/prover/src/examples/blake/air.rs index 565bc77fbb..dea2fa7d60 100644 --- a/crates/prover/src/examples/blake/air.rs +++ b/crates/prover/src/examples/blake/air.rs @@ -1,4 +1,3 @@ -use std::rc::Rc; use std::simd::u32x16; use itertools::{chain, multiunzip, Itertools}; @@ -10,7 +9,7 @@ use super::preprocessed_columns::XorTable; use super::round::{blake_round_info, BlakeRoundComponent, BlakeRoundEval}; use super::scheduler::{BlakeSchedulerComponent, BlakeSchedulerEval}; use super::xor_table::{xor12, xor4, xor7, xor8, xor9}; -use crate::constraint_framework::preprocessed_columns::{IsFirst, PreprocessedColumn}; +use crate::constraint_framework::preprocessed_columns::IsFirst; use crate::constraint_framework::{TraceLocationAllocator, PREPROCESSED_TRACE_IDX}; use crate::core::air::{Component, ComponentProver}; use crate::core::backend::simd::m31::LOG_N_LANES; @@ -28,28 +27,53 @@ use crate::examples::blake::{ round, xor_table, BlakeXorElements, XorAccums, N_ROUNDS, ROUND_LOG_SPLIT, }; -fn preprocessed_xor_columns() -> [Rc; 20] { +fn preprocessed_xor_columns() -> [String; 20] { [ - Rc::new(XorTable::new(12, 4, 0)), - Rc::new(XorTable::new(12, 4, 1)), - Rc::new(XorTable::new(12, 4, 2)), - Rc::new(IsFirst::new(xor12::column_bits::<12, 4>())), - Rc::new(XorTable::new(9, 2, 0)), - Rc::new(XorTable::new(9, 2, 1)), - Rc::new(XorTable::new(9, 2, 2)), - Rc::new(IsFirst::new(xor9::column_bits::<9, 2>())), - Rc::new(XorTable::new(8, 2, 0)), - Rc::new(XorTable::new(8, 2, 1)), - Rc::new(XorTable::new(8, 2, 2)), - Rc::new(IsFirst::new(xor8::column_bits::<8, 2>())), - Rc::new(XorTable::new(7, 2, 0)), - Rc::new(XorTable::new(7, 2, 1)), - Rc::new(XorTable::new(7, 2, 2)), - Rc::new(IsFirst::new(xor7::column_bits::<7, 2>())), - Rc::new(XorTable::new(4, 0, 0)), - Rc::new(XorTable::new(4, 0, 1)), - Rc::new(XorTable::new(4, 0, 2)), - Rc::new(IsFirst::new(xor4::column_bits::<4, 0>())), + XorTable::new(12, 4, 0).id(), + XorTable::new(12, 4, 1).id(), + XorTable::new(12, 4, 2).id(), + IsFirst::new(xor12::column_bits::<12, 4>()).id(), + XorTable::new(9, 2, 0).id(), + XorTable::new(9, 2, 1).id(), + XorTable::new(9, 2, 2).id(), + IsFirst::new(xor9::column_bits::<9, 2>()).id(), + XorTable::new(8, 2, 0).id(), + XorTable::new(8, 2, 1).id(), + XorTable::new(8, 2, 2).id(), + IsFirst::new(xor8::column_bits::<8, 2>()).id(), + XorTable::new(7, 2, 0).id(), + XorTable::new(7, 2, 1).id(), + XorTable::new(7, 2, 2).id(), + IsFirst::new(xor7::column_bits::<7, 2>()).id(), + XorTable::new(4, 0, 0).id(), + XorTable::new(4, 0, 1).id(), + XorTable::new(4, 0, 2).id(), + IsFirst::new(xor4::column_bits::<4, 0>()).id(), + ] +} + +const fn preprocessed_xor_columns_log_sizes() -> [u32; 20] { + [ + 2 * (12 - 4), + 2 * (12 - 4), + 2 * (12 - 4), + xor12::column_bits::<12, 4>(), + 2 * (9 - 2), + 2 * (9 - 2), + 2 * (9 - 2), + xor9::column_bits::<9, 2>(), + 2 * (8 - 2), + 2 * (8 - 2), + 2 * (8 - 2), + xor8::column_bits::<8, 2>(), + 2 * (7 - 2), + 2 * (7 - 2), + 2 * (7 - 2), + xor7::column_bits::<7, 2>(), + 2 * 4, + 2 * 4, + 2 * 4, + xor4::column_bits::<4, 0>(), ] } @@ -90,7 +114,7 @@ impl BlakeStatement0 { log_sizes[PREPROCESSED_TRACE_IDX] = chain!( [scheduler_is_first_column_log_size], blake_round_is_first_column_log_sizes, - preprocessed_xor_columns().map(|column| column.log_size()), + preprocessed_xor_columns_log_sizes(), ) .collect_vec(); @@ -163,11 +187,11 @@ impl BlakeComponents { fn new(stmt0: &BlakeStatement0, all_elements: &AllElements, stmt1: &BlakeStatement1) -> Self { let log_size = stmt0.log_size; - let scheduler_is_first_column: Rc = Rc::new(IsFirst::new(log_size)); - let blake_round_is_first_columns_iter = ROUND_LOG_SPLIT.iter().map(|l| { - let column: Rc = Rc::new(IsFirst::new(log_size + l)); - column - }); + let scheduler_is_first_column = IsFirst::new(log_size).id(); + let blake_round_is_first_columns_iter: Vec = ROUND_LOG_SPLIT + .iter() + .map(|l| IsFirst::new(log_size + l).id()) + .collect_vec(); let tree_span_provider = &mut TraceLocationAllocator::new_with_preproccessed_columns( &chain!( diff --git a/crates/prover/src/examples/blake/preprocessed_columns.rs b/crates/prover/src/examples/blake/preprocessed_columns.rs index 500cbe0a85..5c86c2980a 100644 --- a/crates/prover/src/examples/blake/preprocessed_columns.rs +++ b/crates/prover/src/examples/blake/preprocessed_columns.rs @@ -1,5 +1,3 @@ -use crate::constraint_framework::preprocessed_columns::PreprocessedColumn; - // TODO(Gali): Add documentation. #[derive(Debug)] pub struct XorTable { @@ -17,20 +15,11 @@ impl XorTable { index_in_table, } } -} -impl PreprocessedColumn for XorTable { - fn name(&self) -> &'static str { - "preprocessed_xor_table" - } - fn id(&self) -> String { + pub fn id(&self) -> String { format!( - "XorTable(n_bits: {}, n_expand_bits: {}, index_in_table: {})", + "preprocessed_xor_table_{}_{}_{}", self.n_bits, self.n_expand_bits, self.index_in_table ) } - - fn log_size(&self) -> u32 { - 2 * (self.n_bits - self.n_expand_bits) - } } diff --git a/crates/prover/src/examples/blake/xor_table/constraints.rs b/crates/prover/src/examples/blake/xor_table/constraints.rs index 0bbe097e76..52a989700b 100644 --- a/crates/prover/src/examples/blake/xor_table/constraints.rs +++ b/crates/prover/src/examples/blake/xor_table/constraints.rs @@ -18,27 +18,15 @@ macro_rules! xor_table_eval { // cl is the constant column for the xor: al ^ bl. let al = self .eval - .get_preprocessed_column(std::rc::Rc::new(XorTable::new( - ELEM_BITS, - EXPAND_BITS, - 0, - ))); + .get_preprocessed_column(XorTable::new(ELEM_BITS, EXPAND_BITS, 0).id()); let bl = self .eval - .get_preprocessed_column(std::rc::Rc::new(XorTable::new( - ELEM_BITS, - EXPAND_BITS, - 1, - ))); + .get_preprocessed_column(XorTable::new(ELEM_BITS, EXPAND_BITS, 1).id()); let cl = self .eval - .get_preprocessed_column(std::rc::Rc::new(XorTable::new( - ELEM_BITS, - EXPAND_BITS, - 2, - ))); + .get_preprocessed_column(XorTable::new(ELEM_BITS, EXPAND_BITS, 2).id()); for i in (0..(1 << (2 * EXPAND_BITS))) { let (i, j) = ((i >> EXPAND_BITS) as u32, (i % (1 << EXPAND_BITS)) as u32); diff --git a/crates/prover/src/examples/blake/xor_table/mod.rs b/crates/prover/src/examples/blake/xor_table/mod.rs index 001fbc1b93..4bec217a78 100644 --- a/crates/prover/src/examples/blake/xor_table/mod.rs +++ b/crates/prover/src/examples/blake/xor_table/mod.rs @@ -21,7 +21,7 @@ use tracing::{span, Level}; use super::preprocessed_columns::XorTable; use crate::constraint_framework::logup::{LogupAtRow, LogupTraceGenerator}; -use crate::constraint_framework::preprocessed_columns::{IsFirst, PreprocessedColumn}; +use crate::constraint_framework::preprocessed_columns::IsFirst; use crate::constraint_framework::{ relation, EvalAtRow, FrameworkComponent, FrameworkEval, InfoEvaluator, Relation, RelationEntry, INTERACTION_TRACE_IDX, PREPROCESSED_TRACE_IDX, diff --git a/crates/prover/src/examples/plonk/mod.rs b/crates/prover/src/examples/plonk/mod.rs index ff7f576500..3cd2506062 100644 --- a/crates/prover/src/examples/plonk/mod.rs +++ b/crates/prover/src/examples/plonk/mod.rs @@ -1,7 +1,5 @@ pub mod preprocessed_columns; -use std::rc::Rc; - use itertools::Itertools; use num_traits::One; use preprocessed_columns::Plonk; @@ -54,12 +52,12 @@ impl FrameworkEval for PlonkEval { } fn evaluate(&self, mut eval: E) -> E { - let a_wire = eval.get_preprocessed_column(Rc::new(Plonk::new(0))); - let b_wire = eval.get_preprocessed_column(Rc::new(Plonk::new(1))); + let a_wire = eval.get_preprocessed_column(Plonk::new(0).id()); + let b_wire = eval.get_preprocessed_column(Plonk::new(1).id()); // Note: c_wire could also be implicit: (self.eval.point() - M31_CIRCLE_GEN.into_ef()).x. // A constant column is easier though. - let c_wire = eval.get_preprocessed_column(Rc::new(Plonk::new(2))); - let op = eval.get_preprocessed_column(Rc::new(Plonk::new(3))); + let c_wire = eval.get_preprocessed_column(Plonk::new(2).id()); + let op = eval.get_preprocessed_column(Plonk::new(3).id()); let mult = eval.next_trace_mask(); let a_val = eval.next_trace_mask(); diff --git a/crates/prover/src/examples/plonk/preprocessed_columns.rs b/crates/prover/src/examples/plonk/preprocessed_columns.rs index 06f105ed94..10d891b305 100644 --- a/crates/prover/src/examples/plonk/preprocessed_columns.rs +++ b/crates/prover/src/examples/plonk/preprocessed_columns.rs @@ -1,5 +1,3 @@ -use crate::constraint_framework::preprocessed_columns::PreprocessedColumn; - // TODO(Gali): Add documentation. #[derive(Debug)] pub struct Plonk { @@ -9,17 +7,8 @@ impl Plonk { pub const fn new(wire: usize) -> Self { Self { wire } } -} -impl PreprocessedColumn for Plonk { - fn name(&self) -> &'static str { - "preprocessed_plonk" - } - - fn id(&self) -> String { - format!("Plonk(wire: {})", self.wire) - } - fn log_size(&self) -> u32 { - todo!("Plonk::log_size") + pub fn id(&self) -> String { + format!("preprocessed_plonk_{}", self.wire) } } diff --git a/crates/prover/src/examples/state_machine/mod.rs b/crates/prover/src/examples/state_machine/mod.rs index e32fd154fd..8efc912465 100644 --- a/crates/prover/src/examples/state_machine/mod.rs +++ b/crates/prover/src/examples/state_machine/mod.rs @@ -1,5 +1,3 @@ -use std::rc::Rc; - use crate::constraint_framework::relation_tracker::RelationSummary; use crate::constraint_framework::Relation; pub mod components; @@ -13,7 +11,7 @@ use components::{ use gen::{gen_interaction_trace, gen_trace}; use itertools::{chain, Itertools}; -use crate::constraint_framework::preprocessed_columns::{IsFirst, PreprocessedColumn}; +use crate::constraint_framework::preprocessed_columns::IsFirst; use crate::constraint_framework::TraceLocationAllocator; use crate::core::backend::simd::m31::LOG_N_LANES; use crate::core::backend::simd::SimdBackend; @@ -66,9 +64,9 @@ pub fn prove_state_machine( .into_iter() .map(|col| col.gen_column_simd()) .collect(); - let preprocessed_columns: [Rc; 2] = [ - Rc::new(IsFirst::new(x_axis_log_rows)), - Rc::new(IsFirst::new(y_axis_log_rows)), + let preprocessed_columns = [ + IsFirst::new(x_axis_log_rows).id(), + IsFirst::new(y_axis_log_rows).id(), ]; // Trace. @@ -378,12 +376,12 @@ mod tests { trace_2_column_4_offset_claimed_sum, \ trace_2_column_5_offset_claimed_sum\ ]) - (claimed_sum)) \ - * (preprocessed_is_first); + * (preprocessed_is_first_8); \ let constraint_1 = (QM31Impl::from_partial_evals([trace_2_column_2_offset_0, trace_2_column_3_offset_0, trace_2_column_4_offset_0, trace_2_column_5_offset_0]) \ - (QM31Impl::from_partial_evals([trace_2_column_2_offset_neg_1, trace_2_column_3_offset_neg_1, trace_2_column_4_offset_neg_1, trace_2_column_5_offset_neg_1]) \ - - ((total_sum) * (preprocessed_is_first)))\ + - ((total_sum) * (preprocessed_is_first_8)))\ ) \ * ((intermediate0) * (intermediate1)) \ - (intermediate1 - (intermediate0));" diff --git a/crates/prover/src/examples/xor/gkr_lookups/preprocessed_columns.rs b/crates/prover/src/examples/xor/gkr_lookups/preprocessed_columns.rs index af43b9e1f3..537d578399 100644 --- a/crates/prover/src/examples/xor/gkr_lookups/preprocessed_columns.rs +++ b/crates/prover/src/examples/xor/gkr_lookups/preprocessed_columns.rs @@ -1,6 +1,5 @@ use num_traits::One; -use crate::constraint_framework::preprocessed_columns::PreprocessedColumn; use crate::core::backend::simd::SimdBackend; use crate::core::backend::{Col, Column}; use crate::core::fields::m31::BaseField; @@ -40,20 +39,11 @@ impl IsStepWithOffset { } CircleEvaluation::new(CanonicCoset::new(self.log_size).circle_domain(), col) } -} -impl PreprocessedColumn for IsStepWithOffset { - fn name(&self) -> &'static str { - "preprocessed_is_step_with_offset" - } - fn id(&self) -> String { + pub fn id(&self) -> String { format!( - "IsStepWithOffset(log_size: {}, log_step: {}, offset: {})", + "preprocessed_is_step_with_offset_{}_{}_{}", self.log_size, self.log_step, self.offset ) } - - fn log_size(&self) -> u32 { - self.log_size - } }