1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Auxiliary trace builder trait for dependency inversion.
//!
//! This trait allows ProcessorAir to build auxiliary traces without depending
//! on the processor crate, avoiding circular dependencies.
use RowMajorMatrix;
use crateFelt;
/// Trait for building auxiliary traces from main trace and challenges.
///
/// # Why This Trait Exists
///
/// This trait serves to avoid circular dependencies:
/// - `ProcessorAir` (in this crate) needs to build auxiliary traces during proving
/// - The actual aux building logic lives in the `processor` crate
/// - But `processor` already depends on `air` for trace types and constraints
/// - Direct coupling would create: `air` → `processor` → `air`
///
/// The trait breaks the cycle:
/// - `air` defines the interface (this trait)
/// - `processor` implements the interface (concrete aux builders)
/// - `prover` injects the implementation: `ProcessorAir::with_aux_builder(impl)`
///
/// The trait works with row-major matrices (i.e., Plonky3 format).
/// Dummy implementation for () to support ProcessorAir without aux trace builders (e.g., in
/// verifier). This implementation should never be called since ProcessorAir::build_aux_trace
/// returns None when aux_builder is None.