From 82bd67487ce350c16f704297e1411677ef4d0db2 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 20:40:42 +0000 Subject: [PATCH 01/25] update brillig report to account for inliner aggressiveness, for now just bytecode size report --- .github/scripts/merge-bench-reports.sh | 2 -- .github/workflows/reports.yml | 21 +++++++++++++++++++-- test_programs/gates_report_brillig.sh | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/scripts/merge-bench-reports.sh b/.github/scripts/merge-bench-reports.sh index 23a62874148..b36d9c77f28 100755 --- a/.github/scripts/merge-bench-reports.sh +++ b/.github/scripts/merge-bench-reports.sh @@ -17,8 +17,6 @@ for report in ./reports/*; do combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")") done -combined_reports=$(jq '[."'$NAME_PLURAL'"[]] + '"$combined_reports" <<< "$(cat ./$REPORT_NAME.json)") - # Wrap the merged memory reports into a new object as to keep the $NAME_PLURAL key final_report="{\"$NAME_PLURAL\": $combined_reports}" diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 56e12b173a4..0af87f70842 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -116,8 +116,21 @@ jobs: - name: Generate Brillig bytecode size report working-directory: ./test_programs run: | - ./gates_report_brillig.sh - mv gates_report_brillig.json ../gates_report_brillig.json + ./gates_report_brillig.sh 9223372036854775807 + mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json + ./gates_report_brillig.sh 0 + jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json + cat gates_report_brillig.json + mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_zero.json + ./gates_report_brillig.sh -9223372036854775808 + jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json + mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_min.json + + - name: Merge compilation reports using jq + run: | + mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh + ./merge-bench-reports.sh program + mv ./program.json ./gates_report_brillig.json - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff @@ -440,6 +453,7 @@ jobs: - name: Merge compilation reports using jq run: | + mv ./compilation_report.json ./reports/compilation_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh ./merge-bench-reports.sh compilation_report @@ -577,6 +591,7 @@ jobs: - name: Merge memory reports using jq run: | + mv ./memory_report.json ./reports/memory_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh ./merge-bench-reports.sh memory_report @@ -621,6 +636,7 @@ jobs: - name: Merge memory reports using jq run: | + mv ./memory_report.json ./reports/memory_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh ./merge-bench-reports.sh memory_report # Rename the memory report as to not clash with the compilation memory report file name @@ -667,6 +683,7 @@ jobs: - name: Merge execution reports using jq run: | + mv ./execution_report.json ./reports/execution_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh ./merge-bench-reports.sh execution_report diff --git a/test_programs/gates_report_brillig.sh b/test_programs/gates_report_brillig.sh index 7343857a3c5..4a10dd79461 100755 --- a/test_programs/gates_report_brillig.sh +++ b/test_programs/gates_report_brillig.sh @@ -28,6 +28,6 @@ done echo "]" >> Nargo.toml -nargo info --force-brillig --json | jq -r ".programs[].functions = []" > gates_report_brillig.json +nargo info --force-brillig --json --inliner-aggressiveness $1 | jq -r ".programs[].functions = []" > gates_report_brillig.json rm Nargo.toml From ba63ab18b8559e4971d38b6a92afb8dc24f0defe Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 20:46:47 +0000 Subject: [PATCH 02/25] makereports dir --- .github/workflows/reports.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 0af87f70842..45abaa34d06 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -117,6 +117,7 @@ jobs: working-directory: ./test_programs run: | ./gates_report_brillig.sh 9223372036854775807 + mkdir ./reports mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json From 824f0de0df2b2acfcf40f7a1c844dbaae213b6d3 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 20:52:42 +0000 Subject: [PATCH 03/25] mkdir with ./ --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 45abaa34d06..5fc29a79f87 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -117,7 +117,7 @@ jobs: working-directory: ./test_programs run: | ./gates_report_brillig.sh 9223372036854775807 - mkdir ./reports + mkdir reports mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json From 4a5ea32fcc5c741587bf071c05337d4e21377599 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 20:53:14 +0000 Subject: [PATCH 04/25] fix path of reports dir --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 5fc29a79f87..0ffeaff768a 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -117,7 +117,7 @@ jobs: working-directory: ./test_programs run: | ./gates_report_brillig.sh 9223372036854775807 - mkdir reports + mkdir ../reports mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json From d624ba497009d792e61178c44945c16f8bab8957 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 20:59:59 +0000 Subject: [PATCH 05/25] fix name in merge report --- .github/scripts/merge-bench-reports.sh | 7 ++++++- .github/workflows/reports.yml | 2 +- test_programs/gates_report_brillig.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/scripts/merge-bench-reports.sh b/.github/scripts/merge-bench-reports.sh index b36d9c77f28..05e84701f61 100755 --- a/.github/scripts/merge-bench-reports.sh +++ b/.github/scripts/merge-bench-reports.sh @@ -14,7 +14,12 @@ for report in ./reports/*; do FILE_PATH=$(echo $(ls $report)) # Extract the $NAME_PLURAL array from each report and merge it - combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")") + if [ "$2" == "1" ]; then + echo $report + combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report")") + else + combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")") + fi done # Wrap the merged memory reports into a new object as to keep the $NAME_PLURAL key diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 0ffeaff768a..eaaba3c824e 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -130,7 +130,7 @@ jobs: - name: Merge compilation reports using jq run: | mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh program + ./merge-bench-reports.sh program 1 mv ./program.json ./gates_report_brillig.json - name: Compare Brillig bytecode size reports diff --git a/test_programs/gates_report_brillig.sh b/test_programs/gates_report_brillig.sh index 4a10dd79461..3f2a4542735 100755 --- a/test_programs/gates_report_brillig.sh +++ b/test_programs/gates_report_brillig.sh @@ -28,6 +28,6 @@ done echo "]" >> Nargo.toml -nargo info --force-brillig --json --inliner-aggressiveness $1 | jq -r ".programs[].functions = []" > gates_report_brillig.json +nargo info --silence-warnings --force-brillig --json --inliner-aggressiveness $1 | jq -r ".programs[].functions = []" > gates_report_brillig.json rm Nargo.toml From 1fa8d124d5daf2fb8423110705b308eec3cd88c5 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 21:17:20 +0000 Subject: [PATCH 06/25] fixes --- .github/workflows/reports.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index eaaba3c824e..6ee66ff71e1 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -120,11 +120,11 @@ jobs: mkdir ../reports mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 - jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json + jq -i '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 - jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json + jq -i '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_min.json - name: Merge compilation reports using jq @@ -456,7 +456,7 @@ jobs: run: | mv ./compilation_report.json ./reports/compilation_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh compilation_report + ./merge-bench-reports.sh compilation_report 0 - name: Parse compilation report id: compilation_report @@ -594,7 +594,7 @@ jobs: run: | mv ./memory_report.json ./reports/memory_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh memory_report + ./merge-bench-reports.sh memory_report 0 - name: Parse compilation memory report id: compilation_mem_report @@ -639,7 +639,7 @@ jobs: run: | mv ./memory_report.json ./reports/memory_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh memory_report + ./merge-bench-reports.sh memory_report 0 # Rename the memory report as to not clash with the compilation memory report file name cp memory_report.json execution_memory_report.json @@ -686,7 +686,7 @@ jobs: run: | mv ./execution_report.json ./reports/execution_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh execution_report + ./merge-bench-reports.sh execution_report 0 - name: Parse execution report id: execution_report From 5169c7b8eab00beb8cd7f203a2e04dc60b1aa0b0 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 21:27:13 +0000 Subject: [PATCH 07/25] switch how we output from jq --- .github/workflows/reports.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 6ee66ff71e1..43db31a8d71 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -120,11 +120,12 @@ jobs: mkdir ../reports mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 - jq -i '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json + jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > gates_report_brillig.json cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 - jq -i '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json + jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > gates_report_brillig.json + cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_min.json - name: Merge compilation reports using jq From 49dd4978b878093c6d0c7710b69ac9acd9f0bc9d Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 21:35:57 +0000 Subject: [PATCH 08/25] try one line jq --- .github/workflows/reports.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 43db31a8d71..b005ce696b5 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -131,8 +131,8 @@ jobs: - name: Merge compilation reports using jq run: | mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh program 1 - mv ./program.json ./gates_report_brillig.json + jq -s '[.[][]]' ./reports/* > gates_report_brillig.json + cat gates_report_brillig - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff From 051c53842772539cdaa460b13d686fcce33ee69c Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 21:41:16 +0000 Subject: [PATCH 09/25] fix cat --- .github/workflows/reports.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index b005ce696b5..88822a45739 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -130,9 +130,8 @@ jobs: - name: Merge compilation reports using jq run: | - mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh jq -s '[.[][]]' ./reports/* > gates_report_brillig.json - cat gates_report_brillig + cat gates_report_brillig.json - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff From aa3e63cc0d2def1ed7c1153c0eae0460e5fe19c2 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Mon, 13 Jan 2025 23:29:42 +0000 Subject: [PATCH 10/25] go back to old merge bench reports --- .github/scripts/merge-bench-reports.sh | 9 +++------ .github/workflows/reports.yml | 14 ++++---------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/scripts/merge-bench-reports.sh b/.github/scripts/merge-bench-reports.sh index 05e84701f61..23a62874148 100755 --- a/.github/scripts/merge-bench-reports.sh +++ b/.github/scripts/merge-bench-reports.sh @@ -14,14 +14,11 @@ for report in ./reports/*; do FILE_PATH=$(echo $(ls $report)) # Extract the $NAME_PLURAL array from each report and merge it - if [ "$2" == "1" ]; then - echo $report - combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report")") - else - combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")") - fi + combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")") done +combined_reports=$(jq '[."'$NAME_PLURAL'"[]] + '"$combined_reports" <<< "$(cat ./$REPORT_NAME.json)") + # Wrap the merged memory reports into a new object as to keep the $NAME_PLURAL key final_report="{\"$NAME_PLURAL\": $combined_reports}" diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 88822a45739..6413380d8ee 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -121,11 +121,9 @@ jobs: mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > gates_report_brillig.json - cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > gates_report_brillig.json - cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_min.json - name: Merge compilation reports using jq @@ -454,9 +452,8 @@ jobs: - name: Merge compilation reports using jq run: | - mv ./compilation_report.json ./reports/compilation_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh compilation_report 0 + ./merge-bench-reports.sh compilation_report - name: Parse compilation report id: compilation_report @@ -592,9 +589,8 @@ jobs: - name: Merge memory reports using jq run: | - mv ./memory_report.json ./reports/memory_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh memory_report 0 + ./merge-bench-reports.sh memory_report - name: Parse compilation memory report id: compilation_mem_report @@ -637,9 +633,8 @@ jobs: - name: Merge memory reports using jq run: | - mv ./memory_report.json ./reports/memory_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh memory_report 0 + ./merge-bench-reports.sh memory_report # Rename the memory report as to not clash with the compilation memory report file name cp memory_report.json execution_memory_report.json @@ -684,9 +679,8 @@ jobs: - name: Merge execution reports using jq run: | - mv ./execution_report.json ./reports/execution_report.json mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh - ./merge-bench-reports.sh execution_report 0 + ./merge-bench-reports.sh execution_report - name: Parse execution report id: execution_report From 87e74f56854a358489e27a74b8d40ed9c36e4ef2 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 01:17:05 +0000 Subject: [PATCH 11/25] keep programs fields in report --- .github/workflows/reports.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 489cc0eff09..0d5c71d3c32 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -116,19 +116,25 @@ jobs: - name: Generate Brillig bytecode size report working-directory: ./test_programs run: | - ./gates_report_brillig.sh 9223372036854775807 mkdir ../reports + + ./gates_report_brillig.sh 9223372036854775807 + cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json + ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > gates_report_brillig.json + cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_zero.json + ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > gates_report_brillig.json + cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_min.json - name: Merge compilation reports using jq run: | - jq -s '[.[][]]' ./reports/* > gates_report_brillig.json + jq -s '{ programs: [.[][]] }' ./reports/* > gates_report_brillig.json cat gates_report_brillig.json - name: Compare Brillig bytecode size reports From ead40ff26c25f33fcc5bb8de9d6ec2e5d22363b6 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 01:59:43 +0000 Subject: [PATCH 12/25] fix jq merge --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 0d5c71d3c32..94f30b6ce5c 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -134,7 +134,7 @@ jobs: - name: Merge compilation reports using jq run: | - jq -s '{ programs: [.[][]] }' ./reports/* > gates_report_brillig.json + jq -s '{ programs: map(.programs) | add }' ./reports/* > gates_report_brillig.json cat gates_report_brillig.json - name: Compare Brillig bytecode size reports From fd8d18edfded856312e7b0fd9110e3dfc6d86197 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 02:01:13 +0000 Subject: [PATCH 13/25] remove cat --- .github/workflows/reports.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 94f30b6ce5c..109be1737e2 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -119,7 +119,6 @@ jobs: mkdir ../reports ./gates_report_brillig.sh 9223372036854775807 - cat gates_report_brillig.json mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 From 1f4de7db59103306c89669a864d3abd3f678fe88 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 02:33:29 +0000 Subject: [PATCH 14/25] merge in same report --- .github/workflows/reports.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 109be1737e2..918be74407a 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -122,20 +122,22 @@ jobs: mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 - jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > gates_report_brillig.json - cat gates_report_brillig.json - mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_zero.json + jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ../reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 - jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > gates_report_brillig.json - cat gates_report_brillig.json - mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_min.json + jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ../reports/gates_report_brillig_inliner_min.json + cat ../reports/gates_report_brillig_inliner_min.json - - name: Merge compilation reports using jq - run: | - jq -s '{ programs: map(.programs) | add }' ./reports/* > gates_report_brillig.json + ls ../reports + + jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json cat gates_report_brillig.json + # - name: Merge compilation reports using jq + # run: | + # jq -s '{ programs: map(.programs) | add }' ./reports/* > gates_report_brillig.json + # cat gates_report_brillig.json + - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff uses: noir-lang/noir-gates-diff@7e4ddaa91c69380f15ccba514eac17bc7432a8cc From 2d42c4941f3123abc38f79e51fd9e3dfb21de90a Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 02:41:19 +0000 Subject: [PATCH 15/25] fix reports dir path --- .github/workflows/reports.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 918be74407a..51e2ffaebfe 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -116,28 +116,22 @@ jobs: - name: Generate Brillig bytecode size report working-directory: ./test_programs run: | - mkdir ../reports + mkdir ./reports ./gates_report_brillig.sh 9223372036854775807 - mv gates_report_brillig.json ../reports/gates_report_brillig_inliner_max.json + mv gates_report_brillig.json ./reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 - jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ../reports/gates_report_brillig_inliner_zero.json + jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 - jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ../reports/gates_report_brillig_inliner_min.json - cat ../reports/gates_report_brillig_inliner_min.json + jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json - ls ../reports + ls ./reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json cat gates_report_brillig.json - # - name: Merge compilation reports using jq - # run: | - # jq -s '{ programs: map(.programs) | add }' ./reports/* > gates_report_brillig.json - # cat gates_report_brillig.json - - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff uses: noir-lang/noir-gates-diff@7e4ddaa91c69380f15ccba514eac17bc7432a8cc From 9468770833c66ff5f7a36ef415617e20a74af955 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 02:51:01 +0000 Subject: [PATCH 16/25] test print --- .github/workflows/reports.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 51e2ffaebfe..ff90e092c85 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -126,11 +126,11 @@ jobs: ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json - + # cat ./reports/gates_report_brillig_inliner_min ls ./reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json - cat gates_report_brillig.json + cat ../gates_report_brillig.json - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff From 02c65713f14b048f901e2eaed7cc8fa979d8f8e3 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 02:51:10 +0000 Subject: [PATCH 17/25] cat min inliner report --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index ff90e092c85..b702ef8a9ad 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -126,7 +126,7 @@ jobs: ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json - # cat ./reports/gates_report_brillig_inliner_min + cat ./reports/gates_report_brillig_inliner_min ls ./reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json From 01f8e42efb0d8f6a3e78fd3867494ed40f685240 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 02:55:44 +0000 Subject: [PATCH 18/25] missing json suffix --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index b702ef8a9ad..1e892562d32 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -126,7 +126,7 @@ jobs: ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json - cat ./reports/gates_report_brillig_inliner_min + cat ./reports/gates_report_brillig_inliner_min.json ls ./reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json From ac7157694883dc1fe83c2222ac3b984ee15b4b25 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:02:21 +0000 Subject: [PATCH 19/25] check len of programs array --- .github/workflows/reports.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 1e892562d32..53eb741f1c0 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -120,17 +120,19 @@ jobs: ./gates_report_brillig.sh 9223372036854775807 mv gates_report_brillig.json ./reports/gates_report_brillig_inliner_max.json + jq '.programs | length' ./reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_zero.json + jq '.programs | length' ./reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json - cat ./reports/gates_report_brillig_inliner_min.json + jq '.programs | length' ./reports/gates_report_brillig_inliner_min.json ls ./reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json - cat ../gates_report_brillig.json + jq '.programs | length' ../gates_report_brillig.json - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff From 435e19497a8579b609889c49c568b9a1b031d265 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:09:33 +0000 Subject: [PATCH 20/25] update brillig execution reports --- .github/workflows/reports.yml | 18 ++++++++++++++++-- .../gates_report_brillig_execution.sh | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 53eb741f1c0..c173e8fbaf5 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -180,8 +180,22 @@ jobs: - name: Generate Brillig execution report working-directory: ./test_programs run: | - ./gates_report_brillig_execution.sh - mv gates_report_brillig_execution.json ../gates_report_brillig_execution.json + mkdir ./reports + ./gates_report_brillig_execution.sh 9223372036854775807 + mv gates_report_brillig_execution.json ../gates_report_brillig_execution_inliner_max.json + jq '.programs | length' ./reports/gates_report_brillig_inliner_max.json + + ./gates_report_brillig_execution.sh 0 + jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_zero.json + jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_zero.json + + ./gates_report_brillig_execution.sh -9223372036854775808 + jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_min.json + jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_min.json + ls ./reports + + jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig_execution.json + jq '.programs | length' ../gates_report_brillig.json - name: Compare Brillig execution reports id: brillig_execution_diff diff --git a/test_programs/gates_report_brillig_execution.sh b/test_programs/gates_report_brillig_execution.sh index 219fbb5c11a..c6a904f8b93 100755 --- a/test_programs/gates_report_brillig_execution.sh +++ b/test_programs/gates_report_brillig_execution.sh @@ -42,6 +42,6 @@ done echo "]" >> Nargo.toml -nargo info --profile-execution --json | jq -r ".programs[].functions = []" > gates_report_brillig_execution.json +nargo info --silence-warnings --profile-execution --json --inliner-aggressiveness $1 | jq -r ".programs[].functions = []" > gates_report_brillig_execution.json rm Nargo.toml From ac244a4e58e9dc8ea140ae7707cfc57fd62269fd Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:14:20 +0000 Subject: [PATCH 21/25] specify file path correctly --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index c173e8fbaf5..b7fe8cedf19 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -183,7 +183,7 @@ jobs: mkdir ./reports ./gates_report_brillig_execution.sh 9223372036854775807 mv gates_report_brillig_execution.json ../gates_report_brillig_execution_inliner_max.json - jq '.programs | length' ./reports/gates_report_brillig_inliner_max.json + jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_max.json ./gates_report_brillig_execution.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_zero.json From 8c5e32d5bef7219a0df259bdcb6fabc5b2c25f75 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:18:26 +0000 Subject: [PATCH 22/25] move file to reports dir --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index b7fe8cedf19..d50916b5e18 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -182,7 +182,7 @@ jobs: run: | mkdir ./reports ./gates_report_brillig_execution.sh 9223372036854775807 - mv gates_report_brillig_execution.json ../gates_report_brillig_execution_inliner_max.json + mv gates_report_brillig_execution.json ./reports/gates_report_brillig_execution_inliner_max.json jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_max.json ./gates_report_brillig_execution.sh 0 From 3b7ac26ab8ff8aed27dcdb3b2e43bd36e035b9ca Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:22:59 +0000 Subject: [PATCH 23/25] one more messed up file name --- .github/workflows/reports.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index d50916b5e18..7d96a388bda 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -195,7 +195,7 @@ jobs: ls ./reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig_execution.json - jq '.programs | length' ../gates_report_brillig.json + jq '.programs | length' ../gates_report_brillig_execution.json - name: Compare Brillig execution reports id: brillig_execution_diff From 15509e8aade2c3d91ab8c8b62c8663fb73f4c912 Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:49:06 +0000 Subject: [PATCH 24/25] remove dbg cmds --- .github/workflows/reports.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 7d96a388bda..421a6a9414f 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -119,20 +119,16 @@ jobs: mkdir ./reports ./gates_report_brillig.sh 9223372036854775807 - mv gates_report_brillig.json ./reports/gates_report_brillig_inliner_max.json - jq '.programs | length' ./reports/gates_report_brillig_inliner_max.json + jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_max.json ./gates_report_brillig.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_zero.json - jq '.programs | length' ./reports/gates_report_brillig_inliner_zero.json ./gates_report_brillig.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig.json > ./reports/gates_report_brillig_inliner_min.json - jq '.programs | length' ./reports/gates_report_brillig_inliner_min.json - ls ./reports + # Merge all reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig.json - jq '.programs | length' ../gates_report_brillig.json - name: Compare Brillig bytecode size reports id: brillig_bytecode_diff @@ -182,20 +178,16 @@ jobs: run: | mkdir ./reports ./gates_report_brillig_execution.sh 9223372036854775807 - mv gates_report_brillig_execution.json ./reports/gates_report_brillig_execution_inliner_max.json - jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_max.json + jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_max.json ./gates_report_brillig_execution.sh 0 jq '.programs |= map(.package_name |= (. + "_inliner_zero"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_zero.json - jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_zero.json ./gates_report_brillig_execution.sh -9223372036854775808 jq '.programs |= map(.package_name |= (. + "_inliner_min"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_min.json - jq '.programs | length' ./reports/gates_report_brillig_execution_inliner_min.json - ls ./reports + # Merge all reports jq -s '{ programs: map(.programs) | add }' ./reports/* > ../gates_report_brillig_execution.json - jq '.programs | length' ../gates_report_brillig_execution.json - name: Compare Brillig execution reports id: brillig_execution_diff From 66f60a725f0132cbda26404be7a54b96cbc846ee Mon Sep 17 00:00:00 2001 From: Maxim Vezenov Date: Tue, 14 Jan 2025 03:49:26 +0000 Subject: [PATCH 25/25] space --- .github/workflows/reports.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index 421a6a9414f..224ecb5a637 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -177,6 +177,7 @@ jobs: working-directory: ./test_programs run: | mkdir ./reports + ./gates_report_brillig_execution.sh 9223372036854775807 jq '.programs |= map(.package_name |= (. + "_inliner_max"))' gates_report_brillig_execution.json > ./reports/gates_report_brillig_execution_inliner_max.json