chore: circuit to polys cleanup#23013
chore: circuit to polys cleanup#23013ledwards2225 wants to merge 5 commits intomerge-train/barretenbergfrom
Conversation
0554c68 to
62b9931
Compare
|
Bench: realistic Chonk flow, dedicated remote (HARDWARE_CONCURRENCY=16) Flow:
The regions the PR directly touches all show double-digit improvements: dropping the intermediate |
| * @details We check that for the arithmetic, delta_range, elliptic, memory, nnf, lookup, busread, poseidon2_external, | ||
| * poseidon2_internal blocks, and the other selectors are zero on that block. | ||
| */ | ||
| TEST(MegaCircuitBuilder, CompleteSelectorPartitioningCheck) |
There was a problem hiding this comment.
the condition this test is checking is now structurally impossible to deviate from
| EXPECT_TRUE(CircuitChecker::check(builder)); | ||
|
|
||
| // Verify that in the NNF block, all non-NNF selectors are zero | ||
| for (size_t i = 0; i < builder.blocks.nnf.size(); ++i) { |
| * @brief Stores permutation mapping data for a single wire column. | ||
| * | ||
| */ | ||
| struct Mapping { |
There was a problem hiding this comment.
massive code simplification here primarily due to constructing the permutation polys directly rather than passing through the intermediate Mapping/PermutationMapping. also a perf improvement since it avoids many small allocations
…de/circuit-to-polys
1f76369 to
17b314c
Compare
Two cleanups in trace-to-polynomials land. Originally motivated by small perf wins but is attractive for the code simplification:
1. Simpler permutation polynomial construction. The old code built a large intermediate table and walked it to produce the sigma/id polynomials. The new code
writes those polynomials directly in three steps: identity init, cycle linkages, public-input update.
2. Each block has only the non-gate selectors plus (at most) one gate selector. Previously every block declared all eight or nine possible gate selectors using the hacky
ZeroSelector.ZeroSelectorclass is gone plus lots of simplification in the block classes.