diff --git a/.github/benchmark_projects.yml b/.github/benchmark_projects.yml index 23fbd3c82ff..da174e5d752 100644 --- a/.github/benchmark_projects.yml +++ b/.github/benchmark_projects.yml @@ -45,7 +45,7 @@ projects: path: noir-projects/noir-protocol-circuits/crates/rollup-base-public num_runs: 5 timeout: 15 - compilation-timeout: 15 + compilation-timeout: 20 execution-timeout: 0.75 compilation-memory-limit: 1500 execution-memory-limit: 500 @@ -65,7 +65,7 @@ projects: cannot_execute: true num_runs: 1 timeout: 60 - compilation-timeout: 150 + compilation-timeout: 180 compilation-memory-limit: 8000 rollup-block-root: repo: AztecProtocol/aztec-packages diff --git a/EXTERNAL_NOIR_LIBRARIES.yml b/EXTERNAL_NOIR_LIBRARIES.yml index b0de84b2032..c869983b7d3 100644 --- a/EXTERNAL_NOIR_LIBRARIES.yml +++ b/EXTERNAL_NOIR_LIBRARIES.yml @@ -82,7 +82,7 @@ libraries: repo: AztecProtocol/aztec-packages ref: *AZ_COMMIT path: noir-projects/noir-contracts - timeout: 90 + timeout: 100 critical: false blob: repo: AztecProtocol/aztec-packages diff --git a/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs b/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs index a4488cfd90a..ac2e305c4cf 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs @@ -127,6 +127,21 @@ impl Loop { fn get_induction_variable(&self, function: &Function) -> ValueId { function.dfg.block_parameters(self.header)[0] } + + // Check if the loop will be fully executed by checking the number of predecessors of the loop exit + // Our SSA code generation restricts loops to having one exit block except in the case of a `break`. + // If a loop can have several exit blocks, we would need to update this function + pub(super) fn is_fully_executed(&self, cfg: &ControlFlowGraph) -> bool { + let Some(header) = self.blocks.first() else { + return true; + }; + for block in cfg.successors(*header) { + if !self.blocks.contains(&block) { + return cfg.predecessors(block).len() == 1; + } + } + true + } } struct LoopInvariantContext<'f> { @@ -194,20 +209,6 @@ impl<'f> LoopInvariantContext<'f> { self.current_pre_header.expect("ICE: Pre-header block should have been set") } - // Check if the loop will be fully executed by checking the number of predecessors of the loop exit - // If a loop can have several exit blocks, we would need to update this function - fn is_fully_executed(&self, loop_: &Loop) -> bool { - let Some(header) = loop_.blocks.first() else { - return true; - }; - for block in self.inserter.function.dfg[*header].successors() { - if !loop_.blocks.contains(&block) { - return self.cfg.predecessors(block).len() == 1; - } - } - true - } - fn hoist_loop_invariants(&mut self, loop_: &Loop) { self.set_values_defined_in_loop(loop_); @@ -298,7 +299,7 @@ impl<'f> LoopInvariantContext<'f> { // set the new current induction variable. self.current_induction_variables.clear(); self.set_induction_var_bounds(loop_, true); - self.no_break = self.is_fully_executed(loop_); + self.no_break = loop_.is_fully_executed(&self.cfg); for block in loop_.blocks.iter() { let params = self.inserter.function.dfg.block_parameters(*block); diff --git a/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs b/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs index 935588e2b13..514d112d5d8 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/unrolling.rs @@ -666,7 +666,9 @@ impl Loop { /// of unrolled instructions times the number of iterations would result in smaller bytecode /// than if we keep the loops with their overheads. fn is_small_loop(&self, function: &Function, cfg: &ControlFlowGraph) -> bool { - self.boilerplate_stats(function, cfg).map(|s| s.is_small()).unwrap_or_default() + self.boilerplate_stats(function, cfg) + .map(|s| s.is_small() && self.is_fully_executed(cfg)) + .unwrap_or_default() } /// Collect boilerplate stats if we can figure out the upper and lower bounds of the loop, @@ -1483,4 +1485,52 @@ mod tests { fn test_is_new_size_ok(old: usize, new: usize, max: i32, ok: bool) { assert_eq!(is_new_size_ok(old, new, max), ok); } + + #[test] + fn do_not_unroll_loop_with_break() { + // One of the loop header's (b1) successors (b3) has multiple predecessors (b1 and b4). + // This logic is how we identify a loop with a break expression. + // We do not support unrolling these types of loops. + let src = r#" + brillig(inline) predicate_pure fn main f0 { + b0(): + jmp b1(u32 0) + b1(v0: u32): + v3 = lt v0, u32 5 + jmpif v3 then: b2, else: b3 + b2(): + jmpif u1 1 then: b4, else: b5 + b3(): + return u1 1 + b4(): + jmp b3() + b5(): + v6 = unchecked_add v0, u32 1 + jmp b1(v6) + } + "#; + let ssa = Ssa::from_str(src).unwrap(); + let (ssa, errors) = try_unroll_loops(ssa); + assert_eq!(errors.len(), 0, "All loops should be unrolled"); + + // The SSA is expected to be unchanged + assert_ssa_snapshot!(ssa, @r#" + brillig(inline) predicate_pure fn main f0 { + b0(): + jmp b1(u32 0) + b1(v0: u32): + v3 = lt v0, u32 5 + jmpif v3 then: b2, else: b3 + b2(): + jmpif u1 1 then: b4, else: b5 + b3(): + return u1 1 + b4(): + jmp b3() + b5(): + v6 = unchecked_add v0, u32 1 + jmp b1(v6) + } + "#); + } } diff --git a/test_programs/execution_success/loop/src/main.nr b/test_programs/execution_success/loop/src/main.nr index 24df9f7b7ed..1a1d65df460 100644 --- a/test_programs/execution_success/loop/src/main.nr +++ b/test_programs/execution_success/loop/src/main.nr @@ -6,6 +6,11 @@ fn main(six_as_u32: u32) { assert_eq(loop_incl(3), six_as_u32); assert(plain_loop() == six_as_u32); assert(never_loop() == 0); + + // Safety: testing context + unsafe { + assert(basic_break() == true) + } } fn loop_excl(x: u32) -> u32 { @@ -39,3 +44,10 @@ fn never_loop() -> u32 { } sum } + +unconstrained fn basic_break() -> bool { + for idx_e in 0..5 { + if (idx_e < 5) { break; }; + } + true +} diff --git a/test_programs/execution_success/loop_small_break/Nargo.toml b/test_programs/execution_success/loop_small_break/Nargo.toml new file mode 100644 index 00000000000..d881cfafd40 --- /dev/null +++ b/test_programs/execution_success/loop_small_break/Nargo.toml @@ -0,0 +1,6 @@ +[package] +name = "loop_small_break" +type = "bin" +authors = [""] + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/loop_small_break/Prover.toml b/test_programs/execution_success/loop_small_break/Prover.toml new file mode 100644 index 00000000000..fed79d05f4a --- /dev/null +++ b/test_programs/execution_success/loop_small_break/Prover.toml @@ -0,0 +1 @@ +x = 5 diff --git a/test_programs/execution_success/loop_small_break/src/main.nr b/test_programs/execution_success/loop_small_break/src/main.nr new file mode 100644 index 00000000000..cbb525e41d0 --- /dev/null +++ b/test_programs/execution_success/loop_small_break/src/main.nr @@ -0,0 +1,13 @@ +// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359) +// We want the loop to be small enough that the compiler may attempt to unroll it. +unconstrained fn main(x: Field) { + let mut count = 0; + + for i in 0..1 { + if x == 5 { + count = i; + break; + } + } + assert(count == 0); +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap index 9f4533e16a8..6f7b0010e9d 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -24,7 +24,7 @@ expression: artifact "debug_symbols": "TYxLCsMwDAXvonUW6Y+Cr1JK8EcOAmMb2S4Uk7tHCQlkp3mDpoND0+aJok8F1KdDSFZXSlGow7hPJeu4UamaK6jb/TEARifX870M4CkgqNe4fAUMUwg0T9eMzD/NpE3AA32L9mLrP5/m/M+cLLrGuJV2J/kV", "file_map": { "50": { - "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n", + "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n\n // Safety: testing context\n unsafe {\n assert(basic_break() == true)\n }\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n\nunconstrained fn basic_break() -> bool {\n for idx_e in 0..5 {\n if (idx_e < 5) { break; };\n }\n true\n}\n", "path": "" } }, diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_0.snap index 9f4533e16a8..6f7b0010e9d 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_0.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_0.snap @@ -24,7 +24,7 @@ expression: artifact "debug_symbols": "TYxLCsMwDAXvonUW6Y+Cr1JK8EcOAmMb2S4Uk7tHCQlkp3mDpoND0+aJok8F1KdDSFZXSlGow7hPJeu4UamaK6jb/TEARifX870M4CkgqNe4fAUMUwg0T9eMzD/NpE3AA32L9mLrP5/m/M+cLLrGuJV2J/kV", "file_map": { "50": { - "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n", + "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n\n // Safety: testing context\n unsafe {\n assert(basic_break() == true)\n }\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n\nunconstrained fn basic_break() -> bool {\n for idx_e in 0..5 {\n if (idx_e < 5) { break; };\n }\n true\n}\n", "path": "" } }, diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_9223372036854775807.snap index 9f4533e16a8..6f7b0010e9d 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_9223372036854775807.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -24,7 +24,7 @@ expression: artifact "debug_symbols": "TYxLCsMwDAXvonUW6Y+Cr1JK8EcOAmMb2S4Uk7tHCQlkp3mDpoND0+aJok8F1KdDSFZXSlGow7hPJeu4UamaK6jb/TEARifX870M4CkgqNe4fAUMUwg0T9eMzD/NpE3AA32L9mLrP5/m/M+cLLrGuJV2J/kV", "file_map": { "50": { - "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n", + "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n\n // Safety: testing context\n unsafe {\n assert(basic_break() == true)\n }\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n\nunconstrained fn basic_break() -> bool {\n for idx_e in 0..5 {\n if (idx_e < 5) { break; };\n }\n true\n}\n", "path": "" } }, diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap index a1709959da4..25e80fa5b16 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -29,11 +29,11 @@ expression: artifact } } }, - "bytecode": "H4sIAAAAAAAA/91XPU/DQAy9tNdCqBAVzPwAtouafjCAKrUslRALAyPpFwsDEhISW386OmErr8ZJg5pDqF586b08++wXJ41MbhF5K66NghmTd/tZUiOXUxMtM8Z8ko/JN2C/WeNhYxG3Tv6RSwexcr4a8+/FxBmyPswZgN8dEc/dJueXZzHgGSfv8funtEadMeaY9nndpXUs7gnR/4D9cRdK/g04m7fJJkxs5p+G4U861Ktb0atAtUyZ34bh77M+W+an8V5b6aM2N5viGvP2NZsCr8TJmPhsY3zMwRJO4pmvJfCX5APX1J0Dr6xDYL30DkkvT8ArcTJmCL1ckf8Pegn0rktPRbyiOrNpPePffM/eaF2lZ6iNFqyRE3vWEBhj8p4xvkf+kJ9xqfmiOrNpPePcfM/eaV2lZ9p5y54z5OB3vnzObsiH/q7TesaxOib/NrGb+uMPR85x3CbUQeuhhX3ET+j6RDmH3SPP9TBL1r1snfWz5TJdZLJO3hpQJ/z+0bQYFXhjtnsrubsKF2tGzgzc8/N+BryoTa7xrvnB+AeTc97T+szo3+PeOrBvlX2+D9+XTQUvc2tDHhq+JfJn/CN536MPWneVnOS8tUp+WOvp5ttrs9tCrjOI/9caKTtLpJxF9qat4KWWEP9MHmu9S6dzsx0bdajpVMZm/AvkvKJ1VZ1q+2U6RXwVnSK+SKev5H+r00jJr6pOI8h1DvHlfzlZnzFdu/1sUDQ7tXekx9Y959N+NlxkwyS5TpNVmvR3zfkvWZPgNfUTAAA=", - "debug_symbols": "ldfdioMwEAXgd8m1F0lmJj99lWUptrVFEC3WLiyl775xqaXEgJwbMeLH0UwkzkOdmsP9sm/783BTu6+H6oZjPbVDn0aPZ6UOY9t17WX/eVnp+WD8//23a93Pw9tUj5PaGUuVavpTOiNJ/tx2jdqJfn5XygRYRFRYDQsDCwsLggXDQjYE+1w4WHhYBFiUa+54Ed5lgjQsDCwsLAgWDAuBhYOF3xAh5CLAIqKCNSyKNbfavoQ1nAsLC4IFw0Jg4WDhN4RdzW6ARUSFaFiUa85vIfmbi4UFwYJhIbBwsPBbIuYiwCKiwmlYFDPILDsOrVa717AwsCjWnGh5DyLKRbEeJHoRku+cPqIZQaMZwcDCwoJgwbAQWBRnl+2y47DN/8iihoWBRXF2md+CV4JgwbAQWARUGF2eLLcsd3ZxRQhPYTxFcOJw4nEScBIx8kyjn3ps60PXvFrI870/fnSU0++1yZrL6zgcm9N9bOY286PDnL+flOT8/CRztY0JlbE6paSkPw==", + "bytecode": "H4sIAAAAAAAA/91XTUvkQBCtTDqzmx1k3d37/oA9dZjMxr0swurqRU+CeBHixxxEEC8eBCEg+LslWEWeNZUYnbSofamO9eZVddXrDyNqRsTWqW8yMOts/XIjG5DLm4l2DcHcsU3ZjsAfD7jYVMUdkn/N50VqrG/A/Kcpc4asj3AG4PefmOd/1fDrtRBYwenf1P4VnqPOBPOZ/TL/xvNU/SZE/wP2x/8w8h/B2urxrwoTW/g3gJ9o+L25GSb/bMJa2FZaCNSrXPhdGP6Z6D+hxSG+MS3qxDqXY/WNedc12wVejdMx8ezA+JiDY5zGC1+i8D/ZBq6p/w68ug6B9TL9SHo5Al6N0zFD6OUX27egl0B3ab6i4rXVWYbVM/lb3bNrnvfpGWojgTlyYs9GCkPU9EzwOduPvMe15tvqLMPqmeRW9+yG5316Zq23a58hh7wp9D77yzb0u9HqWaxiv5eeVTx/ac8S5duiV6mD2QOJNaHm/emq4eMXa95L3Lhq6mD1xIEf8Tv8/cVYh1siz3lRZvNpOS9n5clJflzqOpGqE75BLW1FLZbo8f7S3KsGl+xbfW6jr75z94BXa63PGS74A2o493n+lRa1LDlOwO8Mv/wO3yyxgde5jSEPC5+o/AV/yLbu0S3PV42c9J3njPyw1pvVg7XuTwe57kH819ZI11oiYy26N2MDb51bgj9ji7V+Sqfn9Dg26tDSaduZeQk5X/C8r04tf5dOrfOyS6eIb9PpFdvn6jQy8uur0whyPYf4+v9pXZ91/vbLjd9tZ6f1TumD3QDs0HdCPiuL47LIsj95dppns6fuhHsN6NPMBRYAAA==", + "debug_symbols": "ldjbioNADAbgd5lrLyaTZA59lWVZbGuLILbYdmEpfffVUksZB+S/ESN+RBOHkdzNvtnejj9tfzhdzObrbrrTrr62p36M7o/KbIe269rjz+dlY6cDxef9l3PdT+HlWg9XsyHHlWn6/XjGOvpD2zVmo/bxXRlKqHAWFgQLBwuGhcBCYeFXhIRcBFhEWCRUcLnnXmYRfC4IFg4WDAuBhcLCwyLAIq6IGHORUCEWFgSLYs+ddS/hSHLBsBBYKCw8LAIs4opwi+omVKiFBcGi3HN5C83fXBkWAguFhYdFgEVcEykXCRXewoJgUew5u1nwYuf0DAuBhcLCwyLAIq4I4VwkVAQLi2IOea9zsbmIFhYEi2LPxdEsnMtFsR/CaRaS77UxoTmSRXMkgoWDBcNCYKGwKFZXaf4X1cU+SNbihHBSLLDym/CSME4EJ4qTCBMqV0znr141Lgj++iR4FsWJx0nAScRJwshjjH7roa23XfOaBRxu/e5jNHD9OzfZlOA8nHbN/jY007zgY1QwraLgqhCeTzIGxFQR85hlzPQP", "file_map": { "50": { - "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n", + "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n\n // Safety: testing context\n unsafe {\n assert(basic_break() == true)\n }\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n\nunconstrained fn basic_break() -> bool {\n for idx_e in 0..5 {\n if (idx_e < 5) { break; };\n }\n true\n}\n", "path": "" } }, diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_0.snap index d1c4e609de6..ab97a9d9286 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_0.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_0.snap @@ -29,7 +29,7 @@ expression: artifact "debug_symbols": "lZDLCoMwEEX/ZdZZGFu19VekSNRRAiGRPAol5N87KV0Ed9kMc4c5d3EibLiEY5Z6Nw7GKYIyq/DSaEoxMVisVEoec3mGJg/e/f7dKXSOzgvrYeTtjQHqjbb7QPwuFcLYNenFgPfVxFBNPKqJZx2RKL2FlWJR+Je0B70WzvznxIu+05oVt2Axiywc0pxaztqeaqn6Cw==", "file_map": { "50": { - "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n", + "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n\n // Safety: testing context\n unsafe {\n assert(basic_break() == true)\n }\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n\nunconstrained fn basic_break() -> bool {\n for idx_e in 0..5 {\n if (idx_e < 5) { break; };\n }\n true\n}\n", "path": "" } }, diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_9223372036854775807.snap index d1c4e609de6..ab97a9d9286 100644 --- a/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_9223372036854775807.snap +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -29,7 +29,7 @@ expression: artifact "debug_symbols": "lZDLCoMwEEX/ZdZZGFu19VekSNRRAiGRPAol5N87KV0Ed9kMc4c5d3EibLiEY5Z6Nw7GKYIyq/DSaEoxMVisVEoec3mGJg/e/f7dKXSOzgvrYeTtjQHqjbb7QPwuFcLYNenFgPfVxFBNPKqJZx2RKL2FlWJR+Je0B70WzvznxIu+05oVt2Axiywc0pxaztqeaqn6Cw==", "file_map": { "50": { - "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n", + "source": "// Tests a very simple program.\n//\n// The features being tested is basic looping.\nfn main(six_as_u32: u32) {\n assert_eq(loop_excl(4), six_as_u32);\n assert_eq(loop_incl(3), six_as_u32);\n assert(plain_loop() == six_as_u32);\n assert(never_loop() == 0);\n\n // Safety: testing context\n unsafe {\n assert(basic_break() == true)\n }\n}\n\nfn loop_excl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..x {\n sum = sum + i;\n }\n sum\n}\n\nfn loop_incl(x: u32) -> u32 {\n let mut sum = 0;\n for i in 0..=x {\n sum = sum + i;\n }\n sum\n}\n\nfn plain_loop() -> u32 {\n let mut sum = 0;\n for i in 0..4 {\n sum = sum + i;\n }\n sum\n}\n\nfn never_loop() -> u32 {\n let mut sum = 0;\n for i in 4..0 {\n sum = sum + i;\n }\n sum\n}\n\nunconstrained fn basic_break() -> bool {\n for idx_e in 0..5 {\n if (idx_e < 5) { break; };\n }\n true\n}\n", "path": "" } }, diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..517a0de5e13 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_-9223372036854775808.snap @@ -0,0 +1,40 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "x", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/7VVwYrCMBCdtsnuZl3ZZT0IIogXvSikaNGjB38kKP2OfroWZsg4Tr2YDJRJ2sl7b15CWkCMArMRc1BqTpj9e1EnxPKq0FdBNVvMDnPJvlcJm3WCNyX+0e8bp/SXUP/OIWZOfwgzA77/RJxzF/FlL32Mcc7PEK35uj8/EMdjHDuxJsfeZvTeTxT9xDXCXtfCn4r5UwxkgMf9pCiFbyZTX3/wfKaM4LZMVyLehrg+EM/Cs79W6Mhxdu5R036Vige9vil7z3UZ1DG01or6GcNcihryYcFq5gO8MMBL/mj9WKUfbe9LReMv6P5zXlrHPeH10hOqX2HOfbf9M1zZwwjiv8106fkPR++Jt+qiD/x+AMFvRf0G599KH+YNne0h1O0utKEJ1+v+EqRPffB77gYXk/5IEQkAAA==", + "debug_symbols": "ldPBCoMwDADQf8nZgxrr1F+RIVWrFEortQ6G+O9rhxuiXnIJTekLgSYr9KJdxkbqwcxQ1Sso03EnjfbZukXQWqmUHJvjNcQhJNn3/TxxHdLZceugShMWgdB9OOXeD1IJqFi8PSNIGFnkZPEgi+JWsPgn2EWUVJHircB/V3gR5K4wIQski9s/x7TYBWJxFowscrJ40MTmsxe3krdK7GM+LLo7TL17T+K0AJM1negXK8IqHLbAxxrLKMt8WV/6Aw==", + "file_map": { + "50": { + "source": "// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359)\n// We want the loop to be small enough that the compiler may attempt to unroll it.\nunconstrained fn main(x: Field) {\n let mut count = 0;\n\n for i in 0..1 {\n if x == 5 {\n count = i;\n break;\n }\n }\n assert(count == 0);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_0.snap new file mode 100644 index 00000000000..517a0de5e13 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_0.snap @@ -0,0 +1,40 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "x", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/7VVwYrCMBCdtsnuZl3ZZT0IIogXvSikaNGjB38kKP2OfroWZsg4Tr2YDJRJ2sl7b15CWkCMArMRc1BqTpj9e1EnxPKq0FdBNVvMDnPJvlcJm3WCNyX+0e8bp/SXUP/OIWZOfwgzA77/RJxzF/FlL32Mcc7PEK35uj8/EMdjHDuxJsfeZvTeTxT9xDXCXtfCn4r5UwxkgMf9pCiFbyZTX3/wfKaM4LZMVyLehrg+EM/Cs79W6Mhxdu5R036Vige9vil7z3UZ1DG01or6GcNcihryYcFq5gO8MMBL/mj9WKUfbe9LReMv6P5zXlrHPeH10hOqX2HOfbf9M1zZwwjiv8106fkPR++Jt+qiD/x+AMFvRf0G599KH+YNne0h1O0utKEJ1+v+EqRPffB77gYXk/5IEQkAAA==", + "debug_symbols": "ldPBCoMwDADQf8nZgxrr1F+RIVWrFEortQ6G+O9rhxuiXnIJTekLgSYr9KJdxkbqwcxQ1Sso03EnjfbZukXQWqmUHJvjNcQhJNn3/TxxHdLZceugShMWgdB9OOXeD1IJqFi8PSNIGFnkZPEgi+JWsPgn2EWUVJHircB/V3gR5K4wIQski9s/x7TYBWJxFowscrJ40MTmsxe3krdK7GM+LLo7TL17T+K0AJM1negXK8IqHLbAxxrLKMt8WV/6Aw==", + "file_map": { + "50": { + "source": "// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359)\n// We want the loop to be small enough that the compiler may attempt to unroll it.\nunconstrained fn main(x: Field) {\n let mut count = 0;\n\n for i in 0..1 {\n if x == 5 {\n count = i;\n break;\n }\n }\n assert(count == 0);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..517a0de5e13 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_false_inliner_9223372036854775807.snap @@ -0,0 +1,40 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "x", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/7VVwYrCMBCdtsnuZl3ZZT0IIogXvSikaNGjB38kKP2OfroWZsg4Tr2YDJRJ2sl7b15CWkCMArMRc1BqTpj9e1EnxPKq0FdBNVvMDnPJvlcJm3WCNyX+0e8bp/SXUP/OIWZOfwgzA77/RJxzF/FlL32Mcc7PEK35uj8/EMdjHDuxJsfeZvTeTxT9xDXCXtfCn4r5UwxkgMf9pCiFbyZTX3/wfKaM4LZMVyLehrg+EM/Cs79W6Mhxdu5R036Vige9vil7z3UZ1DG01or6GcNcihryYcFq5gO8MMBL/mj9WKUfbe9LReMv6P5zXlrHPeH10hOqX2HOfbf9M1zZwwjiv8106fkPR++Jt+qiD/x+AMFvRf0G599KH+YNne0h1O0utKEJ1+v+EqRPffB77gYXk/5IEQkAAA==", + "debug_symbols": "ldPBCoMwDADQf8nZgxrr1F+RIVWrFEortQ6G+O9rhxuiXnIJTekLgSYr9KJdxkbqwcxQ1Sso03EnjfbZukXQWqmUHJvjNcQhJNn3/TxxHdLZceugShMWgdB9OOXeD1IJqFi8PSNIGFnkZPEgi+JWsPgn2EWUVJHircB/V3gR5K4wIQski9s/x7TYBWJxFowscrJ40MTmsxe3krdK7GM+LLo7TL17T+K0AJM1negXK8IqHLbAxxrLKMt8WV/6Aw==", + "file_map": { + "50": { + "source": "// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359)\n// We want the loop to be small enough that the compiler may attempt to unroll it.\nunconstrained fn main(x: Field) {\n let mut count = 0;\n\n for i in 0..1 {\n if x == 5 {\n count = i;\n break;\n }\n }\n assert(count == 0);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap new file mode 100644 index 00000000000..517a0de5e13 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_-9223372036854775808.snap @@ -0,0 +1,40 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "x", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/7VVwYrCMBCdtsnuZl3ZZT0IIogXvSikaNGjB38kKP2OfroWZsg4Tr2YDJRJ2sl7b15CWkCMArMRc1BqTpj9e1EnxPKq0FdBNVvMDnPJvlcJm3WCNyX+0e8bp/SXUP/OIWZOfwgzA77/RJxzF/FlL32Mcc7PEK35uj8/EMdjHDuxJsfeZvTeTxT9xDXCXtfCn4r5UwxkgMf9pCiFbyZTX3/wfKaM4LZMVyLehrg+EM/Cs79W6Mhxdu5R036Vige9vil7z3UZ1DG01or6GcNcihryYcFq5gO8MMBL/mj9WKUfbe9LReMv6P5zXlrHPeH10hOqX2HOfbf9M1zZwwjiv8106fkPR++Jt+qiD/x+AMFvRf0G599KH+YNne0h1O0utKEJ1+v+EqRPffB77gYXk/5IEQkAAA==", + "debug_symbols": "ldPBCoMwDADQf8nZgxrr1F+RIVWrFEortQ6G+O9rhxuiXnIJTekLgSYr9KJdxkbqwcxQ1Sso03EnjfbZukXQWqmUHJvjNcQhJNn3/TxxHdLZceugShMWgdB9OOXeD1IJqFi8PSNIGFnkZPEgi+JWsPgn2EWUVJHircB/V3gR5K4wIQski9s/x7TYBWJxFowscrJ40MTmsxe3krdK7GM+LLo7TL17T+K0AJM1negXK8IqHLbAxxrLKMt8WV/6Aw==", + "file_map": { + "50": { + "source": "// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359)\n// We want the loop to be small enough that the compiler may attempt to unroll it.\nunconstrained fn main(x: Field) {\n let mut count = 0;\n\n for i in 0..1 {\n if x == 5 {\n count = i;\n break;\n }\n }\n assert(count == 0);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_0.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_0.snap new file mode 100644 index 00000000000..517a0de5e13 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_0.snap @@ -0,0 +1,40 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "x", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/7VVwYrCMBCdtsnuZl3ZZT0IIogXvSikaNGjB38kKP2OfroWZsg4Tr2YDJRJ2sl7b15CWkCMArMRc1BqTpj9e1EnxPKq0FdBNVvMDnPJvlcJm3WCNyX+0e8bp/SXUP/OIWZOfwgzA77/RJxzF/FlL32Mcc7PEK35uj8/EMdjHDuxJsfeZvTeTxT9xDXCXtfCn4r5UwxkgMf9pCiFbyZTX3/wfKaM4LZMVyLehrg+EM/Cs79W6Mhxdu5R036Vige9vil7z3UZ1DG01or6GcNcihryYcFq5gO8MMBL/mj9WKUfbe9LReMv6P5zXlrHPeH10hOqX2HOfbf9M1zZwwjiv8106fkPR++Jt+qiD/x+AMFvRf0G599KH+YNne0h1O0utKEJ1+v+EqRPffB77gYXk/5IEQkAAA==", + "debug_symbols": "ldPBCoMwDADQf8nZgxrr1F+RIVWrFEortQ6G+O9rhxuiXnIJTekLgSYr9KJdxkbqwcxQ1Sso03EnjfbZukXQWqmUHJvjNcQhJNn3/TxxHdLZceugShMWgdB9OOXeD1IJqFi8PSNIGFnkZPEgi+JWsPgn2EWUVJHircB/V3gR5K4wIQski9s/x7TYBWJxFowscrJ40MTmsxe3krdK7GM+LLo7TL17T+K0AJM1negXK8IqHLbAxxrLKMt8WV/6Aw==", + "file_map": { + "50": { + "source": "// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359)\n// We want the loop to be small enough that the compiler may attempt to unroll it.\nunconstrained fn main(x: Field) {\n let mut count = 0;\n\n for i in 0..1 {\n if x == 5 {\n count = i;\n break;\n }\n }\n assert(count == 0);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +} diff --git a/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_9223372036854775807.snap b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_9223372036854775807.snap new file mode 100644 index 00000000000..517a0de5e13 --- /dev/null +++ b/tooling/nargo_cli/tests/snapshots/execution_success/loop_small_break/execute__tests__force_brillig_true_inliner_9223372036854775807.snap @@ -0,0 +1,40 @@ +--- +source: tooling/nargo_cli/tests/execute.rs +expression: artifact +--- +{ + "noir_version": "[noir_version]", + "hash": "[hash]", + "abi": { + "parameters": [ + { + "name": "x", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null, + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + } + }, + "bytecode": "H4sIAAAAAAAA/7VVwYrCMBCdtsnuZl3ZZT0IIogXvSikaNGjB38kKP2OfroWZsg4Tr2YDJRJ2sl7b15CWkCMArMRc1BqTpj9e1EnxPKq0FdBNVvMDnPJvlcJm3WCNyX+0e8bp/SXUP/OIWZOfwgzA77/RJxzF/FlL32Mcc7PEK35uj8/EMdjHDuxJsfeZvTeTxT9xDXCXtfCn4r5UwxkgMf9pCiFbyZTX3/wfKaM4LZMVyLehrg+EM/Cs79W6Mhxdu5R036Vige9vil7z3UZ1DG01or6GcNcihryYcFq5gO8MMBL/mj9WKUfbe9LReMv6P5zXlrHPeH10hOqX2HOfbf9M1zZwwjiv8106fkPR++Jt+qiD/x+AMFvRf0G599KH+YNne0h1O0utKEJ1+v+EqRPffB77gYXk/5IEQkAAA==", + "debug_symbols": "ldPBCoMwDADQf8nZgxrr1F+RIVWrFEortQ6G+O9rhxuiXnIJTekLgSYr9KJdxkbqwcxQ1Sso03EnjfbZukXQWqmUHJvjNcQhJNn3/TxxHdLZceugShMWgdB9OOXeD1IJqFi8PSNIGFnkZPEgi+JWsPgn2EWUVJHircB/V3gR5K4wIQski9s/x7TYBWJxFowscrJ40MTmsxe3krdK7GM+LLo7TL17T+K0AJM1negXK8IqHLbAxxrLKMt8WV/6Aw==", + "file_map": { + "50": { + "source": "// Regression for issue #7359 (https://github.com/noir-lang/noir/issues/7359)\n// We want the loop to be small enough that the compiler may attempt to unroll it.\nunconstrained fn main(x: Field) {\n let mut count = 0;\n\n for i in 0..1 {\n if x == 5 {\n count = i;\n break;\n }\n }\n assert(count == 0);\n}\n", + "path": "" + } + }, + "names": [ + "main" + ], + "brillig_names": [ + "main" + ] +}