-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: protogalaxy perturbator! #2624
Conversation
0b760ca
to
e358648
Compare
e358648
to
3e8eb72
Compare
3e8eb72
to
bf18f8e
Compare
*/ | ||
class ClaimedEvaluations : public AllEntities<FF, FF> { | ||
class ProverPolynomialsEvaluations : public AllEntities<FF, FF> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started with having two different structures for ClaimedEvaluations
and RowEvaluations
but they have exactly the same form so it seemed wasteful. Wdyt of the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #2619 I renamed this to just AllValues
since it's now being used more generally, in the check circuit functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can give a more informative alias within the sumcheck class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProverPolynomialEvaluations
might feel a bit more natural, but I'm not sure I have full context
barretenberg/cpp/src/barretenberg/proof_system/relations/ecc_vm/ecc_transcript_relation.hpp
Outdated
Show resolved
Hide resolved
return poly; | ||
} | ||
|
||
ProverPolynomials construct_ultra_full_polynomials(auto& input_polynomials) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are taken from sumcheck functionality atm, I added an issue to make a testing utility file with functionality shared amongst tests in the codebase. In my mind, I'll do that when writing the final comprehensive tests. I noticed you started creating it in the combiner work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big steps forward here!
*/ | ||
class ClaimedEvaluations : public AllEntities<FF, FF> { | ||
class ProverPolynomialsEvaluations : public AllEntities<FF, FF> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #2619 I renamed this to just AllValues
since it's now being used more generally, in the check circuit functions.
*/ | ||
class ClaimedEvaluations : public AllEntities<FF, FF> { | ||
class ProverPolynomialsEvaluations : public AllEntities<FF, FF> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can give a more informative alias within the sumcheck class.
barretenberg/cpp/src/barretenberg/honk/instance/prover_instance.hpp
Outdated
Show resolved
Hide resolved
barretenberg/cpp/src/barretenberg/honk/proof_system/protogalaxy_prover.hpp
Outdated
Show resolved
Hide resolved
} | ||
} | ||
TEST_F(ProtoGalaxyTests, PerturbatorCoefficients) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked this example with this script
import numpy as np
from random import randint
maras_coeffs = [648, 936, 432, 64]
b = np.array([11, 8, 5])
d = np.array([8, 4, 2])
iis = [bin(i)[2:].zfill(3) for i in range(8)]
iis = [np.array([bool(int(n)) for n in s]) for s in iis]
bs = [b[idx] for idx in iis]
ds = [d[idx] for idx in iis]
def run_test():
x = randint(0, 1<<256)
prods = [np.prod((beta + x * delta)) for beta, delta in zip(bs, ds)]
my_value = sum(prods)
maras_value = sum(x**i * maras_coeffs[i] for i in range(len(maras_coeffs)))
assert(maras_value == my_value)
run_test()
print("Test succeeded!")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sometimes I enjoy doing arithmetic by hand, but I can add a script that double checks if you think it's necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I was just documenting how I checked your work in case it's useful to have the code at some point in the future.
@@ -22,6 +26,135 @@ template <class ProverInstances> class ProtoGalaxyProver_ { | |||
|
|||
void prepare_for_folding(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was in the source file, moved to header file
barretenberg/cpp/src/barretenberg/honk/proof_system/protogalaxy_prover.hpp
Outdated
Show resolved
Hide resolved
for (size_t idx = 0; idx <= log_instance_size; idx++) { | ||
transcript.send_to_verifier("perturbator_" + std::to_string(idx), perturbator[idx]); | ||
} | ||
// auto value = transcript.get_challenge("evaluation_point"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you wanted to keep this commented-out stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, that's work that should go in the prover, removed
d2ee57c
to
2b5ef9b
Compare
forgot to finish merge.
2b5ef9b
to
6bd86cc
Compare
Benchmark resultsAll benchmarks are run on txs on the This benchmark source data is available in JSON format on S3 here. Values are compared against data from master at commit L2 block published to L1Each column represents the number of txs on an L2 block published to L1.
L2 chain processingEach column represents the number of blocks on the L2 chain where each block has 16 txs.
Circuits statsStats on running time and I/O sizes collected for every circuit run across all benchmarks.
MiscellaneousTransaction sizes based on how many contracts are deployed in the tx.
|
87f7fb5
to
be146f7
Compare
39a75e1
to
ae3220b
Compare
ae3220b
to
576fe43
Compare
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-packages: 0.10.0</summary> ## [0.10.0](aztec-packages-v0.9.0...aztec-packages-v0.10.0) (2023-10-24) ### ⚠ BREAKING CHANGES * Emitting encrypted log by default ([#2926](#2926)) ### Features * Added register-account command to cli ([#2980](#2980)) ([0977a90](0977a90)) * **docs:** Fix portals tutorial formatting ([#2929](#2929)) ([ab19b67](ab19b67)) * Emitting encrypted log by default ([#2926](#2926)) ([1ea2d4f](1ea2d4f)), closes [#2912](#2912) * Goblin translator non-native field relation (Goblin Translator part 6) ([#2871](#2871)) ([c4d8d96](c4d8d96)) * Honk profiling by pass, tsan preset ([#2982](#2982)) ([a1592fd](a1592fd)) * Incorporate docs feedback and add "intermediate" level intros to some pages ([#2598](#2598)) ([78f9f52](78f9f52)) * Nuking `Pokeable` contract ([#2939](#2939)) ([583d6fb](583d6fb)) * Protogalaxy Combiner ([#2436](#2436)) ([a60c70d](a60c70d)) * Protogalaxy perturbator! ([#2624](#2624)) ([509dee6](509dee6)) * Refactor pedersen hash standard ([#2592](#2592)) ([3085676](3085676)) * Widget benchmarking ([#2897](#2897)) ([0e927e9](0e927e9)) ### Bug Fixes * Add @jest/types to box deps ([#2903](#2903)) ([db3fa62](db3fa62)) * Add lint rule for focused tests ([#2901](#2901)) ([fd1a1a8](fd1a1a8)) * Avoid tsc OOM by unignoring an old contract artifact ([#2932](#2932)) ([7310600](7310600)) * Bad it.only in tests ([#2900](#2900)) ([a1f3af1](a1f3af1)) * Boxes boostrap dont use ts-node directly and add .prettierignore ([#2890](#2890)) ([a3b1804](a3b1804)) * Confusing "Unknown complete address" error ([#2967](#2967)) ([3a8f54a](3a8f54a)) * Force jest to quit, otherwise CI can rack up to 3hrs of credits per job. ([#2899](#2899)) ([ba2f671](ba2f671)) * Honk sumcheck performance ([#2925](#2925)) ([5fbfe6e](5fbfe6e)) * Pending commitments contract using the wrong number of arguments ([#2959](#2959)) ([655c322](655c322)) * Prettierignore in boxes ([#2902](#2902)) ([8f7a200](8f7a200)) * Randomness in `AddressNote` ([#2965](#2965)) ([4dc49a9](4dc49a9)) * Yarn lock ([#2923](#2923)) ([7042bc6](7042bc6)) ### Miscellaneous * `Private Data Tree` --> `Note Hash Tree` ([#2945](#2945)) ([abaec9c](abaec9c)), closes [#2906](#2906) * Apply hash abstraction over aztec-nr ([#2958](#2958)) ([52f01ae](52f01ae)) * **docs:** Add Singleton and ImmutableSingleton `view_note` methods ([#2934](#2934)) ([c1497f8](c1497f8)) * Fix box frontend styling ([#2919](#2919)) ([7e9e8cc](7e9e8cc)) * Less noisy benchmark reports ([#2916](#2916)) ([0df166c](0df166c)) * Remove unused nix files ([#2933](#2933)) ([3174f84](3174f84)) * Run all e2e tests against sandbox ([#2891](#2891)) ([6c4e26c](6c4e26c)) * Token box copies noir source files from noir-contracts on bootstrap ([#2940](#2940)) ([a467b96](a467b96)) ### Documentation * Fix: update cheat codes to connect to ethRpcUrl ([#2922](#2922)) ([4ffe9be](4ffe9be)) </details> <details><summary>barretenberg.js: 0.10.0</summary> ## [0.10.0](barretenberg.js-v0.9.0...barretenberg.js-v0.10.0) (2023-10-24) ### Features * Refactor pedersen hash standard ([#2592](#2592)) ([3085676](3085676)) </details> <details><summary>barretenberg: 0.10.0</summary> ## [0.10.0](barretenberg-v0.9.0...barretenberg-v0.10.0) (2023-10-24) ### Features * Goblin translator non-native field relation (Goblin Translator part 6) ([#2871](#2871)) ([c4d8d96](c4d8d96)) * Honk profiling by pass, tsan preset ([#2982](#2982)) ([a1592fd](a1592fd)) * Protogalaxy Combiner ([#2436](#2436)) ([a60c70d](a60c70d)) * Protogalaxy perturbator! ([#2624](#2624)) ([509dee6](509dee6)) * Refactor pedersen hash standard ([#2592](#2592)) ([3085676](3085676)) * Widget benchmarking ([#2897](#2897)) ([0e927e9](0e927e9)) ### Bug Fixes * Honk sumcheck performance ([#2925](#2925)) ([5fbfe6e](5fbfe6e)) ### Miscellaneous * Remove unused nix files ([#2933](#2933)) ([3174f84](3174f84)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>aztec-packages: 0.10.0</summary> ## [0.10.0](AztecProtocol/aztec-packages@aztec-packages-v0.9.0...aztec-packages-v0.10.0) (2023-10-24) ### ⚠ BREAKING CHANGES * Emitting encrypted log by default ([#2926](AztecProtocol/aztec-packages#2926)) ### Features * Added register-account command to cli ([#2980](AztecProtocol/aztec-packages#2980)) ([0977a90](AztecProtocol/aztec-packages@0977a90)) * **docs:** Fix portals tutorial formatting ([#2929](AztecProtocol/aztec-packages#2929)) ([ab19b67](AztecProtocol/aztec-packages@ab19b67)) * Emitting encrypted log by default ([#2926](AztecProtocol/aztec-packages#2926)) ([1ea2d4f](AztecProtocol/aztec-packages@1ea2d4f)), closes [#2912](AztecProtocol/aztec-packages#2912) * Goblin translator non-native field relation (Goblin Translator part 6) ([#2871](AztecProtocol/aztec-packages#2871)) ([c4d8d96](AztecProtocol/aztec-packages@c4d8d96)) * Honk profiling by pass, tsan preset ([#2982](AztecProtocol/aztec-packages#2982)) ([a1592fd](AztecProtocol/aztec-packages@a1592fd)) * Incorporate docs feedback and add "intermediate" level intros to some pages ([#2598](AztecProtocol/aztec-packages#2598)) ([78f9f52](AztecProtocol/aztec-packages@78f9f52)) * Nuking `Pokeable` contract ([#2939](AztecProtocol/aztec-packages#2939)) ([583d6fb](AztecProtocol/aztec-packages@583d6fb)) * Protogalaxy Combiner ([#2436](AztecProtocol/aztec-packages#2436)) ([a60c70d](AztecProtocol/aztec-packages@a60c70d)) * Protogalaxy perturbator! ([#2624](AztecProtocol/aztec-packages#2624)) ([509dee6](AztecProtocol/aztec-packages@509dee6)) * Refactor pedersen hash standard ([#2592](AztecProtocol/aztec-packages#2592)) ([3085676](AztecProtocol/aztec-packages@3085676)) * Widget benchmarking ([#2897](AztecProtocol/aztec-packages#2897)) ([0e927e9](AztecProtocol/aztec-packages@0e927e9)) ### Bug Fixes * Add @jest/types to box deps ([#2903](AztecProtocol/aztec-packages#2903)) ([db3fa62](AztecProtocol/aztec-packages@db3fa62)) * Add lint rule for focused tests ([#2901](AztecProtocol/aztec-packages#2901)) ([fd1a1a8](AztecProtocol/aztec-packages@fd1a1a8)) * Avoid tsc OOM by unignoring an old contract artifact ([#2932](AztecProtocol/aztec-packages#2932)) ([7310600](AztecProtocol/aztec-packages@7310600)) * Bad it.only in tests ([#2900](AztecProtocol/aztec-packages#2900)) ([a1f3af1](AztecProtocol/aztec-packages@a1f3af1)) * Boxes boostrap dont use ts-node directly and add .prettierignore ([#2890](AztecProtocol/aztec-packages#2890)) ([a3b1804](AztecProtocol/aztec-packages@a3b1804)) * Confusing "Unknown complete address" error ([#2967](AztecProtocol/aztec-packages#2967)) ([3a8f54a](AztecProtocol/aztec-packages@3a8f54a)) * Force jest to quit, otherwise CI can rack up to 3hrs of credits per job. ([#2899](AztecProtocol/aztec-packages#2899)) ([ba2f671](AztecProtocol/aztec-packages@ba2f671)) * Honk sumcheck performance ([#2925](AztecProtocol/aztec-packages#2925)) ([5fbfe6e](AztecProtocol/aztec-packages@5fbfe6e)) * Pending commitments contract using the wrong number of arguments ([#2959](AztecProtocol/aztec-packages#2959)) ([655c322](AztecProtocol/aztec-packages@655c322)) * Prettierignore in boxes ([#2902](AztecProtocol/aztec-packages#2902)) ([8f7a200](AztecProtocol/aztec-packages@8f7a200)) * Randomness in `AddressNote` ([#2965](AztecProtocol/aztec-packages#2965)) ([4dc49a9](AztecProtocol/aztec-packages@4dc49a9)) * Yarn lock ([#2923](AztecProtocol/aztec-packages#2923)) ([7042bc6](AztecProtocol/aztec-packages@7042bc6)) ### Miscellaneous * `Private Data Tree` --> `Note Hash Tree` ([#2945](AztecProtocol/aztec-packages#2945)) ([abaec9c](AztecProtocol/aztec-packages@abaec9c)), closes [#2906](AztecProtocol/aztec-packages#2906) * Apply hash abstraction over aztec-nr ([#2958](AztecProtocol/aztec-packages#2958)) ([52f01ae](AztecProtocol/aztec-packages@52f01ae)) * **docs:** Add Singleton and ImmutableSingleton `view_note` methods ([#2934](AztecProtocol/aztec-packages#2934)) ([c1497f8](AztecProtocol/aztec-packages@c1497f8)) * Fix box frontend styling ([#2919](AztecProtocol/aztec-packages#2919)) ([7e9e8cc](AztecProtocol/aztec-packages@7e9e8cc)) * Less noisy benchmark reports ([#2916](AztecProtocol/aztec-packages#2916)) ([0df166c](AztecProtocol/aztec-packages@0df166c)) * Remove unused nix files ([#2933](AztecProtocol/aztec-packages#2933)) ([3174f84](AztecProtocol/aztec-packages@3174f84)) * Run all e2e tests against sandbox ([#2891](AztecProtocol/aztec-packages#2891)) ([6c4e26c](AztecProtocol/aztec-packages@6c4e26c)) * Token box copies noir source files from noir-contracts on bootstrap ([#2940](AztecProtocol/aztec-packages#2940)) ([a467b96](AztecProtocol/aztec-packages@a467b96)) ### Documentation * Fix: update cheat codes to connect to ethRpcUrl ([#2922](AztecProtocol/aztec-packages#2922)) ([4ffe9be](AztecProtocol/aztec-packages@4ffe9be)) </details> <details><summary>barretenberg.js: 0.10.0</summary> ## [0.10.0](AztecProtocol/aztec-packages@barretenberg.js-v0.9.0...barretenberg.js-v0.10.0) (2023-10-24) ### Features * Refactor pedersen hash standard ([#2592](AztecProtocol/aztec-packages#2592)) ([3085676](AztecProtocol/aztec-packages@3085676)) </details> <details><summary>barretenberg: 0.10.0</summary> ## [0.10.0](AztecProtocol/aztec-packages@barretenberg-v0.9.0...barretenberg-v0.10.0) (2023-10-24) ### Features * Goblin translator non-native field relation (Goblin Translator part 6) ([#2871](AztecProtocol/aztec-packages#2871)) ([c4d8d96](AztecProtocol/aztec-packages@c4d8d96)) * Honk profiling by pass, tsan preset ([#2982](AztecProtocol/aztec-packages#2982)) ([a1592fd](AztecProtocol/aztec-packages@a1592fd)) * Protogalaxy Combiner ([#2436](AztecProtocol/aztec-packages#2436)) ([a60c70d](AztecProtocol/aztec-packages@a60c70d)) * Protogalaxy perturbator! ([#2624](AztecProtocol/aztec-packages#2624)) ([509dee6](AztecProtocol/aztec-packages@509dee6)) * Refactor pedersen hash standard ([#2592](AztecProtocol/aztec-packages#2592)) ([3085676](AztecProtocol/aztec-packages@3085676)) * Widget benchmarking ([#2897](AztecProtocol/aztec-packages#2897)) ([0e927e9](AztecProtocol/aztec-packages@0e927e9)) ### Bug Fixes * Honk sumcheck performance ([#2925](AztecProtocol/aztec-packages#2925)) ([5fbfe6e](AztecProtocol/aztec-packages@5fbfe6e)) ### Miscellaneous * Remove unused nix files ([#2933](AztecProtocol/aztec-packages#2933)) ([3174f84](AztecProtocol/aztec-packages@3174f84)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR implements the power perturbator polynomial (F(X) in the paper), following the tree technique in the paper, allowing computation of the polynomial in coefficient form in O(N) time where N is the size of the instance. Resolves #693 and #687
The relation-related functionality from sumcheck that is now used in both sumcheck and PG has been moved in a shared
RelationUtils
fileChecklist:
Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.