fix: Fix comptime casts of negative integer to field#8696
Merged
Conversation
aakoshh
reviewed
May 28, 2025
asterite
approved these changes
Jun 2, 2025
github-merge-queue bot
pushed a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Jun 6, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix: type unification tests, and try moving constants to the other side (noir-lang/noir#8807) fix!: disallow casting numeric to bool (noir-lang/noir#8703) fix: delay associated constants resolution (noir-lang/noir#8744) fix: right shift overflow to 0 (noir-lang/noir#8772) fix: use value predicated by range checks (noir-lang/noir#8778) fix: unify infix expressions by isolating unbound type variables (noir-lang/noir#8796) feat: use `asm` feature flag in arkworks (noir-lang/noir#8792) chore: add a failing test for #8780 (noir-lang/noir#8785) chore: Adjust the frequency of 'for' statements in ACIR fuzz generation (noir-lang/noir#8788) fix: Merge `replacement_type` and `is_function_type` in `defunctionalization` (noir-lang/noir#8784) chore(fuzz): Remove unreachable functions in the AST fuzzer (noir-lang/noir#8782) chore(docs): Copy attribute docs into versioned docs (noir-lang/noir#8777) fix(licm): Preserve semantic ordering of side-effectual instructions when hoisting (noir-lang/noir#8724) fix: Create SSA interpreter arguments from scratch for each invocation (noir-lang/noir#8762) chore: mark sha512 as non-critical (noir-lang/noir#8776) fix!: disallow specifying associated items via generics (noir-lang/noir#8756) fix: stop inserting instructions after break and continue (noir-lang/noir#8712) fix: Fix comptime casts of negative integer to field (noir-lang/noir#8696) chore(SSA): restrict `shr` and `shl` right-hand side to u8 (noir-lang/noir#8753) chore: bump some JS packages (noir-lang/noir#8771) chore: document `allow(dead_code)` and reorganize attributes (noir-lang/noir#8766) fix: Add missing cases for finding function values in `find_functions_as_values` (noir-lang/noir#8738) fix: correct bitsize in signed division (noir-lang/noir#8733) chore: remove noir-lang/noir_rsa from external libraries (noir-lang/noir#8752) chore: bump external pinned commits (noir-lang/noir#8747) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
danielntmd
pushed a commit
to danielntmd/aztec-packages
that referenced
this pull request
Jul 16, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE fix: type unification tests, and try moving constants to the other side (noir-lang/noir#8807) fix!: disallow casting numeric to bool (noir-lang/noir#8703) fix: delay associated constants resolution (noir-lang/noir#8744) fix: right shift overflow to 0 (noir-lang/noir#8772) fix: use value predicated by range checks (noir-lang/noir#8778) fix: unify infix expressions by isolating unbound type variables (noir-lang/noir#8796) feat: use `asm` feature flag in arkworks (noir-lang/noir#8792) chore: add a failing test for AztecProtocol#8780 (noir-lang/noir#8785) chore: Adjust the frequency of 'for' statements in ACIR fuzz generation (noir-lang/noir#8788) fix: Merge `replacement_type` and `is_function_type` in `defunctionalization` (noir-lang/noir#8784) chore(fuzz): Remove unreachable functions in the AST fuzzer (noir-lang/noir#8782) chore(docs): Copy attribute docs into versioned docs (noir-lang/noir#8777) fix(licm): Preserve semantic ordering of side-effectual instructions when hoisting (noir-lang/noir#8724) fix: Create SSA interpreter arguments from scratch for each invocation (noir-lang/noir#8762) chore: mark sha512 as non-critical (noir-lang/noir#8776) fix!: disallow specifying associated items via generics (noir-lang/noir#8756) fix: stop inserting instructions after break and continue (noir-lang/noir#8712) fix: Fix comptime casts of negative integer to field (noir-lang/noir#8696) chore(SSA): restrict `shr` and `shl` right-hand side to u8 (noir-lang/noir#8753) chore: bump some JS packages (noir-lang/noir#8771) chore: document `allow(dead_code)` and reorganize attributes (noir-lang/noir#8766) fix: Add missing cases for finding function values in `find_functions_as_values` (noir-lang/noir#8738) fix: correct bitsize in signed division (noir-lang/noir#8733) chore: remove noir-lang/noir_rsa from external libraries (noir-lang/noir#8752) chore: bump external pinned commits (noir-lang/noir#8747) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
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
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*
A test case I was using for #8669 was incorrect. It stated we expect
-1_u8 as Field == -1while the rest of our code base uses-1_u8 as Field = 255Summary*
Not sure how I missed this originally but the problem is given above. We always zero-extend which casting to fields regardless of whether the source was signed or not.
There is something to be said about this being unintuitive. Even for existing languages casting a signed value to an unsigned one still sign-extends it.
Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.