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!: Ban Fields in for loop indices and bitwise ops #4376

Merged
merged 16 commits into from
Feb 22, 2024
Merged

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Feb 14, 2024

Description

Problem*

Resolves #3639
Resolves #4193

Summary*

Uses the new TypeVariableKind::Integer in for loops and bitwise operations to prevent Field types from being used there.

Removes the old delayed_type_checks hack.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [Exceptional Case] 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.

@kevaundray
Copy link
Contributor

Note the PR body is repeated, not sure if you meant to state that it resolves two different issues:

Resolves https://github.com/noir-lang/noir/issues/3639
Resolves https://github.com/noir-lang/noir/issues/3639

@jfecher
Copy link
Contributor Author

jfecher commented Feb 14, 2024

@kevaundray those issues are correct, the other PR didn't quite resolve them since it implemented the new type variable kind but the new kind was unused until this PR

Edit: Whoops, the first is correct but the second was meant to be a different (but also closed) issue. I'll edit the description and re-open both issues for clarity.

@sirasistant
Copy link
Contributor

sirasistant commented Feb 15, 2024

There is a typing issue in sort_via in std, I commented sort_via and run the println in ssa_gen/codegen_for:

      println!(
            "Type of start index is {:?} type of iterator is {:?} type of end index is {:?}",
            self.builder.type_of_value(start_index),
            index_type,
            self.builder.type_of_value(end_index)
        );

And it gave:
Type of start index is Numeric(NativeField) type of iterator is Numeric(Unsigned { bit_size: 32 }) type of end index is Numeric(NativeField)
in #4290 example (the iterator is inconsistent with the range bounds)
It's weird because it's the same error as before, maybe I did something wrong?

Copy link
Contributor

github-actions bot commented Feb 15, 2024

Changes to circuit sizes

Generated at commit: 639427428a162fb7285591f445a43c27f04688bd, compared to commit: ceb8001e213066bd8a01d90657951ce5f1419f3a

🧾 Summary (10% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
array_sort +28 ❌ +90.32% +2,817 ❌ +2934.38%
slice_dynamic_index +110 ❌ +5.29% +210 ❌ +2.18%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
array_sort 59 (+28) +90.32% 2,913 (+2,817) +2934.38%
slice_dynamic_index 2,189 (+110) +5.29% 9,821 (+210) +2.18%
slices 601 (+31) +5.44% 4,294 (+30) +0.70%

@jfecher
Copy link
Contributor Author

jfecher commented Feb 15, 2024

@sirasistant good catch, I found a bug when unifying TypeVariableKind::Integer where we still succeeded previously on Fields: 6bc4e23

@jfecher jfecher changed the title fix: Use new TypeVariableKind in loops and bitwise ops fix!: Use new TypeVariableKind in loops and bitwise ops Feb 15, 2024
@jfecher
Copy link
Contributor Author

jfecher commented Feb 15, 2024

Wow, ok. So after the change it turns out we were using Fields in for loops in a lot of places. So this is actually quite the breaking change (I've since fixed each of these, hence the changes in the stdlib):

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:21:15
   │
21 │     for _r in 0..rf / 2 {
   │               ---------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:22:18
   │
22 │         for i in 0..state.len() {
   │                  --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:25:18
   │
25 │         for i in 0..state.len() {
   │                  --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:33:15
   │
33 │     for _r in 0..rp {
   │               -----
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:34:18
   │
34 │         for i in 0..state.len() {
   │                  --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:43:15
   │
43 │     for _r in 0..rf / 2 {
   │               ---------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:44:18
   │
44 │         for i in 0..state.len() {
   │                  --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:47:18
   │
47 │         for i in 0..state.len() {
   │                  --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:70:14
   │
70 │     for k in 0..msg.len() {
   │              ------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon/bn254.nr:96:14
   │
96 │     for i in 0..input.len() {
   │              --------------
   │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:105:14
    │
105 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:114:14
    │
114 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:123:14
    │
123 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:132:14
    │
132 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:141:14
    │
141 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:150:14
    │
150 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:159:14
    │
159 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:168:14
    │
168 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:177:14
    │
177 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:186:14
    │
186 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:195:14
    │
195 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:204:14
    │
204 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:213:14
    │
213 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:222:14
    │
222 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/poseidon/bn254.nr:231:14
    │
231 │     for i in 0..input.len() {
    │              --------------
    │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon.nr:37:14
   │
37 │     for r in 0..(ark.len() / state.len()) {
   │              ---------------------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon.nr:38:18
   │
38 │         for i in 0..state.len() {
   │                  --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon.nr:44:22
   │
44 │             for i in 1..state.len() {
   │                      --------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon.nr:67:14
   │
67 │     for k in 0..msg.len() {
   │              ------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon.nr:94:14
   │
94 │     for i in 0..x.len() {
   │              ----------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/poseidon.nr:96:18
   │
96 │         for j in 0..x.len() {
   │                  ----------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/hash/mimc.nr:11:14
   │
11 │     for i in 1..constants.len() {
   │              ------------------
   │

error: The type Field cannot be used in a for loop
    ┌─ std/hash/mimc.nr:120:17
    │
120 │     for elem in array {
    │                 -----
    │

error: The type Field cannot be used in a for loop
    ┌─ std/array.nr:122:14
    │
122 │     for i in 0..a.len() {
    │              ----------
    │

error: The type Field cannot be used in a for loop
  ┌─ std/merkle.nr:9:14
  │
9 │     for i in 0..n {
  │              ----
  │

error: The type Field cannot be used in a for loop
   ┌─ std/sha512.nr:95:14
   │
95 │     for k in 0..msg.len() {
   │              ------------
   │

error: The type Field cannot be used in a for loop
    ┌─ std/ec.nr:164:14
    │
164 │     for i in 0..N_BITS {
    │              ---------
    │

error: Expected type Field, found type u64
   ┌─ std/array.nr:18:48
   │
18 │             let pos = find_index(sorted_index, i);
   │                                                -
   │

error: Types in a binary operation should match, but found Field and u64
   ┌─ std/array.nr:19:20
   │
19 │             assert(sorted_index[pos] == i);
   │                    ----------------------
   │

error: expected type [Field; N], found type [u64; N]
   ┌─ std/array.nr:34:87
   │
34 │     unconstrained fn get_sorting_index<Env>(self, ordering: fn[Env](T, T) -> bool) -> [Field; N] {
   │                                                                                       ---------- expected [Field; N] because of return type
   ·
52 │         result
   │         ------ [u64; N] returned here
   │

error: The type Field cannot be used in a for loop
   ┌─ std/array.nr:59:21
   │
59 │         for elem in self {
   │                     ----
   │

error: The type Field cannot be used in a for loop
   ┌─ std/array.nr:71:18
   │
71 │         for i in 1 .. self.len() {
   │                  ---------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/array.nr:82:21
   │
82 │         for elem in self {
   │                     ----
   │

error: The type Field cannot be used in a for loop
   ┌─ std/array.nr:93:18
   │
93 │         for i in 1 .. self.len() {
   │                  ---------------
   │

error: The type Field cannot be used in a for loop
    ┌─ std/array.nr:102:21
    │
102 │         for elem in self {
    │                     ----
    │

error: The type Field cannot be used in a for loop
    ┌─ std/array.nr:111:21
    │
111 │         for elem in self {
    │                     ----
    │

error: The type Field cannot be used in a for loop
   ┌─ std/collections/bounded_vec.nr:47:18
   │
47 │         for i in 0..array.len() {
   │                  --------------
   │

error: Types in a binary operation should match, but found Field and u64
   ┌─ std/collections/bounded_vec.nr:60:29
   │
60 │             exceeded_len |= i == append_len;
   │                             ---------------
   │

error: Types in a binary operation should match, but found Field and u64
   ┌─ std/collections/bounded_vec.nr:81:29
   │
81 │             exceeded_len |= i == self.len;
   │                             -------------
   │

error: The type Field cannot be used in a for loop
   ┌─ std/slice.nr:38:21
   │
38 │         for elem in other {
   │                     -----
   │

error: The type Field cannot be used in a for loop
   ┌─ std/cmp.nr:24:18
   │
24 │         for i in 0 .. self.len() {
   │                  ---------------
   │

error: The type Field cannot be used in a for loop
    ┌─ std/cmp.nr:201:18
    │
201 │         for i in 0 .. self.len() {
    │                  ---------------
    │

@jfecher jfecher changed the title fix!: Use new TypeVariableKind in loops and bitwise ops fix!: Ban Fields in for loop indices and bitwise ops Feb 15, 2024
@jfecher
Copy link
Contributor Author

jfecher commented Feb 15, 2024

@sirasistant I've found the core issue in #4290 is a result from a bug in the monomorphizer. I've pulled out the fix here: #4386. In the general case though, this PR will still be required to prevent Fields in for loops.

@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Feb 15, 2024

cc @noir-lang/developerrelations we have warnings in Nargo for this breaking change for quite a while now; flagging for early heads up still as this might break quite some code from the community once merged and released.

@sirasistant
Copy link
Contributor

sirasistant commented Feb 15, 2024

Should we make len() return type be an usize (u64)? That'll probably reduce the blast radius of this breaking change, since some of the failures are iterations using 0..arr.len()

@jfecher
Copy link
Contributor Author

jfecher commented Feb 15, 2024

@sirasistant I made that change in this PR but I'm open to debate on whether we should keep it or not.

@sirasistant
Copy link
Contributor

Ah cool, I haven't look at the code yet. That sounds good to me :D

@jfecher
Copy link
Contributor Author

jfecher commented Feb 21, 2024

error: package bumpalo v3.15.1 cannot be built because it requires rustc 1.73.0 or newer, while the currently active rustc version is 1.72.1

Not sure why the CI is selecting bumpalo v3.15.1 when our Cargo.lock specifies v3.13.0

@TomAFrench
Copy link
Member

Spoke in person but for posterity, this is because we ignore the lockfile in the "MSRV check" workflow as this ensures that we'll be able to publish to crates.io because we want to know if this will fail before we push out a new version.

We shouldn't block non-release PRs on this however. I'll update this to run on master and raise issues in future.

@jfecher jfecher added this pull request to the merge queue Feb 22, 2024
Merged via the queue into master with commit 601fd9a Feb 22, 2024
47 checks passed
@jfecher jfecher deleted the jf/use-new-tv-kind branch February 22, 2024 15:43
@TomAFrench TomAFrench mentioned this pull request Feb 24, 2024
5 tasks
TomAFrench added a commit that referenced this pull request Feb 24, 2024
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

This removes some unwanted prints which were left in from #4376

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** 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.
TomAFrench added a commit that referenced this pull request Feb 26, 2024
* master: (39 commits)
  chore: remove unwanted prints (#4419)
  fix: remove print from monomorphization pass (#4417)
  chore(ssa): Remove mem2reg run before flattening (#4415)
  feat: Add HashMap to the stdlib (#4242)
  fix!: Ban Fields in for loop indices and bitwise ops (#4376)
  chore: Add #[recursive] Explainer to Documentation (#4399)
  feat(ci): Use wasm-opt when compiling wasm packages (#4334)
  fix: add handling to `noir_wasm` for projects without dependencies (#4344)
  chore: rename parameter 'filter' to 'level' in 'init_log_level' (#4403)
  chore!: bump msrv to 1.73.0 (#4406)
  chore: fix docker test workflows (#4308)
  chore: Update Vec docs (#4400)
  feat: update error message when trying to load workspace as dependency (#4393)
  chore: bump webpack dependencies (#4346)
  fix: correct invalid brillig codegen for `EmbeddedCurvePoint.add` (#4382)
  chore: remove dependency on generational-arena (#4207)
  fix(docs): update install versions (#4396)
  fix: Enforce matching types of binary ops in SSA (#4391)
  fix(docs): Update noirjs_app for 0.23 (#4378)
  chore(ci): add alerts for failed publishes (#4388)
  ...
TomAFrench added a commit that referenced this pull request Feb 26, 2024
* master: (440 commits)
  chore: remove duplicate `parse_all` function in wasm compiler (#4411)
  chore(ci): prevent msrv checks from blocking PRs (#4414)
  feat: expose separate functions to compile programs vs contracts in `noir_wasm` (#4413)
  chore: do not panic when dividing by zero (#4424)
  chore: remove unwanted prints (#4419)
  fix: remove print from monomorphization pass (#4417)
  chore(ssa): Remove mem2reg run before flattening (#4415)
  feat: Add HashMap to the stdlib (#4242)
  fix!: Ban Fields in for loop indices and bitwise ops (#4376)
  chore: Add #[recursive] Explainer to Documentation (#4399)
  feat(ci): Use wasm-opt when compiling wasm packages (#4334)
  fix: add handling to `noir_wasm` for projects without dependencies (#4344)
  chore: rename parameter 'filter' to 'level' in 'init_log_level' (#4403)
  chore!: bump msrv to 1.73.0 (#4406)
  chore: fix docker test workflows (#4308)
  chore: Update Vec docs (#4400)
  feat: update error message when trying to load workspace as dependency (#4393)
  chore: bump webpack dependencies (#4346)
  fix: correct invalid brillig codegen for `EmbeddedCurvePoint.add` (#4382)
  chore: remove dependency on generational-arena (#4207)
  ...
TomAFrench added a commit that referenced this pull request Feb 27, 2024
* master: (45 commits)
  chore(docs): correct 'Edit this page' URL for dev docs (#4433)
  feat: Sync from aztec-packages (#4390)
  chore(docs): fix external contributor force push workflow (#4437)
  chore!: Remove empty value from bounded vec (#4431)
  chore: nargo fmt (#4434)
  feat: add poseidon2 opcode implementation for acvm/brillig, and Noir (#4398)
  fix: remove panic when generic array length is not resolvable (#4408)
  chore(ci): enforce formatting of noir code in CI (#4422)
  fix: correct formatting for databus visibility types (#4423)
  chore: remove duplicate `parse_all` function in wasm compiler (#4411)
  chore(ci): prevent msrv checks from blocking PRs (#4414)
  feat: expose separate functions to compile programs vs contracts in `noir_wasm` (#4413)
  chore: do not panic when dividing by zero (#4424)
  chore: remove unwanted prints (#4419)
  fix: remove print from monomorphization pass (#4417)
  chore(ssa): Remove mem2reg run before flattening (#4415)
  feat: Add HashMap to the stdlib (#4242)
  fix!: Ban Fields in for loop indices and bitwise ops (#4376)
  chore: Add #[recursive] Explainer to Documentation (#4399)
  feat(ci): Use wasm-opt when compiling wasm packages (#4334)
  ...
TomAFrench added a commit that referenced this pull request Feb 27, 2024
* master: (46 commits)
  feat: Sync from aztec-packages (#4438)
  chore(docs): correct 'Edit this page' URL for dev docs (#4433)
  feat: Sync from aztec-packages (#4390)
  chore(docs): fix external contributor force push workflow (#4437)
  chore!: Remove empty value from bounded vec (#4431)
  chore: nargo fmt (#4434)
  feat: add poseidon2 opcode implementation for acvm/brillig, and Noir (#4398)
  fix: remove panic when generic array length is not resolvable (#4408)
  chore(ci): enforce formatting of noir code in CI (#4422)
  fix: correct formatting for databus visibility types (#4423)
  chore: remove duplicate `parse_all` function in wasm compiler (#4411)
  chore(ci): prevent msrv checks from blocking PRs (#4414)
  feat: expose separate functions to compile programs vs contracts in `noir_wasm` (#4413)
  chore: do not panic when dividing by zero (#4424)
  chore: remove unwanted prints (#4419)
  fix: remove print from monomorphization pass (#4417)
  chore(ssa): Remove mem2reg run before flattening (#4415)
  feat: Add HashMap to the stdlib (#4242)
  fix!: Ban Fields in for loop indices and bitwise ops (#4376)
  chore: Add #[recursive] Explainer to Documentation (#4399)
  ...
github-merge-queue bot pushed a commit that referenced this pull request Mar 11, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>0.25.0</summary>

## [0.25.0](v0.24.0...v0.25.0)
(2024-03-11)


### ⚠ BREAKING CHANGES

* Internal as a macro
(AztecProtocol/aztec-packages#4898)
* reserve `unchecked` keyword
([#4432](#4432))
* Remove empty value from bounded vec
([#4431](#4431))
* Ban Fields in for loop indices and bitwise ops
([#4376](#4376))
* bump msrv to 1.73.0
([#4406](#4406))
* **ci:** Bump MSRV to 1.72.1 and enforce that ACVM can be published
using updated lockfile
([#4385](#4385))
* Restrict bit sizes
([#4235](#4235))
* move noir out of yarn-project
(AztecProtocol/aztec-packages#4479)
* note type ids
(AztecProtocol/aztec-packages#4500)

### Features

* Add eddsa_poseidon_to_pub function to stdlib with test + docs
([#4473](#4473))
([00d2c32](00d2c32))
* Add HashMap to the stdlib
([#4242](#4242))
([650ffc5](650ffc5))
* Add option to set max memory for bb.js
([#4227](#4227))
([8a6b131](8a6b131))
* Add overflow and underflow checks for unsigned integers in brillig
([#4445](#4445))
([21fc4b8](21fc4b8))
* Add poseidon2 opcode implementation for acvm/brillig, and Noir
([#4398](#4398))
([10e8292](10e8292))
* Added cast opcode and cast calldata
(AztecProtocol/aztec-packages#4423)
([78ef013](78ef013))
* Allow type aliases to reference other aliases
([#4353](#4353))
([c44ef14](c44ef14))
* Backpropagate constants in ACIR during optimization
([#3926](#3926))
([aad0da0](aad0da0))
* **ci:** Use wasm-opt when compiling wasm packages
([#4334](#4334))
([e382921](e382921))
* DAP Preflight and debugger compilation options
([#4185](#4185))
([e0ad0b2](e0ad0b2))
* Expose separate functions to compile programs vs contracts in
`noir_wasm` ([#4413](#4413))
([7cd5fdb](7cd5fdb))
* Internal as a macro
(AztecProtocol/aztec-packages#4898)
([5f57ebb](5f57ebb))
* Note type ids
(AztecProtocol/aztec-packages#4500)
([78ef013](78ef013))
* Restrict bit sizes
([#4235](#4235))
([1048f81](1048f81))
* Run tests in parallel in `nargo test`
([#4484](#4484))
([761734e](761734e))
* Skip redundant range checks in brillig
([#4460](#4460))
([cb4c1c5](cb4c1c5))
* Sync from aztec-packages
([#4483](#4483))
([fe8f277](fe8f277))
* Track stack frames and their variables in the debugger
([#4188](#4188))
([ae1a9d9](ae1a9d9))
* TypeVariableKind for just Integers
([#4118](#4118))
([c956be8](c956be8))
* Update error message when trying to load workspace as dependency
([#4393](#4393))
([d2585e7](d2585e7))


### Bug Fixes

* **acir:** Array dynamic flatten
([#4351](#4351))
([b2aaeab](b2aaeab))
* **acir:** Use types on dynamic arrays
([#4364](#4364))
([ba2c541](ba2c541))
* Add `follow_bindings` to follow `Type::Alias` links
([#4521](#4521))
([b94adb9](b94adb9))
* Add handling to `noir_wasm` for projects without dependencies
([#4344](#4344))
([4982251](4982251))
* Allow type aliases in main
([#4505](#4505))
([8a5359c](8a5359c))
* Ban Fields in for loop indices and bitwise ops
([#4376](#4376))
([601fd9a](601fd9a))
* Brillig range check with consistent bit size
([#4357](#4357))
([ea47d4a](ea47d4a))
* Build noir_codegen when publishing
([#4448](#4448))
([cb1ceee](cb1ceee))
* Consistent bit size for truncate
([#4370](#4370))
([dcd7a1e](dcd7a1e))
* Correct formatting for databus visibility types
([#4423](#4423))
([cd796de](cd796de))
* Correct invalid brillig codegen for `EmbeddedCurvePoint.add`
([#4382](#4382))
([5051ec4](5051ec4))
* **docs:** Update install versions
([#4396](#4396))
([b283637](b283637))
* **docs:** Update noirjs_app for 0.23
([#4378](#4378))
([f77f702](f77f702))
* Enforce matching types of binary ops in SSA
([#4391](#4391))
([70866ae](70866ae))
* Fix brillig slowdown when assigning arrays in loops
([#4472](#4472))
([2a53545](2a53545))
* **flake:** Stop flake.nix removing ignored-tests.txt
([#4455](#4455))
([ebaf05a](ebaf05a))
* Force src impl for == on slices
([#4507](#4507))
([1691274](1691274))
* Handling of gh deps in noir_wasm
([#4499](#4499))
([1d65370](1d65370))
* Iterative flattening pass
([#4492](#4492))
([33c1ef7](33c1ef7))
* Noir test incorrect reporting
(AztecProtocol/aztec-packages#4925)
([5f57ebb](5f57ebb))
* Only add `.nr` files to file manager
([#4380](#4380))
([8536c7c](8536c7c))
* Remove panic when generic array length is not resolvable
([#4408](#4408))
([00ab3db](00ab3db))
* Remove print from monomorphization pass
([#4417](#4417))
([27c66b3](27c66b3))
* **ssa:** Handle mergers of slices returned from calls
([#4496](#4496))
([f988d02](f988d02))
* Use correct type for numeric generics
([#4386](#4386))
([0a1d109](0a1d109))
* Variables from trait constraints being permanently bound over when
used within a trait impl
([#4450](#4450))
([ac60ef5](ac60ef5))


### Miscellaneous Chores

* Bump msrv to 1.73.0
([#4406](#4406))
([b5e5c30](b5e5c30))
* **ci:** Bump MSRV to 1.72.1 and enforce that ACVM can be published
using updated lockfile
([#4385](#4385))
([2fc95d2](2fc95d2))
* Move noir out of yarn-project
(AztecProtocol/aztec-packages#4479)
([78ef013](78ef013))
* Remove empty value from bounded vec
([#4431](#4431))
([b9384fb](b9384fb))
* Reserve `unchecked` keyword
([#4432](#4432))
([9544813](9544813))
</details>

<details><summary>0.41.0</summary>

## [0.41.0](v0.40.0...v0.41.0)
(2024-03-11)


### ⚠ BREAKING CHANGES

* Internal as a macro
(AztecProtocol/aztec-packages#4898)
* move noir out of yarn-project
(AztecProtocol/aztec-packages#4479)
* note type ids
(AztecProtocol/aztec-packages#4500)
* rename bigint_neg into bigint_sub
(AztecProtocol/aztec-packages#4420)
* Add expression width into acir
(AztecProtocol/aztec-packages#4014)
* init storage macro
(AztecProtocol/aztec-packages#4200)
* **acir:** Move `is_recursive` flag to be part of the circuit
definition (AztecProtocol/aztec-packages#4221)
* Sync commits from `aztec-packages`
([#4144](#4144))
* Breaking changes from aztec-packages
([#3955](#3955))
* Rename Arithmetic opcode to AssertZero
([#3840](#3840))
* Remove unused methods on ACIR opcodes
([#3841](#3841))
* Remove partial backend feature
([#3805](#3805))

### Features

* Add bit size to const opcode
(AztecProtocol/aztec-packages#4385)
([158c8ce](158c8ce))
* Add expression width into acir
(AztecProtocol/aztec-packages#4014)
([158c8ce](158c8ce))
* Add instrumentation for tracking variables in debugging
([#4122](#4122))
([c58d691](c58d691))
* Add poseidon2 opcode implementation for acvm/brillig, and Noir
([#4398](#4398))
([10e8292](10e8292))
* Add support for overriding expression width
([#4117](#4117))
([c8026d5](c8026d5))
* Added cast opcode and cast calldata
(AztecProtocol/aztec-packages#4423)
([78ef013](78ef013))
* Allow brillig to read arrays directly from memory
(AztecProtocol/aztec-packages#4460)
([158c8ce](158c8ce))
* Allow nested arrays and vectors in Brillig foreign calls
(AztecProtocol/aztec-packages#4478)
([158c8ce](158c8ce))
* Allow variables and stack trace inspection in the debugger
([#4184](#4184))
([bf263fc](bf263fc))
* **avm:** Back in avm context with macro - refactor context
(AztecProtocol/aztec-packages#4438)
([158c8ce](158c8ce))
* **aztec-nr:** Initial work for aztec public vm macro
(AztecProtocol/aztec-packages#4400)
([158c8ce](158c8ce))
* Aztec-packages
([#3754](#3754))
([c043265](c043265))
* Backpropagate constants in ACIR during optimization
([#3926](#3926))
([aad0da0](aad0da0))
* Breaking changes from aztec-packages
([#3955](#3955))
([5be049e](5be049e))
* Evaluation of dynamic assert messages
([#4101](#4101))
([c284e01](c284e01))
* Init storage macro
(AztecProtocol/aztec-packages#4200)
([158c8ce](158c8ce))
* Internal as a macro
(AztecProtocol/aztec-packages#4898)
([5f57ebb](5f57ebb))
* Note type ids
(AztecProtocol/aztec-packages#4500)
([78ef013](78ef013))
* Remove range constraints from witnesses which are constrained to be
constants ([#3928](#3928))
([afe9c7a](afe9c7a))
* Remove replacement of boolean range opcodes with `AssertZero` opcodes
([#4107](#4107))
([dac0e87](dac0e87))
* Speed up transformation of debug messages
([#3815](#3815))
([2a8af1e](2a8af1e))
* Sync `aztec-packages`
([#4011](#4011))
([fee2452](fee2452))
* Sync commits from `aztec-packages`
([#4068](#4068))
([7a8f3a3](7a8f3a3))
* Sync commits from `aztec-packages`
([#4144](#4144))
([0205d3b](0205d3b))
* Sync from aztec-packages
([#4483](#4483))
([fe8f277](fe8f277))


### Bug Fixes

* Deserialize odd length hex literals
([#3747](#3747))
([4000fb2](4000fb2))
* Noir test incorrect reporting
(AztecProtocol/aztec-packages#4925)
([5f57ebb](5f57ebb))
* Remove panic from `init_log_level` in `acvm_js`
([#4195](#4195))
([2e26530](2e26530))
* Return error rather instead of panicking on invalid circuit
([#3976](#3976))
([67201bf](67201bf))


### Miscellaneous Chores

* **acir:** Move `is_recursive` flag to be part of the circuit
definition (AztecProtocol/aztec-packages#4221)
([158c8ce](158c8ce))
* Move noir out of yarn-project
(AztecProtocol/aztec-packages#4479)
([78ef013](78ef013))
* Remove partial backend feature
([#3805](#3805))
([0383100](0383100))
* Remove unused methods on ACIR opcodes
([#3841](#3841))
([9e5d0e8](9e5d0e8))
* Rename Arithmetic opcode to AssertZero
([#3840](#3840))
([836f171](836f171))
* Rename bigint_neg into bigint_sub
(AztecProtocol/aztec-packages#4420)
([158c8ce](158c8ce))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Savio <72797635+Savio-Sou@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
5 participants