-
Notifications
You must be signed in to change notification settings - Fork 250
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: No longer error on INT_MIN globals #7519
Merged
Merged
Conversation
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
asterite
reviewed
Feb 25, 2025
asterite
reviewed
Feb 25, 2025
asterite
approved these changes
Feb 25, 2025
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.
Looks great! I left a couple of comments.
Sorry, scrolling through the page or something I clicked "Update branch" though it wasn't needed... |
…into jf/int-min-globals
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 26, 2025
fix: No longer error on INT_MIN globals (noir-lang/noir#7519) fix: correctly format trait function with multiple where clauses (noir-lang/noir#7531) chore(ssa): Do not run passes on Brillig functions post Brillig gen (noir-lang/noir#7527)
TomAFrench
pushed a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Feb 26, 2025
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore!: bump msrv to 1.85.0 (noir-lang/noir#7530) fix: No longer error on INT_MIN globals (noir-lang/noir#7519) fix: correctly format trait function with multiple where clauses (noir-lang/noir#7531) chore(ssa): Do not run passes on Brillig functions post Brillig gen (noir-lang/noir#7527) END_COMMIT_OVERRIDE --------- Co-authored-by: guipublic <guipublic@gmail.com> Co-authored-by: guipublic <47281315+guipublic@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Problem*
Resolves #7506
Resolves #7324
This PR also possibly improves some error messages which previously displayed negative integer values as a negated field value (a large number) - these will now show an actual negative sign and integer value. I don't expect this to be a noticeable change however since there's a check on
FieldElement::display
to just display the value as negative if that value is smaller (in terms of string characters).Summary*
Allow INT_MIN globals by properly handling negatives by refactoring the frontend to use
SignedField
instead ofFieldElement, bool
pairs.Additional Context
One advantage I noticed while using SignedField was that I was able to refactor several separate conversion functions we had (mostly in the interpreter) from SignedField to various signed and unsigned integer types into one place. Before we had written these conversions several times and some handled INT_MIN properly while others did not. Now there are conversion methods on
SignedField
itself.Some future improvements we could do that I did not tackle in this PR:
Type::Constant
still holds aFIeldElement
rather than aSignedField
. I think refactoring it to handle negatives was beyond the scope of this PR, although theoretically it should be easier in the future once we have the following point.Type::Constant
although the later is only on Fields). This feels like something that should be on SignedField itself (sans error reporting).Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.