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: Revert "correct result when assigning shared arrays" and added regression test #4333

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/function_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ impl FunctionBuilder {
}
}
Type::Array(..) | Type::Slice(..) => {
self.insert_instruction(Instruction::IncrementRc { value }, None);
// If there are nested arrays or slices, we wait until ArrayGet
// is issued to increment the count of that array.
self.insert_instruction(Instruction::IncrementRc { value }, None);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion compiler/noirc_evaluator/src/ssa/ssa_gen/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ impl<'a> FunctionContext<'a> {
new_value.for_each(|value| {
let value = value.eval(self);
array = self.builder.insert_array_set(array, index, value);
self.builder.increment_array_reference_count(array);
index = self.builder.insert_binary(index, BinaryOp::Add, one);
});
array
Expand Down
5 changes: 0 additions & 5 deletions compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
/// br loop_entry(v0)
/// loop_entry(i: Field):
/// v2 = lt i v1
/// brif v2, then: loop_body, else: loop_end

Check warning on line 461 in compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (brif)
/// loop_body():
/// v3 = ... codegen body ...
/// v4 = add 1, i
Expand Down Expand Up @@ -512,7 +512,7 @@
/// For example, the expression `if cond { a } else { b }` is codegen'd as:
///
/// v0 = ... codegen cond ...
/// brif v0, then: then_block, else: else_block

Check warning on line 515 in compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (brif)
/// then_block():
/// v1 = ... codegen a ...
/// br end_if(v1)
Expand All @@ -525,7 +525,7 @@
/// As another example, the expression `if cond { a }` is codegen'd as:
///
/// v0 = ... codegen cond ...
/// brif v0, then: then_block, else: end_block

Check warning on line 528 in compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (brif)
/// then_block:
/// v1 = ... codegen a ...
/// br end_if()
Expand Down Expand Up @@ -724,11 +724,6 @@
let lhs = self.extract_current_value(&assign.lvalue)?;
let rhs = self.codegen_expression(&assign.expression)?;

rhs.clone().for_each(|value| {
let value = value.eval(self);
self.builder.increment_array_reference_count(value);
});

self.assign_new_value(lhs, rhs);
Ok(Self::unit_value())
}
Expand Down
7 changes: 0 additions & 7 deletions test_programs/execution_success/brillig_cow_assign/Nargo.toml

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions test_programs/execution_success/brillig_cow_assign/src/main.nr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "brillig_cow_regression"
type = "bin"
authors = [""]

[dependencies]
229 changes: 229 additions & 0 deletions test_programs/execution_success/brillig_cow_regression/Prover.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
[kernel_data]
encrypted_logs_hash = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
new_commitments = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
new_l2_to_l1_msgs = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
new_nullifiers = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]
unencrypted_logs_hash = [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000000000000000000000000000000000000000000000",
]

[[kernel_data.new_contracts]]
contract_address = "0x0000000000000000000000000000000000000000000000000000000000000000"
portal_contract_address = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"

[[kernel_data.public_data_update_requests]]
leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000"
new_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
old_value = "0x0000000000000000000000000000000000000000000000000000000000000000"
Loading
Loading