From 4693009e22524741ba3db6392b836881f4a1b249 Mon Sep 17 00:00:00 2001 From: Ohad Agadi Date: Mon, 23 Dec 2024 11:58:26 +0200 Subject: [PATCH] trace to evals --- crates/air_utils/src/trace/component_trace.rs | 15 ++++++++++----- crates/air_utils/src/trace/examle_lookup_data.rs | 2 +- crates/air_utils/src/trace/mod.rs | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/air_utils/src/trace/component_trace.rs b/crates/air_utils/src/trace/component_trace.rs index 4ad0e67cd..8a3c10f36 100644 --- a/crates/air_utils/src/trace/component_trace.rs +++ b/crates/air_utils/src/trace/component_trace.rs @@ -1,11 +1,9 @@ use bytemuck::Zeroable; -use itertools::Itertools; -use rayon::iter::plumbing::{bridge, Consumer, Producer, ProducerCallback, UnindexedConsumer}; -use rayon::prelude::*; +use stwo_prover::core::backend::simd::column::BaseColumn; use stwo_prover::core::backend::simd::m31::{PackedM31, LOG_N_LANES, N_LANES}; use stwo_prover::core::backend::simd::SimdBackend; use stwo_prover::core::fields::m31::M31; -use stwo_prover::core::poly::circle::CircleEvaluation; +use stwo_prover::core::poly::circle::{CanonicCoset, CircleEvaluation}; use stwo_prover::core::poly::BitReversedOrder; use super::row_iterator::{ParRowIterMut, RowIterMut}; @@ -82,7 +80,14 @@ impl ComponentTrace { } pub fn to_evals(self) -> [CircleEvaluation; N] { - todo!() + let domain = CanonicCoset::new(self.log_size).circle_domain(); + self.data.map(|column| { + let eval = BaseColumn { + data: column, + length: 1 << self.log_size, + }; + CircleEvaluation::::new(domain, eval) + }) } pub fn row_at(&self, row: usize) -> [M31; N] { diff --git a/crates/air_utils/src/trace/examle_lookup_data.rs b/crates/air_utils/src/trace/examle_lookup_data.rs index 9436071bc..31fc9ea95 100644 --- a/crates/air_utils/src/trace/examle_lookup_data.rs +++ b/crates/air_utils/src/trace/examle_lookup_data.rs @@ -171,8 +171,8 @@ mod tests { use stwo_prover::core::backend::simd::m31::{PackedM31, N_LANES}; use stwo_prover::core::fields::m31::M31; - use crate::trace::examle_lookup_data::LookupData; use crate::trace::component_trace::ComponentTrace; + use crate::trace::examle_lookup_data::LookupData; #[test] fn test_lookup_data() { diff --git a/crates/air_utils/src/trace/mod.rs b/crates/air_utils/src/trace/mod.rs index 0f981ff3d..d8e9bd094 100644 --- a/crates/air_utils/src/trace/mod.rs +++ b/crates/air_utils/src/trace/mod.rs @@ -1,3 +1,3 @@ pub mod component_trace; -mod row_iterator; pub mod examle_lookup_data; +mod row_iterator;