Commit 1e69078
authored
Align dummy column and APC column order (#3451)
In direct write to APC trace witgen, it's required that the order of
original columns in original instruction execution order should match
the order of post-optimization APC columns. This wasn't the case because
previously we use an `AllChildren` visitor that chains
`AlgebraicExpressions` in all constraints and bus interactions, whose
`AlgebraicReference` don't necessarily follow the order of
`StructReflection` of orignal airs columns.
However, thanks to `StructReflection`, `poly_id` of original air columns
are dispensed in the same order as the struct, and `globalize_reference`
also keeps the same order before optimization. Therefore, the only work
needed is to sort the unique columns returned by the `AllChildren`
implementation of `SymbolicMachine` in the same order as the `poly_id`
of original air columns.
This turns out to be quite efficient as well via a `BTreeMap`, as
explained in the comment below.1 parent 8387f8b commit 1e69078
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
0 commit comments