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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//! Per-bus emitters for the Miden VM's LogUp argument.
//!
//! The Miden VM's LogUp buses are emitted across 7 columns — most host a single bus, but
//! several host two or more linearly-independent buses sharing one running accumulator via
//! distinct `bus_prefix[bus]` additive bases (see per-bus module docs for the merges).
//! Each emitter is a crate-private `pub(in crate::constraints::lookup) fn emit_*` that
//! opens a single [`super::LookupBuilder::column`] closure and describes the bus's
//! interactions via [`super::LookupColumn::group`] or
//! [`super::LookupColumn::group_with_cached_encoding`].
//!
//! The emitters are routed through two separate [`super::LookupAir`] implementors:
//! - [`super::main_air::MainLookupAir`] for the main-trace columns.
//! - [`super::chiplet_air::ChipletLookupAir`] for the chiplet-trace columns.
//!
//! [`crate::ProcessorAir`]'s `LookupAir` impl is a thin aggregator that calls both in sequence,
//! preserving the `enforce_main` / `enforce_chiplet` column order for downstream consumers
//! that want the full 7-column picture in a single `eval` call.
//!
//! ## Shared precompute contexts
//!
//! The main-trace and chiplet-trace contexts live next to their respective LookupAirs:
//! - [`super::main_air::MainBusContext`] — two-row window plus the shared
//! [`crate::constraints::op_flags::OpFlags`] instance consumed by the 4 main-trace emitters.
//! - [`super::chiplet_air::ChipletBusContext`] — two-row window plus the shared
//! [`ChipletActiveFlags`] snapshot consumed by the 3 chiplet-trace emitters.
//!
//! Each context is built once per `eval` through an extension-trait hook
//! ([`super::main_air::MainLookupBuilder::build_op_flags`] /
//! [`super::chiplet_air::ChipletLookupBuilder::build_chiplet_active`]), so a future
//! prover-side override can replace the polynomial construction with a cheaper boolean fast
//! path without touching any emitter code. [`ChipletActiveFlags`] itself lives in this
//! module because it's the pure-compute helper both the default chiplet hook and any
//! future override want to reach for; it does not depend on either `MainCols` context type.
use ;
use crateMainCols;
pub
pub
pub
pub
pub
pub
pub
pub
pub use LookupOpFlags;
// CHIPLET ACTIVE FLAGS
// ================================================================================================
/// Per-chiplet `is_active` expressions, mirroring the active-flag block of
/// [`build_chiplet_selectors`](super::super::chiplets::selectors::build_chiplet_selectors).
///
/// These are the only chiplet-flag flavors the LogUp buses consume —
/// `is_transition` / `is_last` / `next_is_first` are used only by the constraint-path
/// chiplet code, not by the LogUp argument — so this type carries no other variants.
///
/// The constructor is a pure compute function: it builds the same algebra as
/// `build_chiplet_selectors` but does NOT emit any `when` / `assert_*` calls, so it is
/// safe to run in parallel with the constraint-path chiplet selector pass.
pub