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
50
51
52
53
54
55
56
57
58
59
60
//! Input layout definitions for ACE circuit evaluation.
//!
//! The layout mirrors the MASM verifier READ section: values are stored as
//! extension-field elements in point-major order (all openings at `zeta`
//! followed by all openings at `g * zeta`). Auxiliary trace and quotient
//! chunk openings are provided as base-field coordinates and merged into
//! extension elements inside the ACE circuit.
//!
//! All offsets and widths in this module are measured in extension-field (EF)
//! elements. One EF element occupies two base-field elements.
//!
//! Besides the AIR constraints themselves, the ACE circuit computes:
//! - Randomness expansion from `(alpha, beta)` into the full coefficient vector `[alpha, 1, beta,
//! beta^2, ...]`.
//! - Auxiliary/quotient coordinate merges to recover extension-field values.
//! - Periodic column evaluations from `z_k`.
//! - Selector polynomial evaluations and vanishing inverses.
//! - Lagrange-kernel weights and shifts for quotient chunk recomposition.
//! - Constraint folding with the composition challenge and final root check.
//!
//! The current "stark vars" block is sufficient to derive both selector
//! polynomials and the Lagrange-kernel weights used in quotient chunk
//! recomposition:
//! - Selector evaluations:
//! - `inv_vanishing = 1 / (z^N - 1)`
//! - `is_first = (z^N - 1) * inv(z - 1)`
//! - `is_last = (z^N - 1) * inv(z - g^{-1})`
//! - `is_transition = z - g^{-1}`
//! - Lagrange kernel inputs:
//! - `s0 = offset^N` and `g = subgroup_gen^N` define the shifts `s_i = s0 * g^i`.
//! - `weight0 = 1 / (k * s0^{k-1})` gives barycentric weights `weight_i = weight0 * g^i` for the
//! chunk recomposition kernel.
//! - `z_k` is used to evaluate periodic columns inside the circuit.
//!
//! Layout order (both Native and Masm):
//! 1) public_values
//! 2) aux randomness (alpha/beta)
//! 3) main_curr
//! 4) aux_curr
//! 5) quotient_curr
//! 6) main_next
//! 7) aux_next
//! 8) quotient_next
//! 9) aux_bus_boundary
//! 10) stark_vars
//!
//! Notes:
//! - `quotient_next` is included in the READ layout and is mapped via
//! `InputKey::QuotientChunkCoord` with `offset = 1`.
//! - `stark_vars` reserves at least 14 EF slots for the canonical verifier inputs. Extra slots are
//! left available for future aux inputs.
pub use InputKey;
pub use InputKeyMapper;
pub use ;
pub use ;