Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e07769d
do not simplify call-data values
guipublic Sep 30, 2025
df89010
Merge branch 'master' into gd/issue_9983
guipublic Sep 30, 2025
ae577f8
Merge branch 'master' into gd/issue_9983
guipublic Oct 2, 2025
156bf29
Merge branch 'master' into gd/issue_9983
guipublic Oct 6, 2025
35826bb
Merge branch 'master' into gd/issue_9983
guipublic Oct 7, 2025
259ba3f
Merge branch 'master' into gd/issue_9983
TomAFrench Oct 7, 2025
d08aa2b
Merge branch 'master' into gd/issue_9983
guipublic Oct 8, 2025
666b317
Merge branch 'master' into gd/issue_9983
TomAFrench Oct 9, 2025
e73f96a
Merge branch 'master' into gd/issue_9983
TomAFrench Oct 15, 2025
afc0305
Merge branch 'master' into gd/issue_9983
TomAFrench Oct 16, 2025
fff083b
.
TomAFrench Oct 16, 2025
7ab2207
Merge branch 'master' into gd/issue_9983
guipublic Oct 16, 2025
1186e87
chore: align compiler version to aztec-packages
TomAFrench Oct 16, 2025
d8ad7af
debug smart contract verifier
guipublic Oct 20, 2025
74e606e
debugging
guipublic Oct 20, 2025
76fd84a
clippy
guipublic Oct 20, 2025
9e6bb26
revert debug logs
guipublic Oct 21, 2025
a779dec
implement default trait for compile options
guipublic Oct 21, 2025
f0f0a53
Merge branch 'master' into gd/issue_9983
guipublic Oct 21, 2025
288898f
Merge branch 'master' into gd/issue_9983
guipublic Oct 30, 2025
3610282
Merge branch 'master' into gd/issue_9983
guipublic Oct 30, 2025
871c5ce
Merge branch 'master' into gd/issue_9983
guipublic Oct 30, 2025
4a20860
Merge branch 'master' into gd/issue_9983
guipublic Oct 31, 2025
8b547ef
code review: revert config change
guipublic Oct 31, 2025
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
9 changes: 7 additions & 2 deletions compiler/noirc_evaluator/src/acir/acir_context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ impl<F: AcirField> AcirContext<F> {
return Ok(());
}

if let Some(w) = self.var_to_expression(lhs)?.to_witness() {
if self.acir_ir.input_witnesses.contains(&w) {
//Input witnesses are not replaced
return Ok(());
}
}

let lhs_data = self.vars.remove(&lhs).ok_or_else(|| InternalError::UndeclaredAcirVar {
call_stack: self.get_call_stack(),
})?;
Expand Down Expand Up @@ -1321,11 +1328,9 @@ impl<F: AcirField> AcirContext<F> {
/// Terminates the context and takes the resulting `GeneratedAcir`
pub(crate) fn finish(
mut self,
inputs: Vec<Witness>,
return_values: Vec<Witness>,
warnings: Vec<SsaReport>,
) -> GeneratedAcir<F> {
self.acir_ir.input_witnesses = inputs;
self.acir_ir.return_witnesses = return_values;
self.acir_ir.warnings = warnings;
self.acir_ir
Expand Down
9 changes: 5 additions & 4 deletions compiler/noirc_evaluator/src/acir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ impl<'a> Context<'a> {
) -> Result<GeneratedAcir<FieldElement>, RuntimeError> {
let dfg = &main_func.dfg;
let entry_block = &dfg[main_func.entry_block()];
let input_witness = self.convert_ssa_block_params(entry_block.parameters(), dfg)?;
self.acir_context.acir_ir.input_witnesses =
self.convert_ssa_block_params(entry_block.parameters(), dfg)?;

let num_return_witnesses =
self.get_num_return_witnesses(entry_block.unwrap_terminator(), dfg);

Expand Down Expand Up @@ -250,7 +252,6 @@ impl<'a> Context<'a> {

// Add the warnings from the alter Ssa passes
Ok(self.acir_context.finish(
input_witness,
// Don't embed databus return witnesses into the circuit.
if self.data_bus.return_data.is_some() { Vec::new() } else { return_witnesses },
warnings,
Expand All @@ -269,7 +270,7 @@ impl<'a> Context<'a> {
})?;
let arguments = self.gen_brillig_parameters(dfg[main_func.entry_block()].parameters(), dfg);

let witness_inputs = self.acir_context.extract_witness(&inputs);
self.acir_context.acir_ir.input_witnesses = self.acir_context.extract_witness(&inputs);
let returns = main_func.returns().unwrap_or_default();

let outputs: Vec<AcirType> =
Expand Down Expand Up @@ -303,7 +304,7 @@ impl<'a> Context<'a> {
.map(|(value, _)| self.acir_context.var_to_witness(value))
.collect::<Result<_, _>>()?;

let generated_acir = self.acir_context.finish(witness_inputs, return_witnesses, Vec::new());
let generated_acir = self.acir_context.finish(return_witnesses, Vec::new());

assert_eq!(
generated_acir.opcodes().len(),
Expand Down
28 changes: 28 additions & 0 deletions compiler/noirc_evaluator/src/acir/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,34 @@ fn derive_pedersen_generators_requires_constant_input() {
.expect_err("Should fail with assert constant");
}

#[test]
fn databus() {
let src = "
acir(inline) predicate_pure fn main f0 {
b0(v0: u32, v1: u32):
v2 = cast v0 as Field
v3 = make_array [v2] : [Field; 1]
constrain v0 == u32 0
v4 = add v0, v1
return v4
}
";
let program = ssa_to_acir_program(src);

// Check that w0 is not replaced
assert_circuit_snapshot!(program, @r"
func 0
private parameters: [w0, w1]
public parameters: []
return values: [w2]
BLACKBOX::RANGE input: w1, bits: 32
ASSERT w0 = 0
ASSERT w3 = w0 + w1
BLACKBOX::RANGE input: w3, bits: 32
ASSERT w3 = w2
");
}

/// Convert the SSA input into ACIR and use ACVM to execute it
/// Returns the ACVM execution status and the value of the 'output' witness value,
/// unless the provided output is None or the ACVM fails during execution.
Expand Down
Loading