Skip to content

Commit

Permalink
Merge branch 'master' into stdout-backend-communication
Browse files Browse the repository at this point in the history
* master:
  fix(ssa): Slice mergers with multiple ifs (#2597)
  chore: remove usage of `serial_test` dependency (#2598)
  fix: Implement auto-dereferencing when calling methods (#2581)
  chore(noir): Release 0.11.1 (#2594)
  • Loading branch information
TomAFrench committed Sep 7, 2023
2 parents aa16786 + 6110638 commit 35b287c
Show file tree
Hide file tree
Showing 22 changed files with 183 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.11.0"
".": "0.11.1"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [0.11.1](https://github.com/noir-lang/noir/compare/v0.11.0...v0.11.1) (2023-09-07)


### Features

* Enable dynamic indices on slices ([#2446](https://github.com/noir-lang/noir/issues/2446)) ([c5c4052](https://github.com/noir-lang/noir/commit/c5c40529d8c000ba61f3372b336e57947673646a))


### Bug Fixes

* Disable loop unrolling in brillig ([#2590](https://github.com/noir-lang/noir/issues/2590)) ([464f878](https://github.com/noir-lang/noir/commit/464f87834ada04320ea396cb4bdbab3317e036db))

## [0.11.0](https://github.com/noir-lang/noir/compare/v0.10.5...v0.11.0) (2023-09-07)


Expand Down
68 changes: 15 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resolver = "2"

[workspace.package]
# x-release-please-start-version
version = "0.11.0"
version = "0.11.1"
# x-release-please-end
authors = ["The Noir Team <team@noir-lang.org>"]
edition = "2021"
Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ reqwest = { version = "0.11.16", default-features = false, features = [
] }

[dev-dependencies]
serial_test = "2.0.0"
test-binary = "3.0.1"

[build-dependencies]
Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ impl ContractCommand {
}

#[test]
#[serial_test::serial]
fn contract_command() {
use tempfile::tempdir;

Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/gates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ impl GatesCommand {
}

#[test]
#[serial_test::serial]
fn gate_command() {
use tempfile::tempdir;

Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ impl InfoCommand {
}

#[test]
#[serial_test::serial]
fn info_command() {
use acvm::acir::circuit::black_box_functions::BlackBoxFunc;
use acvm::acir::circuit::opcodes::{BlackBoxFuncCall, Opcode};
Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub(crate) use verify::VerifyCommand;
pub(crate) use write_vk::WriteVkCommand;

#[test]
#[serial_test::serial]
fn no_command_provided_works() {
// This is a simple test to check that the binaries work

Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl ProveCommand {
}

#[test]
#[serial_test::serial]
fn prove_command() {
use tempfile::tempdir;

Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl VerifyCommand {
}

#[test]
#[serial_test::serial]
fn verify_command() {
use tempfile::tempdir;

Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/cli/write_vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ impl WriteVkCommand {
}

#[test]
#[serial_test::serial]
fn write_vk_command() {
use tempfile::tempdir;

Expand Down
1 change: 0 additions & 1 deletion crates/acvm_backend_barretenberg/src/smart_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ mod tests {
use crate::get_mock_backend;

#[test]
#[serial_test::serial]
fn test_smart_contract() {
let expression = &(Witness(1) + Witness(2)) - &Expression::from(Witness(3));
let constraint = Opcode::Arithmetic(expression);
Expand Down
13 changes: 13 additions & 0 deletions crates/nargo_cli/tests/execution_success/references/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ fn main(mut x: Field) {
regression_2218_if_inner_else(20, x);
regression_2218_else(x, 3);
regression_2218_loop(x, 10);

regression_2560(s_ref);
}

fn add1(x: &mut Field) {
Expand All @@ -64,6 +66,10 @@ impl S {
fn add2(&mut self) {
self.y += 2;
}

fn get_y(self) -> Field {
self.y
}
}

fn mutate_copy(mut a: Field) {
Expand Down Expand Up @@ -230,3 +236,10 @@ fn regression_2218_loop(x: Field, y: Field) {
}
assert(*q1 == 2);
}

// This is more a feature test than a proper regression.
// Before, we never automatically dereferenced objects in method calls to their value types.
// Now, we insert as many `*` as necessary to get to `S`.
fn regression_2560(s_ref: &mut S) {
assert(s_ref.get_y() == 7);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn regression_dynamic_slice_index(x: Field, y: Field) {

dynamic_slice_merge_if(slice, x);
dynamic_slice_merge_else(slice, x);
dynamic_slice_merge_two_ifs(slice, x);
}

fn dynamic_slice_index_set_if(mut slice: [Field], x: Field, y: Field) {
Expand Down Expand Up @@ -164,6 +165,35 @@ fn dynamic_slice_merge_else(mut slice: [Field], x: Field) {
assert(slice[slice.len() - 1] == 20);
}

fn dynamic_slice_merge_two_ifs(mut slice: [Field], x: Field) {
if x as u32 > 10 {
assert(slice[x] == 0);
slice[x] = 2;
} else {
assert(slice[x] == 4);
slice[x] = slice[x] - 2;
slice = slice.push_back(10);
}

assert(slice.len() == 6);
assert(slice[slice.len() - 1] == 10);

if x == 20 {
slice = slice.push_back(20);
} else {
slice = slice.push_back(15);
}
// TODO(#2599): Breaks if the push back happens without the else case
// slice = slice.push_back(15);

assert(slice.len() == 7);
assert(slice[slice.len() - 1] == 15);

slice = slice.push_back(20);
assert(slice.len() == 8);
assert(slice[slice.len() - 1] == 20);
}

fn dynamic_slice_index_set_nested_if_else_else(mut slice: [Field], x: Field, y: Field) {
assert(slice[x] == 4);
assert(slice[y] == 1);
Expand Down
Loading

0 comments on commit 35b287c

Please sign in to comment.