Skip to content

chore(fuzz): Consider RangeCheckFailed equivalent to ConstantDoesNotFitType if the value matches#8958

Merged
aakoshh merged 1 commit intomasterfrom
af/8863-ssa-interpret-constfit-vs-rangecheck
Jun 18, 2025
Merged

chore(fuzz): Consider RangeCheckFailed equivalent to ConstantDoesNotFitType if the value matches#8958
aakoshh merged 1 commit intomasterfrom
af/8863-ssa-interpret-constfit-vs-rangecheck

Conversation

@aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Jun 18, 2025

Description

Problem*

Resolves #8863

Summary*

Relaxes the Comparable implementation for the SSA interpreter errors to consider the errors from a range check equivalent to the internal error we get when a constant does not fit into the intended type, as long as the value they mention is the same. This is because SSA passes might reorder some instructions that result in failure for the same reason, but with a different manifestation in the interpreter depending on which instruction comes first.

Additional Context

This is a follow up for the discussion in #8910 without going all the way to consider every failure equivalent. That would be too aggressive at the moment, because the SSA interpreter doesn't handle prints yet (I'll do that next).

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@aakoshh aakoshh requested a review from a team June 18, 2025 09:28
@aakoshh aakoshh enabled auto-merge June 18, 2025 09:29
@aakoshh aakoshh added this pull request to the merge queue Jun 18, 2025
@asterite
Copy link
Collaborator

I wonder if we should add an option to nargo interpret to check that every pass gives the "same" result. Then we could add a test program for #8863 and always pass that flag when running tests. What do you think?

@asterite
Copy link
Collaborator

Ah, I now realize it would be a compile_failure test for the interpret, so something new... probably for an optional follow-up PR.

Merged via the queue into master with commit 46abffd Jun 18, 2025
118 checks passed
@aakoshh aakoshh deleted the af/8863-ssa-interpret-constfit-vs-rangecheck branch June 18, 2025 13:50
@aakoshh
Copy link
Contributor Author

aakoshh commented Jun 18, 2025

It's not unheard of for the interpreter to heal itself, we could definitely add something to the interpreter command as a follow up 👍

github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 19, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
fix(defunctionalize): Create a placeholder function for first-class
function calls with no variants
(noir-lang/noir#8697)
fix(mem2reg): Keep store when any aliased reference is kept
(noir-lang/noir#8960)
fix(parser): let `as` have a lower precedence
(noir-lang/noir#8956)
fix: Match against all Value recursive types when checking for a
function/closure in a global
(noir-lang/noir#8967)
fix(formatter): reset indetnation after group changed it
(noir-lang/noir#8966)
chore(validation): Ban function pointers in SSA globals
(noir-lang/noir#8947)
chore: address various clippy issues
(noir-lang/noir#8942)
chore(fuzz): Consider `RangeCheckFailed` equivalent to
`ConstantDoesNotFitType` if the value matches
(noir-lang/noir#8958)
chore(fuzz): Use `nextest` to run nightly fuzz test
(noir-lang/noir#8962)
chore: minor code quality issues
(noir-lang/noir#8961)
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(defunctionalize): Create a placeholder function for first-class
function calls with no variants
(noir-lang/noir#8697)
fix(mem2reg): Keep store when any aliased reference is kept
(noir-lang/noir#8960)
fix(parser): let `as` have a lower precedence
(noir-lang/noir#8956)
fix: Match against all Value recursive types when checking for a
function/closure in a global
(noir-lang/noir#8967)
fix(formatter): reset indetnation after group changed it
(noir-lang/noir#8966)
chore(validation): Ban function pointers in SSA globals
(noir-lang/noir#8947)
chore: address various clippy issues
(noir-lang/noir#8942)
chore(fuzz): Consider `RangeCheckFailed` equivalent to
`ConstantDoesNotFitType` if the value matches
(noir-lang/noir#8958)
chore(fuzz): Use `nextest` to run nightly fuzz test
(noir-lang/noir#8962)
chore: minor code quality issues
(noir-lang/noir#8961)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSA Interpreter: ConstantDoesNotFitInType after LICM

2 participants