diff --git a/compiler/noirc_evaluator/src/ssa/function_builder/data_bus.rs b/compiler/noirc_evaluator/src/ssa/function_builder/data_bus.rs index d442917e3b1..0ef3fa3b6ff 100644 --- a/compiler/noirc_evaluator/src/ssa/function_builder/data_bus.rs +++ b/compiler/noirc_evaluator/src/ssa/function_builder/data_bus.rs @@ -156,6 +156,11 @@ impl FunctionBuilder { let index_var = FieldElement::from(index as i128); let index_var = self.current_function.dfg.make_constant(index_var, length_type); + // If we do not check for an empty array we will have an unused array get + // as an array of length zero will not be actually added to the databus' values. + if let Type::Array(_, 0) = subitem_typ { + continue; + } let element = self.insert_array_get(value, index_var, subitem_typ.clone()); index += match subitem_typ { Type::Array(_, _) | Type::Slice(_) => subitem_typ.element_size(), @@ -230,6 +235,7 @@ impl FunctionBuilder { } } } + // create the call-data-bus from the filtered lists let mut result = Vec::new(); for id in databus_param.keys() { diff --git a/compiler/noirc_evaluator/src/ssa/ssa_gen/tests.rs b/compiler/noirc_evaluator/src/ssa/ssa_gen/tests.rs index 65ba5e11fe8..db4c0216b07 100644 --- a/compiler/noirc_evaluator/src/ssa/ssa_gen/tests.rs +++ b/compiler/noirc_evaluator/src/ssa/ssa_gen/tests.rs @@ -107,3 +107,40 @@ fn basic_loop() { assert_normalized_ssa_equals(ssa, expected); } + +#[named] +#[test] +fn databus_no_dead_param_on_empty_array() { + let src = " + fn main(a: (i8, u32, i8), b: call_data(0) [(i8, i8, bool, bool, str<0>); 2]) -> pub [(bool, str<3>, str<0>, u32); 0] { + [] + } + "; + + let ssa = get_initial_ssa(src, function_path!()).unwrap(); + + // We expect that there to be no `array_get` attempting to fetch from v3 + // the empty nested array `[u8; 0]`. + // The databus is only going to be initialized with actual numeric values so keeping + // an empty array in the databus is pointless. + // The databus is not mutated after initialization as well. So if we have instructions + // on the data bus (such as an `array_get` on an empty array) that go unused, it becomes + // more difficult to eliminate those unused instructions. Thus, we just do not generate them. + let expected = " + acir(inline) fn main f0 { + b0(v0: i8, v1: u32, v2: i8, v3: [(i8, i8, u1, u1, [u8; 0]); 2]): + v5 = array_get v3, index u32 0 -> i8 + v7 = array_get v3, index u32 1 -> i8 + v9 = array_get v3, index u32 2 -> u1 + v11 = array_get v3, index u32 3 -> u1 + v13 = array_get v3, index u32 4 -> i8 + v15 = array_get v3, index u32 5 -> i8 + v17 = array_get v3, index u32 6 -> u1 + v19 = array_get v3, index u32 7 -> u1 + v20 = make_array [v5, v7, v9, v11, v13, v15, v17, v19] : [Field; 8] + v21 = make_array [] : [(u1, [u8; 3], [u8; 0], u32); 0] + return v21 + } + "; + assert_normalized_ssa_equals(ssa, expected); +} diff --git a/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/Nargo.toml b/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/Nargo.toml new file mode 100644 index 00000000000..d0a4e58a9c1 --- /dev/null +++ b/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/Nargo.toml @@ -0,0 +1,7 @@ + + [package] + name = "noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array" + type = "bin" + authors = [""] + + [dependencies] \ No newline at end of file diff --git a/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/src/main.nr b/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/src/main.nr new file mode 100644 index 00000000000..5f9fb7bb219 --- /dev/null +++ b/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/src/main.nr @@ -0,0 +1,5 @@ + + fn main(a: (i8, u32, i8), b: call_data(0) [(i8, i8, bool, bool, str<0>); 2]) -> pub [(bool, str<3>, str<0>, u32); 0] { + [] + } + \ No newline at end of file diff --git a/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/src_hash.txt b/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/src_hash.txt new file mode 100644 index 00000000000..c44009cef2d --- /dev/null +++ b/test_programs/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/src_hash.txt @@ -0,0 +1 @@ +8959072883599795205 \ No newline at end of file diff --git a/test_programs/execution_success/databus_dead_param/Nargo.toml b/test_programs/execution_success/databus_dead_param/Nargo.toml new file mode 100644 index 00000000000..78c20a46938 --- /dev/null +++ b/test_programs/execution_success/databus_dead_param/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "databus_dead_param" +type = "bin" +authors = [""] + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/databus_dead_param/Prover.toml b/test_programs/execution_success/databus_dead_param/Prover.toml new file mode 100644 index 00000000000..0b65b80348e --- /dev/null +++ b/test_programs/execution_success/databus_dead_param/Prover.toml @@ -0,0 +1,2 @@ +a = ["1", "2", "3"] +b = [["0", "0", true, true, ""], ["0", "0", true, true, ""]] diff --git a/test_programs/execution_success/databus_dead_param/src/main.nr b/test_programs/execution_success/databus_dead_param/src/main.nr new file mode 100644 index 00000000000..2bd2c51a0d6 --- /dev/null +++ b/test_programs/execution_success/databus_dead_param/src/main.nr @@ -0,0 +1,7 @@ +// Regression for issue #8398 (https://github.com/noir-lang/noir/issues/8398) +fn main( + a: (i8, u32, i8), + b: call_data(0) [(i8, i8, bool, bool, str<0>); 2], +) -> pub [(bool, str<3>, str<0>, u32); 0] { + [] +} diff --git a/test_programs/execution_success/databus_dead_param/stdout.txt b/test_programs/execution_success/databus_dead_param/stdout.txt new file mode 100644 index 00000000000..214724f894e --- /dev/null +++ b/test_programs/execution_success/databus_dead_param/stdout.txt @@ -0,0 +1 @@ +[databus_dead_param] Circuit output: Vec([]) \ No newline at end of file diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..28aac3bb070 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,105 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + } + ] + }, + "visibility": "private" + }, + { + "name": "b", + "type": { + "kind": "array", + "length": 2, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "boolean" + }, + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 0 + } + ] + } + }, + "visibility": "databus" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 0, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 3 + }, + { + "kind": "string", + "length": 0 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + } + }, + "visibility": "public" + }, + "error_types": {} + }, + "bytecode": "H4sIAAAAAAAA/4WPgQrAIAhEbbVWbh+x///KkpQkjjo4qkeeGmiIuz+9h+6op6gsTPwv7AL/ImAJsNvlGsuAPaC2AFZBLYMs0nfSGbLrUd3+NrfopSnbe5fBdFYDiWIJXIQBAAA=", + "debug_symbols": "XY5BCsQwCEXv4rqLWfcqw1BsaosgJtikMITefWyYQOlK/3/6tcJCc9km1jXuML4rzMYivE0SA2aO6m49B+hyykbkFty4byU00gyjFpEBDpTShvaE2mpGc/oagHTx6oErC13d+XGBge158UBjnIX+ci0abjR/Uyf942Qx0FKMrqTGPPsH", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..28aac3bb070 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,105 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + } + ] + }, + "visibility": "private" + }, + { + "name": "b", + "type": { + "kind": "array", + "length": 2, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "boolean" + }, + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 0 + } + ] + } + }, + "visibility": "databus" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 0, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 3 + }, + { + "kind": "string", + "length": 0 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + } + }, + "visibility": "public" + }, + "error_types": {} + }, + "bytecode": "H4sIAAAAAAAA/4WPgQrAIAhEbbVWbh+x///KkpQkjjo4qkeeGmiIuz+9h+6op6gsTPwv7AL/ImAJsNvlGsuAPaC2AFZBLYMs0nfSGbLrUd3+NrfopSnbe5fBdFYDiWIJXIQBAAA=", + "debug_symbols": "XY5BCsQwCEXv4rqLWfcqw1BsaosgJtikMITefWyYQOlK/3/6tcJCc9km1jXuML4rzMYivE0SA2aO6m49B+hyykbkFty4byU00gyjFpEBDpTShvaE2mpGc/oagHTx6oErC13d+XGBge158UBjnIX+ci0abjR/Uyf942Qx0FKMrqTGPPsH", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..28aac3bb070 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,105 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + } + ] + }, + "visibility": "private" + }, + { + "name": "b", + "type": { + "kind": "array", + "length": 2, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "boolean" + }, + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 0 + } + ] + } + }, + "visibility": "databus" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 0, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 3 + }, + { + "kind": "string", + "length": 0 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + } + }, + "visibility": "public" + }, + "error_types": {} + }, + "bytecode": "H4sIAAAAAAAA/4WPgQrAIAhEbbVWbh+x///KkpQkjjo4qkeeGmiIuz+9h+6op6gsTPwv7AL/ImAJsNvlGsuAPaC2AFZBLYMs0nfSGbLrUd3+NrfopSnbe5fBdFYDiWIJXIQBAAA=", + "debug_symbols": "XY5BCsQwCEXv4rqLWfcqw1BsaosgJtikMITefWyYQOlK/3/6tcJCc9km1jXuML4rzMYivE0SA2aO6m49B+hyykbkFty4byU00gyjFpEBDpTShvaE2mpGc/oagHTx6oErC13d+XGBge158UBjnIX+ci0abjR/Uyf942Qx0FKMrqTGPPsH", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..9ada97af1a7 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,112 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + } + ] + }, + "visibility": "private" + }, + { + "name": "b", + "type": { + "kind": "array", + "length": 2, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "boolean" + }, + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 0 + } + ] + } + }, + "visibility": "databus" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 0, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 3 + }, + { + "kind": "string", + "length": 0 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + } + }, + "visibility": "public" + }, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/+1Zy27bMBCkHpQtKS+0PyLFduTeeojzTv5BaeBrgd7aXoRe2s9umHDj0YYMkIQbQFEIGJS4o93Z4WotSJG6H8XtL7LHKZtxEOarnavXjTqgr0qSZzQQnnFAnobbVMnufyKga2iO6QA46gFwzAbAcTIAjtMBcMwHwLFQYXslcnwYJRwbo2nQpumZpmJuWnNTmKIzm2pEK5R/kPN/ds7tHIM9YEOtcxY3pP9lNV/njvwC8p/l1qeW8X9N/jMZ/9XE+jnsNv4xF4qbMBy/JgLMCjCrrs+bMEeAOfL4OQbMsQdzApgTD+YUMKeAUYA5A8yZB3MOmHNPrAvAXHgwl4C59MS6AswVw2yDTxqHXd8Wg23FbAnYSHuqM3ogD3wfNsJ13FJuGnIjfSj2RCb2tasxJ2wN4xdKtGfUEYtHfLg+MdMnl+FTkf9CyD/lWzryxXqm/Hbt+RRsJRz7fGH9UC57juunb6NrLaxrPVJd94V13R+prjNhXWcj1XUurOv8uboSn20ZPhX9128Bn8gzE1e+Rv99BfMl1UN31GPtthx8SLOk2/ApmS0F2w6zabDRmqnD75Af2pDPU3WNe0m8B17Xi5H2i4Wwrgcj1fVAWNdmpLo2wrouR6rrUljXLx/PDS8e7/q5gfYBa0BDzF9w/JvFjx3xXftDtYR7GPq9MvKR8i/B34zPHv4K9Jx0qqf13QxrVDMP9YJ4ZsvBlnb9OIU9TyEO+iIemuF/2vNdO2dwDV2/54ifsfg93o411Ij7ShxrhDfvOn/Y49L+TE3/sWtPvbN8aT+SfqeYMT6cf8xywzw0aEE9P+3C822Wm49lVIda9d97KxZfM/xftdGV+NH8mo/166at17N23S7am5v5t/YT848aGp3+A9ZsGH49IwAA", + "debug_symbols": "XY7dCoMwDIXfJde9aCe72asMkVijFEJbYisM8d2XygTZTZKTLz9nh4nGugwhzmmF13uHUQJzWAZOHktIUbv7YeCSQxEibcGN61ZGoVjgFSuzgQ25nkNrxnjmgqLUGqA4adaDc2Bq1dGrQB/k/+OGEnBk+sm5Rn+j5ZMvcjnOkjxNVahdagxsC50adM4Z93C9AWeb7Kxx3bM/2vcv", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..9ada97af1a7 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,112 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + } + ] + }, + "visibility": "private" + }, + { + "name": "b", + "type": { + "kind": "array", + "length": 2, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "boolean" + }, + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 0 + } + ] + } + }, + "visibility": "databus" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 0, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 3 + }, + { + "kind": "string", + "length": 0 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + } + }, + "visibility": "public" + }, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/+1Zy27bMBCkHpQtKS+0PyLFduTeeojzTv5BaeBrgd7aXoRe2s9umHDj0YYMkIQbQFEIGJS4o93Z4WotSJG6H8XtL7LHKZtxEOarnavXjTqgr0qSZzQQnnFAnobbVMnufyKga2iO6QA46gFwzAbAcTIAjtMBcMwHwLFQYXslcnwYJRwbo2nQpumZpmJuWnNTmKIzm2pEK5R/kPN/ds7tHIM9YEOtcxY3pP9lNV/njvwC8p/l1qeW8X9N/jMZ/9XE+jnsNv4xF4qbMBy/JgLMCjCrrs+bMEeAOfL4OQbMsQdzApgTD+YUMKeAUYA5A8yZB3MOmHNPrAvAXHgwl4C59MS6AswVw2yDTxqHXd8Wg23FbAnYSHuqM3ogD3wfNsJ13FJuGnIjfSj2RCb2tasxJ2wN4xdKtGfUEYtHfLg+MdMnl+FTkf9CyD/lWzryxXqm/Hbt+RRsJRz7fGH9UC57juunb6NrLaxrPVJd94V13R+prjNhXWcj1XUurOv8uboSn20ZPhX9128Bn8gzE1e+Rv99BfMl1UN31GPtthx8SLOk2/ApmS0F2w6zabDRmqnD75Af2pDPU3WNe0m8B17Xi5H2i4Wwrgcj1fVAWNdmpLo2wrouR6rrUljXLx/PDS8e7/q5gfYBa0BDzF9w/JvFjx3xXftDtYR7GPq9MvKR8i/B34zPHv4K9Jx0qqf13QxrVDMP9YJ4ZsvBlnb9OIU9TyEO+iIemuF/2vNdO2dwDV2/54ifsfg93o411Ij7ShxrhDfvOn/Y49L+TE3/sWtPvbN8aT+SfqeYMT6cf8xywzw0aEE9P+3C822Wm49lVIda9d97KxZfM/xftdGV+NH8mo/166at17N23S7am5v5t/YT848aGp3+A9ZsGH49IwAA", + "debug_symbols": "XY7dCoMwDIXfJde9aCe72asMkVijFEJbYisM8d2XygTZTZKTLz9nh4nGugwhzmmF13uHUQJzWAZOHktIUbv7YeCSQxEibcGN61ZGoVjgFSuzgQ25nkNrxnjmgqLUGqA4adaDc2Bq1dGrQB/k/+OGEnBk+sm5Rn+j5ZMvcjnOkjxNVahdagxsC50adM4Z93C9AWeb7Kxx3bM/2vcv", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..9ada97af1a7 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/databus_dead_param/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,112 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "a", + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + } + ] + }, + "visibility": "private" + }, + { + "name": "b", + "type": { + "kind": "array", + "length": 2, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "integer", + "sign": "signed", + "width": 8 + }, + { + "kind": "boolean" + }, + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 0 + } + ] + } + }, + "visibility": "databus" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 0, + "type": { + "kind": "tuple", + "fields": [ + { + "kind": "boolean" + }, + { + "kind": "string", + "length": 3 + }, + { + "kind": "string", + "length": 0 + }, + { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + ] + } + }, + "visibility": "public" + }, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/+1Zy27bMBCkHpQtKS+0PyLFduTeeojzTv5BaeBrgd7aXoRe2s9umHDj0YYMkIQbQFEIGJS4o93Z4WotSJG6H8XtL7LHKZtxEOarnavXjTqgr0qSZzQQnnFAnobbVMnufyKga2iO6QA46gFwzAbAcTIAjtMBcMwHwLFQYXslcnwYJRwbo2nQpumZpmJuWnNTmKIzm2pEK5R/kPN/ds7tHIM9YEOtcxY3pP9lNV/njvwC8p/l1qeW8X9N/jMZ/9XE+jnsNv4xF4qbMBy/JgLMCjCrrs+bMEeAOfL4OQbMsQdzApgTD+YUMKeAUYA5A8yZB3MOmHNPrAvAXHgwl4C59MS6AswVw2yDTxqHXd8Wg23FbAnYSHuqM3ogD3wfNsJ13FJuGnIjfSj2RCb2tasxJ2wN4xdKtGfUEYtHfLg+MdMnl+FTkf9CyD/lWzryxXqm/Hbt+RRsJRz7fGH9UC57juunb6NrLaxrPVJd94V13R+prjNhXWcj1XUurOv8uboSn20ZPhX9128Bn8gzE1e+Rv99BfMl1UN31GPtthx8SLOk2/ApmS0F2w6zabDRmqnD75Af2pDPU3WNe0m8B17Xi5H2i4Wwrgcj1fVAWNdmpLo2wrouR6rrUljXLx/PDS8e7/q5gfYBa0BDzF9w/JvFjx3xXftDtYR7GPq9MvKR8i/B34zPHv4K9Jx0qqf13QxrVDMP9YJ4ZsvBlnb9OIU9TyEO+iIemuF/2vNdO2dwDV2/54ifsfg93o411Ij7ShxrhDfvOn/Y49L+TE3/sWtPvbN8aT+SfqeYMT6cf8xywzw0aEE9P+3C822Wm49lVIda9d97KxZfM/xftdGV+NH8mo/166at17N23S7am5v5t/YT848aGp3+A9ZsGH49IwAA", + "debug_symbols": "XY7dCoMwDIXfJde9aCe72asMkVijFEJbYisM8d2XygTZTZKTLz9nh4nGugwhzmmF13uHUQJzWAZOHktIUbv7YeCSQxEibcGN61ZGoVjgFSuzgQ25nkNrxnjmgqLUGqA4adaDc2Bq1dGrQB/k/+OGEnBk+sm5Rn+j5ZMvcjnOkjxNVahdagxsC50adM4Z93C9AWeb7Kxx3bM/2vcv", + "file_map": {}, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/expand/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/expand/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/execute__tests__expanded.snap new file mode 100644 index 00000000000..7594492d8ce --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/expand/compile_success_no_bug/noirc_evaluator_ssa_ssa_gen_tests_databus_no_dead_param_on_empty_array/execute__tests__expanded.snap @@ -0,0 +1,10 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +fn main( + a: (i8, u32, i8), + b: [(i8, i8, bool, bool, str<0>); 2], +) -> pub [(bool, str<3>, str<0>, u32); 0] { + [] +} diff --git a/tooling/nargo_cli/tests/snapshots/expand/execution_success/databus_dead_param/execute__tests__expanded.snap b/tooling/nargo_cli/tests/snapshots/expand/execution_success/databus_dead_param/execute__tests__expanded.snap new file mode 100644 index 00000000000..7594492d8ce --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/expand/execution_success/databus_dead_param/execute__tests__expanded.snap @@ -0,0 +1,10 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: expanded_code +--- +fn main( + a: (i8, u32, i8), + b: [(i8, i8, bool, bool, str<0>); 2], +) -> pub [(bool, str<3>, str<0>, u32); 0] { + [] +}