From 50bc32587a837c930ed14175c98ace1530c54bef Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 23 Apr 2024 21:03:38 +0100 Subject: [PATCH] fix: Reset the noir-gates-diff report on master (#4878) # Description ## Problem\* Resolves Opened this PR to test https://github.com/TomAFrench/noir-gates-diff/pull/3 after seeing this https://github.com/noir-lang/noir/pull/4848#issuecomment-2070241529 ## Summary\* The noir-gates-diff report became malformed on master as "main" was used as the program name for each program in `execution_success`. This PR references the last commit in this PR https://github.com/TomAFrench/noir-gates-diff/pull/3. That PR changes to using the correct name for each program in `execution_success` but also resets the report on `master` by comparing against a harcoded reference. That is why it is expected to see a massive gate diff report on this PR. The follow-up will revert the changes to accurately check against the reference. ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ ] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --- .github/workflows/gates_report.yml | 4 ++-- tooling/nargo_cli/src/cli/info_cmd.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gates_report.yml b/.github/workflows/gates_report.yml index e694e5fad04..71ebd342613 100644 --- a/.github/workflows/gates_report.yml +++ b/.github/workflows/gates_report.yml @@ -71,10 +71,10 @@ jobs: run: | ./gates_report.sh mv gates_report.json ../gates_report.json - + - name: Compare gates reports id: gates_diff - uses: vezenovm/noir-gates-diff@f80ea702d579873ff80f0261c62e2bae5203748e + uses: vezenovm/noir-gates-diff@45e9c9a21deb236fa7f38138b42b33ddaf7c0985 with: report: gates_report.json summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%) diff --git a/tooling/nargo_cli/src/cli/info_cmd.rs b/tooling/nargo_cli/src/cli/info_cmd.rs index 67825362f92..3695fb57d31 100644 --- a/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/tooling/nargo_cli/src/cli/info_cmd.rs @@ -228,7 +228,7 @@ struct InfoReport { #[derive(Debug, Serialize)] struct ProgramInfo { - name: String, + package_name: String, #[serde(skip)] expression_width: ExpressionWidth, functions: Vec, @@ -238,7 +238,7 @@ impl From for Vec { fn from(program_info: ProgramInfo) -> Self { vecmap(program_info.functions, |function| { row![ - Fm->format!("{}", program_info.name), + Fm->format!("{}", program_info.package_name), Fc->format!("{}", function.name), format!("{:?}", program_info.expression_width), Fc->format!("{}", function.acir_opcodes), @@ -302,7 +302,7 @@ fn count_opcodes_and_gates_in_program( }) .collect::>()?; - Ok(ProgramInfo { name: package.name.to_string(), expression_width, functions }) + Ok(ProgramInfo { package_name: package.name.to_string(), expression_width, functions }) } fn count_opcodes_and_gates_in_contract(