Skip to content

Commit

Permalink
Merge TraceLayout into TraceInfo (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer authored and irakliyk committed May 9, 2024
1 parent 0952575 commit 0513a99
Show file tree
Hide file tree
Showing 19 changed files with 323 additions and 424 deletions.
4 changes: 2 additions & 2 deletions air/src/air/boundary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ impl<E: FieldElement> BoundaryConstraints<E> {
);

let trace_length = context.trace_info.length();
let main_trace_width = context.trace_info.layout().main_trace_width();
let aux_trace_width = context.trace_info.layout().aux_trace_width();
let main_trace_width = context.trace_info.main_trace_width();
let aux_trace_width = context.trace_info.aux_trace_width();

// make sure the assertions are valid in the context of their respective trace segments;
// also, sort the assertions in the deterministic order so that changing the order of
Expand Down
11 changes: 2 additions & 9 deletions air/src/air/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crypto::{RandomCoin, RandomCoinError};
use math::{fft, ExtensibleField, ExtensionOf, FieldElement, StarkField, ToElements};

mod trace_info;
pub use trace_info::{TraceInfo, TraceLayout};
pub use trace_info::TraceInfo;

mod context;
pub use context::AirContext;
Expand Down Expand Up @@ -390,12 +390,6 @@ pub trait Air: Send + Sync {
self.context().trace_info.length()
}

/// Returns a description of how execution trace columns are arranged into segments for
/// an instance of a computation described by this AIR.
fn trace_layout(&self) -> &TraceLayout {
self.context().trace_info.layout()
}

/// Returns degree of trace polynomials for an instance of the computation described by
/// this AIR.
///
Expand Down Expand Up @@ -476,8 +470,7 @@ pub trait Air: Send + Sync {
E: FieldElement<BaseField = Self::BaseField>,
R: RandomCoin<BaseField = Self::BaseField>,
{
let num_elements =
self.trace_info().layout().get_aux_segment_rand_elements(aux_segment_idx);
let num_elements = self.trace_info().get_aux_segment_rand_elements(aux_segment_idx);
let mut result = Vec::with_capacity(num_elements);
for _ in 0..num_elements {
result.push(public_coin.draw()?);
Expand Down
Loading

0 comments on commit 0513a99

Please sign in to comment.