From 6d7704acad8a77ef47ea9c47f04b49ab6bf14a50 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Tue, 2 Apr 2024 20:27:29 +0000 Subject: [PATCH 01/19] initial testing of nargo info on multiple circuits against poseidon blowup --- .../noirc_evaluator/src/ssa/acir_gen/mod.rs | 15 ++- .../src/ssa/opt/flatten_cfg.rs | 6 + noir_stdlib/src/hash/poseidon2.nr | 2 +- .../poseidon_blowup_test/Nargo.toml | 7 ++ .../poseidon_blowup_test/Prover.toml | 4 + .../poseidon_blowup_test/src/main.nr | 55 +++++++++ tooling/nargo_cli/src/cli/info_cmd.rs | 115 +++++++++++++++--- 7 files changed, 185 insertions(+), 19 deletions(-) create mode 100644 test_programs/execution_success/poseidon_blowup_test/Nargo.toml create mode 100644 test_programs/execution_success/poseidon_blowup_test/Prover.toml create mode 100644 test_programs/execution_success/poseidon_blowup_test/src/main.nr diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs index e3dd4c33986..94008c86efa 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs @@ -812,9 +812,22 @@ impl Context { } // If there is a predicate and the index is not out of range, we can directly perform the read else if index < array_size && store_value.is_none() { + // dbg!("got in constant read"); self.define_result(dfg, instruction, array[index].clone()); return Ok(true); - } + } + // else if index < array_size && store_value.is_some() { + // dbg!("got in constant write"); + // let value = match store_value { + // Some(store_value) => { + // let store_value = self.convert_value(store_value, dfg); + // AcirValue::Array(array.update(index, store_value)) + // } + // None => array[index].clone(), + // }; + // self.define_result(dfg, instruction, value); + // return Ok(true); + // } } } AcirValue::DynamicArray(_) => (), diff --git a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 07771397ce8..50342392b07 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -643,6 +643,12 @@ impl<'f> Context<'f> { } } + // dbg!(new_map.len()); + // for (address, (then_case, else_case, _)) in &new_map { + // dbg!(&self.inserter.function.dfg[*then_case]); + // dbg!(&self.inserter.function.dfg[*else_case]); + // } + // Most slice information is collected when instructions are inlined. // We need to collect information on slice values here as we may possibly merge stores // before any inlining occurs. diff --git a/noir_stdlib/src/hash/poseidon2.nr b/noir_stdlib/src/hash/poseidon2.nr index 12bf373e671..23de635ade8 100644 --- a/noir_stdlib/src/hash/poseidon2.nr +++ b/noir_stdlib/src/hash/poseidon2.nr @@ -95,7 +95,7 @@ impl Poseidon2 { result } - fn hash_internal(input: [Field; N], in_len: u64, is_variable_length: bool) -> Field { + pub fn hash_internal(input: [Field; N], in_len: u64, is_variable_length: bool) -> Field { let two_pow_64 = 18446744073709551616; let iv : Field = (in_len as Field) * two_pow_64; let mut sponge = Poseidon2::new(iv); diff --git a/test_programs/execution_success/poseidon_blowup_test/Nargo.toml b/test_programs/execution_success/poseidon_blowup_test/Nargo.toml new file mode 100644 index 00000000000..9326ed33c2c --- /dev/null +++ b/test_programs/execution_success/poseidon_blowup_test/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "poseidon_blowup_test" +type = "bin" +authors = [""] +compiler_version = ">=0.26.0" + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/poseidon_blowup_test/Prover.toml b/test_programs/execution_success/poseidon_blowup_test/Prover.toml new file mode 100644 index 00000000000..c507142cf6d --- /dev/null +++ b/test_programs/execution_success/poseidon_blowup_test/Prover.toml @@ -0,0 +1,4 @@ +enable = true +to_hash = ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'] +# enable = [true, true, true, false] +# to_hash = [['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1']] \ No newline at end of file diff --git a/test_programs/execution_success/poseidon_blowup_test/src/main.nr b/test_programs/execution_success/poseidon_blowup_test/src/main.nr new file mode 100644 index 00000000000..c9c6d8ea02d --- /dev/null +++ b/test_programs/execution_success/poseidon_blowup_test/src/main.nr @@ -0,0 +1,55 @@ +use dep::std::hash::{pedersen_hash_with_separator, poseidon2::Poseidon2}; + +global NUM_HASHES = 4; +global HASH_LENGTH = 20; + +pub fn pedersen_hash(inputs: [Field; N], hash_index: u32) -> Field { + dep::std::hash::pedersen_hash_with_separator(inputs, hash_index) +} + +pub fn poseidon_hash(inputs: [Field; N]) -> Field { + Poseidon2::hash(inputs, inputs.len()) +} + +pub fn poseideon_hash_internal(inputs: [Field; N]) -> Field { + Poseidon2::hash_internal(inputs, inputs.len(), false) +} + +fn main( + to_hash: [Field; HASH_LENGTH], + enable: bool +) -> pub Field { + let mut result = 0; + if enable { + // result = poseidon_hash(to_hash); + // result = pedersen_hash(to_hash, 0); + result = poseidon_in_fold(to_hash); + } + result +} + +// fn main( +// to_hash: [[Field; HASH_LENGTH]; NUM_HASHES], +// enable: [bool; NUM_HASHES], +// // to_hash: [Field; HASH_LENGTH], +// // enable: bool +// ) -> pub [Field; NUM_HASHES] { +// let mut result = [0; NUM_HASHES]; +// for i in 0..NUM_HASHES { +// let enable = enable[i]; +// let to_hash = to_hash[i]; +// if enable { +// // result[i] = pedersen_hash(to_hash, 0); +// // result[i] = poseidon_hash(to_hash); +// // result[i] = poseideon_hash_internal(to_hash); +// // Failing with Assertion `(arg.mul_terms.size() <= 1) +// // result[i] = poseidon_in_fold(to_hash); +// } +// } +// result +// } + +#[fold] +fn poseidon_in_fold(inputs: [Field; HASH_LENGTH]) -> Field { + poseidon_hash(inputs) +} \ No newline at end of file diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index 49924622392..478ed40660d 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use acvm::acir::circuit::ExpressionWidth; +use acvm::acir::circuit::{Circuit, ExpressionWidth, Program}; use backend_interface::BackendError; use clap::Args; use iter_extended::vecmap; @@ -114,19 +114,35 @@ pub(crate) fn run( let binary_packages = workspace.into_iter().filter(|package| package.is_binary()).zip(compiled_programs); - let program_info = binary_packages - .par_bridge() - .map(|(package, program)| { - count_opcodes_and_gates_in_program(backend, program, package, expression_width) - }) - .collect::>()?; + // let program_info = binary_packages + // .par_bridge() + // .map(|(package, program)| { + // count_opcodes_and_gates_in_program(backend, program, package, expression_width) + // }) + // .collect::>()?; + let mut new_program_info = binary_packages + .par_bridge() + .map(|(package, program)| { + count_opcodes_and_gates_in_program_full(backend, program, package, expression_width) + }) + .collect::>()?; let contract_info = compiled_contracts .into_par_iter() .map(|contract| count_opcodes_and_gates_in_contract(backend, contract, expression_width)) .collect::>()?; - let info_report = InfoReport { programs: program_info, contracts: contract_info }; + // let contract_info = binar + // .into_par_iter() + // .map(|contract| count_opcodes_and_gates_in_contract(backend, contract, expression_width)) + // .collect::>()?; + + // let mut new_program_info = binary_packages.flat_map(|(package, program)| { + // count_opcodes_and_gates_in_program_full(backend, program, package, expression_width) + // }).collect::>()?; + // program_info.append(&mut new_program_info); + + let info_report = InfoReport { contracts: contract_info, programs: new_program_info }; if args.json { // Expose machine-readable JSON data. @@ -134,10 +150,16 @@ pub(crate) fn run( } else { // Otherwise print human-readable table. if !info_report.programs.is_empty() { - let mut program_table = table!([Fm->"Package", Fm->"Expression Width", Fm->"ACIR Opcodes", Fm->"Backend Circuit Size"]); - - for program in info_report.programs { - program_table.add_row(program.into()); + let mut program_table = table!([Fm->"Package", Fm->"Function", Fm->"Expression Width", Fm->"ACIR Opcodes", Fm->"Backend Circuit Size"]); + + // for program in info_report.new_programs { + // program_table.add_row(program.into()); + // } + for program_info in info_report.programs { + let program_rows: Vec = program_info.into(); + for row in program_rows { + program_table.add_row(row); + } } program_table.printstd(); } @@ -219,7 +241,7 @@ struct InfoReport { } #[derive(Debug, Serialize)] -struct ProgramInfo { +struct CircuitInfo { name: String, #[serde(skip)] expression_width: ExpressionWidth, @@ -227,8 +249,8 @@ struct ProgramInfo { circuit_size: u32, } -impl From for Row { - fn from(program_info: ProgramInfo) -> Self { +impl From for Row { + fn from(program_info: CircuitInfo) -> Self { row![ Fm->format!("{}", program_info.name), format!("{:?}", program_info.expression_width), @@ -238,6 +260,28 @@ impl From for Row { } } +#[derive(Debug, Serialize)] +struct ProgramInfo { + name: String, + #[serde(skip)] + expression_width: ExpressionWidth, + functions: Vec, +} + +impl From for Vec { + fn from(program_info: ProgramInfo) -> Self { + vecmap(program_info.functions, |function| { + row![ + Fm->format!("{}", program_info.name), + Fc->format!("{}", function.name), + format!("{:?}", program_info.expression_width), + Fc->format!("{}", function.acir_opcodes), + Fc->format!("{}", function.circuit_size), + ] + }) + } +} + #[derive(Debug, Serialize)] struct ContractInfo { name: String, @@ -272,8 +316,8 @@ fn count_opcodes_and_gates_in_program( compiled_program: CompiledProgram, package: &Package, expression_width: ExpressionWidth, -) -> Result { - Ok(ProgramInfo { +) -> Result { + Ok(CircuitInfo { name: package.name.to_string(), expression_width, // TODO(https://github.com/noir-lang/noir/issues/4428) @@ -282,6 +326,43 @@ fn count_opcodes_and_gates_in_program( }) } +fn count_opcodes_and_gates_in_circuit( + backend: &Backend, + circuit: &Circuit, + program: &Program, + // compiled_program: CompiledProgram, + package: &Package, + expression_width: ExpressionWidth, +) -> Result { + Ok(CircuitInfo { + name: package.name.to_string(), + expression_width, + acir_opcodes: circuit.opcodes.len(), + circuit_size: backend.get_exact_circuit_size(program)?, + }) +} + +fn count_opcodes_and_gates_in_program_full( + backend: &Backend, + compiled_program: CompiledProgram, + package: &Package, + expression_width: ExpressionWidth, +) -> Result { + let functions = compiled_program.program + .functions + .into_par_iter().enumerate() + .map(|(i, function)| -> Result<_, BackendError> { + Ok(FunctionInfo { + name: if i == 0 { "main".to_owned() } else { format!("func {i}") }, + acir_opcodes: function.opcodes.len(), + circuit_size: backend.get_exact_circuit_size(&Program { functions: vec![function] })?, + }) + }) + .collect::>()?; + // Ok(functions) + Ok(ProgramInfo { name: package.name.to_string(), expression_width, functions }) +} + fn count_opcodes_and_gates_in_contract( backend: &Backend, contract: CompiledContract, From ea5e0730b076a053ae4d2cebf4fe8a19d30a98ce Mon Sep 17 00:00:00 2001 From: vezenovm Date: Wed, 3 Apr 2024 18:31:54 +0000 Subject: [PATCH 02/19] cleanup old dbgs and debug methods in info cmd --- .../noirc_evaluator/src/ssa/acir_gen/mod.rs | 13 ---- .../src/ssa/opt/flatten_cfg.rs | 6 -- tooling/nargo_cli/src/cli/info_cmd.rs | 59 ++----------------- 3 files changed, 5 insertions(+), 73 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs index 94008c86efa..a45ef6e9398 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs @@ -812,22 +812,9 @@ impl Context { } // If there is a predicate and the index is not out of range, we can directly perform the read else if index < array_size && store_value.is_none() { - // dbg!("got in constant read"); self.define_result(dfg, instruction, array[index].clone()); return Ok(true); } - // else if index < array_size && store_value.is_some() { - // dbg!("got in constant write"); - // let value = match store_value { - // Some(store_value) => { - // let store_value = self.convert_value(store_value, dfg); - // AcirValue::Array(array.update(index, store_value)) - // } - // None => array[index].clone(), - // }; - // self.define_result(dfg, instruction, value); - // return Ok(true); - // } } } AcirValue::DynamicArray(_) => (), diff --git a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index 50342392b07..07771397ce8 100644 --- a/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -643,12 +643,6 @@ impl<'f> Context<'f> { } } - // dbg!(new_map.len()); - // for (address, (then_case, else_case, _)) in &new_map { - // dbg!(&self.inserter.function.dfg[*then_case]); - // dbg!(&self.inserter.function.dfg[*else_case]); - // } - // Most slice information is collected when instructions are inlined. // We need to collect information on slice values here as we may possibly merge stores // before any inlining occurs. diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index 478ed40660d..e55f49d32ee 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -114,16 +114,11 @@ pub(crate) fn run( let binary_packages = workspace.into_iter().filter(|package| package.is_binary()).zip(compiled_programs); - // let program_info = binary_packages - // .par_bridge() - // .map(|(package, program)| { - // count_opcodes_and_gates_in_program(backend, program, package, expression_width) - // }) - // .collect::>()?; - let mut new_program_info = binary_packages + + let program_info = binary_packages .par_bridge() .map(|(package, program)| { - count_opcodes_and_gates_in_program_full(backend, program, package, expression_width) + count_opcodes_and_gates_in_program(backend, program, package, expression_width) }) .collect::>()?; @@ -132,17 +127,7 @@ pub(crate) fn run( .map(|contract| count_opcodes_and_gates_in_contract(backend, contract, expression_width)) .collect::>()?; - // let contract_info = binar - // .into_par_iter() - // .map(|contract| count_opcodes_and_gates_in_contract(backend, contract, expression_width)) - // .collect::>()?; - - // let mut new_program_info = binary_packages.flat_map(|(package, program)| { - // count_opcodes_and_gates_in_program_full(backend, program, package, expression_width) - // }).collect::>()?; - // program_info.append(&mut new_program_info); - - let info_report = InfoReport { contracts: contract_info, programs: new_program_info }; + let info_report = InfoReport { programs: program_info, contracts: contract_info }; if args.json { // Expose machine-readable JSON data. @@ -152,9 +137,6 @@ pub(crate) fn run( if !info_report.programs.is_empty() { let mut program_table = table!([Fm->"Package", Fm->"Function", Fm->"Expression Width", Fm->"ACIR Opcodes", Fm->"Backend Circuit Size"]); - // for program in info_report.new_programs { - // program_table.add_row(program.into()); - // } for program_info in info_report.programs { let program_rows: Vec = program_info.into(); for row in program_rows { @@ -316,37 +298,6 @@ fn count_opcodes_and_gates_in_program( compiled_program: CompiledProgram, package: &Package, expression_width: ExpressionWidth, -) -> Result { - Ok(CircuitInfo { - name: package.name.to_string(), - expression_width, - // TODO(https://github.com/noir-lang/noir/issues/4428) - acir_opcodes: compiled_program.program.functions[0].opcodes.len(), - circuit_size: backend.get_exact_circuit_size(&compiled_program.program)?, - }) -} - -fn count_opcodes_and_gates_in_circuit( - backend: &Backend, - circuit: &Circuit, - program: &Program, - // compiled_program: CompiledProgram, - package: &Package, - expression_width: ExpressionWidth, -) -> Result { - Ok(CircuitInfo { - name: package.name.to_string(), - expression_width, - acir_opcodes: circuit.opcodes.len(), - circuit_size: backend.get_exact_circuit_size(program)?, - }) -} - -fn count_opcodes_and_gates_in_program_full( - backend: &Backend, - compiled_program: CompiledProgram, - package: &Package, - expression_width: ExpressionWidth, ) -> Result { let functions = compiled_program.program .functions @@ -359,7 +310,7 @@ fn count_opcodes_and_gates_in_program_full( }) }) .collect::>()?; - // Ok(functions) + Ok(ProgramInfo { name: package.name.to_string(), expression_width, functions }) } From 92ff22944b23ca2bea21c5890b01b0fa5ef1ac3d Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 19:49:06 +0000 Subject: [PATCH 03/19] refactor some of ssa.rs to have circuit and program artifacts to group context info --- compiler/noirc_driver/src/contract.rs | 3 + compiler/noirc_driver/src/lib.rs | 21 ++++- compiler/noirc_driver/src/program.rs | 2 + compiler/noirc_evaluator/src/ssa.rs | 88 +++++++++++++------ .../ssa/acir_gen/acir_ir/generated_acir.rs | 6 +- .../noirc_evaluator/src/ssa/acir_gen/mod.rs | 9 +- .../noirc_evaluator/src/ssa/ir/function.rs | 5 ++ .../fold_non_contract_method/Nargo.toml | 7 ++ .../fold_non_contract_method/src/main.nr | 18 ++++ tooling/nargo/src/artifacts/program.rs | 4 + tooling/nargo_cli/src/cli/info_cmd.rs | 28 +++--- 11 files changed, 144 insertions(+), 47 deletions(-) create mode 100644 test_programs/compile_success_contract/fold_non_contract_method/Nargo.toml create mode 100644 test_programs/compile_success_contract/fold_non_contract_method/src/main.nr diff --git a/compiler/noirc_driver/src/contract.rs b/compiler/noirc_driver/src/contract.rs index 9a0e25a321b..bd78cb23cdc 100644 --- a/compiler/noirc_driver/src/contract.rs +++ b/compiler/noirc_driver/src/contract.rs @@ -51,4 +51,7 @@ pub struct ContractFunction { pub bytecode: Program, pub debug: DebugInfo, + + /// Names of the functions in the program. These are used for more informative debugging and benchmarking. + pub names: Vec, } diff --git a/compiler/noirc_driver/src/lib.rs b/compiler/noirc_driver/src/lib.rs index 86d4cd1510d..8fa2d9680c8 100644 --- a/compiler/noirc_driver/src/lib.rs +++ b/compiler/noirc_driver/src/lib.rs @@ -11,6 +11,7 @@ use noirc_abi::{AbiParameter, AbiType, ContractEvent}; use noirc_errors::{CustomDiagnostic, FileDiagnostic}; use noirc_evaluator::create_program; use noirc_evaluator::errors::RuntimeError; +use noirc_evaluator::ssa::SsaProgramArtifact; use noirc_frontend::debug::build_debug_crate_file; use noirc_frontend::graph::{CrateId, CrateName}; use noirc_frontend::hir::def_map::{Contract, CrateDefMap}; @@ -423,6 +424,7 @@ fn compile_contract_inner( bytecode: function.program, debug: function.debug, is_unconstrained: modifiers.is_unconstrained, + names: function.names, }); } @@ -485,7 +487,14 @@ pub fn compile_no_check( } let visibility = program.return_visibility; - let (program, debug, warnings, input_witnesses, return_witnesses) = create_program( + let SsaProgramArtifact { + program, + debug, + warnings, + main_input_witnesses, + main_return_witnesses, + names, + } = create_program( program, options.show_ssa, options.show_brillig, @@ -493,8 +502,13 @@ pub fn compile_no_check( options.benchmark_codegen, )?; - let abi = - abi_gen::gen_abi(context, &main_function, input_witnesses, return_witnesses, visibility); + let abi = abi_gen::gen_abi( + context, + &main_function, + main_input_witnesses, + main_return_witnesses, + visibility, + ); let file_map = filter_relevant_files(&debug, &context.file_manager); Ok(CompiledProgram { @@ -510,5 +524,6 @@ pub fn compile_no_check( file_map, noir_version: NOIR_ARTIFACT_VERSION_STRING.to_string(), warnings, + names, }) } diff --git a/compiler/noirc_driver/src/program.rs b/compiler/noirc_driver/src/program.rs index 6f527297dcb..9ffd2d70dda 100644 --- a/compiler/noirc_driver/src/program.rs +++ b/compiler/noirc_driver/src/program.rs @@ -27,4 +27,6 @@ pub struct CompiledProgram { pub debug: DebugInfo, pub file_map: BTreeMap, pub warnings: Vec, + /// Names of the functions in the program. These are used for more informative debugging and benchmarking. + pub names: Vec, } diff --git a/compiler/noirc_evaluator/src/ssa.rs b/compiler/noirc_evaluator/src/ssa.rs index a45cf3af608..6d2da3b12c2 100644 --- a/compiler/noirc_evaluator/src/ssa.rs +++ b/compiler/noirc_evaluator/src/ssa.rs @@ -86,6 +86,29 @@ fn time(name: &str, print_timings: bool, f: impl FnOnce() -> T) -> T { result } +#[derive(Default)] +pub struct SsaProgramArtifact { + pub program: AcirProgram, + pub debug: Vec, + pub warnings: Vec, + pub main_input_witnesses: Vec, + pub main_return_witnesses: Vec, + pub names: Vec, +} + +impl SsaProgramArtifact { + fn add_circuit(&mut self, mut circuit_artifact: SsaCircuitArtifact, is_main: bool) { + self.program.functions.push(circuit_artifact.circuit); + self.debug.push(circuit_artifact.debug_info); + self.warnings.append(&mut circuit_artifact.warnings); + if is_main { + self.main_input_witnesses = circuit_artifact.input_witnesses; + self.main_return_witnesses = circuit_artifact.return_witnesses; + } + self.names.push(circuit_artifact.name); + } +} + /// Compiles the [`Program`] into [`ACIR``][acvm::acir::circuit::Program]. /// /// The output ACIR is is backend-agnostic and so must go through a transformation pass before usage in proof generation. @@ -97,8 +120,7 @@ pub fn create_program( enable_brillig_logging: bool, force_brillig_output: bool, print_codegen_timings: bool, -) -> Result<(AcirProgram, Vec, Vec, Vec, Vec), RuntimeError> -{ +) -> Result { let debug_variables = program.debug_variables.clone(); let debug_types = program.debug_types.clone(); let debug_functions = program.debug_functions.clone(); @@ -119,37 +141,38 @@ pub fn create_program( "The generated ACIRs should match the supplied function signatures" ); - let mut functions = vec![]; - let mut debug_infos = vec![]; - let mut warning_infos = vec![]; - let mut main_input_witnesses = Vec::new(); - let mut main_return_witnesses = Vec::new(); + // let mut functions = vec![]; + // let mut debug_infos = vec![]; + // let mut warning_infos = vec![]; + // let mut main_input_witnesses = Vec::new(); + // let mut main_return_witnesses = Vec::new(); + let mut program_artifact = SsaProgramArtifact::default(); // For setting up the ABI we need separately specify main's input and return witnesses let mut is_main = true; for (acir, func_sig) in generated_acirs.into_iter().zip(func_sigs) { - let (circuit, debug_info, warnings, input_witnesses, return_witnesses) = - convert_generated_acir_into_circuit( - acir, - func_sig, - recursive, - // TODO: get rid of these clones - debug_variables.clone(), - debug_functions.clone(), - debug_types.clone(), - ); - functions.push(circuit); - debug_infos.push(debug_info); - warning_infos.extend(warnings); - if is_main { - main_input_witnesses = input_witnesses; - main_return_witnesses = return_witnesses; - } + let circuit_artifact = convert_generated_acir_into_circuit( + acir, + func_sig, + recursive, + // TODO: get rid of these clones + debug_variables.clone(), + debug_functions.clone(), + debug_types.clone(), + ); + program_artifact.add_circuit(circuit_artifact, is_main); is_main = false; } - let program = AcirProgram { functions }; + Ok(program_artifact) +} - Ok((program, debug_infos, warning_infos, main_input_witnesses, main_return_witnesses)) +pub struct SsaCircuitArtifact { + name: String, + circuit: Circuit, + debug_info: DebugInfo, + warnings: Vec, + input_witnesses: Vec, + return_witnesses: Vec, } fn convert_generated_acir_into_circuit( @@ -159,7 +182,7 @@ fn convert_generated_acir_into_circuit( debug_variables: DebugVariables, debug_functions: DebugFunctions, debug_types: DebugTypes, -) -> (Circuit, DebugInfo, Vec, Vec, Vec) { +) -> SsaCircuitArtifact { let opcodes = generated_acir.take_opcodes(); let current_witness_index = generated_acir.current_witness_index().0; let GeneratedAcir { @@ -168,6 +191,7 @@ fn convert_generated_acir_into_circuit( input_witnesses, assert_messages, warnings, + name, .. } = generated_acir; @@ -200,7 +224,15 @@ fn convert_generated_acir_into_circuit( let (optimized_circuit, transformation_map) = acvm::compiler::optimize(circuit); debug_info.update_acir(transformation_map); - (optimized_circuit, debug_info, warnings, input_witnesses, return_witnesses) + SsaCircuitArtifact { + name, + circuit: optimized_circuit, + debug_info, + warnings, + input_witnesses, + return_witnesses, + } + // (optimized_circuit, debug_info, warnings, input_witnesses, return_witnesses) } // Takes each function argument and partitions the circuit's inputs witnesses according to its visibility. diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs index 1d05e998b13..b43110b2f5b 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/generated_acir.rs @@ -25,7 +25,7 @@ use iter_extended::vecmap; use num_bigint::BigUint; #[derive(Debug, Default)] -/// The output of the Acir-gen pass +/// The output of the Acir-gen pass, which should only be produced for entry point Acir functions pub(crate) struct GeneratedAcir { /// The next witness index that may be declared. /// If witness index is `None` then we have not yet created a witness @@ -58,6 +58,10 @@ pub(crate) struct GeneratedAcir { pub(crate) assert_messages: BTreeMap, pub(crate) warnings: Vec, + + /// Name for the corresponding entry point represented by this Acir-gen output. + /// Only used for debugging and benchmarking purposes + pub(crate) name: String, } impl GeneratedAcir { diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs index a45ef6e9398..e0961955fb1 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs @@ -186,7 +186,10 @@ impl Ssa { // TODO: can we parallelise this? for function in self.functions.values() { let context = Context::new(); - if let Some(generated_acir) = context.convert_ssa_function(&self, function, brillig)? { + if let Some(mut generated_acir) = + context.convert_ssa_function(&self, function, brillig)? + { + generated_acir.name = function.name().to_owned(); acirs.push(generated_acir); } } @@ -253,7 +256,7 @@ impl Context { } } } - // We only want to convert entry point functions. This being `main` and those marked with `#[fold]` + // We only want to convert entry point functions. This being `main` and those marked with `InlineType::Fold` Ok(Some(self.convert_acir_main(function, ssa, brillig)?)) } RuntimeType::Brillig => { @@ -814,7 +817,7 @@ impl Context { else if index < array_size && store_value.is_none() { self.define_result(dfg, instruction, array[index].clone()); return Ok(true); - } + } } } AcirValue::DynamicArray(_) => (), diff --git a/compiler/noirc_evaluator/src/ssa/ir/function.rs b/compiler/noirc_evaluator/src/ssa/ir/function.rs index 011bee36661..3c1de9a581f 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/function.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/function.rs @@ -99,6 +99,11 @@ impl Function { self.runtime = runtime; } + /// Check the runtime type of a function for whether it is an entry point + pub(crate) fn is_entry_point(&self) -> bool { + self.runtime.is_entry_point() + } + /// Retrieves the entry block of a function. /// /// A function's entry block contains the instructions diff --git a/test_programs/compile_success_contract/fold_non_contract_method/Nargo.toml b/test_programs/compile_success_contract/fold_non_contract_method/Nargo.toml new file mode 100644 index 00000000000..ff64bbb6f1b --- /dev/null +++ b/test_programs/compile_success_contract/fold_non_contract_method/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "fold_non_contract_method" +type = "contract" +authors = [""] +compiler_version = ">=0.26.0" + +[dependencies] \ No newline at end of file diff --git a/test_programs/compile_success_contract/fold_non_contract_method/src/main.nr b/test_programs/compile_success_contract/fold_non_contract_method/src/main.nr new file mode 100644 index 00000000000..2e00ffa1381 --- /dev/null +++ b/test_programs/compile_success_contract/fold_non_contract_method/src/main.nr @@ -0,0 +1,18 @@ +contract Foo { + use crate::times_10; + + fn double(x: Field) -> pub Field { + x * 2 + } + fn triple(x: Field) -> pub Field { + x * 3 + } + fn times_40(x: Field) -> pub Field { + times_10(x) * 4 + } +} + +#[fold] +fn times_10(x: Field) -> Field { + x * 10 +} diff --git a/tooling/nargo/src/artifacts/program.rs b/tooling/nargo/src/artifacts/program.rs index 046db1cd8fa..9e660cbd359 100644 --- a/tooling/nargo/src/artifacts/program.rs +++ b/tooling/nargo/src/artifacts/program.rs @@ -34,6 +34,8 @@ pub struct ProgramArtifact { /// Map of file Id to the source code so locations in debug info can be mapped to source code they point to. pub file_map: BTreeMap, + + pub names: Vec, } impl From for ProgramArtifact { @@ -45,6 +47,7 @@ impl From for ProgramArtifact { bytecode: compiled_program.program, debug_symbols: compiled_program.debug, file_map: compiled_program.file_map, + names: compiled_program.names, } } } @@ -59,6 +62,7 @@ impl From for CompiledProgram { debug: program.debug_symbols, file_map: program.file_map, warnings: vec![], + names: program.names, } } } diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index e55f49d32ee..11faf64d5cc 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use acvm::acir::circuit::{Circuit, ExpressionWidth, Program}; +use acvm::acir::circuit::{ExpressionWidth, Program}; use backend_interface::BackendError; use clap::Args; use iter_extended::vecmap; @@ -24,9 +24,9 @@ use crate::errors::CliError; use super::{compile_cmd::compile_workspace, NargoConfig}; -/// Provides detailed information on a circuit +/// Provides detailed information on each of a program's function (represented by a single circuit) /// -/// Current information provided: +/// Current information provided per circuit: /// 1. The number of ACIR opcodes /// 2. Counts the final number gates in the circuit used by a backend #[derive(Debug, Clone, Args)] @@ -116,11 +116,11 @@ pub(crate) fn run( workspace.into_iter().filter(|package| package.is_binary()).zip(compiled_programs); let program_info = binary_packages - .par_bridge() - .map(|(package, program)| { - count_opcodes_and_gates_in_program(backend, program, package, expression_width) - }) - .collect::>()?; + .par_bridge() + .map(|(package, program)| { + count_opcodes_and_gates_in_program(backend, program, package, expression_width) + }) + .collect::>()?; let contract_info = compiled_contracts .into_par_iter() @@ -269,6 +269,7 @@ struct ContractInfo { name: String, #[serde(skip)] expression_width: ExpressionWidth, + // TODO: Settle on how to display contract functions with non-inlined Acir calls functions: Vec, } @@ -299,14 +300,17 @@ fn count_opcodes_and_gates_in_program( package: &Package, expression_width: ExpressionWidth, ) -> Result { - let functions = compiled_program.program + let functions = compiled_program + .program .functions - .into_par_iter().enumerate() + .into_par_iter() + .enumerate() .map(|(i, function)| -> Result<_, BackendError> { Ok(FunctionInfo { - name: if i == 0 { "main".to_owned() } else { format!("func {i}") }, + name: compiled_program.names[i].clone(), acir_opcodes: function.opcodes.len(), - circuit_size: backend.get_exact_circuit_size(&Program { functions: vec![function] })?, + circuit_size: backend + .get_exact_circuit_size(&Program { functions: vec![function] })?, }) }) .collect::>()?; From c3e26978c9aeb55bfbcbba258650f3cfd5a93f0d Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:00:08 +0000 Subject: [PATCH 04/19] remove pub on hash_internal --- noir_stdlib/src/hash/poseidon2.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir_stdlib/src/hash/poseidon2.nr b/noir_stdlib/src/hash/poseidon2.nr index 23de635ade8..12bf373e671 100644 --- a/noir_stdlib/src/hash/poseidon2.nr +++ b/noir_stdlib/src/hash/poseidon2.nr @@ -95,7 +95,7 @@ impl Poseidon2 { result } - pub fn hash_internal(input: [Field; N], in_len: u64, is_variable_length: bool) -> Field { + fn hash_internal(input: [Field; N], in_len: u64, is_variable_length: bool) -> Field { let two_pow_64 = 18446744073709551616; let iv : Field = (in_len as Field) * two_pow_64; let mut sponge = Poseidon2::new(iv); From d8f4aa01790f051d74b648beed43757018328034 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:00:30 +0000 Subject: [PATCH 05/19] remove unused func --- compiler/noirc_evaluator/src/ssa/ir/function.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/ir/function.rs b/compiler/noirc_evaluator/src/ssa/ir/function.rs index 3c1de9a581f..011bee36661 100644 --- a/compiler/noirc_evaluator/src/ssa/ir/function.rs +++ b/compiler/noirc_evaluator/src/ssa/ir/function.rs @@ -99,11 +99,6 @@ impl Function { self.runtime = runtime; } - /// Check the runtime type of a function for whether it is an entry point - pub(crate) fn is_entry_point(&self) -> bool { - self.runtime.is_entry_point() - } - /// Retrieves the entry block of a function. /// /// A function's entry block contains the instructions From 9372200407938b7f9ed228eb3c971fb01d884433 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:01:25 +0000 Subject: [PATCH 06/19] cleanup --- compiler/noirc_evaluator/src/ssa.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa.rs b/compiler/noirc_evaluator/src/ssa.rs index 6d2da3b12c2..182a6f0402c 100644 --- a/compiler/noirc_evaluator/src/ssa.rs +++ b/compiler/noirc_evaluator/src/ssa.rs @@ -141,11 +141,6 @@ pub fn create_program( "The generated ACIRs should match the supplied function signatures" ); - // let mut functions = vec![]; - // let mut debug_infos = vec![]; - // let mut warning_infos = vec![]; - // let mut main_input_witnesses = Vec::new(); - // let mut main_return_witnesses = Vec::new(); let mut program_artifact = SsaProgramArtifact::default(); // For setting up the ABI we need separately specify main's input and return witnesses let mut is_main = true; @@ -232,7 +227,6 @@ fn convert_generated_acir_into_circuit( input_witnesses, return_witnesses, } - // (optimized_circuit, debug_info, warnings, input_witnesses, return_witnesses) } // Takes each function argument and partitions the circuit's inputs witnesses according to its visibility. From 382d95a80950a64391f9307ddb8c8379bc6751df Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:03:18 +0000 Subject: [PATCH 07/19] remove poseidon blowup test --- .../poseidon_blowup_test/Nargo.toml | 7 --- .../poseidon_blowup_test/Prover.toml | 4 -- .../poseidon_blowup_test/src/main.nr | 55 ------------------- 3 files changed, 66 deletions(-) delete mode 100644 test_programs/execution_success/poseidon_blowup_test/Nargo.toml delete mode 100644 test_programs/execution_success/poseidon_blowup_test/Prover.toml delete mode 100644 test_programs/execution_success/poseidon_blowup_test/src/main.nr diff --git a/test_programs/execution_success/poseidon_blowup_test/Nargo.toml b/test_programs/execution_success/poseidon_blowup_test/Nargo.toml deleted file mode 100644 index 9326ed33c2c..00000000000 --- a/test_programs/execution_success/poseidon_blowup_test/Nargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "poseidon_blowup_test" -type = "bin" -authors = [""] -compiler_version = ">=0.26.0" - -[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/poseidon_blowup_test/Prover.toml b/test_programs/execution_success/poseidon_blowup_test/Prover.toml deleted file mode 100644 index c507142cf6d..00000000000 --- a/test_programs/execution_success/poseidon_blowup_test/Prover.toml +++ /dev/null @@ -1,4 +0,0 @@ -enable = true -to_hash = ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'] -# enable = [true, true, true, false] -# to_hash = [['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1'], ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1']] \ No newline at end of file diff --git a/test_programs/execution_success/poseidon_blowup_test/src/main.nr b/test_programs/execution_success/poseidon_blowup_test/src/main.nr deleted file mode 100644 index c9c6d8ea02d..00000000000 --- a/test_programs/execution_success/poseidon_blowup_test/src/main.nr +++ /dev/null @@ -1,55 +0,0 @@ -use dep::std::hash::{pedersen_hash_with_separator, poseidon2::Poseidon2}; - -global NUM_HASHES = 4; -global HASH_LENGTH = 20; - -pub fn pedersen_hash(inputs: [Field; N], hash_index: u32) -> Field { - dep::std::hash::pedersen_hash_with_separator(inputs, hash_index) -} - -pub fn poseidon_hash(inputs: [Field; N]) -> Field { - Poseidon2::hash(inputs, inputs.len()) -} - -pub fn poseideon_hash_internal(inputs: [Field; N]) -> Field { - Poseidon2::hash_internal(inputs, inputs.len(), false) -} - -fn main( - to_hash: [Field; HASH_LENGTH], - enable: bool -) -> pub Field { - let mut result = 0; - if enable { - // result = poseidon_hash(to_hash); - // result = pedersen_hash(to_hash, 0); - result = poseidon_in_fold(to_hash); - } - result -} - -// fn main( -// to_hash: [[Field; HASH_LENGTH]; NUM_HASHES], -// enable: [bool; NUM_HASHES], -// // to_hash: [Field; HASH_LENGTH], -// // enable: bool -// ) -> pub [Field; NUM_HASHES] { -// let mut result = [0; NUM_HASHES]; -// for i in 0..NUM_HASHES { -// let enable = enable[i]; -// let to_hash = to_hash[i]; -// if enable { -// // result[i] = pedersen_hash(to_hash, 0); -// // result[i] = poseidon_hash(to_hash); -// // result[i] = poseideon_hash_internal(to_hash); -// // Failing with Assertion `(arg.mul_terms.size() <= 1) -// // result[i] = poseidon_in_fold(to_hash); -// } -// } -// result -// } - -#[fold] -fn poseidon_in_fold(inputs: [Field; HASH_LENGTH]) -> Field { - poseidon_hash(inputs) -} \ No newline at end of file From 748b2014e43f082b91d7560f921f716799c0b674 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:03:55 +0000 Subject: [PATCH 08/19] update issue link in comments --- tooling/nargo_cli/src/cli/info_cmd.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index 11faf64d5cc..c95090126c0 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -269,7 +269,7 @@ struct ContractInfo { name: String, #[serde(skip)] expression_width: ExpressionWidth, - // TODO: Settle on how to display contract functions with non-inlined Acir calls + // TODO(https://github.com/noir-lang/noir/issues/4720): Settle on how to display contract functions with non-inlined Acir calls functions: Vec, } @@ -329,7 +329,7 @@ fn count_opcodes_and_gates_in_contract( .map(|function| -> Result<_, BackendError> { Ok(FunctionInfo { name: function.name, - // TODO(https://github.com/noir-lang/noir/issues/4428) + // TODO(https://github.com/noir-lang/noir/issues/4720) acir_opcodes: function.bytecode.functions[0].opcodes.len(), circuit_size: backend.get_exact_circuit_size(&function.bytecode)?, }) From 35a1f5d8845f0ccec102b3477e850dee930f4cea Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:13:41 +0000 Subject: [PATCH 09/19] fix compile_success_empty tests --- tooling/nargo_cli/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/nargo_cli/build.rs b/tooling/nargo_cli/build.rs index 16df29e6985..bf97dfb3e96 100644 --- a/tooling/nargo_cli/build.rs +++ b/tooling/nargo_cli/build.rs @@ -244,7 +244,7 @@ fn compile_success_empty_{test_name}() {{ let json: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap_or_else(|e| {{ panic!("JSON was not well-formatted {{:?}}\n\n{{:?}}", e, std::str::from_utf8(&output.stdout)) }}); - let num_opcodes = &json["programs"][0]["acir_opcodes"]; + let num_opcodes = &json["programs"][0]["functions"][0]["acir_opcodes"]; assert_eq!(num_opcodes.as_u64().expect("number of opcodes should fit in a u64"), 0); }} "#, From 4baa6588f0258635a74321a3ea65ea012eaef0a1 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:14:52 +0000 Subject: [PATCH 10/19] Cargo fmt --- tooling/nargo_cli/src/cli/info_cmd.rs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index c95090126c0..72784013e17 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -222,26 +222,6 @@ struct InfoReport { contracts: Vec, } -#[derive(Debug, Serialize)] -struct CircuitInfo { - name: String, - #[serde(skip)] - expression_width: ExpressionWidth, - acir_opcodes: usize, - circuit_size: u32, -} - -impl From for Row { - fn from(program_info: CircuitInfo) -> Self { - row![ - Fm->format!("{}", program_info.name), - format!("{:?}", program_info.expression_width), - Fc->format!("{}", program_info.acir_opcodes), - Fc->format!("{}", program_info.circuit_size), - ] - } -} - #[derive(Debug, Serialize)] struct ProgramInfo { name: String, From 249cb9987d0ce404c3eb335d906d57636a3a06f8 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:36:28 +0000 Subject: [PATCH 11/19] use vezenovm fork to pass ci for gates diff --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index f3f798fc5ea..d83481f7810 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: TomAFrench/noir-gates-diff@e7cf131b7e7f044c01615f93f0b855f65ddc02d4 + uses: vezenovm/noir-gates-diff@8d7a537991316af1eb24071fdfe15abeeb15615c with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From 9012100bbf6e528a2122adb253a32af97c2662c4 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 20:52:18 +0000 Subject: [PATCH 12/19] new commit to gates report diff --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index d83481f7810..7a4b66afc4e 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@8d7a537991316af1eb24071fdfe15abeeb15615c + uses: vezenovm/noir-gates-diff@e7a63cdc4236a11ef0bd7b9d25425a07c9ae5d55 with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From ac2cbefbf72f91ffa00e41721e3e7fc8cf8d0ab6 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 21:04:57 +0000 Subject: [PATCH 13/19] new gate report commit --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 7a4b66afc4e..1ec957e328e 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@e7a63cdc4236a11ef0bd7b9d25425a07c9ae5d55 + uses: vezenovm/noir-gates-diff@5000b4f312e09232efa0f439a068bac264f899d4 with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From 726fa90a5315be6a50a84d340bebc292f747ae61 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Thu, 4 Apr 2024 21:15:47 +0000 Subject: [PATCH 14/19] one more update to gate diff report --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 1ec957e328e..b249acb09a9 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@5000b4f312e09232efa0f439a068bac264f899d4 + uses: vezenovm/noir-gates-diff@070044769fa33991613a262e44031b8f0c215fcb with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From a59e7c2125de1951f4b7035b06de55dab8a73f72 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 5 Apr 2024 01:11:31 +0000 Subject: [PATCH 15/19] update noir-gates-diff PR to check with old workspace report type --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index b249acb09a9..5cc1a6e7479 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@070044769fa33991613a262e44031b8f0c215fcb + uses: vezenovm/noir-gates-diff@9f5b631d60e52f7652a7d999231a3e855c2fcfef with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From 21b17104e8e0d9af26d07ea58098e9e9490457c3 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 5 Apr 2024 13:50:59 +0000 Subject: [PATCH 16/19] update gates_diff commit --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 5cc1a6e7479..28f9b63ef1d 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@9f5b631d60e52f7652a7d999231a3e855c2fcfef + uses: vezenovm/noir-gates-diff@4f2b0ad1ac5c9c628c9a4e80d3f020385f7fbd44 with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From bc8298d85e4d46b56bc3a5be0f86794586edbb9a Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 5 Apr 2024 14:06:26 +0000 Subject: [PATCH 17/19] update commit --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 28f9b63ef1d..0b0cd2f7871 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@4f2b0ad1ac5c9c628c9a4e80d3f020385f7fbd44 + uses: vezenovm/noir-gates-diff@6e957388beaff84331c16d9d76d21f85cdf9809f with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From f24c370c105d3334e71160343e25b809b157aedd Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 5 Apr 2024 15:22:04 +0000 Subject: [PATCH 18/19] update gate_diff commit --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 0b0cd2f7871..6e724b76741 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@6e957388beaff84331c16d9d76d21f85cdf9809f + uses: vezenovm/noir-gates-diff@2b14d43ddd2b5ffa9ec8dc2045485f417388d2e3 with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) From 5172dfdd117bbea3b79e760d571a3d918b1ed888 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Fri, 5 Apr 2024 20:09:57 +0100 Subject: [PATCH 19/19] fix: Update gates report commit (#4730) --- .github/workflows/gates_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index 6e724b76741..ebf17f7374c 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -74,7 +74,7 @@ jobs: - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@2b14d43ddd2b5ffa9ec8dc2045485f417388d2e3 + uses: TomAFrench/noir-gates-diff@df05f34e2ab275ddc4f2cac065df1c88f8a05e5d with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)