-
Notifications
You must be signed in to change notification settings - Fork 596
chore: rm dummy values from mega wires #22453
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
Open
iakovenkos
wants to merge
12
commits into
si/eccvm-lagrange-last-integer
Choose a base branch
from
si/no-dummy-values-in-mega
base: si/eccvm-lagrange-last-integer
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
38d99a0
rm dummy values, bump up max capacity
iakovenkos 9c440e1
Merge branch 'si/eccvm-lagrange-last-integer' into si/no-dummy-values…
iakovenkos f70a801
update empty builder expectations
iakovenkos cb88eee
Merge branch 'si/no-dummy-values-in-mega' of github.com:AztecProtocol…
iakovenkos a25ee62
Merge branch 'si/eccvm-lagrange-last-integer' into si/no-dummy-values…
iakovenkos eb8441e
relation correctness fix
iakovenkos 21a8e8e
Merge branch 'si/no-dummy-values-in-mega' of github.com:AztecProtocol…
iakovenkos c479835
Merge branch 'si/eccvm-lagrange-last-integer' into si/no-dummy-values…
iakovenkos 1958f45
clean up
iakovenkos 99434bf
upd vk hash
iakovenkos b4e330f
Merge remote-tracking branch 'origin/si/eccvm-lagrange-last-integer' …
iakovenkos 28742e1
upd vks
iakovenkos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -629,7 +629,7 @@ class ECCVMFlavor { | |
|
|
||
| const size_t num_rows = | ||
| std::max({ point_table_rows.size(), msm_rows.size(), transcript_rows.size() }) + TRACE_OFFSET; | ||
| vinfo("Num rows in the ECCVM: ", num_rows); | ||
| info("Num rows in the ECCVM: ", num_rows); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. intentional? |
||
| const auto log_num_rows = static_cast<size_t>(numeric::get_msb64(num_rows)); | ||
| size_t dyadic_num_rows = 1UL << (log_num_rows + (1UL << log_num_rows == num_rows ? 0 : 1)); | ||
| BB_ASSERT_LTE(dyadic_num_rows, | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,60 +16,9 @@ using namespace bb::crypto; | |
|
|
||
| namespace bb { | ||
|
|
||
| template <typename FF> void MegaCircuitBuilder_<FF>::finalize_circuit(const bool ensure_nonzero) | ||
| template <typename FF> void MegaCircuitBuilder_<FF>::finalize_circuit([[maybe_unused]] const bool ensure_nonzero) | ||
| { | ||
| if (ensure_nonzero && !this->circuit_finalized) { | ||
| // do the mega part of ensuring all polynomials are nonzero; ultra part will be done inside of | ||
| // Ultra::finalize_circuit | ||
| add_mega_gates_to_ensure_all_polys_are_non_zero(); | ||
| } | ||
| // All of the gates involved in finalization are part of the Ultra arithmetization | ||
| UltraCircuitBuilder_<MegaExecutionTraceBlocks>::finalize_circuit(ensure_nonzero); | ||
| } | ||
|
|
||
| /** | ||
| * @brief Ensure all polynomials have at least one non-zero coefficient to avoid commiting to the zero-polynomial. | ||
| * This only adds gates for the Goblin polynomials. Most polynomials are handled via the Ultra method, | ||
| * which should be done by a separate call to the Ultra builder's non zero polynomial gates method. | ||
| * | ||
| * @param in Structure containing variables and witness selectors | ||
| */ | ||
| template <typename FF> void MegaCircuitBuilder_<FF>::add_mega_gates_to_ensure_all_polys_are_non_zero() | ||
| { | ||
| // Add a single default value to all databus columns. Note: This value must be equal across all columns in order for | ||
| // inter-circuit databus commitment checks to pass in IVC settings. | ||
|
|
||
| // Create an arbitrary calldata read gate | ||
| add_public_calldata(this->add_variable(BusVector::DEFAULT_VALUE)); // add one entry in calldata | ||
| auto raw_read_idx = static_cast<uint32_t>(get_calldata().size()) - 1; // read data that was just added | ||
| auto read_idx = this->add_variable(FF(raw_read_idx)); | ||
| update_finalize_witnesses({ read_idx, read_calldata(read_idx) }); | ||
|
|
||
| // Create an arbitrary secondary_calldata read gate | ||
| add_public_secondary_calldata(this->add_variable(BusVector::DEFAULT_VALUE)); // add one entry in secondary_calldata | ||
| raw_read_idx = static_cast<uint32_t>(get_secondary_calldata().size()) - 1; // read data that was just added | ||
| read_idx = this->add_variable(FF(raw_read_idx)); | ||
| update_finalize_witnesses({ read_idx, read_secondary_calldata(read_idx) }); | ||
|
|
||
| // Create an arbitrary return data read gate | ||
| add_public_return_data(this->add_variable(BusVector::DEFAULT_VALUE)); // add one entry in return data | ||
| raw_read_idx = static_cast<uint32_t>(get_return_data().size()) - 1; // read data that was just added | ||
| read_idx = this->add_variable(FF(raw_read_idx)); | ||
| update_finalize_witnesses({ read_idx, read_return_data(read_idx) }); | ||
| } | ||
|
|
||
| /** | ||
| * @brief Ensure all polynomials have at least one non-zero coefficient to avoid commiting to the zero-polynomial. | ||
| * This only adds gates for the Goblin polynomials. Most polynomials are handled via the Ultra method, | ||
| * which should be done by a separate call to the Ultra builder's non zero polynomial gates method. | ||
| * | ||
| * @param in Structure containing variables and witness selectors | ||
| */ | ||
| template <typename FF> void MegaCircuitBuilder_<FF>::add_ultra_and_mega_gates_to_ensure_all_polys_are_non_zero() | ||
| { | ||
| // Most polynomials are handled via the conventional Ultra method | ||
| UltraCircuitBuilder_<MegaExecutionTraceBlocks>::add_gates_to_ensure_all_polys_are_non_zero(); | ||
| add_mega_gates_to_ensure_all_polys_are_non_zero(); | ||
| UltraCircuitBuilder_<MegaExecutionTraceBlocks>::finalize_circuit(ENSURE_NONZERO); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whats the reason for not doing the same for Ultra? |
||
| } | ||
|
|
||
| /** | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit - I try to avoid the comments that referenece an historical pattern