Skip to content
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: do not discard negative sign from field literals in comptime interpreter #7439

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

TomAFrench
Copy link
Member

Description

Problem*

Resolves #7433

Summary*

We are currently throwing away the sign when evaluating Field type literals in the interpreter which causes nasty weird behaviour as seen in #7433. I've updated the interpreter to negate the field properly in this case.

A regression test has been added along with a sanity check test I wrote while debugging to ensure that we parse these correctly.

Additional Context

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.

@TomAFrench TomAFrench requested a review from a team February 19, 2025 13:49
@TomAFrench TomAFrench added this pull request to the merge queue Feb 19, 2025
Merged via the queue into master with commit 1d04f8b Feb 19, 2025
102 checks passed
@TomAFrench TomAFrench deleted the tf/regression-7433 branch February 19, 2025 15:35
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 19, 2025
chore!: make `ResolverError::OracleMarkedAsConstrained` into a full error (noir-lang/noir#7426)
chore: simplify reports (noir-lang/noir#7421)
fix: do not discard negative sign from field literals in comptime interpreter (noir-lang/noir#7439)
chore: bump aztec-packages commit (noir-lang/noir#7441)
fix: require loop/for/while body to be unit (noir-lang/noir#7437)
feat: simplify assertions that squared values are equal to zero (noir-lang/noir#7432)
chore(benchmark): Improve noir msm benchmark (noir-lang/noir#7390)
chore: Add SSA security checks description (noir-lang/noir#7366)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 19, 2025
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat(cli): add noir-execute binary
(noir-lang/noir#7384)
chore!: make `ResolverError::OracleMarkedAsConstrained` into a full
error (noir-lang/noir#7426)
chore: simplify reports (noir-lang/noir#7421)
fix: do not discard negative sign from field literals in comptime
interpreter (noir-lang/noir#7439)
chore: bump aztec-packages commit
(noir-lang/noir#7441)
fix: require loop/for/while body to be unit
(noir-lang/noir#7437)
feat: simplify assertions that squared values are equal to zero
(noir-lang/noir#7432)
chore(benchmark): Improve noir msm benchmark
(noir-lang/noir#7390)
chore: Add SSA security checks description
(noir-lang/noir#7366)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
TomAFrench added a commit that referenced this pull request Feb 20, 2025
* master: (89 commits)
  chore: bump external pinned commits (#7472)
  chore: remove `disable_macros` compile option (#7468)
  chore(ci): add workflow to automate bumping aztec-packages commit (#7465)
  chore: Release Noir(1.0.0-beta.3) (#7346)
  chore(ci): Missing dash in profiler command argument (#7467)
  feat(experimental): show macro errors where they happen (#7333)
  feat: optimize FieldElement::num_bits (#7147)
  chore(profiler): Docs on profiler command and more complete error reporting (#7436)
  feat(ci): Release noir-inspector in binaries (#7464)
  chore(docs): Noir Profiler external documentation (#7457)
  feat(ci): Publish binaries for noir-profiler (#7443)
  chore: Copy #7387 docs into v1.0.0-beta.2 versioned_docs (#7458)
  fix: prevent incorrect ACIRgen caused by noop truncations (#7456)
  feat: add native `u128` type (#7301)
  chore: standardize that doc comments on top of statements and expression are allowed but warn (#7450)
  fix: don't let nargo fmt produce multiple trailing newlines (#7444)
  feat(cli): add noir-execute binary (#7384)
  chore!: make `ResolverError::OracleMarkedAsConstrained` into a full error (#7426)
  chore: simplify reports (#7421)
  fix: do not discard negative sign from field literals in comptime interpreter (#7439)
  ...
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.

Negative global field treated as positive
2 participants