-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Checking finalized sizes + a test of two folding verifiers (#8503)
Original goal: add a test so we can get the size of a circuit containing two folding verifiers. Detour: (Ultra and Mega flavors only) getting the size after adding nonzero gates and finalizing a circuit used to require adding a printout to the Honk proving key constructor, which would either be noise in many tests, or which would then have to be removed. Rearranging the ensure_nonzero function, we can accommodate the use case in tests where we want to print out the number of gates after finalization. To do this, just call finalize and and print the number of gates before passing the circuit to the prover or proving key constructor. You get a warning, but that's appropriate. Caution: I left in a code path that finalizes but does add extra gates because this was in use in many places. If those are all valid uses, then we only really want the gate-adding version in one place, so I made the default not add nonzero gates. ``` Console is in 'commands' mode, prefix expressions with '?'. Launching: /mnt/user-data/cody/aztec-packages/barretenberg/cpp/build-debug/bin/stdlib_protogalaxy_verifier_tests --gtest_color=no --gtest_filter=ProtogalaxyRecursiveTests/0.RecursiveFoldingTwiceTest --gtest_also_run_disabled_tests --gtest_break_on_failure Launched process 2323108 Running main() from /mnt/user-data/cody/aztec-packages/barretenberg/cpp/build-debug/_deps/gtest-src/googletest/src/gtest_main.cc Note: Google Test filter = ProtogalaxyRecursiveTests/0.RecursiveFoldingTwiceTest [==========] Running 1 test from 1 test suite. [----------] Global test environment set-up. [----------] 1 test from ProtogalaxyRecursiveTests/0, where TypeParam = bb::MegaRecursiveFlavor_<bb::MegaCircuitBuilder_<bb::field<bb::Bn254FrParams> > > [ RUN ] ProtogalaxyRecursiveTests/0.RecursiveFoldingTwiceTest Folding Recursive Verifier: num gates unfinalized = 18085 Folding Recursive Verifier: num gates finalized = 20211 WARNING: Redundant call to finalize_circuit(). Is this intentional? Dyadic size of verifier circuit: 32768 [ OK ] ProtogalaxyRecursiveTests/0.RecursiveFoldingTwiceTest (6768 ms) [----------] 1 test from ProtogalaxyRecursiveTests/0 (6768 ms total) [----------] Global test environment tear-down [==========] 1 test from 1 test suite ran. (6768 ms total) [ PASSED ] 1 test. Process exited with code 0. ``` ```
- Loading branch information
1 parent
986e703
commit d9e3f4d
Showing
7 changed files
with
66 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters