chore: circuit to polys cleanup#23013
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
35e8ab7
into
merge-train/barretenberg
|
glad you did it! |
BEGIN_COMMIT_OVERRIDE chore: circuit to polys cleanup (AztecProtocol#23013) chore: translator fixes (AztecProtocol#22983) chore: cycle group defense in depth (AztecProtocol#23118) chore: add a shplemini failure test (AztecProtocol#23147) feat: multi-app kernel circuits (AztecProtocol#23076) chore(dsl): require MemOp index and value to be witnesses (AztecProtocol#23171) chore: Fix merge-train conflicts (AztecProtocol#23173) chore: Merge next into merge-train/barretenberg (AztecProtocol#23191) fix: Fix conflicts next vs merge-train/barretenberg (AztecProtocol#23194) chore: poly audit followup (AztecProtocol#23053) chore: shrink msm test size while maintaining coverage (AztecProtocol#23226) END_COMMIT_OVERRIDE
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.