From 3ccbd4cb1adea484e258c0d6f36aceaff5d6afeb Mon Sep 17 00:00:00 2001 From: Tom French Date: Thu, 4 Jan 2024 15:13:35 +0000 Subject: [PATCH] chore: document new boolean arg --- .../noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs | 3 +++ compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs index 4c47b752e5c..ddafc0bb570 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs @@ -1332,6 +1332,9 @@ impl AcirContext { // Optimistically try executing the brillig now, if we can complete execution they just return the results. // This is a temporary measure pending SSA optimizations being applied to Brillig which would remove constant-input opcodes (See #2066) + // + // We do _not_ want to do this in the situation where the `main` function is unconstrained, as if execution succeeds + // the entire program will be replaced with witness constraints to its outputs. if attempt_execution { if let Some(brillig_outputs) = self.execute_brillig(&generated_brillig.byte_code, &b_inputs, &outputs) diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs index 906389cfb6b..edf0461430f 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs @@ -266,6 +266,8 @@ impl Context { let code = self.gen_brillig_for(main_func, &brillig)?; + // We specifically do not attempt execution of the brillig code being generated as this can result in it being + // replaced with constraints on witnesses to the program outputs. let output_values = self.acir_context.brillig( self.current_side_effects_enabled_var, code,