-
Notifications
You must be signed in to change notification settings - Fork 234
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
fix: remove finalize from acir create circuit #6585
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c11599e
remove finalize from acir create circuit
ledwards2225 b3da019
Merge branch 'master' into lde/finalize_fix
ledwards2225 4e547e7
revert to the old finalize model
ledwards2225 8d9a249
Merge branch 'master' into lde/finalize_fix
ledwards2225 67a0baf
add duplicate finalize warning
ledwards2225 ed181b4
cleanup
ledwards2225 e5c68ac
Merge branch 'master' into lde/finalize_fix
ledwards2225 246ffaf
comment
ledwards2225 a400492
Merge branch 'master' into lde/finalize_fix
ledwards2225 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,12 +40,14 @@ template <typename Arithmetization> void UltraCircuitBuilder_<Arithmetization>:: | |
* our circuit is finalized, and we must not to execute these functions again. | ||
*/ | ||
if (!circuit_finalized) { | ||
add_gates_to_ensure_all_polys_are_non_zero(); | ||
process_non_native_field_multiplications(); | ||
process_ROM_arrays(); | ||
process_RAM_arrays(); | ||
process_range_lists(); | ||
circuit_finalized = true; | ||
} else { | ||
// Gates added after first call to finalize will not be processed since finalization is only performed once | ||
info("WARNING: Redudant call to finalize_circuit(). Is this intentional?"); | ||
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. nice |
||
} | ||
} | ||
|
||
|
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
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.
does this not double count the ensure_nonzero gates? Since get_num_gates_added_to_ensure_nonzero_polynomials will add these gates in, and then get_total_circuit_size would already account for these extra gates.
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.
get_total_circuit_size doesn't account for the added gates for non-zero polys, only the gates that have been added explicitly plus those that will be added via the finalize method.
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.
What I'm saying is that calling get_num_gates_added_to_ensure_nonzero_polynomials will add the non-zero gates and then get_total_circuit_size calls get_num_gates which calls get_num_gates_split_into_components which sets the count to be this->num_gates which should include the added non-zero gates.
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.
but the added non-zero gates aren't added until we construct an instance
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.
Oh, maybe the confusion is this:
get_num_gates_added_to_ensure_nonzero_polynomials
doesn't actually add the gates. It creates a new builder, adds them to that, then counts them. The original builder is unaffectedThere 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.
ah got it. I didn't look hard enough at that function oops
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 added some comments to make that a bit more explicit