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(ssa): Do not replace previously constrained values #2647

Merged
merged 15 commits into from
Sep 21, 2023

Conversation

vezenovm
Copy link
Contributor

@vezenovm vezenovm commented Sep 11, 2023

Description

Problem*

Resolves #2645

Summary*

This PR simply checks whether we have an enable_side_effects instruction before caching an instruction in constant_folding. This makes sure that we only replace previously constrained values that we know do not have possible side effects.

This PR removes the optimization in this PR (#2483). As per the issue, doing this optimization during SSA can cause constant constraints failures before a dynamic constraint check has been executed.

In order to avoid this there are a few options:

  1. Do not fail on compile time constraint checks. I lean towards that this is not good as we should be able to tell a user at compile time whether a circuit they wrote is unprovable without them having to execute the program.
  2. We can track a replaced constrain statement to see which instruction it was simplified from. If it was modified because of a simplification we don't issue an error during ACIR gen and we wait until execution. This is essentially a more selective version of option 1, and would most likely not be a simple solution for marginal gains.
  3. We can remove the constrain cache entirely.

This PR went with option 3 as the optimization looks to have minimal use-cases (if any) that are not handled by simplifications during ACIR gen and ACVM. For the use-case linked in PR #2483, the backend circuit size remains the same with or without the optimization. If I add the following to the linked program above:

    assert(sender_bytes.len() == 32);
    assert(chainId_bytes.len() == 32);
    assert(recipient_bytes.len() == 32);
    assert(version_bytes.len() == 32);
    assert(content_bytes.len() == 32);
    assert(secret_hash_bytes.len() == 32);
    assert(deadline_bytes.len() == 32);
    assert(fee_bytes.len() == 32);

With the constrain cache the number of ACIR opcodes reduces from 3724 to 1036. However, the backend circuit size remains the same in both cases. Having the PR check for enable_side_effects and disabling the constrain cache when it is true was the original workaround. However, other than the linked use-case, any program that has on side effects will most likely disable this constrain cache. The fact that the final circuit size remains the same makes me lean towards removing the cache straight up.

Using the program linked in the issue:
SSA currently:

After Mem2Reg:
acir fn main f0 {
  b0(v0: Field, v1: Field):
    v104 = allocate
    v105 = allocate
    v107 = eq v0, v1
    v108 = not v107
    enable_side_effects v108
    enable_side_effects v107
    enable_side_effects u1 1
    v118 = cast v108 as Field
    v119 = cast v107 as Field
    v120 = mul v118, Field 4
    v121 = mul v119, Field 3
    v122 = add v120, v121
    v123 = cast v108 as Field
    v124 = cast v107 as Field
    v125 = cast v108 as Field
    v126 = cast v107 as Field
    v127 = cast v108 as Field
    v128 = cast v107 as Field
    v129 = mul v127, v1
    v130 = mul v128, v0
    v131 = add v129, v130
    v132 = cast v108 as Field
    v133 = cast v107 as Field
    v134 = mul v132, v0
    constrain v122 == Field 3
    v138 = cast v122 as u64
    v139 = lt Field 3, v138
    constrain v139 == u1 1
    constrain v134 == Field 5
    return 
}

After Constant Folding:
acir fn main f0 {
  b0(v0: Field, v1: Field):
    v141 = allocate
    v142 = allocate
    v143 = eq v0, v1
    v144 = not v143
    enable_side_effects u1 1
    v145 = cast v144 as Field
    v146 = cast v143 as Field
    v147 = mul v145, Field 4
    v148 = mul v146, Field 3
    v149 = add v147, v148
    v150 = mul v145, v1
    v151 = mul v146, v0
    v152 = add v150, v151
    v153 = mul v145, v0
    constrain v149 == Field 3
    constrain u1 0 == u1 1
    constrain v153 == Field 5
    return 
}

You can see that the lines

    v138 = cast v122 as u64
    v139 = lt Field 3, v138

are getting optimized out when they should not be. Because these two lines are replaced with constrain u1 0 == u1 1 we end up with a constant constraint failure that occurs before we can check that constrain v149 == Field 3 is invalid.

SSA after this PR:

After Mem2Reg:
acir fn main f0 {
  b0(v0: Field, v1: Field):
    v104 = allocate
    v105 = allocate
    v107 = eq v0, v1
    v108 = not v107
    enable_side_effects v108
    enable_side_effects v107
    enable_side_effects u1 1
    v118 = cast v108 as Field
    v119 = cast v107 as Field
    v120 = mul v118, Field 4
    v121 = mul v119, Field 3
    v122 = add v120, v121
    v123 = cast v108 as Field
    v124 = cast v107 as Field
    v125 = cast v108 as Field
    v126 = cast v107 as Field
    v127 = cast v108 as Field
    v128 = cast v107 as Field
    v129 = mul v127, v1
    v130 = mul v128, v0
    v131 = add v129, v130
    v132 = cast v108 as Field
    v133 = cast v107 as Field
    v134 = mul v132, v0
    constrain v122 == Field 3
    v138 = cast v122 as u64
    v139 = lt Field 3, v138
    constrain v139 == u1 1
    constrain v134 == Field 5
    return 
}

After Constant Folding:
acir fn main f0 {
  b0(v0: Field, v1: Field):
    v141 = allocate
    v142 = allocate
    v143 = eq v0, v1
    v144 = not v143
    enable_side_effects u1 1
    v145 = cast v144 as Field
    v146 = cast v143 as Field
    v147 = mul v145, Field 4
    v148 = mul v146, Field 3
    v149 = add v147, v148
    v150 = mul v145, v1
    v151 = mul v146, v0
    v152 = add v150, v151
    v153 = mul v145, v0
    constrain v149 == Field 3
    v154 = cast v149 as u64
    v155 = lt Field 3, v154
    constrain v155 == u1 1
    constrain v153 == Field 5
    return 
}

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

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

@vezenovm vezenovm changed the title fix(ssa): Do not simplify ArrayLen for slices in SSA fix(ssa): Do not replace previously constrained values when side effects are enabled Sep 12, 2023
vezenovm and others added 2 commits September 12, 2023 17:00
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
kevaundray
kevaundray previously approved these changes Sep 15, 2023
@kevaundray
Copy link
Collaborator

Could you resolve the merge conflicts por favor?

@vezenovm
Copy link
Contributor Author

Conflicts resolved this is ready for review again

Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

I think this PR is too pessimistic. Since the default value of enable side effects is true, this can effectively disable constant folding for an entire program (after the first if when enable_side_effects is first inserted). I think a better solution would be finding the side-effectful instructions that may differ depending on the status of enable_side_effects and selectively disabling those.

compiler/noirc_evaluator/src/ssa/opt/constant_folding.rs Outdated Show resolved Hide resolved
@vezenovm
Copy link
Contributor Author

Since the default value of enable side effects is true, this can effectively disable constant folding for an entire program

I will take a look at how I can select specific instructions. Although, this PR wouldn't disable constant folding for an entire program, it would just disable usage of the constrain statement cache and replacing those values.

@vezenovm
Copy link
Contributor Author

I think a better solution would be finding the side-effectful instructions that may differ depending on the status of enable_side_effects and selectively disabling those.

Actually I think because this only disables the constrain cache this PR does do what this says by only disabling folding the dynamic part of a constrain instruction.

@vezenovm vezenovm changed the title fix(ssa): Do not replace previously constrained values when side effects are enabled fix(ssa): Do not replace previously constrained values Sep 21, 2023
@vezenovm
Copy link
Contributor Author

I have updated this PR to remove the constrain cache inside of constant folding. Reasoning for this can be found in the PR description.

@jfecher jfecher added this pull request to the merge queue Sep 21, 2023
Merged via the queue into master with commit d528844 Sep 21, 2023
21 checks passed
@jfecher jfecher deleted the mv/slice-len-check-fix branch September 21, 2023 20:34
kevaundray added a commit that referenced this pull request Dec 1, 2023
🤖 I have created a release *beep* *boop*
---


<details><summary>0.20.0</summary>

## [0.20.0](v0.19.5...v0.20.0)
(2023-12-01)


### ⚠ BREAKING CHANGES

* avoid integer overflows
([#2713](#2713))
* return Pedersen structure in stdlib
([#3190](#3190))
* noir-wasm outputs debug symbols
([#3317](#3317))
* move mimc to hash submodule
([#3361](#3361))
* bump MSRV to 1.71.1
([#3353](#3353))
* Add semver checks for the compiler version in Nargo.toml
([#3336](#3336))
* Move circuit serialization circuit into acir
([#3345](#3345))
* change stdlib function `pedersen` to `pedersen_commitment`
([#3341](#3341))
* expose pedersen hash in acir and bb solver
([#3269](#3269))
* Switch to new pedersen implementation
([#3151](#3151))
* Pass ACIR to ACVM by reference rather than passing ownership
([#2872](#2872))
* Make for loops a statement
([#2975](#2975))
* **traits:** trait functions with a default implementation must not be
followed by a semicolon
([#2987](#2987))
* **wasm:** improve and simplify wasm compiler interface
([#2976](#2976))
* **wasm:** update wasm artifacts to match cli artifacts
([#2973](#2973))
* Maintain shape of foreign call arguments
([#2935](#2935))
* update to `bb` version 0.7.3
([#2729](#2729))
* **noir_js:** Rename inner and outer proof methods
([#2845](#2845))
* `generateWitness` now returns a serialized witness file
([#2842](#2842))
* Issue an error when a module is declared twice & fix module search
path ([#2801](#2801))
* Default integers to u64
([#2764](#2764))

### Features

* `compute_note_hash_and_nullifier` check
([#3216](#3216))
([4963c6c](4963c6c))
* **abi:** Throw errors rather than returning string from
`noirc_abi_wasm`
([#2817](#2817))
([df7b42c](df7b42c))
* **abi:** Tuples as inputs/outputs to main
([#2899](#2899))
([d8bd78f](d8bd78f))
* **acir:** Enable dynamic indices on non-homogenous arrays
([#2703](#2703))
([622d2e4](622d2e4))
* **acir:** Handle dynamic array operations for nested slices
([#3187](#3187))
([e026319](e026319))
* **acir:** Set dynamic array values
([#3054](#3054))
([e871866](e871866))
* **acvm_js:** Export black box solver functions
([#2812](#2812))
([da8a98e](da8a98e))
* **acvm:** Separate ACVM optimizations and transformations
([#2979](#2979))
([5865d1a](5865d1a))
* Add --check option to nargo fmt for dry-run formatting verification
([#3530](#3530))
([4469707](4469707))
* Add `destroy` method to `Noir`
([#3105](#3105))
([7e40274](7e40274))
* Add `execute` method to `Noir` class
([#3081](#3081))
([17bdd7e](17bdd7e))
* Add `FieldElement::from&lt;usize&gt;` implementation
([#3647](#3647))
([8b7c5aa](8b7c5aa))
* Add `noir_codegen` package
([#3392](#3392))
([6c4cd4d](6c4cd4d))
* Add ACIR serializer C++ codegen
([#2961](#2961))
([7556982](7556982))
* Add an options object to `BarretenbergBackend` constructor
([#3105](#3105))
([7e40274](7e40274))
* Add aztec selectors for event structs
([#2983](#2983))
([982380e](982380e))
* Add bb interface implementation
([#2902](#2902))
([fe92dc0](fe92dc0))
* Add check for overlapping generic traits
([#3307](#3307))
([8cf81b6](8cf81b6))
* Add conditional compilation of methods based on the underlying field
being used ([#3045](#3045))
([2e008e2](2e008e2))
* Add crate for pub modifier
([#3271](#3271))
([e7a1a1a](e7a1a1a))
* Add debugger commands to introspect (and modify) the current state
([#3391](#3391))
([9e1ad85](9e1ad85))
* Add experimental REPL-based debugger
([#2995](#2995))
([281c696](281c696))
* Add exports of JS black box solvers to noirJS
([#3295](#3295))
([8369871](8369871))
* Add generic count check for trait methods
([#3382](#3382))
([a9f9717](a9f9717))
* Add JS types for ABI and input maps
([#3023](#3023))
([599e7a1](599e7a1))
* Add LSP command to profile opcodes in vscode
([#3496](#3496))
([6fbf77a](6fbf77a))
* Add lsp formatting
([#3433](#3433))
([286c876](286c876))
* Add noir types package
([#2893](#2893))
([e8fc868](e8fc868))
* Add package version to Nargo.toml metadata
([#3427](#3427))
([9e1717c](9e1717c))
* Add profile info print out
([#3425](#3425))
([a8b5fa8](a8b5fa8))
* Add semver checks for the compiler version in Nargo.toml
([#3336](#3336))
([0e530cf](0e530cf))
* Add special case for boolean AND in acir-gen
([#3615](#3615))
([824039b](824039b))
* Add support for tuple values in `noir_codegen`
([#3592](#3592))
([346d75f](346d75f))
* Allow a trait to be implemented multiple times for the same struct
([#3292](#3292))
([51831df](51831df))
* Allow providing custom foreign call executors to `execute_circuit`
([#3506](#3506))
([d27db33](d27db33))
* Allow traits to have generic functions
([#3365](#3365))
([0f9af65](0f9af65))
* Avoid integer overflows
([#2713](#2713))
([7d7d632](7d7d632))
* Aztec-packages
([#3599](#3599))
([2cd6dc3](2cd6dc3))
* Aztec-packages
([#3626](#3626))
([e0a96ea](e0a96ea))
* Cache debug artifacts
([#3133](#3133))
([c5a6229](c5a6229))
* Check where clauses when searching for trait impls
([#3407](#3407))
([84c6604](84c6604))
* Codegen typed interfaces for functions in `noir_codegen`
([#3533](#3533))
([290c463](290c463))
* Compile without a backend
([#3437](#3437))
([d69cf5d](d69cf5d))
* Complex slice inputs for dynamic slice builtins
([#3617](#3617))
([8b23b34](8b23b34))
* Contract events in artifacts
([#2873](#2873))
([4765c82](4765c82))
* Copy on write optimization for brillig
([#3522](#3522))
([da29c02](da29c02))
* Data bus ([#3508](#3508))
([6b0bdbc](6b0bdbc))
* **debugger:** Highlight current src code loc
([#3174](#3174))
([6b87582](6b87582))
* **debugger:** Print limited source code context
([#3217](#3217))
([dcda1c7](dcda1c7))
* Default integers to u64
([#2764](#2764))
([01cb041](01cb041))
* Dynamic indexing of non-homogenous slices
([#2883](#2883))
([72c3661](72c3661))
* Enable the `fmt` command in the help menu
([#3328](#3328))
([63d414c](63d414c))
* Expand trait impl overlap check to cover generic types
([#3320](#3320))
([a01549b](a01549b))
* Export `CompiledCircuit` from codegened TS
([#3589](#3589))
([e06c675](e06c675))
* Expose pedersen hash in acir and bb solver
([#3269](#3269))
([0108b6c](0108b6c))
* Extract Brillig VM to allow step debugging
([#3259](#3259))
([f6431f9](f6431f9))
* Format infix expressions
([#3001](#3001))
([7926ada](7926ada))
* **formatter:** Add formatter support for array literals
([#3061](#3061))
([a535321](a535321))
* Handle constant index operations on simple slices
([#3464](#3464))
([7ae12f8](7ae12f8))
* Handle warnings in evaluator
([#3205](#3205))
([5cfd156](5cfd156))
* Implement `bound_constraint_with_offset` in terms of `AcirVar`s
([#3233](#3233))
([8d89cb5](8d89cb5))
* Implement automatic dereferencing for index expressions
([#3082](#3082))
([8221bfd](8221bfd))
* Implement automatic dereferencing for indexing lvalues
([#3083](#3083))
([6e2b70a](6e2b70a))
* Implement euclidean division and signed division in terms of
`AcirVar`s ([#3230](#3230))
([b8b7782](b8b7782))
* Implement impl specialization
([#3087](#3087))
([44716fa](44716fa))
* Implement integer printing
([#3577](#3577))
([6601408](6601408))
* Implement raw string literals
([#3556](#3556))
([87a302f](87a302f))
* Implement string escape sequences
([#2803](#2803))
([f7529b8](f7529b8))
* Implement where clauses on impls
([#3324](#3324))
([4c3d1de](4c3d1de))
* **lsp:** Add "info" codelens
([#2982](#2982))
([80770d9](80770d9))
* **lsp:** Add goto definition for functions
([#3656](#3656))
([7bb7356](7bb7356))
* Maintain shape of foreign call arguments
([#2935](#2935))
([f7869e6](f7869e6))
* Make generic impls callable
([#3297](#3297))
([8d9b738](8d9b738))
* Manage breakpoints and allow restarting a debugging session
([#3325](#3325))
([f502108](f502108))
* Nargo test runtime callstacks and assert messages without string
matching ([#2953](#2953))
([1b6a4e6](1b6a4e6))
* **noir_js:** Allow providing foreign call handlers in noirJS
([#3294](#3294))
([c76b0f8](c76b0f8))
* Noir-wasm outputs debug symbols
([#3317](#3317))
([f9933fa](f9933fa))
* Noir-wasm takes dependency graph
([#3213](#3213))
([a2c8ebd](a2c8ebd))
* Old docs issues
([#3195](#3195))
([26746c5](26746c5))
* Optimize euclidean division acir-gen
([#3121](#3121))
([2c175c0](2c175c0))
* Oracle mocker for nargo test
([#2928](#2928))
([0dd1e77](0dd1e77))
* Pass ACIR to ACVM by reference rather than passing ownership
([#2872](#2872))
([b3a9c34](b3a9c34))
* Pass brillig bytecode to VM by reference
([#3030](#3030))
([4ee290b](4ee290b))
* Perform compile-time euclidean division on constants
([#3231](#3231))
([3866d7e](3866d7e))
* Prevent unnecessary witness creation in euclidean division
([#2980](#2980))
([c6f660e](c6f660e))
* Properly track equivalence of witnesses generated for black box
functions ([#3428](#3428))
([20b70c2](20b70c2))
* Provide formatting subcommand
([#2640](#2640))
([a38b15f](a38b15f))
* Publish aztec build of noir_wasm
([#3049](#3049))
([3b51f4d](3b51f4d))
* Refactor debugger and separate core from UI
([#3308](#3308))
([8466810](8466810))
* Remove redundant predicate from brillig quotients
([#2784](#2784))
([a8f18c5](a8f18c5))
* Remove type arrays for flat slices
([#3466](#3466))
([8225b2b](8225b2b))
* Remove unnecessary truncation of boolean multiplication
([#3122](#3122))
([39dbcf1](39dbcf1))
* Replace boolean range constraints with arithmetic opcodes
([#3234](#3234))
([949222c](949222c))
* Return compilation errors from noir_wasm
([#3091](#3091))
([55f63c9](55f63c9))
* Return Pedersen structure in stdlib
([#3190](#3190))
([be30d59](be30d59))
* Reuse witnesses more when interacting with memory
([#3658](#3658))
([5a4a73d](5a4a73d))
* Reuse witnesses which have been assigned constant values during ACIR
gen ([#3137](#3137))
([9eb43e2](9eb43e2))
* Save Brillig execution state in ACVM
([#3026](#3026))
([88682da](88682da))
* Send and receive unflattened public inputs to backend
([#3543](#3543))
([a7bdc67](a7bdc67))
* Solve `fixed_base_scalar_mul` black box functions in rust
([#3153](#3153))
([1c1afbc](1c1afbc))
* **ssa:** Multiple slice mergers
([#2753](#2753))
([8f76fe5](8f76fe5))
* **stdlib:** Optimize constraint counts in sha256/sha512
([#3253](#3253))
([d3be552](d3be552))
* Switch to new pedersen implementation
([#3151](#3151))
([35fb3f7](35fb3f7))
* **traits:** Add impl Trait as function return type
[#2397](#2397)
([#3176](#3176))
([4cb2024](4cb2024))
* **traits:** Add trait impl for buildin types
([#2964](#2964))
([2c87b27](2c87b27))
* **traits:** Added checks for duplicated trait associated items (types,
consts, functions)
([#2927](#2927))
([d49492c](d49492c))
* **traits:** Allow multiple traits to share the same associated
function name and to be implemented for the same type
([#3126](#3126))
([004f8dd](004f8dd))
* **traits:** Implement trait bounds typechecker + monomorphizer passes
([#2717](#2717))
([5ca99b1](5ca99b1))
* **traits:** Improve support for traits static method resolution
([#2958](#2958))
([0d0d8f7](0d0d8f7))
* **traits:** Multi module support for traits
([#2844](#2844))
([4deb07f](4deb07f))
* Use ranges instead of a vector for input witness
([#3314](#3314))
([b12b7ec](b12b7ec))
* **wasm:** Improve and simplify wasm compiler interface
([#2976](#2976))
([1b5124b](1b5124b))
* **wasm:** Update wasm artifacts to match cli artifacts
([#2973](#2973))
([ce16c0b](ce16c0b))


### Bug Fixes

* "Missing trait impl" error in trait dispatch
([#3440](#3440))
([52daaec](52daaec))
* `compute_note_hash_and_nullifier` compiler check
([#3351](#3351))
([4e2d35f](4e2d35f))
* **3275:** Activate brillig modulo test with negative integers
([#3318](#3318))
([31c493c](31c493c))
* **3300:** Cache warnings into debug artefacts
([#3313](#3313))
([cb5a15b](cb5a15b))
* ACIR optimizer should update assertion messages
([#3010](#3010))
([758b6b6](758b6b6))
* **acvm:** Return false rather than panicking on invalid ECDSA
signatures ([#2783](#2783))
([155abc0](155abc0))
* Add `pub` modifier to grumpkin functions
([#3036](#3036))
([f8990d7](f8990d7))
* Add compiler error message for invalid input types
([#3220](#3220))
([989e80d](989e80d))
* Add size checks to integer literals
([#3236](#3236))
([7f8fe8c](7f8fe8c))
* Adding proving key initialization
([#3322](#3322))
([3383740](3383740))
* Allow `where` clause on all functions and improve error message
([#3465](#3465))
([1647e33](1647e33))
* Allow constructors in parentheses in `if` conditions and `for` ranges
([#3219](#3219))
([ad192d1](ad192d1))
* Allow two `TypeVariable::Constant(N)` to unify even if their constants
are not equal ([#3225](#3225))
([cc4ca4b](cc4ca4b))
* Apply predicate to over/underflow checks
([#3494](#3494))
([fc3edf7](fc3edf7))
* **aztec_nr:** Serialise arrays of structs
([#3401](#3401))
([e979a58](e979a58))
* Change non-constant argument errors from `to_be_radix` from ICE to
proper error ([#3048](#3048))
([19ce286](19ce286))
* Check for overflow with hexadecimal inputs
([#3004](#3004))
([db1e736](db1e736))
* Compiler version error message
([#3558](#3558))
([026a358](026a358))
* Complete debug metadata
([#3228](#3228))
([2f6509d](2f6509d))
* Conditionally run the "Create or Update PR" step in acir artifacts
rebuild workflow
([#2849](#2849))
([63da875](63da875))
* Corrected the formatting of error message parameters in index out of
bounds error ([#3630](#3630))
([3bba386](3bba386))
* **debugger:** Step through foreign calls and breakpoints inside
Brillig blocks ([#3511](#3511))
([5d77d7a](5d77d7a))
* Determinism of fallback transformer
([#3100](#3100))
([12daad1](12daad1))
* Disable modulo for fields
([#3009](#3009))
([7e68976](7e68976))
* Disallow returning constant values
([#2978](#2978))
([79c2e88](79c2e88))
* Do not perform dead instruction elimination on mod,div unless rhs is
constant ([#3141](#3141))
([af3d771](af3d771))
* Do not simply divisions
([#3664](#3664))
([e5b981b](e5b981b))
* Docker builds ([#3620](#3620))
([f3eac52](f3eac52))
* **docs:** Update `editUrl` path for docusaurus
([#3184](#3184))
([4646a93](4646a93))
* Download expected `bb` version if installed backend has version
mismatch ([#3150](#3150))
([3f03435](3f03435))
* Error message for assigning the wrong type is backwards
[#2804](#2804)
([#2805](#2805))
([b2d62bf](b2d62bf))
* Finer bit size in bound constrain
([#2869](#2869))
([68385e2](68385e2))
* Fix aztec library after nargo fmt
([#3014](#3014))
([f43083c](f43083c))
* Fix crash when using undeclared traits
([#3509](#3509))
([8bb095a](8bb095a))
* Fix lexer error formatting
([#3274](#3274))
([74bd517](74bd517))
* Fix method `program_counter`, change method signature
([#3012](#3012))
([5ea522b](5ea522b))
* Fix panic in some cases when calling a private function
([#2799](#2799))
([078d5df](078d5df))
* Fix panic when using repeated arrays which define variables
([#3221](#3221))
([c4faf3a](c4faf3a))
* Fix should_fail_with
([#2940](#2940))
([4f07b84](4f07b84))
* Fix subtract with underflow in flattening pass
([#2796](#2796))
([f2ed505](f2ed505))
* Fixing versioning workflow
([#3296](#3296))
([3d5e43a](3d5e43a))
* Flatten public inputs according to their index in numerial rather than
ascii order ([#3605](#3605))
([a1f6343](a1f6343))
* Follow dependencies when looking for a struct
([#3405](#3405))
([561b1b8](561b1b8))
* Force recompilation when `output_debug` flag is set.
([#2898](#2898))
([9854416](9854416))
* **frontend:** Error on unsupported integer annotation
([#2778](#2778))
([90c3d8b](90c3d8b))
* Impl methods are no longer placed in contracts
([#3255](#3255))
([b673b07](b673b07))
* Improve error message when multiplying unit values
([#2950](#2950))
([57b7c55](57b7c55))
* Include .nr and .sol files in builds
([#3039](#3039))
([ae8d0e9](ae8d0e9))
* Issue an error when a module is declared twice & fix module search
path ([#2801](#2801))
([7f76910](7f76910))
* Lack of cjs package version
([#2848](#2848))
([adc2d59](adc2d59))
* Make for loops a statement
([#2975](#2975))
([0e266eb](0e266eb))
* Match rust behaviour for left-shift overflow
([#3518](#3518))
([2d7ceb1](2d7ceb1))
* Minor problems with `aztec` publishing
([#3095](#3095))
([0fc8f20](0fc8f20))
* Move mimc to hash submodule
([#3361](#3361))
([3ec29f1](3ec29f1))
* Overflow checks for constant folding
([#3420](#3420))
([b7a6383](b7a6383))
* Parse parenthesized lvalues
([#3058](#3058))
([50ca58c](50ca58c))
* Prevent duplicated assert message transformation
([#3038](#3038))
([082a6d0](082a6d0))
* Prevent mutating immutable bindings to mutable types
([#3075](#3075))
([d5ee20e](d5ee20e))
* **println:** Enable printing of arrays/strings &gt;2 in fmt strings
([#2947](#2947))
([309fa70](309fa70))
* Recompile artefacts from a different noir version
([#3248](#3248))
([7347b27](7347b27))
* Remove cast for field comparisons in brillig
([#2874](#2874))
([1fc1fdb](1fc1fdb))
* Remove duplication of code to load stdlib files
([#2868](#2868))
([b694aab](b694aab))
* Remove quotes from println output
([#3574](#3574))
([127b6aa](127b6aa))
* Remove sha2_block test
([#3360](#3360))
([a48c03b](a48c03b))
* Restrict fill_internal_slices pass to acir functions
([#3634](#3634))
([0cad9aa](0cad9aa))
* Return error rather than panicking on unreadable circuits
([#3179](#3179))
([d4f61d3](d4f61d3))
* Show println output before an error occurs in `nargo execute`
([#3211](#3211))
([2f0b80d](2f0b80d))
* Silence unused variable warnings in stdlib
([#2795](#2795))
([5747bfe](5747bfe))
* Somewhat reduce mem2reg memory usage
([#3572](#3572))
([9b9ed89](9b9ed89))
* Split conditional_regression tests
([#2774](#2774))
([8ed8832](8ed8832))
* **ssa:** Do not replace previously constrained values
([#2647](#2647))
([d528844](d528844))
* **traits:** Trait functions with a default implementation must not be
followed by a semicolon
([#2987](#2987))
([a3593c0](a3593c0))
* Transform hir before type checks
([#2994](#2994))
([a29b568](a29b568))
* Update link to recursion example
([#3224](#3224))
([10eae15](10eae15))
* Use 128 bits for constant bit shift
([#3586](#3586))
([2ca9b05](2ca9b05))
* Use pedersen_hash for merkle tree
([#3357](#3357))
([6b74d31](6b74d31))
* Verify impls arising from function calls exist
([#3472](#3472))
([d7f919d](d7f919d))


### Miscellaneous Chores

* `generateWitness` now returns a serialized witness file
([#2842](#2842))
([57d3f37](57d3f37))
* Bump MSRV to 1.71.1
([#3353](#3353))
([78f2127](78f2127))
* Change stdlib function `pedersen` to `pedersen_commitment`
([#3341](#3341))
([964b777](964b777))
* Move circuit serialization circuit into acir
([#3345](#3345))
([122119b](122119b))
* **noir_js:** Rename inner and outer proof methods
([#2845](#2845))
([71dbbb8](71dbbb8))
* Update to `bb` version 0.7.3
([#2729](#2729))
([fce68d1](fce68d1))
</details>

<details><summary>0.37.0</summary>

## [0.37.0](v0.36.0...v0.37.0)
(2023-12-01)


### ⚠ BREAKING CHANGES

* Move circuit serialization circuit into acir
([#3345](#3345))
* expose pedersen hash in acir and bb solver
([#3269](#3269))
* Switch to new pedersen implementation
([#3151](#3151))
* Pass ACIR to ACVM by reference rather than passing ownership
([#2872](#2872))
* **wasm:** improve and simplify wasm compiler interface
([#2976](#2976))
* Maintain shape of foreign call arguments
([#2935](#2935))

### Features

* **acvm_js:** Export black box solver functions
([#2812](#2812))
([da8a98e](da8a98e))
* **acvm:** Separate ACVM optimizations and transformations
([#2979](#2979))
([5865d1a](5865d1a))
* Add `FieldElement::from&lt;usize&gt;` implementation
([#3647](#3647))
([8b7c5aa](8b7c5aa))
* Add ACIR serializer C++ codegen
([#2961](#2961))
([7556982](7556982))
* Add conditional compilation of methods based on the underlying field
being used ([#3045](#3045))
([2e008e2](2e008e2))
* Add debugger commands to introspect (and modify) the current state
([#3391](#3391))
([9e1ad85](9e1ad85))
* Aztec-packages
([#3599](#3599))
([2cd6dc3](2cd6dc3))
* Expose pedersen hash in acir and bb solver
([#3269](#3269))
([0108b6c](0108b6c))
* Extract Brillig VM to allow step debugging
([#3259](#3259))
([f6431f9](f6431f9))
* Implement euclidean division and signed division in terms of
`AcirVar`s ([#3230](#3230))
([b8b7782](b8b7782))
* Maintain shape of foreign call arguments
([#2935](#2935))
([f7869e6](f7869e6))
* Pass ACIR to ACVM by reference rather than passing ownership
([#2872](#2872))
([b3a9c34](b3a9c34))
* Pass brillig bytecode to VM by reference
([#3030](#3030))
([4ee290b](4ee290b))
* Refactor debugger and separate core from UI
([#3308](#3308))
([8466810](8466810))
* Replace boolean range constraints with arithmetic opcodes
([#3234](#3234))
([949222c](949222c))
* Save Brillig execution state in ACVM
([#3026](#3026))
([88682da](88682da))
* Solve `fixed_base_scalar_mul` black box functions in rust
([#3153](#3153))
([1c1afbc](1c1afbc))
* Switch to new pedersen implementation
([#3151](#3151))
([35fb3f7](35fb3f7))
* **wasm:** Improve and simplify wasm compiler interface
([#2976](#2976))
([1b5124b](1b5124b))


### Bug Fixes

* ACIR optimizer should update assertion messages
([#3010](#3010))
([758b6b6](758b6b6))
* **acvm:** Return false rather than panicking on invalid ECDSA
signatures ([#2783](#2783))
([155abc0](155abc0))
* Determinism of fallback transformer
([#3100](#3100))
([12daad1](12daad1))
* Fix method `program_counter`, change method signature
([#3012](#3012))
([5ea522b](5ea522b))
* Minor problems with `aztec` publishing
([#3095](#3095))
([0fc8f20](0fc8f20))
* Prevent duplicated assert message transformation
([#3038](#3038))
([082a6d0](082a6d0))
* Return error rather than panicking on unreadable circuits
([#3179](#3179))
([d4f61d3](d4f61d3))


### Miscellaneous Chores

* Move circuit serialization circuit into acir
([#3345](#3345))
([122119b](122119b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

Valid slice access fails constraint
4 participants