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

feat: Sync from noir #8378

Merged
merged 17 commits into from
Sep 5, 2024
Merged

feat: Sync from noir #8378

merged 17 commits into from
Sep 5, 2024

Conversation

AztecBot
Copy link
Collaborator

@AztecBot AztecBot commented Sep 4, 2024

Automated pull of development from the noir programming language, a dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat(perf): Remove known store values that equal the store address in mem2reg (noir-lang/noir#5935)
feat: remove blocks which consist of only a jump to another block (noir-lang/noir#5889)
fix: use element_size() instead of computing it with division (noir-lang/noir#5939)
feat: Add StructDefinition::set_fields (noir-lang/noir#5931)
feat: Only check array bounds in brillig if index is unsafe (noir-lang/noir#5938)
chore: error on false constraint (noir-lang/noir#5890)
feat: warn on unused functions (noir-lang/noir#5892)
feat: add fmtstr::contents (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
END_COMMIT_OVERRIDE

AztecBot and others added 13 commits September 4, 2024 20:16
…g/noir#5929)

feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
feat: add `fmtstr::contents` (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
feat: add `fmtstr::contents` (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
* master:
  feat: verify public validation requests (#8150)
  feat: ultra keccak honk verifier (#8261)
  git subrepo push --branch=master noir-projects/aztec-nr
  git_subrepo.sh: Fix parent in .gitrepo file. [skip ci]
  chore: replace relative paths to noir-protocol-circuits
  git subrepo push --branch=master barretenberg
  chore(bb): use std::span for srs (#8371)
  feat: router contract (#8352)
  chore: Merge provernet to master (#8373)
  feat: Sync from noir (#8363)
  chore: Change efs volumes to use bursting throughput (#8370)
  chore: move spartan network tests to nightly (#8369)
  chore(ci): Test lowering of non-persistent ebs provisions (#8360)
  chore(bb): reinstate "chore: uncomment asserts in oink rec verifier"" (#8356)
  fix: Split stores per component and split merkle tree operations (#8299)
  fix: TXE logs in docker (#8365)
  feat: Liveness analysis for constants (#8294)
  chore(avm): remove some unused deps (#8366)
…5931)

feat: Only check array bounds in brillig if index is unsafe (noir-lang/noir#5938)
chore: error on false constraint (noir-lang/noir#5890)
feat: warn on unused functions (noir-lang/noir#5892)
feat: add `fmtstr::contents` (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
feat: Only check array bounds in brillig if index is unsafe (noir-lang/noir#5938)
chore: error on false constraint (noir-lang/noir#5890)
feat: warn on unused functions (noir-lang/noir#5892)
feat: add `fmtstr::contents` (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
…e address in mem2reg (noir-lang/noir#5935)

feat: remove blocks which consist of only a jump to another block (noir-lang/noir#5889)
fix: use element_size() instead of computing it with division (noir-lang/noir#5939)
feat: Add `StructDefinition::set_fields` (noir-lang/noir#5931)
feat: Only check array bounds in brillig if index is unsafe (noir-lang/noir#5938)
chore: error on false constraint (noir-lang/noir#5890)
feat: warn on unused functions (noir-lang/noir#5892)
feat: add `fmtstr::contents` (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
… mem2reg (noir-lang/noir#5935)

feat: remove blocks which consist of only a jump to another block (noir-lang/noir#5889)
fix: use element_size() instead of computing it with division (noir-lang/noir#5939)
feat: Add `StructDefinition::set_fields` (noir-lang/noir#5931)
feat: Only check array bounds in brillig if index is unsafe (noir-lang/noir#5938)
chore: error on false constraint (noir-lang/noir#5890)
feat: warn on unused functions (noir-lang/noir#5892)
feat: add `fmtstr::contents` (noir-lang/noir#5928)
fix: collect functions generated by attributes (noir-lang/noir#5930)
fix: Support debug comptime flag for attributes (noir-lang/noir#5929)
feat: Allow inserting new structs and into programs from attributes (noir-lang/noir#5927)
feat: module attributes (noir-lang/noir#5888)
feat: unquote some value as tokens, not as unquote markers (noir-lang/noir#5924)
feat: check argument count and types on attribute function callback (noir-lang/noir#5921)
feat: LSP will now suggest private items if they are visible (noir-lang/noir#5923)
@TomAFrench
Copy link
Member

@vezenovm Looks like your mem2reg changes are causing the noir contracts to fail.

@vezenovm
Copy link
Contributor

vezenovm commented Sep 5, 2024

@vezenovm Looks like your mem2reg changes are causing the noir contracts to fail.

Looks to be an aliasing issue, although I did think they were handled in #5935. I am going try and produce a minimal example as we could use more aliasing tests in mem2reg either way.

@vezenovm
Copy link
Contributor

vezenovm commented Sep 5, 2024

@TomAFrench I think I found the fix, but I'm trying to get a minimal repro for the mem2reg tests on Noir.

Copy link
Contributor

github-actions bot commented Sep 5, 2024

Changes to circuit sizes

Generated at commit: cfb2b903fa6a7875d71a55f96f0580adeb67dec5, compared to commit: cfea06ed72449a62e21ba4b0f1b0d77200f91635

🧾 Summary (100% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup -206 ✅ -0.09% -239 ✅ -0.01%
public_kernel_app_logic -206 ✅ -0.09% -240 ✅ -0.01%
public_kernel_teardown -206 ✅ -0.09% -241 ✅ -0.01%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
public_kernel_setup 231,801 (-206) -0.09% 1,931,600 (-239) -0.01%
public_kernel_app_logic 231,341 (-206) -0.09% 1,928,397 (-240) -0.01%
public_kernel_teardown 231,972 (-206) -0.09% 1,929,181 (-241) -0.01%

@TomAFrench TomAFrench merged commit 05cc59f into master Sep 5, 2024
97 of 98 checks passed
@TomAFrench TomAFrench deleted the sync-noir branch September 5, 2024 22:09
github-merge-queue bot pushed a commit to noir-lang/noir that referenced this pull request Sep 6, 2024
…load (#5959)

# Description

## Problem\*

Resolves #5771 

This was a bug found on
AztecProtocol/aztec-packages#8378 from
#5935. However it looks to
inadvertently fix the linked issue as well.

## Summary\*

We were just directly inserting a new expression and alias for a load
result. This was overriding whatever expression of AliasSet may have
been there before. This PR switches to checking whether the result
already has an expression, which if it does to use that. It then checks
whether the result already has an alias set, if it does we add to the
alias set rather than overriding it.

## Additional Context



## Documentation\*

Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
github-merge-queue bot pushed a commit to noir-lang/noir that referenced this pull request Sep 6, 2024
…ional alias unit test (#5967)

# Description

## Problem\*

Partially
#5925 (comment) and
benefits other post mem2reg function cleanup work
#5925. Want to add some more
aliasing cases.

Works towards making the alias testing surrounding mem2reg more robust.

## Summary\*

I have added a mem2reg unit test where the code is storing to an alias
inside of a loop. This triggered a failure that has been fixed in this
PR. I also confirmed that this unit test would have caught the error
triggered by #5935 in
AztecProtocol/aztec-packages#8378.

We have a simple post-mem2reg process that operates over the final
mem2reg state to determine if there are any stores that were missed that
can be removed. The check currently does not look at whether the store
we are removing is an alias.

For now I simply block removing this store if it is an alias.

## Additional Context

In follow-ups we can work on handling of aliases in this per function
state to remove aliases we know we can simplify.

## Documentation\*

Check one:
- [X] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [X] I have tested the changes locally.
- [X] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
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.

3 participants