Commit 3796b02
committed
fix(air): correct constraint ID ordering and range-checker batch size
Two bugs introduced in the initial addr range check implementation:
1. Constraint ID ordering (test_miden_vm_ood_evals_match failure):
enforce_addr_range_check() is called from enforce_memory_constraints_all_rows
immediately after the WORD_IDX constraints (offset +4..+5), so ADDR_RANGE
must be at offset +6 (not +21 as originally placed). All subsequent offsets
shift by +1 accordingly. MEMORY_COUNT corrected from 24 to 22.
2. Range-checker batch size (assertion failure in add_range_checks):
The range checker requires exactly 2 or 4 values per call. The original code
submitted a separate 3-value call [addr_lo, addr_hi, addr_hi_x4], violating
the invariant. Fix: combine delta and addr into one 4-value call:
range.add_range_checks(row, &[delta_lo, delta_hi, addr_lo, addr_hi])
The AIR bus is updated to a 4-way batch LogUp (removing the 5th addr_hi_x4
lookup), matching the processor's range-check submission.
The addr_hi_x4 overflow guard is dropped; addr_lo/addr_hi ∈ [0, 2^16) plus
the reconstruction constraint already guarantee word_addr ∈ [0, 2^32).
Also update TAG_CHIPLETS_COUNT from 136 to 137 in ids.rs to account for the
one new reconstruction constraint.1 parent 5e5a8f8 commit 3796b02
4 files changed
+37
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | | - | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
716 | 719 | | |
717 | 720 | | |
718 | 721 | | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
| 722 | + | |
| 723 | + | |
747 | 724 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 107 | + | |
| 108 | + | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
| |||
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
161 | 145 | | |
162 | 146 | | |
163 | 147 | | |
| |||
170 | 154 | | |
171 | 155 | | |
172 | 156 | | |
173 | | - | |
174 | | - | |
| 157 | + | |
175 | 158 | | |
176 | 159 | | |
177 | 160 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | | - | |
280 | 278 | | |
281 | 279 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
287 | 287 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
| 288 | + | |
293 | 289 | | |
294 | 290 | | |
295 | 291 | | |
| |||
0 commit comments