diff --git a/crates/prover/benches/eval_at_point.rs b/crates/prover/benches/eval_at_point.rs index 0b2f22a68..64d1eecc7 100644 --- a/crates/prover/benches/eval_at_point.rs +++ b/crates/prover/benches/eval_at_point.rs @@ -1,7 +1,7 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; use rand::rngs::SmallRng; use rand::{Rng, SeedableRng}; -use stwo_prover::core::backend::cpu::CPUBackend; +use stwo_prover::core::backend::cpu::CpuBackend; use stwo_prover::core::backend::simd::SimdBackend; use stwo_prover::core::circle::CirclePoint; use stwo_prover::core::fields::m31::BaseField; @@ -25,7 +25,7 @@ fn bench_eval_at_secure_point(c: &mut Criterion, id: &str) { fn eval_at_secure_point_benches(c: &mut Criterion) { bench_eval_at_secure_point::(c, "simd"); - bench_eval_at_secure_point::(c, "cpu"); + bench_eval_at_secure_point::(c, "cpu"); } criterion_group!( diff --git a/crates/prover/benches/fri.rs b/crates/prover/benches/fri.rs index dc694f6a5..921286e35 100644 --- a/crates/prover/benches/fri.rs +++ b/crates/prover/benches/fri.rs @@ -1,5 +1,5 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use stwo_prover::core::backend::CPUBackend; +use stwo_prover::core::backend::CpuBackend; use stwo_prover::core::fields::m31::BaseField; use stwo_prover::core::fields::qm31::SecureField; use stwo_prover::core::fields::secure_column::SecureColumn; @@ -19,10 +19,10 @@ fn folding_benchmark(c: &mut Criterion) { }, ); let alpha = SecureField::from_u32_unchecked(2213980, 2213981, 2213982, 2213983); - let twiddles = CPUBackend::precompute_twiddles(domain.coset()); + let twiddles = CpuBackend::precompute_twiddles(domain.coset()); c.bench_function("fold_line", |b| { b.iter(|| { - black_box(CPUBackend::fold_line( + black_box(CpuBackend::fold_line( black_box(&evals), black_box(alpha), &twiddles, diff --git a/crates/prover/benches/merkle.rs b/crates/prover/benches/merkle.rs index 89b8904d4..c039be77e 100644 --- a/crates/prover/benches/merkle.rs +++ b/crates/prover/benches/merkle.rs @@ -4,7 +4,7 @@ use criterion::{criterion_group, criterion_main, Criterion, Throughput}; use itertools::Itertools; use num_traits::Zero; use stwo_prover::core::backend::simd::SimdBackend; -use stwo_prover::core::backend::{CPUBackend, Col}; +use stwo_prover::core::backend::{Col, CpuBackend}; use stwo_prover::core::fields::m31::{BaseField, N_BYTES_FELT}; use stwo_prover::core::vcs::blake2_merkle::Blake2sMerkleHasher; use stwo_prover::core::vcs::ops::MerkleOps; @@ -28,7 +28,7 @@ fn bench_blake2s_merkle>(c: &mut Criterion, id fn blake2s_merkle_benches(c: &mut Criterion) { bench_blake2s_merkle::(c, "simd"); - bench_blake2s_merkle::(c, "cpu"); + bench_blake2s_merkle::(c, "cpu"); } criterion_group!( diff --git a/crates/prover/benches/quotients.rs b/crates/prover/benches/quotients.rs index bae785640..b110dbfee 100644 --- a/crates/prover/benches/quotients.rs +++ b/crates/prover/benches/quotients.rs @@ -2,7 +2,7 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; use itertools::Itertools; -use stwo_prover::core::backend::cpu::CPUBackend; +use stwo_prover::core::backend::cpu::CpuBackend; use stwo_prover::core::backend::simd::SimdBackend; use stwo_prover::core::circle::SECURE_FIELD_CIRCLE_GEN; use stwo_prover::core::fields::m31::BaseField; @@ -44,7 +44,7 @@ fn bench_quotients fn quotients_benches(c: &mut Criterion) { bench_quotients::(c, "simd"); - bench_quotients::(c, "cpu"); + bench_quotients::(c, "cpu"); } criterion_group!( diff --git a/crates/prover/src/core/air/accumulation.rs b/crates/prover/src/core/air/accumulation.rs index 4ceeb245e..a81e9341e 100644 --- a/crates/prover/src/core/air/accumulation.rs +++ b/crates/prover/src/core/air/accumulation.rs @@ -6,7 +6,7 @@ use itertools::Itertools; use tracing::{span, Level}; -use crate::core::backend::{Backend, CPUBackend}; +use crate::core::backend::{Backend, CpuBackend}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; use crate::core::fields::secure_column::SecureColumn; @@ -147,7 +147,7 @@ pub struct ColumnAccumulator<'a, B: Backend> { pub random_coeff_powers: Vec, pub col: &'a mut SecureColumn, } -impl<'a> ColumnAccumulator<'a, CPUBackend> { +impl<'a> ColumnAccumulator<'a, CpuBackend> { pub fn accumulate(&mut self, index: usize, evaluation: SecureField) { let val = self.col.at(index) + evaluation; self.col.set(index, val); @@ -163,7 +163,7 @@ mod tests { use rand::{Rng, SeedableRng}; use super::*; - use crate::core::backend::cpu::CPUCircleEvaluation; + use crate::core::backend::cpu::CpuCircleEvaluation; use crate::core::circle::CirclePoint; use crate::core::fields::m31::{M31, P}; use crate::qm31; @@ -225,7 +225,7 @@ mod tests { let alpha = qm31!(2, 3, 4, 5); // Use accumulator. - let mut accumulator = DomainEvaluationAccumulator::::new( + let mut accumulator = DomainEvaluationAccumulator::::new( alpha, LOG_SIZE_BOUND, evaluations.len(), @@ -273,7 +273,7 @@ mod tests { let mut res = SecureField::default(); for (log_size, values) in log_sizes.into_iter().zip(evaluations) { res = res * alpha - + CPUCircleEvaluation::new(CanonicCoset::new(log_size).circle_domain(), values) + + CpuCircleEvaluation::new(CanonicCoset::new(log_size).circle_domain(), values) .interpolate() .eval_at_point(point); } diff --git a/crates/prover/src/core/backend/cpu/accumulation.rs b/crates/prover/src/core/backend/cpu/accumulation.rs index b8351d807..9c3580f5b 100644 --- a/crates/prover/src/core/backend/cpu/accumulation.rs +++ b/crates/prover/src/core/backend/cpu/accumulation.rs @@ -1,8 +1,8 @@ -use super::CPUBackend; +use super::CpuBackend; use crate::core::air::accumulation::AccumulationOps; use crate::core::fields::secure_column::SecureColumn; -impl AccumulationOps for CPUBackend { +impl AccumulationOps for CpuBackend { fn accumulate(column: &mut SecureColumn, other: &SecureColumn) { for i in 0..column.len() { let res_coeff = column.at(i) + other.at(i); diff --git a/crates/prover/src/core/backend/cpu/blake2s.rs b/crates/prover/src/core/backend/cpu/blake2s.rs index b4666d91c..a87a5ae00 100644 --- a/crates/prover/src/core/backend/cpu/blake2s.rs +++ b/crates/prover/src/core/backend/cpu/blake2s.rs @@ -1,12 +1,12 @@ use itertools::Itertools; -use crate::core::backend::CPUBackend; +use crate::core::backend::CpuBackend; use crate::core::fields::m31::BaseField; use crate::core::vcs::blake2_hash::Blake2sHash; use crate::core::vcs::blake2_merkle::Blake2sMerkleHasher; use crate::core::vcs::ops::{MerkleHasher, MerkleOps}; -impl MerkleOps for CPUBackend { +impl MerkleOps for CpuBackend { fn commit_on_layer( log_size: u32, prev_layer: Option<&Vec>, diff --git a/crates/prover/src/core/backend/cpu/circle.rs b/crates/prover/src/core/backend/cpu/circle.rs index 0c1ee7fa8..b3b434b6b 100644 --- a/crates/prover/src/core/backend/cpu/circle.rs +++ b/crates/prover/src/core/backend/cpu/circle.rs @@ -1,6 +1,6 @@ use num_traits::Zero; -use super::CPUBackend; +use super::CpuBackend; use crate::core::backend::{Col, ColumnOps}; use crate::core::circle::{CirclePoint, Coset}; use crate::core::fft::{butterfly, ibutterfly}; @@ -15,7 +15,7 @@ use crate::core::poly::utils::{domain_line_twiddles_from_tree, fold}; use crate::core::poly::BitReversedOrder; use crate::core::utils::bit_reverse; -impl PolyOps for CPUBackend { +impl PolyOps for CpuBackend { type Twiddles = Vec; fn new_canonical_ordered( @@ -32,7 +32,7 @@ impl PolyOps for CPUBackend { for i in 0..half_len { new_values.push(values[domain.size() - 1 - (i << 1)]); } - CPUBackend::bit_reverse_column(&mut new_values); + CpuBackend::bit_reverse_column(&mut new_values); CircleEvaluation::new(domain, new_values) } @@ -214,7 +214,7 @@ fn circle_twiddles_from_line_twiddles( } impl, EvalOrder> IntoIterator - for CircleEvaluation + for CircleEvaluation { type Item = F; type IntoIter = std::vec::IntoIter; diff --git a/crates/prover/src/core/backend/cpu/fri.rs b/crates/prover/src/core/backend/cpu/fri.rs index 33ecd6da3..26ca2bb77 100644 --- a/crates/prover/src/core/backend/cpu/fri.rs +++ b/crates/prover/src/core/backend/cpu/fri.rs @@ -1,4 +1,4 @@ -use super::CPUBackend; +use super::CpuBackend; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; use crate::core::fields::secure_column::SecureColumn; @@ -8,7 +8,7 @@ use crate::core::poly::line::LineEvaluation; use crate::core::poly::twiddles::TwiddleTree; // TODO(spapini): Optimized these functions as well. -impl FriOps for CPUBackend { +impl FriOps for CpuBackend { fn fold_line( eval: &LineEvaluation, alpha: SecureField, @@ -51,7 +51,7 @@ impl FriOps for CPUBackend { } } -impl CPUBackend { +impl CpuBackend { /// Used to decompose a general polynomial to a polynomial inside the fft-space, and /// the remainder terms. /// A coset-diff on a [`CirclePoly`] that is in the FFT space will return zero. @@ -89,8 +89,8 @@ impl CPUBackend { mod tests { use num_traits::Zero; - use crate::core::backend::cpu::{CPUCircleEvaluation, CPUCirclePoly}; - use crate::core::backend::CPUBackend; + use crate::core::backend::cpu::{CpuCircleEvaluation, CpuCirclePoly}; + use crate::core::backend::CpuBackend; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; use crate::core::fields::secure_column::SecureColumn; @@ -109,9 +109,9 @@ mod tests { // Polynomial is out of FFT space. coeffs[1 << domain_log_half_size] = m31!(1); - assert!(!CPUCirclePoly::new(coeffs.clone()).is_in_fft_space(domain_log_half_size)); + assert!(!CpuCirclePoly::new(coeffs.clone()).is_in_fft_space(domain_log_half_size)); - let poly = CPUCirclePoly::new(coeffs); + let poly = CpuCirclePoly::new(coeffs); let values = poly.evaluate(domain); let secure_column = SecureColumn { columns: [ @@ -121,12 +121,12 @@ mod tests { values.values.clone(), ], }; - let secure_eval = SecureEvaluation:: { + let secure_eval = SecureEvaluation:: { domain, values: secure_column.clone(), }; - let (g, lambda) = CPUBackend::decompose(&secure_eval); + let (g, lambda) = CpuBackend::decompose(&secure_eval); // Sanity check. assert_ne!(lambda, SecureField::zero()); @@ -134,9 +134,9 @@ mod tests { // Assert the new polynomial is in the FFT space. for i in 0..4 { let basefield_column = g.columns[i].clone(); - let eval = CPUCircleEvaluation::new(domain, basefield_column); + let eval = CpuCircleEvaluation::new(domain, basefield_column); let coeffs = eval.interpolate().coeffs; - assert!(CPUCirclePoly::new(coeffs).is_in_fft_space(domain_log_half_size)); + assert!(CpuCirclePoly::new(coeffs).is_in_fft_space(domain_log_half_size)); } } } diff --git a/crates/prover/src/core/backend/cpu/lookups/mle.rs b/crates/prover/src/core/backend/cpu/lookups/mle.rs index 3ad6fac75..176b8f6e0 100644 --- a/crates/prover/src/core/backend/cpu/lookups/mle.rs +++ b/crates/prover/src/core/backend/cpu/lookups/mle.rs @@ -2,7 +2,7 @@ use std::iter::zip; use num_traits::{One, Zero}; -use crate::core::backend::CPUBackend; +use crate::core::backend::CpuBackend; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; use crate::core::fields::{ExtensionOf, Field}; @@ -10,7 +10,7 @@ use crate::core::lookups::mle::{Mle, MleOps}; use crate::core::lookups::sumcheck::MultivariatePolyOracle; use crate::core::lookups::utils::UnivariatePoly; -impl MleOps for CPUBackend { +impl MleOps for CpuBackend { fn fix_first_variable( mle: Mle, assignment: SecureField, @@ -26,7 +26,7 @@ impl MleOps for CPUBackend { } } -impl MleOps for CPUBackend { +impl MleOps for CpuBackend { fn fix_first_variable( mle: Mle, assignment: SecureField, @@ -46,7 +46,7 @@ impl MleOps for CPUBackend { } } -impl MultivariatePolyOracle for Mle { +impl MultivariatePolyOracle for Mle { fn n_variables(&self) -> usize { self.n_variables() } diff --git a/crates/prover/src/core/backend/cpu/mod.rs b/crates/prover/src/core/backend/cpu/mod.rs index 5081eed63..c033e4cc2 100644 --- a/crates/prover/src/core/backend/cpu/mod.rs +++ b/crates/prover/src/core/backend/cpu/mod.rs @@ -14,11 +14,11 @@ use crate::core::poly::circle::{CircleEvaluation, CirclePoly}; use crate::core::utils::bit_reverse; #[derive(Copy, Clone, Debug)] -pub struct CPUBackend; +pub struct CpuBackend; -impl Backend for CPUBackend {} +impl Backend for CpuBackend {} -impl ColumnOps for CPUBackend { +impl ColumnOps for CpuBackend { type Column = Vec; fn bit_reverse_column(column: &mut Self::Column) { @@ -26,7 +26,7 @@ impl ColumnOps for CPUBackend { } } -impl FieldOps for CPUBackend { +impl FieldOps for CpuBackend { /// Batch inversion using the Montgomery's trick. // TODO(Ohad): Benchmark this function. fn batch_inverse(column: &Self::Column, dst: &mut Self::Column) { @@ -49,9 +49,9 @@ impl Column for Vec { } } -pub type CPUCirclePoly = CirclePoly; -pub type CPUCircleEvaluation = CircleEvaluation; -pub type CPUMle = Mle; +pub type CpuCirclePoly = CirclePoly; +pub type CpuCircleEvaluation = CircleEvaluation; +pub type CpuMle = Mle; #[cfg(test)] mod tests { @@ -59,7 +59,7 @@ mod tests { use rand::prelude::*; use rand::rngs::SmallRng; - use crate::core::backend::{CPUBackend, Column, FieldOps}; + use crate::core::backend::{Column, CpuBackend, FieldOps}; use crate::core::fields::qm31::QM31; use crate::core::fields::FieldExpOps; @@ -70,7 +70,7 @@ mod tests { let expected = column.iter().map(|e| e.inverse()).collect_vec(); let mut dst = Column::zeros(column.len()); - CPUBackend::batch_inverse(&column, &mut dst); + CpuBackend::batch_inverse(&column, &mut dst); assert_eq!(expected, dst); } diff --git a/crates/prover/src/core/backend/cpu/quotients.rs b/crates/prover/src/core/backend/cpu/quotients.rs index 270e32245..d6beb4716 100644 --- a/crates/prover/src/core/backend/cpu/quotients.rs +++ b/crates/prover/src/core/backend/cpu/quotients.rs @@ -1,7 +1,7 @@ use itertools::izip; use num_traits::{One, Zero}; -use super::CPUBackend; +use super::CpuBackend; use crate::core::backend::{Backend, Col}; use crate::core::circle::CirclePoint; use crate::core::constraints::{complex_conjugate_line_coeffs, point_vanishing_fraction}; @@ -14,7 +14,7 @@ use crate::core::poly::circle::{CircleDomain, CircleEvaluation, SecureEvaluation use crate::core::poly::BitReversedOrder; use crate::core::utils::{bit_reverse, bit_reverse_index}; -impl QuotientOps for CPUBackend { +impl QuotientOps for CpuBackend { fn accumulate_quotients( domain: CircleDomain, columns: &[&CircleEvaluation], @@ -45,8 +45,8 @@ impl QuotientOps for CPUBackend { // function that deals with quotients over pair_vanishing polynomials. pub fn accumulate_row_quotients( sample_batches: &[ColumnSampleBatch], - columns: &[&CircleEvaluation], - quotient_constants: &QuotientConstants, + columns: &[&CircleEvaluation], + quotient_constants: &QuotientConstants, row: usize, _domain_point: CirclePoint, ) -> SecureField { @@ -113,7 +113,7 @@ pub fn batch_random_coeffs( fn denominator_inverses( sample_batches: &[ColumnSampleBatch], domain: CircleDomain, -) -> Vec> { +) -> Vec> { let n_fracions = sample_batches.len() * domain.size(); let mut flat_denominators = Vec::with_capacity(n_fracions); let mut numerator_terms = Vec::with_capacity(n_fracions); @@ -146,7 +146,7 @@ pub fn quotient_constants( sample_batches: &[ColumnSampleBatch], random_coeff: SecureField, domain: CircleDomain, -) -> QuotientConstants { +) -> QuotientConstants { let line_coeffs = column_line_coeffs(sample_batches, random_coeff); let batch_random_coeffs = batch_random_coeffs(sample_batches, random_coeff); let denominator_inverses = denominator_inverses(sample_batches, domain); @@ -171,8 +171,8 @@ pub struct QuotientConstants { #[cfg(test)] mod tests { - use crate::core::backend::cpu::{CPUCircleEvaluation, CPUCirclePoly}; - use crate::core::backend::CPUBackend; + use crate::core::backend::cpu::{CpuCircleEvaluation, CpuCirclePoly}; + use crate::core::backend::CpuBackend; use crate::core::circle::SECURE_FIELD_CIRCLE_GEN; use crate::core::pcs::quotients::{ColumnSampleBatch, QuotientOps}; use crate::core::poly::circle::CanonicCoset; @@ -181,13 +181,13 @@ mod tests { #[test] fn test_quotients_are_low_degree() { const LOG_SIZE: u32 = 7; - let polynomial = CPUCirclePoly::new((0..1 << LOG_SIZE).map(|i| m31!(i)).collect()); + let polynomial = CpuCirclePoly::new((0..1 << LOG_SIZE).map(|i| m31!(i)).collect()); let eval_domain = CanonicCoset::new(LOG_SIZE + 1).circle_domain(); let eval = polynomial.evaluate(eval_domain); let point = SECURE_FIELD_CIRCLE_GEN; let value = polynomial.eval_at_point(point); let coeff = qm31!(1, 2, 3, 4); - let quot_eval = CPUBackend::accumulate_quotients( + let quot_eval = CpuBackend::accumulate_quotients( eval_domain, &[&eval], coeff, @@ -197,7 +197,7 @@ mod tests { }], ); let quot_poly_base_field = - CPUCircleEvaluation::new(eval_domain, quot_eval.columns[0].clone()).interpolate(); + CpuCircleEvaluation::new(eval_domain, quot_eval.columns[0].clone()).interpolate(); assert!(quot_poly_base_field.is_in_fri_space(LOG_SIZE)); } } diff --git a/crates/prover/src/core/backend/mod.rs b/crates/prover/src/core/backend/mod.rs index fba8c4d4d..f2d4fd043 100644 --- a/crates/prover/src/core/backend/mod.rs +++ b/crates/prover/src/core/backend/mod.rs @@ -1,6 +1,6 @@ use std::fmt::Debug; -pub use cpu::CPUBackend; +pub use cpu::CpuBackend; use super::air::accumulation::AccumulationOps; use super::fields::m31::BaseField; diff --git a/crates/prover/src/core/backend/simd/circle.rs b/crates/prover/src/core/backend/simd/circle.rs index dd677fc05..4c543c1cc 100644 --- a/crates/prover/src/core/backend/simd/circle.rs +++ b/crates/prover/src/core/backend/simd/circle.rs @@ -9,7 +9,7 @@ use super::m31::{PackedBaseField, LOG_N_LANES, N_LANES}; use super::qm31::PackedSecureField; use super::SimdBackend; use crate::core::backend::simd::column::BaseFieldVec; -use crate::core::backend::{CPUBackend, Col}; +use crate::core::backend::{Col, CpuBackend}; use crate::core::circle::{CirclePoint, Coset}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; @@ -132,7 +132,7 @@ impl PolyOps for SimdBackend { values: Col, ) -> CircleEvaluation { // TODO(spapini): Optimize. - let eval = CPUBackend::new_canonical_ordered(coset, values.into_cpu_vec()); + let eval = CpuBackend::new_canonical_ordered(coset, values.into_cpu_vec()); CircleEvaluation::new( eval.domain, Col::::from_iter(eval.values), diff --git a/crates/prover/src/core/backend/simd/column.rs b/crates/prover/src/core/backend/simd/column.rs index c054f8bce..5c2fdd380 100644 --- a/crates/prover/src/core/backend/simd/column.rs +++ b/crates/prover/src/core/backend/simd/column.rs @@ -8,7 +8,7 @@ use super::cm31::PackedCM31; use super::m31::{PackedBaseField, N_LANES}; use super::qm31::{PackedQM31, PackedSecureField}; use super::SimdBackend; -use crate::core::backend::{CPUBackend, Column}; +use crate::core::backend::{Column, CpuBackend}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; use crate::core::fields::secure_column::SecureColumn; @@ -202,7 +202,7 @@ impl SecureColumn { impl FromIterator for SecureColumn { fn from_iter>(iter: I) -> Self { - let cpu_col = SecureColumn::::from_iter(iter); + let cpu_col = SecureColumn::::from_iter(iter); let columns = cpu_col.columns.map(|col| col.into_iter().collect()); SecureColumn { columns } } diff --git a/crates/prover/src/core/backend/simd/fft/ifft.rs b/crates/prover/src/core/backend/simd/fft/ifft.rs index ae218e55e..bc4639070 100644 --- a/crates/prover/src/core/backend/simd/fft/ifft.rs +++ b/crates/prover/src/core/backend/simd/fft/ifft.rs @@ -548,7 +548,7 @@ mod tests { get_itwiddle_dbls, ifft, ifft3, ifft_lower_with_vecwise, simd_ibutterfly, vecwise_ibutterflies, }; - use crate::core::backend::cpu::CPUCircleEvaluation; + use crate::core::backend::cpu::CpuCircleEvaluation; use crate::core::backend::simd::column::BaseFieldVec; use crate::core::backend::simd::fft::{transpose_vecs, CACHED_FFT_LOG_SIZE}; use crate::core::backend::simd::m31::{PackedBaseField, LOG_N_LANES, N_LANES}; @@ -703,7 +703,7 @@ mod tests { } fn ground_truth_ifft(domain: CircleDomain, values: &[BaseField]) -> Vec { - let eval = CPUCircleEvaluation::new(domain, values.to_vec()); + let eval = CpuCircleEvaluation::new(domain, values.to_vec()); let mut res = eval.interpolate().coeffs; let denorm = BaseField::from(domain.size()); res.iter_mut().for_each(|v| *v *= denorm); diff --git a/crates/prover/src/core/backend/simd/fft/rfft.rs b/crates/prover/src/core/backend/simd/fft/rfft.rs index 0239c4331..750d8cfed 100644 --- a/crates/prover/src/core/backend/simd/fft/rfft.rs +++ b/crates/prover/src/core/backend/simd/fft/rfft.rs @@ -574,7 +574,7 @@ mod tests { use super::{ fft, fft3, fft_lower_with_vecwise, get_twiddle_dbls, simd_butterfly, vecwise_butterflies, }; - use crate::core::backend::cpu::CPUCirclePoly; + use crate::core::backend::cpu::CpuCirclePoly; use crate::core::backend::simd::column::BaseFieldVec; use crate::core::backend::simd::fft::{transpose_vecs, CACHED_FFT_LOG_SIZE}; use crate::core::backend::simd::m31::{PackedBaseField, LOG_N_LANES, N_LANES}; @@ -736,7 +736,7 @@ mod tests { } fn ground_truth_fft(domain: CircleDomain, values: &[BaseField]) -> Vec { - let poly = CPUCirclePoly::new(values.to_vec()); + let poly = CpuCirclePoly::new(values.to_vec()); poly.evaluate(domain).values } } diff --git a/crates/prover/src/core/backend/simd/fri.rs b/crates/prover/src/core/backend/simd/fri.rs index 717795d5e..434b67a4b 100644 --- a/crates/prover/src/core/backend/simd/fri.rs +++ b/crates/prover/src/core/backend/simd/fri.rs @@ -160,7 +160,7 @@ mod tests { use crate::core::backend::simd::column::BaseFieldVec; use crate::core::backend::simd::SimdBackend; - use crate::core::backend::{CPUBackend, Column}; + use crate::core::backend::{Column, CpuBackend}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; use crate::core::fields::secure_column::SecureColumn; @@ -176,10 +176,10 @@ mod tests { let values = (0..1 << LOG_SIZE).map(|_| rng.gen()).collect_vec(); let alpha = qm31!(1, 3, 5, 7); let domain = LineDomain::new(CanonicCoset::new(LOG_SIZE + 1).half_coset()); - let cpu_fold = CPUBackend::fold_line( + let cpu_fold = CpuBackend::fold_line( &LineEvaluation::new(domain, values.iter().copied().collect()), alpha, - &CPUBackend::precompute_twiddles(domain.coset()), + &CpuBackend::precompute_twiddles(domain.coset()), ); let avx_fold = SimdBackend::fold_line( @@ -202,14 +202,14 @@ mod tests { let line_domain = LineDomain::new(circle_domain.half_coset); let mut cpu_fold = LineEvaluation::new(line_domain, SecureColumn::zeros(1 << (LOG_SIZE - 1))); - CPUBackend::fold_circle_into_line( + CpuBackend::fold_circle_into_line( &mut cpu_fold, &SecureEvaluation { domain: circle_domain, values: values.iter().copied().collect(), }, alpha, - &CPUBackend::precompute_twiddles(line_domain.coset()), + &CpuBackend::precompute_twiddles(line_domain.coset()), ); let mut simd_fold = @@ -250,11 +250,11 @@ mod tests { domain, values: avx_column.clone(), }; - let cpu_eval = SecureEvaluation:: { + let cpu_eval = SecureEvaluation:: { domain, values: avx_eval.to_cpu(), }; - let (cpu_g, cpu_lambda) = CPUBackend::decompose(&cpu_eval); + let (cpu_g, cpu_lambda) = CpuBackend::decompose(&cpu_eval); let (avx_g, avx_lambda) = SimdBackend::decompose(&avx_eval); diff --git a/crates/prover/src/core/backend/simd/quotients.rs b/crates/prover/src/core/backend/simd/quotients.rs index 0596e2389..28f4d3716 100644 --- a/crates/prover/src/core/backend/simd/quotients.rs +++ b/crates/prover/src/core/backend/simd/quotients.rs @@ -172,7 +172,7 @@ mod tests { use crate::core::backend::simd::column::BaseFieldVec; use crate::core::backend::simd::SimdBackend; - use crate::core::backend::{CPUBackend, Column}; + use crate::core::backend::{Column, CpuBackend}; use crate::core::circle::SECURE_FIELD_CIRCLE_GEN; use crate::core::fields::m31::BaseField; use crate::core::pcs::quotients::{ColumnSampleBatch, QuotientOps}; @@ -200,13 +200,13 @@ mod tests { let cpu_columns = columns .iter() .map(|c| { - CircleEvaluation::::new( + CircleEvaluation::::new( c.domain, c.values.to_cpu(), ) }) .collect::>(); - let cpu_result = CPUBackend::accumulate_quotients( + let cpu_result = CpuBackend::accumulate_quotients( domain, &cpu_columns.iter().collect_vec(), random_coeff, diff --git a/crates/prover/src/core/constraints.rs b/crates/prover/src/core/constraints.rs index 0eadd8d68..45e4db625 100644 --- a/crates/prover/src/core/constraints.rs +++ b/crates/prover/src/core/constraints.rs @@ -129,7 +129,7 @@ mod tests { use num_traits::Zero; use super::{coset_vanishing, point_excluder, point_vanishing}; - use crate::core::backend::cpu::{CPUCircleEvaluation, CPUCirclePoly}; + use crate::core::backend::cpu::{CpuCircleEvaluation, CpuCirclePoly}; use crate::core::circle::{CirclePoint, CirclePointIndex, Coset}; use crate::core::constraints::{complex_conjugate_line, pair_vanishing}; use crate::core::fields::m31::{BaseField, M31}; @@ -210,7 +210,7 @@ mod tests { #[test] fn test_complex_conjugate_symmetry() { // Create a polynomial over a base circle domain. - let polynomial = CPUCirclePoly::new((0..1 << 7).map(|i| m31!(i)).collect()); + let polynomial = CpuCirclePoly::new((0..1 << 7).map(|i| m31!(i)).collect()); let oods_point = CirclePoint::get_point(9834759221); // Assert that the base field polynomial is complex conjugate symmetric. @@ -225,7 +225,7 @@ mod tests { // Create a polynomial over a circle domain. let log_domain_size = 7; let domain_size = 1 << log_domain_size; - let polynomial = CPUCirclePoly::new((0..domain_size).map(|i| m31!(i)).collect()); + let polynomial = CpuCirclePoly::new((0..domain_size).map(|i| m31!(i)).collect()); // Create a larger domain. let log_large_domain_size = log_domain_size + 1; @@ -248,7 +248,7 @@ mod tests { ); quotient_polynomial_values.push(value); } - let quotient_evaluation = CPUCircleEvaluation::::new( + let quotient_evaluation = CpuCircleEvaluation::::new( large_domain, quotient_polynomial_values, ); diff --git a/crates/prover/src/core/fields/secure_column.rs b/crates/prover/src/core/fields/secure_column.rs index 00d3e4a99..d5c9767fd 100644 --- a/crates/prover/src/core/fields/secure_column.rs +++ b/crates/prover/src/core/fields/secure_column.rs @@ -1,7 +1,7 @@ use super::m31::BaseField; use super::qm31::SecureField; use super::{ExtensionOf, FieldOps}; -use crate::core::backend::{CPUBackend, Col, Column}; +use crate::core::backend::{Col, Column, CpuBackend}; use crate::core::utils::IteratorMutExt; pub const SECURE_EXTENSION_DEGREE: usize = @@ -13,7 +13,7 @@ pub const SECURE_EXTENSION_DEGREE: usize = pub struct SecureColumn> { pub columns: [Col; SECURE_EXTENSION_DEGREE], } -impl SecureColumn { +impl SecureColumn { pub fn set(&mut self, index: usize, value: SecureField) { self.columns .iter_mut() @@ -45,7 +45,7 @@ impl> SecureColumn { self.columns[0].is_empty() } - pub fn to_cpu(&self) -> SecureColumn { + pub fn to_cpu(&self) -> SecureColumn { SecureColumn { columns: self.columns.clone().map(|c| c.to_cpu()), } @@ -53,7 +53,7 @@ impl> SecureColumn { } pub struct SecureColumnIter<'a> { - column: &'a SecureColumn, + column: &'a SecureColumn, index: usize, } impl Iterator for SecureColumnIter<'_> { @@ -69,7 +69,7 @@ impl Iterator for SecureColumnIter<'_> { } } } -impl<'a> IntoIterator for &'a SecureColumn { +impl<'a> IntoIterator for &'a SecureColumn { type Item = SecureField; type IntoIter = SecureColumnIter<'a>; @@ -80,7 +80,7 @@ impl<'a> IntoIterator for &'a SecureColumn { } } } -impl FromIterator for SecureColumn { +impl FromIterator for SecureColumn { fn from_iter>(iter: I) -> Self { let mut columns = std::array::from_fn(|_| vec![]); for value in iter.into_iter() { @@ -92,8 +92,8 @@ impl FromIterator for SecureColumn { SecureColumn { columns } } } -impl From> for Vec { - fn from(column: SecureColumn) -> Self { +impl From> for Vec { + fn from(column: SecureColumn) -> Self { column.into_iter().collect() } } diff --git a/crates/prover/src/core/fri.rs b/crates/prover/src/core/fri.rs index 334d6da2f..2d4b4fe90 100644 --- a/crates/prover/src/core/fri.rs +++ b/crates/prover/src/core/fri.rs @@ -9,7 +9,7 @@ use num_traits::Zero; use thiserror::Error; use tracing::{span, Level}; -use super::backend::CPUBackend; +use super::backend::CpuBackend; use super::channel::Channel; use super::fields::m31::BaseField; use super::fields::qm31::SecureField; @@ -503,7 +503,7 @@ impl FriVerifier { } /// Projects a polynomial to the fft space using the coefficient from the proof. - /// See [`CPUBackend::decompose`] for explanation about the decomposition. + /// See [`CpuBackend::decompose`] for explanation about the decomposition. /// NOTE: specific to when Blowup factor is 2. // TODO(Ohad): generalize this. fn project_to_fft_space( @@ -728,7 +728,7 @@ impl FriLayerVerifier { let sparse_evaluation = self.extract_evaluation(&queries, &evals_at_queries)?; // TODO: When leaf values are removed from the decommitment, also remove this block. - let actual_decommitment_evals: SecureColumn = sparse_evaluation + let actual_decommitment_evals: SecureColumn = sparse_evaluation .subline_evals .iter() .flat_map(|e| e.values.into_iter()) @@ -909,7 +909,7 @@ impl, H: MerkleHasher> FriLayerProver { /// Holds a foldable subset of circle polynomial evaluations. #[derive(Debug, Clone)] pub struct SparseCircleEvaluation { - subcircle_evals: Vec>, + subcircle_evals: Vec>, } impl SparseCircleEvaluation { @@ -917,7 +917,7 @@ impl SparseCircleEvaluation { /// /// Panics if the evaluation domain sizes don't equal the folding factor. pub fn new( - subcircle_evals: Vec>, + subcircle_evals: Vec>, ) -> Self { let folding_factor = 1 << CIRCLE_TO_LINE_FOLD_STEP; assert!(subcircle_evals.iter().all(|e| e.len() == folding_factor)); @@ -956,9 +956,9 @@ impl SparseCircleEvaluation { } impl<'a> IntoIterator for &'a mut SparseCircleEvaluation { - type Item = &'a mut CircleEvaluation; + type Item = &'a mut CircleEvaluation; type IntoIter = - std::slice::IterMut<'a, CircleEvaluation>; + std::slice::IterMut<'a, CircleEvaluation>; fn into_iter(self) -> Self::IntoIter { self.subcircle_evals.iter_mut() @@ -969,14 +969,14 @@ impl<'a> IntoIterator for &'a mut SparseCircleEvaluation { /// Evaluation is held at the CPU backend. #[derive(Debug, Clone)] struct SparseLineEvaluation { - subline_evals: Vec>, + subline_evals: Vec>, } impl SparseLineEvaluation { /// # Panics /// /// Panics if the evaluation domain sizes don't equal the folding factor. - fn new(subline_evals: Vec>) -> Self { + fn new(subline_evals: Vec>) -> Self { let folding_factor = 1 << FOLD_STEP; assert!(subline_evals.iter().all(|e| e.len() == folding_factor)); Self { subline_evals } @@ -993,9 +993,9 @@ impl SparseLineEvaluation { /// Folds a degree `d` polynomial into a degree `d/2` polynomial. /// See [`FriOps::fold_line`]. pub fn fold_line( - eval: &LineEvaluation, + eval: &LineEvaluation, alpha: SecureField, -) -> LineEvaluation { +) -> LineEvaluation { let n = eval.len(); assert!(n >= 2, "Evaluation too small"); @@ -1023,8 +1023,8 @@ pub fn fold_line( /// polynomial. /// See [`FriOps::fold_circle_into_line`]. pub fn fold_circle_into_line( - dst: &mut LineEvaluation, - src: &SecureEvaluation, + dst: &mut LineEvaluation, + src: &SecureEvaluation, alpha: SecureField, ) { assert_eq!(src.len() >> CIRCLE_TO_LINE_FOLD_STEP, dst.len()); @@ -1059,8 +1059,8 @@ mod tests { use num_traits::{One, Zero}; use super::{get_opening_positions, FriVerificationError, SparseCircleEvaluation}; - use crate::core::backend::cpu::{CPUCircleEvaluation, CPUCirclePoly}; - use crate::core::backend::{CPUBackend, Col, Column, ColumnOps}; + use crate::core::backend::cpu::{CpuCircleEvaluation, CpuCirclePoly}; + use crate::core::backend::{Col, Column, ColumnOps, CpuBackend}; use crate::core::circle::{CirclePointIndex, Coset}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; @@ -1082,7 +1082,7 @@ mod tests { /// Default blowup factor used for tests. const LOG_BLOWUP_FACTOR: u32 = 1; - type FriProver = super::FriProver; + type FriProver = super::FriProver; #[test] fn fold_line_works() { @@ -1104,12 +1104,12 @@ mod tests { .iter() .map(|p| poly.eval_at_point(p.into())) .collect(); - CPUBackend::bit_reverse_column(&mut values); + CpuBackend::bit_reverse_column(&mut values); let evals = LineEvaluation::new(domain, values.into_iter().collect()); let drp_evals = fold_line(&evals, alpha); let mut drp_evals = drp_evals.values.into_iter().collect_vec(); - CPUBackend::bit_reverse_column(&mut drp_evals); + CpuBackend::bit_reverse_column(&mut drp_evals); assert_eq!(drp_evals.len(), DEGREE / 2); for (i, (&drp_eval, x)) in zip(&drp_evals, drp_domain).enumerate() { @@ -1147,7 +1147,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); } @@ -1165,7 +1165,7 @@ mod tests { &mut test_channel(), FriConfig::new(2, 2, 3), &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); } @@ -1181,7 +1181,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let proof = prover.decommit_on_queries(&queries); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; @@ -1204,7 +1204,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let proof = prover.decommit_on_queries(&queries); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; @@ -1224,7 +1224,7 @@ mod tests { &mut test_channel(), config, &evaluations, - &CPUBackend::precompute_twiddles(evaluations[0].domain.half_coset), + &CpuBackend::precompute_twiddles(evaluations[0].domain.half_coset), ); let decommitment_values = evaluations.map(|p| query_polynomial(&p, &queries)).to_vec(); let proof = prover.decommit_on_queries(&queries); @@ -1244,7 +1244,7 @@ mod tests { &mut test_channel(), config, &evaluations, - &CPUBackend::precompute_twiddles(evaluations[0].domain.half_coset), + &CpuBackend::precompute_twiddles(evaluations[0].domain.half_coset), ); let (proof, prover_opening_positions) = prover.decommit(&mut test_channel()); let decommitment_values = zip(&evaluations, prover_opening_positions.values().rev()) @@ -1270,7 +1270,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let proof = prover.decommit_on_queries(&queries); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; @@ -1297,7 +1297,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let proof = prover.decommit_on_queries(&queries); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; @@ -1325,7 +1325,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; let mut proof = prover.decommit_on_queries(&queries); @@ -1353,7 +1353,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; let mut proof = prover.decommit_on_queries(&queries); @@ -1381,7 +1381,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; let mut proof = prover.decommit_on_queries(&queries); @@ -1408,7 +1408,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; let mut proof = prover.decommit_on_queries(&queries); @@ -1437,7 +1437,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let proof = prover.decommit_on_queries(&queries); let bound = vec![CirclePolyDegreeBound::new(LOG_DEGREE)]; @@ -1462,7 +1462,7 @@ mod tests { &mut test_channel(), config, &[evaluation.clone(), evaluation.clone()], - &CPUBackend::precompute_twiddles(evaluation.domain.half_coset), + &CpuBackend::precompute_twiddles(evaluation.domain.half_coset), ); let proof = prover.decommit_on_queries(&queries); let bound = vec![ @@ -1489,7 +1489,7 @@ mod tests { &mut test_channel(), config, &evaluations, - &CPUBackend::precompute_twiddles(evaluations[0].domain.half_coset), + &CpuBackend::precompute_twiddles(evaluations[0].domain.half_coset), ); let decommitment_values = evaluations.map(|p| query_polynomial(&p, &queries)).to_vec(); let proof = prover.decommit_on_queries(&queries); @@ -1505,8 +1505,8 @@ mod tests { fn polynomial_evaluation( log_degree: u32, log_blowup_factor: u32, - ) -> SecureEvaluation { - let poly = CPUCirclePoly::new(vec![BaseField::one(); 1 << log_degree]); + ) -> SecureEvaluation { + let poly = CpuCirclePoly::new(vec![BaseField::one(); 1 << log_degree]); let coset = Coset::half_odds(log_degree + log_blowup_factor - 1); let domain = CircleDomain::new(coset); let values = poly.evaluate(domain); @@ -1515,16 +1515,16 @@ mod tests { values: SecureColumn { columns: [ values.values, - Col::::zeros(1 << (log_degree + log_blowup_factor)), - Col::::zeros(1 << (log_degree + log_blowup_factor)), - Col::::zeros(1 << (log_degree + log_blowup_factor)), + Col::::zeros(1 << (log_degree + log_blowup_factor)), + Col::::zeros(1 << (log_degree + log_blowup_factor)), + Col::::zeros(1 << (log_degree + log_blowup_factor)), ], }, } } /// Returns the log degree bound of a polynomial. - fn log_degree_bound(polynomial: LineEvaluation) -> u32 { + fn log_degree_bound(polynomial: LineEvaluation) -> u32 { let coeffs = polynomial.interpolate().into_ordered_coefficients(); let degree = coeffs.into_iter().rposition(|c| !c.is_zero()).unwrap_or(0); (degree + 1).ilog2() @@ -1532,7 +1532,7 @@ mod tests { // TODO: Remove after SubcircleDomain integration. fn query_polynomial( - polynomial: &SecureEvaluation, + polynomial: &SecureEvaluation, queries: &Queries, ) -> SparseCircleEvaluation { let polynomial_log_size = polynomial.domain.log_size(); @@ -1542,7 +1542,7 @@ mod tests { } fn open_polynomial( - polynomial: &SecureEvaluation, + polynomial: &SecureEvaluation, positions: &SparseSubCircleDomain, ) -> SparseCircleEvaluation { let coset_evals = positions @@ -1559,7 +1559,7 @@ mod tests { }) .collect(); let coset_eval = - CPUCircleEvaluation::::new(coset_domain, evals); + CpuCircleEvaluation::::new(coset_domain, evals); coset_eval.bit_reverse() }) .collect(); @@ -1569,13 +1569,13 @@ mod tests { /// Returns an evaluation of a polynomial that is out of FFT-space but inside /// riemann-roch-space. - fn riemann_roch_polynomial_evaluation(log_domain_size: u32) -> SecureEvaluation { + fn riemann_roch_polynomial_evaluation(log_domain_size: u32) -> SecureEvaluation { let mut coeffs = vec![BaseField::zero(); 1 << log_domain_size]; let domain_log_half_size = log_domain_size - 1; // Polynomial is out of FFT space. coeffs[1 << domain_log_half_size] = m31!(1); coeffs[(1 << domain_log_half_size) - 1] = m31!(2); - let poly = CPUCirclePoly::new(coeffs); + let poly = CpuCirclePoly::new(coeffs); let domain = CanonicCoset::new(log_domain_size).circle_domain(); let values = poly.evaluate(domain); @@ -1584,9 +1584,9 @@ mod tests { values: SecureColumn { columns: [ values.values, - Col::::zeros(1 << log_domain_size), - Col::::zeros(1 << log_domain_size), - Col::::zeros(1 << log_domain_size), + Col::::zeros(1 << log_domain_size), + Col::::zeros(1 << log_domain_size), + Col::::zeros(1 << log_domain_size), ], }, } diff --git a/crates/prover/src/core/lookups/sumcheck.rs b/crates/prover/src/core/lookups/sumcheck.rs index 3be934bd5..b93b0dab2 100644 --- a/crates/prover/src/core/lookups/sumcheck.rs +++ b/crates/prover/src/core/lookups/sumcheck.rs @@ -203,7 +203,7 @@ mod tests { use num_traits::One; - use crate::core::backend::CPUBackend; + use crate::core::backend::CpuBackend; use crate::core::channel::{Blake2sChannel, Channel}; use crate::core::fields::qm31::SecureField; use crate::core::fields::Field; @@ -216,7 +216,7 @@ mod tests { fn sumcheck_works() { let values = test_channel().draw_felts(32); let claim = values.iter().sum(); - let mle = Mle::::new(values); + let mle = Mle::::new(values); let lambda = SecureField::one(); let (proof, ..) = prove_batch(vec![claim], vec![mle.clone()], lambda, &mut test_channel()); @@ -232,8 +232,8 @@ mod tests { let values1 = channel.draw_felts(32); let claim0 = values0.iter().sum(); let claim1 = values1.iter().sum(); - let mle0 = Mle::::new(values0.clone()); - let mle1 = Mle::::new(values1.clone()); + let mle0 = Mle::::new(values0.clone()); + let mle1 = Mle::::new(values1.clone()); let lambda = channel.draw_felt(); let claims = vec![claim0, claim1]; let mles = vec![mle0.clone(), mle1.clone()]; @@ -254,8 +254,8 @@ mod tests { let values1 = channel.draw_felts(32); let claim0 = values0.iter().sum(); let claim1 = values1.iter().sum(); - let mle0 = Mle::::new(values0.clone()); - let mle1 = Mle::::new(values1.clone()); + let mle0 = Mle::::new(values0.clone()); + let mle1 = Mle::::new(values1.clone()); let lambda = channel.draw_felt(); let claims = vec![claim0, claim1]; let mles = vec![mle0.clone(), mle1.clone()]; @@ -278,7 +278,7 @@ mod tests { let mut invalid_values = values; invalid_values[0] += SecureField::one(); let invalid_claim = vec![invalid_values.iter().sum::()]; - let invalid_mle = vec![Mle::::new(invalid_values.clone())]; + let invalid_mle = vec![Mle::::new(invalid_values.clone())]; let (invalid_proof, ..) = prove_batch(invalid_claim, invalid_mle, lambda, &mut test_channel()); diff --git a/crates/prover/src/core/pcs/quotients.rs b/crates/prover/src/core/pcs/quotients.rs index 6e19199fc..03f5e989e 100644 --- a/crates/prover/src/core/pcs/quotients.rs +++ b/crates/prover/src/core/pcs/quotients.rs @@ -178,7 +178,7 @@ pub fn fri_answers_for_log_size( #[cfg(test)] mod tests { - use crate::core::backend::cpu::{CPUCircleEvaluation, CPUCirclePoly}; + use crate::core::backend::cpu::{CpuCircleEvaluation, CpuCirclePoly}; use crate::core::circle::SECURE_FIELD_CIRCLE_GEN; use crate::core::pcs::quotients::{compute_fri_quotients, PointSample}; use crate::core::poly::circle::CanonicCoset; @@ -187,7 +187,7 @@ mod tests { #[test] fn test_quotients_are_low_degree() { const LOG_SIZE: u32 = 7; - let polynomial = CPUCirclePoly::new((0..1 << LOG_SIZE).map(|i| m31!(i)).collect()); + let polynomial = CpuCirclePoly::new((0..1 << LOG_SIZE).map(|i| m31!(i)).collect()); let eval_domain = CanonicCoset::new(LOG_SIZE + 1).circle_domain(); let eval = polynomial.evaluate(eval_domain); let point = SECURE_FIELD_CIRCLE_GEN; @@ -198,7 +198,7 @@ mod tests { .pop() .unwrap(); let quot_poly_base_field = - CPUCircleEvaluation::new(eval_domain, quot_eval.values.columns[0].clone()) + CpuCircleEvaluation::new(eval_domain, quot_eval.values.columns[0].clone()) .interpolate(); assert!(quot_poly_base_field.is_in_fri_space(LOG_SIZE)); } diff --git a/crates/prover/src/core/poly/circle/evaluation.rs b/crates/prover/src/core/poly/circle/evaluation.rs index 285d52aa6..ff067c190 100644 --- a/crates/prover/src/core/poly/circle/evaluation.rs +++ b/crates/prover/src/core/poly/circle/evaluation.rs @@ -4,7 +4,7 @@ use std::ops::{Deref, Index}; use derivative::Derivative; use super::{CanonicCoset, CircleDomain, CirclePoly, PolyOps}; -use crate::core::backend::cpu::CPUCircleEvaluation; +use crate::core::backend::cpu::CpuCircleEvaluation; use crate::core::backend::{Col, Column}; use crate::core::circle::{CirclePointIndex, Coset}; use crate::core::fields::m31::BaseField; @@ -49,7 +49,7 @@ impl, B: FieldOps> CircleEvaluation> CPUCircleEvaluation { +impl> CpuCircleEvaluation { pub fn fetch_eval_on_coset(&self, coset: Coset) -> CosetSubEvaluation<'_, F> { assert!(coset.log_size() <= self.domain.half_coset.log_size()); if let Some(offset) = self.domain.half_coset.find(coset.initial_index) { @@ -155,7 +155,7 @@ impl<'a, F: ExtensionOf> Index for CosetSubEvaluation<'a, F> { #[cfg(test)] mod tests { - use crate::core::backend::cpu::CPUCircleEvaluation; + use crate::core::backend::cpu::CpuCircleEvaluation; use crate::core::circle::Coset; use crate::core::fields::m31::BaseField; use crate::core::poly::circle::CanonicCoset; @@ -166,7 +166,7 @@ mod tests { fn test_interpolate_non_canonic() { let domain = CanonicCoset::new(3).circle_domain(); assert_eq!(domain.log_size(), 3); - let evaluation = CPUCircleEvaluation::<_, NaturalOrder>::new( + let evaluation = CpuCircleEvaluation::<_, NaturalOrder>::new( domain, (0..8).map(BaseField::from_u32_unchecked).collect(), ) @@ -180,7 +180,7 @@ mod tests { #[test] fn test_interpolate_canonic() { let coset = CanonicCoset::new(3); - let evaluation = CPUCircleEvaluation::new_canonical_ordered( + let evaluation = CpuCircleEvaluation::new_canonical_ordered( coset, (0..8).map(BaseField::from_u32_unchecked).collect(), ); @@ -194,7 +194,7 @@ mod tests { pub fn test_get_at_circle_evaluation() { let domain = CanonicCoset::new(7).circle_domain(); let values = (0..domain.size()).map(|i| m31!(i as u32)).collect(); - let circle_evaluation = CPUCircleEvaluation::<_, NaturalOrder>::new(domain, values); + let circle_evaluation = CpuCircleEvaluation::<_, NaturalOrder>::new(domain, values); let bit_reversed_circle_evaluation = circle_evaluation.clone().bit_reverse(); for index in domain.iter_indices() { assert_eq!( @@ -208,7 +208,7 @@ mod tests { fn test_sub_evaluation() { let domain = CanonicCoset::new(7).circle_domain(); let values = (0..domain.size()).map(|i| m31!(i as u32)).collect(); - let circle_evaluation = CPUCircleEvaluation::new(domain, values); + let circle_evaluation = CpuCircleEvaluation::new(domain, values); let coset = Coset::new(domain.index_at(17), 3); let sub_eval = circle_evaluation.fetch_eval_on_coset(coset); for i in 0..coset.size() { diff --git a/crates/prover/src/core/poly/circle/mod.rs b/crates/prover/src/core/poly/circle/mod.rs index 76973d3d1..f2532d5bf 100644 --- a/crates/prover/src/core/poly/circle/mod.rs +++ b/crates/prover/src/core/poly/circle/mod.rs @@ -15,7 +15,7 @@ pub use secure_poly::{SecureCirclePoly, SecureEvaluation}; #[cfg(test)] mod tests { use super::CanonicCoset; - use crate::core::backend::cpu::CPUCircleEvaluation; + use crate::core::backend::cpu::CpuCircleEvaluation; use crate::core::fields::m31::BaseField; use crate::core::utils::bit_reverse_index; @@ -24,7 +24,7 @@ mod tests { let domain = CanonicCoset::new(3).circle_domain(); assert_eq!(domain.log_size(), 3); let evaluation = - CPUCircleEvaluation::new(domain, (0..8).map(BaseField::from_u32_unchecked).collect()); + CpuCircleEvaluation::new(domain, (0..8).map(BaseField::from_u32_unchecked).collect()); let poly = evaluation.clone().interpolate(); let evaluation2 = poly.evaluate(domain); assert_eq!(evaluation.values, evaluation2.values); diff --git a/crates/prover/src/core/poly/circle/poly.rs b/crates/prover/src/core/poly/circle/poly.rs index ef9e420d4..c10fc5e7a 100644 --- a/crates/prover/src/core/poly/circle/poly.rs +++ b/crates/prover/src/core/poly/circle/poly.rs @@ -67,7 +67,7 @@ impl CirclePoly { } #[cfg(test)] -impl crate::core::backend::cpu::CPUCirclePoly { +impl crate::core::backend::cpu::CpuCirclePoly { pub fn is_in_fft_space(&self, log_fft_size: u32) -> bool { use num_traits::Zero; @@ -100,13 +100,13 @@ impl crate::core::backend::cpu::CPUCirclePoly { #[cfg(test)] mod tests { - use crate::core::backend::cpu::CPUCirclePoly; + use crate::core::backend::cpu::CpuCirclePoly; use crate::core::circle::CirclePoint; use crate::core::fields::m31::BaseField; #[test] fn test_circle_poly_extend() { - let poly = CPUCirclePoly::new((0..16).map(BaseField::from_u32_unchecked).collect()); + let poly = CpuCirclePoly::new((0..16).map(BaseField::from_u32_unchecked).collect()); let extended = poly.clone().extend(8); let random_point = CirclePoint::get_point(21903); diff --git a/crates/prover/src/core/poly/circle/secure_poly.rs b/crates/prover/src/core/poly/circle/secure_poly.rs index 0a71c4433..f9ff38107 100644 --- a/crates/prover/src/core/poly/circle/secure_poly.rs +++ b/crates/prover/src/core/poly/circle/secure_poly.rs @@ -1,8 +1,8 @@ use std::ops::{Deref, DerefMut}; use super::{CircleDomain, CircleEvaluation, CirclePoly, PolyOps}; -use crate::core::backend::cpu::CPUCircleEvaluation; -use crate::core::backend::CPUBackend; +use crate::core::backend::cpu::CpuCircleEvaluation; +use crate::core::backend::CpuBackend; use crate::core::circle::CirclePoint; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; @@ -71,17 +71,17 @@ impl> DerefMut for SecureEvaluation { } } -impl SecureEvaluation { +impl SecureEvaluation { // TODO(spapini): Remove when we no longer use CircleEvaluation. - pub fn to_cpu(self) -> CPUCircleEvaluation { - CPUCircleEvaluation::new(self.domain, self.values.to_vec()) + pub fn to_cpu(self) -> CpuCircleEvaluation { + CpuCircleEvaluation::new(self.domain, self.values.to_vec()) } } -impl From> - for SecureEvaluation +impl From> + for SecureEvaluation { - fn from(evaluation: CircleEvaluation) -> Self { + fn from(evaluation: CircleEvaluation) -> Self { Self { domain: evaluation.domain, values: evaluation.values.into_iter().collect(), diff --git a/crates/prover/src/core/poly/line.rs b/crates/prover/src/core/poly/line.rs index 9baf936ac..7215f5ef0 100644 --- a/crates/prover/src/core/poly/line.rs +++ b/crates/prover/src/core/poly/line.rs @@ -8,7 +8,7 @@ use num_traits::Zero; use super::circle::CircleDomain; use super::utils::fold; -use crate::core::backend::{CPUBackend, ColumnOps}; +use crate::core::backend::{ColumnOps, CpuBackend}; use crate::core::circle::{CirclePoint, Coset, CosetIterator}; use crate::core::fft::ibutterfly; use crate::core::fields::m31::BaseField; @@ -217,16 +217,16 @@ impl> LineEvaluation { } /// Clones the values into a new line evaluation in the CPU. - pub fn to_cpu(&self) -> LineEvaluation { + pub fn to_cpu(&self) -> LineEvaluation { LineEvaluation::new(self.domain, self.values.to_cpu()) } } -impl LineEvaluation { +impl LineEvaluation { /// Interpolates the polynomial as evaluations on `domain`. pub fn interpolate(self) -> LinePoly { let mut values = self.values.into_iter().collect_vec(); - CPUBackend::bit_reverse_column(&mut values); + CpuBackend::bit_reverse_column(&mut values); line_ifft(&mut values, self.domain); // Normalize the coefficients. let len_inv = BaseField::from(values.len()).inverse(); @@ -273,12 +273,12 @@ fn line_ifft>(values: &mut [F], mut domain: LineDomain #[cfg(test)] mod tests { - type B = CPUBackend; + type B = CpuBackend; use itertools::Itertools; use super::LineDomain; - use crate::core::backend::{CPUBackend, ColumnOps}; + use crate::core::backend::{ColumnOps, CpuBackend}; use crate::core::circle::{CirclePoint, Coset}; use crate::core::fields::m31::BaseField; use crate::core::poly::line::{LineEvaluation, LinePoly}; @@ -375,7 +375,7 @@ mod tests { + poly.coeffs[3] * pi_x * x }) .collect_vec(); - CPUBackend::bit_reverse_column(&mut values); + CpuBackend::bit_reverse_column(&mut values); let evals = LineEvaluation::::new(domain, values.into_iter().collect()); let interpolated_poly = evals.interpolate(); diff --git a/crates/prover/src/core/prover/mod.rs b/crates/prover/src/core/prover/mod.rs index 68f100ae9..3d0505832 100644 --- a/crates/prover/src/core/prover/mod.rs +++ b/crates/prover/src/core/prover/mod.rs @@ -10,7 +10,7 @@ use super::poly::circle::{CanonicCoset, SecureCirclePoly, MAX_CIRCLE_DOMAIN_LOG_ use super::proof_of_work::ProofOfWorkVerificationError; use super::ColumnVec; use crate::core::air::{Air, AirExt, AirProverExt}; -use crate::core::backend::CPUBackend; +use crate::core::backend::CpuBackend; use crate::core::channel::{Blake2sChannel, Channel as ChannelTrait}; use crate::core::circle::CirclePoint; use crate::core::fields::m31::BaseField; @@ -45,7 +45,7 @@ pub struct AdditionalProofData { pub composition_polynomial_oods_value: SecureField, pub composition_polynomial_random_coeff: SecureField, pub oods_point: CirclePoint, - pub oods_quotients: Vec>, + pub oods_quotients: Vec>, } pub fn prove>( @@ -198,7 +198,7 @@ fn sampled_values_to_mask( ) -> Result<(ComponentVec>, SecureField), InvalidOodsSampleStructure> { let composition_partial_sampled_values = sampled_values.pop().ok_or(InvalidOodsSampleStructure)?; - let composition_oods_value = SecureCirclePoly::::eval_from_partial_evals( + let composition_oods_value = SecureCirclePoly::::eval_from_partial_evals( composition_partial_sampled_values .iter() .flatten() @@ -270,8 +270,8 @@ mod tests { use crate::core::air::accumulation::{DomainEvaluationAccumulator, PointEvaluationAccumulator}; use crate::core::air::{Air, AirProver, Component, ComponentProver, ComponentTrace}; - use crate::core::backend::cpu::CPUCircleEvaluation; - use crate::core::backend::CPUBackend; + use crate::core::backend::cpu::CpuCircleEvaluation; + use crate::core::backend::CpuBackend; use crate::core::circle::{CirclePoint, CirclePointIndex, Coset}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; @@ -280,7 +280,7 @@ mod tests { use crate::core::test_utils::test_channel; use crate::qm31; - struct TestAir> { + struct TestAir> { component: C, } @@ -290,8 +290,8 @@ mod tests { } } - impl AirProver for TestAir { - fn prover_components(&self) -> Vec<&dyn ComponentProver> { + impl AirProver for TestAir { + fn prover_components(&self) -> Vec<&dyn ComponentProver> { vec![&self.component] } } @@ -331,11 +331,11 @@ mod tests { } } - impl ComponentProver for TestComponent { + impl ComponentProver for TestComponent { fn evaluate_constraint_quotients_on_domain( &self, - _trace: &ComponentTrace<'_, CPUBackend>, - _evaluation_accumulator: &mut DomainEvaluationAccumulator, + _trace: &ComponentTrace<'_, CpuBackend>, + _evaluation_accumulator: &mut DomainEvaluationAccumulator, ) { // Does nothing. } @@ -357,7 +357,7 @@ mod tests { LOG_DOMAIN_SIZE - 1, )); let values = vec![BaseField::zero(); 1 << LOG_DOMAIN_SIZE]; - let trace = vec![CPUCircleEvaluation::new(domain, values)]; + let trace = vec![CpuCircleEvaluation::new(domain, values)]; let proof_error = prove(&air, &mut test_channel(), trace).unwrap_err(); assert!(matches!( @@ -384,7 +384,7 @@ mod tests { LOG_DOMAIN_SIZE - 1, )); let values = vec![BaseField::zero(); 1 << LOG_DOMAIN_SIZE]; - let trace = vec![CPUCircleEvaluation::new(domain, values)]; + let trace = vec![CpuCircleEvaluation::new(domain, values)]; let proof_error = prove(&air, &mut test_channel(), trace).unwrap_err(); assert!(matches!( @@ -406,7 +406,7 @@ mod tests { }; let domain = CanonicCoset::new(LOG_DOMAIN_SIZE).circle_domain(); let values = vec![BaseField::zero(); 1 << LOG_DOMAIN_SIZE]; - let trace = vec![CPUCircleEvaluation::new(domain, values)]; + let trace = vec![CpuCircleEvaluation::new(domain, values)]; let proof = prove(&air, &mut test_channel(), trace).unwrap_err(); assert!(matches!(proof, ProvingError::ConstraintsNotSatisfied)); diff --git a/crates/prover/src/core/test_utils.rs b/crates/prover/src/core/test_utils.rs index 65d1e22f3..083aa88ed 100644 --- a/crates/prover/src/core/test_utils.rs +++ b/crates/prover/src/core/test_utils.rs @@ -1,13 +1,13 @@ -use super::backend::cpu::CPUCircleEvaluation; +use super::backend::cpu::CpuCircleEvaluation; use super::channel::Blake2sChannel; use super::fields::m31::BaseField; use super::fields::qm31::SecureField; use crate::core::channel::Channel; pub fn secure_eval_to_base_eval( - eval: &CPUCircleEvaluation, -) -> CPUCircleEvaluation { - CPUCircleEvaluation::new( + eval: &CpuCircleEvaluation, +) -> CpuCircleEvaluation { + CpuCircleEvaluation::new( eval.domain, eval.values.iter().map(|x| x.to_m31_array()[0]).collect(), ) diff --git a/crates/prover/src/core/vcs/blake2_merkle.rs b/crates/prover/src/core/vcs/blake2_merkle.rs index 6efc9ebfd..f2725d3d4 100644 --- a/crates/prover/src/core/vcs/blake2_merkle.rs +++ b/crates/prover/src/core/vcs/blake2_merkle.rs @@ -46,7 +46,7 @@ mod tests { use rand::rngs::SmallRng; use rand::{Rng, SeedableRng}; - use crate::core::backend::CPUBackend; + use crate::core::backend::CpuBackend; use crate::core::fields::m31::BaseField; use crate::core::vcs::blake2_merkle::{Blake2sHash, Blake2sMerkleHasher}; use crate::core::vcs::prover::{MerkleDecommitment, MerkleProver}; @@ -76,7 +76,7 @@ mod tests { }) .collect_vec(); let merkle = - MerkleProver::::commit(cols.iter().collect_vec()); + MerkleProver::::commit(cols.iter().collect_vec()); let mut queries = BTreeMap::>::new(); for log_size in log_size_range.rev() { diff --git a/crates/prover/src/examples/fibonacci/air.rs b/crates/prover/src/examples/fibonacci/air.rs index 377218a8f..c76ba1f79 100644 --- a/crates/prover/src/examples/fibonacci/air.rs +++ b/crates/prover/src/examples/fibonacci/air.rs @@ -2,7 +2,7 @@ use itertools::{zip_eq, Itertools}; use super::component::FibonacciComponent; use crate::core::air::{Air, AirProver, Component, ComponentProver}; -use crate::core::backend::CPUBackend; +use crate::core::backend::CpuBackend; use crate::core::fields::m31::BaseField; pub struct FibonacciAir { @@ -19,8 +19,8 @@ impl Air for FibonacciAir { vec![&self.component] } } -impl AirProver for FibonacciAir { - fn prover_components(&self) -> Vec<&dyn ComponentProver> { +impl AirProver for FibonacciAir { + fn prover_components(&self) -> Vec<&dyn ComponentProver> { vec![&self.component] } } @@ -45,11 +45,11 @@ impl Air for MultiFibonacciAir { .collect_vec() } } -impl AirProver for MultiFibonacciAir { - fn prover_components(&self) -> Vec<&dyn ComponentProver> { +impl AirProver for MultiFibonacciAir { + fn prover_components(&self) -> Vec<&dyn ComponentProver> { self.components .iter() - .map(|c| c as &dyn ComponentProver) + .map(|c| c as &dyn ComponentProver) .collect_vec() } } diff --git a/crates/prover/src/examples/fibonacci/component.rs b/crates/prover/src/examples/fibonacci/component.rs index f9a9f5c32..6cdd280f9 100644 --- a/crates/prover/src/examples/fibonacci/component.rs +++ b/crates/prover/src/examples/fibonacci/component.rs @@ -5,7 +5,7 @@ use num_traits::One; use crate::core::air::accumulation::{DomainEvaluationAccumulator, PointEvaluationAccumulator}; use crate::core::air::mask::shifted_mask_points; use crate::core::air::{Component, ComponentProver, ComponentTrace}; -use crate::core::backend::CPUBackend; +use crate::core::backend::CpuBackend; use crate::core::circle::{CirclePoint, Coset}; use crate::core::constraints::{coset_vanishing, pair_vanishing}; use crate::core::fields::m31::BaseField; @@ -112,11 +112,11 @@ impl Component for FibonacciComponent { } } -impl ComponentProver for FibonacciComponent { +impl ComponentProver for FibonacciComponent { fn evaluate_constraint_quotients_on_domain( &self, - trace: &ComponentTrace<'_, CPUBackend>, - evaluation_accumulator: &mut DomainEvaluationAccumulator, + trace: &ComponentTrace<'_, CpuBackend>, + evaluation_accumulator: &mut DomainEvaluationAccumulator, ) { let poly = &trace.polys[0]; let trace_domain = CanonicCoset::new(self.log_size); diff --git a/crates/prover/src/examples/fibonacci/mod.rs b/crates/prover/src/examples/fibonacci/mod.rs index e4c6a1778..3d9da9c04 100644 --- a/crates/prover/src/examples/fibonacci/mod.rs +++ b/crates/prover/src/examples/fibonacci/mod.rs @@ -4,7 +4,7 @@ use num_traits::One; use self::air::{FibonacciAir, MultiFibonacciAir}; use self::component::FibonacciComponent; -use crate::core::backend::cpu::CPUCircleEvaluation; +use crate::core::backend::cpu::CpuCircleEvaluation; use crate::core::channel::{Blake2sChannel, Channel}; use crate::core::fields::m31::BaseField; use crate::core::fields::{FieldExpOps, IntoSlice}; @@ -29,7 +29,7 @@ impl Fibonacci { } } - pub fn get_trace(&self) -> CPUCircleEvaluation { + 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. @@ -85,7 +85,7 @@ impl MultiFibonacci { } } - pub fn get_trace(&self) -> Vec> { + pub fn get_trace(&self) -> Vec> { zip(&self.log_sizes, &self.claims) .map(|(log_size, claim)| { let fib = Fibonacci::new(*log_size, *claim); diff --git a/crates/prover/src/examples/wide_fibonacci/constraint_eval.rs b/crates/prover/src/examples/wide_fibonacci/constraint_eval.rs index cb3b8c9f1..8b488a2ea 100644 --- a/crates/prover/src/examples/wide_fibonacci/constraint_eval.rs +++ b/crates/prover/src/examples/wide_fibonacci/constraint_eval.rs @@ -5,7 +5,7 @@ use super::component::{Input, WideFibAir, WideFibComponent}; use super::trace_gen::write_trace_row; use crate::core::air::accumulation::DomainEvaluationAccumulator; use crate::core::air::{AirProver, Component, ComponentProver, ComponentTrace}; -use crate::core::backend::{CPUBackend, Column}; +use crate::core::backend::{Column, CpuBackend}; use crate::core::constraints::coset_vanishing; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::SecureField; @@ -17,17 +17,17 @@ use crate::examples::wide_fibonacci::component::LOG_N_COLUMNS; // TODO(AlonH): Rename file to `cpu.rs`. -impl AirProver for WideFibAir { - fn prover_components(&self) -> Vec<&dyn ComponentProver> { +impl AirProver for WideFibAir { + fn prover_components(&self) -> Vec<&dyn ComponentProver> { vec![&self.component] } } -impl ComponentProver for WideFibComponent { +impl ComponentProver for WideFibComponent { fn evaluate_constraint_quotients_on_domain( &self, - trace: &ComponentTrace<'_, CPUBackend>, - evaluation_accumulator: &mut DomainEvaluationAccumulator, + trace: &ComponentTrace<'_, CpuBackend>, + evaluation_accumulator: &mut DomainEvaluationAccumulator, ) { let max_constraint_degree = self.max_constraint_log_degree_bound(); let trace_eval_domain = CanonicCoset::new(max_constraint_degree).circle_domain(); diff --git a/crates/prover/src/examples/wide_fibonacci/mod.rs b/crates/prover/src/examples/wide_fibonacci/mod.rs index 0ceba23a6..cded94425 100644 --- a/crates/prover/src/examples/wide_fibonacci/mod.rs +++ b/crates/prover/src/examples/wide_fibonacci/mod.rs @@ -12,8 +12,8 @@ mod tests { use super::constraint_eval::gen_trace; use crate::core::air::accumulation::DomainEvaluationAccumulator; use crate::core::air::{Component, ComponentProver, ComponentTrace}; - use crate::core::backend::cpu::CPUCircleEvaluation; - use crate::core::backend::CPUBackend; + use crate::core::backend::cpu::CpuCircleEvaluation; + use crate::core::backend::CpuBackend; use crate::core::channel::{Blake2sChannel, Channel}; use crate::core::fields::m31::BaseField; use crate::core::fields::qm31::QM31; @@ -138,7 +138,7 @@ mod tests { let trace_domain = CanonicCoset::new(wide_fib.log_column_size()); let trace = trace .into_iter() - .map(|col| CPUCircleEvaluation::new_canonical_ordered(trace_domain, col)) + .map(|col| CpuCircleEvaluation::new_canonical_ordered(trace_domain, col)) .collect_vec(); let trace_polys = trace .into_iter() @@ -188,12 +188,12 @@ mod tests { let trace_domain = CanonicCoset::new(component.log_column_size()).circle_domain(); let trace = trace .into_iter() - .map(|eval| CPUCircleEvaluation::<_, BitReversedOrder>::new(trace_domain, eval)) + .map(|eval| CpuCircleEvaluation::<_, BitReversedOrder>::new(trace_domain, eval)) .collect_vec(); let air = WideFibAir { component }; let prover_channel = &mut Blake2sChannel::new(Blake2sHasher::hash(BaseField::into_slice(&[]))); - let proof = prove::(&air, prover_channel, trace).unwrap(); + let proof = prove::(&air, prover_channel, trace).unwrap(); let verifier_channel = &mut Blake2sChannel::new(Blake2sHasher::hash(BaseField::into_slice(&[])));