Releases: noir-lang/noir
Releases · noir-lang/noir
nightly-2024-09-24: feat: swap endianness in-place in keccak implementation (#6128)
Pre-release
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* This PR removes the `temp` array created when swapping the endianness of the `block_bytes` array and just swaps the values in place. This removes some unnecessary reads/writes from brillig. ## 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.
nightly-2024-09-23: feat(perf): Allow array set last uses optimization in return block of…
nightly-2024-09-23: feat(perf): Allow array set last uses optimization in return block of…
Pre-release
Pre-release
… Brillig functions (#6119) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Part of general effort to reduce Brillig bytecode sizes. ## Summary\* We currently only perform the array set last uses optimization on ACIR functions. This makes sense as the pass only looks only last uses in a single block. We can start to expand the last uses opt to encompass more than just ACIR functions and make it aware of the last array set of an array across blocks. This is quite complex though so this PR currently just attempts to look at the return block of Brillig functions and see the effects. ## 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.
nightly-2024-09-22: feat(perf): Allow array set last uses optimization in return block of…
nightly-2024-09-22: feat(perf): Allow array set last uses optimization in return block of…
Pre-release
Pre-release
… Brillig functions (#6119) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Part of general effort to reduce Brillig bytecode sizes. ## Summary\* We currently only perform the array set last uses optimization on ACIR functions. This makes sense as the pass only looks only last uses in a single block. We can start to expand the last uses opt to encompass more than just ACIR functions and make it aware of the last array set of an array across blocks. This is quite complex though so this PR currently just attempts to look at the return block of Brillig functions and see the effects. ## 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.
nightly-2024-09-21: feat(perf): Allow array set last uses optimization in return block of…
nightly-2024-09-21: feat(perf): Allow array set last uses optimization in return block of…
Pre-release
Pre-release
… Brillig functions (#6119) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Part of general effort to reduce Brillig bytecode sizes. ## Summary\* We currently only perform the array set last uses optimization on ACIR functions. This makes sense as the pass only looks only last uses in a single block. We can start to expand the last uses opt to encompass more than just ACIR functions and make it aware of the last array set of an array across blocks. This is quite complex though so this PR currently just attempts to look at the return block of Brillig functions and see the effects. ## 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.
nightly-2024-09-20: fix(mem2reg): Remove possibility of underflow (#6107)
# Description ## Problem\* Resolves ICE ran into by @asterite ## Summary\* After #5925 we have a couple counters that both increment and decrement. In theory they are never supposed to underflow. @asterite has discovered a bug with the remaining last stores counter. I would like to implement the remaining last stores removal in a better way that removes the need for this counter to be decremented, but for now I just block if by check we are not decrementing zero. ## 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. --------- Co-authored-by: jfecher <[email protected]>
nightly-2024-09-19: chore: fix broken formatting on master (#6096)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ ] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
nightly-2024-09-18: feat(perf): Remove unused loads in mem2reg and last stores per functi…
nightly-2024-09-18: feat(perf): Remove unused loads in mem2reg and last stores per functi…
Pre-release
Pre-release
…on (#5925) # Description ## Problem\* Partially resolves #4535. This does not necessarily make SSA "aware of loops" but handles the situation that we in the issue where we have multiple known stores and loads that we are unable to resolve across the function due to loops. ## Summary\* The per function state and the logic run over it has been expanded. We store more information in `last_loads`, a new `load_results` map to track unused loads, and a utility map `calls_reference_input` to avoid deleting stores that are directly passed into an entry point with a mutable reference. To count the remaining stores, I reference count both the results of the loads and the address of the loads. If the results of a load has a counter equal to 0 I remove that load instruction. I then keep track of each removed address with its own reference counter. If the removed loads counter is equal to the counter of the address of the loads, we know we have removed all loads to an address and thus can safely remove the store to that address. We also added a check that store we want to remove is not used as an argument into a function call. I have added a unit test `remove_unused_loads_and_stores` inside of `mem2reg.rs`. The `brillig_loop_size_regression` test: ```noir unconstrained fn main() -> pub Field { let mut emulated_enum = EnumEmulation { a: Option::some(1), b: Option::none(), c: Option::none() }; for _ in 0..1 { assert_eq(emulated_enum.a.unwrap(), 1); } emulated_enum.a = Option::some(2); emulated_enum.a.unwrap() } ``` now compiles to the optimal SSA after a single run of mem2reg: ``` After Mem2Reg: brillig fn main f0 { b0(): v1 = allocate v2 = allocate v3 = allocate v4 = allocate v5 = allocate v6 = allocate jmp b1(u32 0) b1(v0: u32): v8 = eq v0, u32 0 jmpif v8 then: b3, else: b2 b3(): v11 = add v0, u32 1 jmp b1(v11) b2(): return Field 2 } ``` ## Additional Context There is most likely other ways we can utilize this per function state. We can continue to iterate upon it in follow-ups. ## 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. --------- Co-authored-by: Tom French <[email protected]> Co-authored-by: jfecher <[email protected]>
nightly-2024-09-17: fix: let LSP suggest fields and methods in LValue chains (#6051)
Pre-release
# Description ## Problem LSP autocompletion didn't trigger in some cases. ## Summary Makes LSP autocompletion work when typing a dot but in the next line an l-value assignment follows. In that case the current line and the line that follows are parsed as a single assignment to an l-value and we must complete in the middle of that entire expression. ## Additional Context Also adds a missing `follow_bindings()` that caused some of these cases to not work. ## 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.
v0.34.0
0.34.0 (2024-09-13)
⚠ BREAKING CHANGES
- Add Not instruction in brillig (AztecProtocol/aztec-packages#8488)
- avm: variants for SET opcode (AztecProtocol/aztec-packages#8441)
- avm/brillig: take addresses in calldatacopy (AztecProtocol/aztec-packages#8388)
- Do not encode assertion strings in the programs (AztecProtocol/aztec-packages#8315)
- return arrays instead of slices from
to_be_radix
functions (#5851) - Check unused generics are bound (#5840)
Features
- (bb) 128-bit challenges (AztecProtocol/aztec-packages#8406) (3c3ed1e)
- (LSP) suggest names that match any part of the current prefix (#5752) (cb0d490)
Module::add_item
(#5947) (af50a7b)- Add
Expr::as_any_integer
andExpr::as_member_access
(#5742) (6266755) - Add
Expr::as_array
,Expr::as_repeated_element_array
and same for slice (#5750) (f44e0b3) - Add
Expr::as_assert_eq
(#5880) (88f7858) - Add
Expr::as_assert
(#5857) (4e4ad26) - Add
Expr::as_binary_op
(#5734) (73a9f51) - Add
Expr::as_block
andExpr::has_semicolon
(#5784) (19ffa20) - Add
Expr::as_bool
(#5729) (ca75cc2) - Add
Expr::as_cast
andUnresolvedType::is_field
(#5801) (c9aa50d) - Add
Expr::as_let
(#5964) (65da598) - Add
Expr::as_unary
(#5731) (ae33811) - Add
Expr::resolve
andTypedExpr::as_function_definition
(#5859) (bceee55) - Add
Expr
methods:as_tuple
,as_parenthesized
,as_index
,as_if
(#5726) (f57a7b2) - Add
Expr
methods: as_comptime, as_unsafe, is_break, is_continue (#5799) (619fa5c) - Add
fmtstr::contents
(#5928) (f18e9ca) - Add
FunctionDef::body
(#5825) (39b30ba) - Add
FunctionDef::has_named_attribute
(#5870) (a950195) - Add
FunctionDef::set_return_visibility
(#5941) (8beda6b) - Add
FunctionDefinition::add_attribute
(#5944) (c7479c4) - Add
FunctionDefinition::module
andStructDefinition::module
(#5956) (f19344c) - Add
FunctionDefinition
methodsis_unconstrained
andset_unconstrained
(#5962) (b9a072d) - Add
Module::structs
(#6017) (fc5bb02) - Add
Quoted::as_expr
andExpr::as_function_call
(#5708) (3f79607) - Add
Quoted::tokens
(#5942) (a297ec6) - Add
std::meta::typ::fresh_type_variable
(#5948) (3dab4dd) - Add
StructDefinition::add_attribute
andhas_named_attribute
(#5945) (344dd5e) - Add
StructDefinition::add_generic
(#5961) (6004067) - Add
StructDefinition::name
(#5960) (102ebe3) - Add
StructDefinition::set_fields
(#5931) (9d2629d) - Add
TraitImpl::trait_generic_args
andTraitImpl::methods
(#5722) (8c7e493) - Add
Type::as_string
(#5871) (e29d4b3) - Add
Type::get_trait_impl
(#5716) (eb33d1c) - Add
Type::implements
(#5701) (2166c94) - Add
TypedExpr::get_type
(#5992) (31f50c4) - Add
UnresolvedType::is_field
andExpr::as_assign
(#5804) (c45df4e) - Add
unsafe
blocks for calling unconstrained code from constrained functions (#4429) (79593b4) - Add a
panic
method to the stdlib (#5966) (b86c2bc) - Add array_to_str_lossy (#5613) (af5acf4)
- Add assertions for ACVM
FunctionInput
bit_size
(#5864) (8712f4c) - Add Expr::as_method_call (#5822) (806af24)
- Add mutating FunctionDefinition functions (#5685) (2882eae)
- Add Not instruction in brillig (AztecProtocol/aztec-packages#8488) (95e19ab)
- Add recursive aggregation object to proving/verification keys (AztecProtocol/aztec-packages#6770) (4ea25db)
- Add reusable procedures to brillig generation (AztecProtocol/aztec-packages#7981) (5c4f19f)
- Add some
Module
comptime functions (#5684) (eefd69b) - Added indirect const instruction (https://github.com/AztecProtocol/aztec-packages/pull...
nightly-2024-09-16: feat: add `Expr::as_for` and `Expr::as_for_range` (#6039)
Pre-release
# Description ## Problem Part of #5668 ## Summary ## Additional Context ## Documentation Check one: - [ ] No documentation needed. - [x] 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.