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: require trait function calls (Foo::bar()) to have the trait in scope (imported) #6882

Merged
merged 8 commits into from
Jan 3, 2025

Conversation

asterite
Copy link
Collaborator

@asterite asterite commented Dec 19, 2024

Description

Problem

Part of #6864

Summary

This PR is only about calls (Foo::bar()).

There are many more cases to handle (methods, but also calls on primitive types like Field::foo() and method calls on primitive types) but it might be better to do all of this across many PRs so they are easier to review.

Additional Context

  1. To avoid introducing a huge breaking change, if you call a trait function, you don't have it imported, and there's only one possible trait function to call, that's reported as a warning.
  2. We can document these new requirements in the final PR.

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.

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Peak Memory Sample

Program Peak Memory
keccak256 78.48M
workspace 123.33M
regression_4709 422.91M
ram_blowup_regression 1.58G
private-kernel-tail 201.69M
private-kernel-reset 716.96M
private-kernel-inner 291.77M
parity-root 171.99M

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Compilation Report

Program Compilation Time %
sha256_regression 1.389s 0%
regression_4709 0.813s 1%
ram_blowup_regression 15.258s 0%
rollup-root 3.601s -8%
rollup-block-merge 4.201s -2%
rollup-base-public 112.549s -1%
rollup-base-private 94.830s -2%
private-kernel-tail 1.041s 1%
private-kernel-reset 7.201s 0%
private-kernel-inner 2.332s 12%
parity-root 0.735s 1%
noir-contracts 86.558s -1%

Copy link
Contributor

github-actions bot commented Dec 19, 2024

Execution Report

Program Execution Time %
sha256_regression 0.605s 2%
regression_4709 0.407s 2%
ram_blowup_regression 3.878s 0%
rollup-root 2.164s -1%
rollup-block-merge 2.177s -1%
rollup-base-public 34.906s 0%
rollup-base-private 31.445s -1%
private-kernel-tail 0.781s 3%
private-kernel-reset 2.166s 0%
private-kernel-inner 1.283s 5%
parity-root 0.528s 1%

@asterite asterite changed the title feat: require trait methods to be in scope feat: require trait function calls (Foo::bar()) to be in scope Dec 19, 2024
@asterite asterite marked this pull request as ready for review December 19, 2024 19:30
@asterite asterite requested a review from a team December 19, 2024 19:33
@asterite asterite changed the title feat: require trait function calls (Foo::bar()) to be in scope feat: require trait function calls (Foo::bar()) to have the trait in scope (imported) Dec 19, 2024
Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with extra test case.

@TomAFrench TomAFrench enabled auto-merge January 3, 2025 14:41
@TomAFrench TomAFrench added this pull request to the merge queue Jan 3, 2025
Copy link
Contributor

github-actions bot commented Jan 3, 2025

Compilation Memory Report

Program Peak Memory
keccak256 78.48M
workspace 123.23M
regression_4709 422.91M
ram_blowup_regression 1.58G
rollup-base-public 10.47G
rollup-base-private 6.57G
private-kernel-tail 201.79M
private-kernel-reset 717.06M
private-kernel-inner 291.86M
parity-root 172.13M

Copy link
Contributor

github-actions bot commented Jan 3, 2025

Execution Memory Report

Program Peak Memory
keccak256 74.61M
workspace 123.59M
regression_4709 315.92M
ram_blowup_regression 512.47M
rollup-base-public 3.05G
rollup-base-private 2.97G
private-kernel-tail 181.16M
private-kernel-reset 255.25M
private-kernel-inner 214.35M
parity-root 155.86M

Merged via the queue into master with commit a5447ed Jan 3, 2025
90 checks passed
@TomAFrench TomAFrench deleted the ab/require-trait-to-be-in-scope branch January 3, 2025 14:58
TomAFrench added a commit that referenced this pull request Jan 3, 2025
* master: (47 commits)
  chore: delete a bunch of dead code from `noirc_evaluator` (#6939)
  feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (#6882)
  chore: Bump arkworks to version `0.5.0` (#6871)
  feat(ssa): Hoist add and mul binary ops using known induction variables (#6910)
  chore: fix warning (#6927)
  chore(ci): Memory reports for execution (#6907)
  chore: use ssa parser in flattening pass tests (#6868)
  feat(LSP): suggest trait methods from where clauses (#6915)
  feat: warn on trait method visibility (#6923)
  feat!: Switch to using `jsonrpsee` for foreign calls; refactor `run_test`; foreign call layering (#6849)
  chore: add rollup circuits to memory reports (#6897)
  chore: remove unused dependency (#6922)
  chore: add if/loop tip (separate from no-predicate #5657) (#6806)
  chore: move implementation of print foreign call into `nargo` (#6865)
  chore: document format strings (#6920)
  chore: add `rollup_root` and `rollup_block_merge` to tracked protocol circuits (#6903)
  fix: consistent file_id across installation paths (#6912)
  fix: bigint builtins are foreigns (#6892)
  fix: remove unnecessary cast in bit-shift (#6890)
  chore: Release Noir(1.0.0-beta.1) (#6622)
  ...
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 4, 2025
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 5, 2025
…lang/noir#6945)

chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 5, 2025
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 6, 2025
…noir#6930)

fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 6, 2025
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 7, 2025
…oir#6926)

chore: simplify boolean in a mul of a mul (noir-lang/noir#6951)
feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (noir-lang/noir#6893)
chore: Move comment as part of #6945 (noir-lang/noir#6959)
chore: Separate unconstrained functions during monomorphization (noir-lang/noir#6894)
feat!: turn CannotReexportItemWithLessVisibility into an error (noir-lang/noir#6952)
feat: lock on Nargo.toml on several nargo commands (noir-lang/noir#6941)
feat: don't simplify SSA instructions when creating them from a string (noir-lang/noir#6948)
chore: add reproduction case for bignum test failure (noir-lang/noir#6464)
chore: bump `noir-gates-diff` (noir-lang/noir#6949)
feat(test): Enable the test fuzzer for Wasm (noir-lang/noir#6835)
chore: also print test output to stdout in CI (noir-lang/noir#6930)
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 7, 2025
chore: simplify boolean in a mul of a mul (noir-lang/noir#6951)
feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (noir-lang/noir#6893)
chore: Move comment as part of #6945 (noir-lang/noir#6959)
chore: Separate unconstrained functions during monomorphization (noir-lang/noir#6894)
feat!: turn CannotReexportItemWithLessVisibility into an error (noir-lang/noir#6952)
feat: lock on Nargo.toml on several nargo commands (noir-lang/noir#6941)
feat: don't simplify SSA instructions when creating them from a string (noir-lang/noir#6948)
chore: add reproduction case for bignum test failure (noir-lang/noir#6464)
chore: bump `noir-gates-diff` (noir-lang/noir#6949)
feat(test): Enable the test fuzzer for Wasm (noir-lang/noir#6835)
chore: also print test output to stdout in CI (noir-lang/noir#6930)
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 7, 2025
)

feat: `--pedantic-solving` flag (noir-lang/noir#6716)
feat!: update `aes128_encrypt` to return an array (noir-lang/noir#6973)
fix: wrong module to lookup trait when using crate or super (noir-lang/noir#6974)
fix: Start RC at 1 again (noir-lang/noir#6958)
feat!: turn TypeIsMorePrivateThenItem into an error (noir-lang/noir#6953)
fix: don't fail parsing macro if there are parser warnings (noir-lang/noir#6969)
fix: error on missing function parameters (noir-lang/noir#6967)
feat: don't report warnings for dependencies (noir-lang/noir#6926)
chore: simplify boolean in a mul of a mul (noir-lang/noir#6951)
feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (noir-lang/noir#6893)
chore: Move comment as part of #6945 (noir-lang/noir#6959)
chore: Separate unconstrained functions during monomorphization (noir-lang/noir#6894)
feat!: turn CannotReexportItemWithLessVisibility into an error (noir-lang/noir#6952)
feat: lock on Nargo.toml on several nargo commands (noir-lang/noir#6941)
feat: don't simplify SSA instructions when creating them from a string (noir-lang/noir#6948)
chore: add reproduction case for bignum test failure (noir-lang/noir#6464)
chore: bump `noir-gates-diff` (noir-lang/noir#6949)
feat(test): Enable the test fuzzer for Wasm (noir-lang/noir#6835)
chore: also print test output to stdout in CI (noir-lang/noir#6930)
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 7, 2025
feat: `--pedantic-solving` flag (noir-lang/noir#6716)
feat!: update `aes128_encrypt` to return an array (noir-lang/noir#6973)
fix: wrong module to lookup trait when using crate or super (noir-lang/noir#6974)
fix: Start RC at 1 again (noir-lang/noir#6958)
feat!: turn TypeIsMorePrivateThenItem into an error (noir-lang/noir#6953)
fix: don't fail parsing macro if there are parser warnings (noir-lang/noir#6969)
fix: error on missing function parameters (noir-lang/noir#6967)
feat: don't report warnings for dependencies (noir-lang/noir#6926)
chore: simplify boolean in a mul of a mul (noir-lang/noir#6951)
feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (noir-lang/noir#6893)
chore: Move comment as part of #6945 (noir-lang/noir#6959)
chore: Separate unconstrained functions during monomorphization (noir-lang/noir#6894)
feat!: turn CannotReexportItemWithLessVisibility into an error (noir-lang/noir#6952)
feat: lock on Nargo.toml on several nargo commands (noir-lang/noir#6941)
feat: don't simplify SSA instructions when creating them from a string (noir-lang/noir#6948)
chore: add reproduction case for bignum test failure (noir-lang/noir#6464)
chore: bump `noir-gates-diff` (noir-lang/noir#6949)
feat(test): Enable the test fuzzer for Wasm (noir-lang/noir#6835)
chore: also print test output to stdout in CI (noir-lang/noir#6930)
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 8, 2025
)

feat: `--pedantic-solving` flag (noir-lang/noir#6716)
feat!: update `aes128_encrypt` to return an array (noir-lang/noir#6973)
fix: wrong module to lookup trait when using crate or super (noir-lang/noir#6974)
fix: Start RC at 1 again (noir-lang/noir#6958)
feat!: turn TypeIsMorePrivateThenItem into an error (noir-lang/noir#6953)
fix: don't fail parsing macro if there are parser warnings (noir-lang/noir#6969)
fix: error on missing function parameters (noir-lang/noir#6967)
feat: don't report warnings for dependencies (noir-lang/noir#6926)
chore: simplify boolean in a mul of a mul (noir-lang/noir#6951)
feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (noir-lang/noir#6893)
chore: Move comment as part of #6945 (noir-lang/noir#6959)
chore: Separate unconstrained functions during monomorphization (noir-lang/noir#6894)
feat!: turn CannotReexportItemWithLessVisibility into an error (noir-lang/noir#6952)
feat: lock on Nargo.toml on several nargo commands (noir-lang/noir#6941)
feat: don't simplify SSA instructions when creating them from a string (noir-lang/noir#6948)
chore: add reproduction case for bignum test failure (noir-lang/noir#6464)
chore: bump `noir-gates-diff` (noir-lang/noir#6949)
feat(test): Enable the test fuzzer for Wasm (noir-lang/noir#6835)
chore: also print test output to stdout in CI (noir-lang/noir#6930)
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jan 8, 2025
feat: `--pedantic-solving` flag (noir-lang/noir#6716)
feat!: update `aes128_encrypt` to return an array (noir-lang/noir#6973)
fix: wrong module to lookup trait when using crate or super (noir-lang/noir#6974)
fix: Start RC at 1 again (noir-lang/noir#6958)
feat!: turn TypeIsMorePrivateThenItem into an error (noir-lang/noir#6953)
fix: don't fail parsing macro if there are parser warnings (noir-lang/noir#6969)
fix: error on missing function parameters (noir-lang/noir#6967)
feat: don't report warnings for dependencies (noir-lang/noir#6926)
chore: simplify boolean in a mul of a mul (noir-lang/noir#6951)
feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (noir-lang/noir#6893)
chore: Move comment as part of #6945 (noir-lang/noir#6959)
chore: Separate unconstrained functions during monomorphization (noir-lang/noir#6894)
feat!: turn CannotReexportItemWithLessVisibility into an error (noir-lang/noir#6952)
feat: lock on Nargo.toml on several nargo commands (noir-lang/noir#6941)
feat: don't simplify SSA instructions when creating them from a string (noir-lang/noir#6948)
chore: add reproduction case for bignum test failure (noir-lang/noir#6464)
chore: bump `noir-gates-diff` (noir-lang/noir#6949)
feat(test): Enable the test fuzzer for Wasm (noir-lang/noir#6835)
chore: also print test output to stdout in CI (noir-lang/noir#6930)
fix: Non-determinism from under constrained checks (noir-lang/noir#6945)
chore: use logs for benchmarking (noir-lang/noir#6911)
chore: bump `noir-gates-diff` (noir-lang/noir#6944)
chore: bump `noir-gates-diff` (noir-lang/noir#6943)
fix: Show output of `test_program_is_idempotent` on failure (noir-lang/noir#6942)
chore: delete a bunch of dead code from `noirc_evaluator` (noir-lang/noir#6939)
feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (noir-lang/noir#6882)
chore: Bump arkworks to version `0.5.0` (noir-lang/noir#6871)
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.

2 participants