diff --git a/crates/prover/src/core/queries.rs b/crates/prover/src/core/queries.rs index f2860fe5c..09954d34a 100644 --- a/crates/prover/src/core/queries.rs +++ b/crates/prover/src/core/queries.rs @@ -8,8 +8,6 @@ use super::circle::Coset; use super::poly::circle::CircleDomain; use super::utils::bit_reverse_index; -// TODO(AlonH): Move file to fri directory. - pub const UPPER_BOUND_QUERY_BYTES: usize = 4; /// An ordered set of query indices over a bit reversed [CircleDomain]. diff --git a/crates/prover/src/examples/fibonacci/mod.rs b/crates/prover/src/examples/fibonacci/mod.rs index d2fe94b6a..059e5f31c 100644 --- a/crates/prover/src/examples/fibonacci/mod.rs +++ b/crates/prover/src/examples/fibonacci/mod.rs @@ -33,7 +33,6 @@ impl Fibonacci { pub fn get_trace(&self) -> CpuCircleEvaluation { // Trace. let trace_domain = CanonicCoset::new(self.air.component.log_size); - // TODO(AlonH): Consider using Vec::new instead of Vec::with_capacity throughout file. let mut trace = Vec::with_capacity(trace_domain.size()); // Fill trace with fibonacci squared. diff --git a/crates/prover/src/examples/wide_fibonacci/simd.rs b/crates/prover/src/examples/wide_fibonacci/simd.rs index 1055ad962..c3944bc13 100644 --- a/crates/prover/src/examples/wide_fibonacci/simd.rs +++ b/crates/prover/src/examples/wide_fibonacci/simd.rs @@ -162,7 +162,6 @@ pub fn gen_trace( .collect_vec() } -// TODO(AlonH): Implement. impl ComponentTraceGenerator for SimdWideFibComponent { type Component = Self; type Inputs = (); diff --git a/crates/prover/src/examples/wide_fibonacci/trace_gen.rs b/crates/prover/src/examples/wide_fibonacci/trace_gen.rs index 788fc842c..550aa0635 100644 --- a/crates/prover/src/examples/wide_fibonacci/trace_gen.rs +++ b/crates/prover/src/examples/wide_fibonacci/trace_gen.rs @@ -1,5 +1,5 @@ use itertools::Itertools; -use num_traits::One; +use num_traits::{One, Zero}; use super::component::Input; use crate::core::fields::m31::BaseField; @@ -49,23 +49,29 @@ pub fn write_lookup_column( }) .collect_vec(); - (0..n_rows) + let denominators = (0..n_rows) .map(|i| { - let numerator = shifted_secure_combination( - &[natural_ordered_trace[0][i], natural_ordered_trace[1][i]], - alpha, - z, - ); - let denominator = shifted_secure_combination( + shifted_secure_combination( &[ natural_ordered_trace[n_columns - 2][i], natural_ordered_trace[n_columns - 1][i], ], alpha, z, + ) + }) + .collect_vec(); + let mut denominator_inverses = vec![SecureField::zero(); denominators.len()]; + SecureField::batch_inverse(&denominators, &mut denominator_inverses); + + (0..n_rows) + .map(|i| { + let numerator = shifted_secure_combination( + &[natural_ordered_trace[0][i], natural_ordered_trace[1][i]], + alpha, + z, ); - // TODO(AlonH): Use batch inversion. - let cell = (numerator / denominator) * prev_value; + let cell = (numerator * denominator_inverses[i]) * prev_value; prev_value = cell; cell })