Skip to content

Commit

Permalink
Revert "feat: Sync from noir (#11796)"
Browse files Browse the repository at this point in the history
This reverts commit 3840e8e.
  • Loading branch information
ludamad authored Feb 7, 2025
1 parent ff1536a commit 133f89e
Show file tree
Hide file tree
Showing 47 changed files with 1,157 additions and 1,327 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
819a53a7db921f40febc0e480539df3bfaf917a2
130d99125a09110a3ee3e877d88d83b5aa37f369
18 changes: 0 additions & 18 deletions noir/noir-repo/.github/actions/download-nargo/action.yml

This file was deleted.

Empty file.
27 changes: 27 additions & 0 deletions noir/noir-repo/.github/scripts/merge-bench-reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -eu

echo "Merging reports"

REPORT_NAME=$1
NAME_PLURAL=""$REPORT_NAME"s"

combined_reports="[]"

# Iterate over each report and merge them
for report in ./reports/*; do
# The report is saved under ./$REPORT_NAME_{ matrix_report }/$REPORT_NAME_{ matrix_report }.json
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")")
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}"

echo "$final_report" > $REPORT_NAME.json

cat $REPORT_NAME.json
13 changes: 12 additions & 1 deletion noir/noir-repo/.github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,18 @@ jobs:
uses: actions/checkout@v4

- name: Download nargo binary
uses: ./.github/actions/download-nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Format stdlib
working-directory: ./noir_stdlib
Expand Down
136 changes: 106 additions & 30 deletions noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ jobs:
echo "$HOME/.bb/" >> $GITHUB_PATH
- name: Download nargo binary
uses: ./.github/actions/download-nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate gates report
working-directory: ./test_programs
Expand Down Expand Up @@ -89,7 +100,18 @@ jobs:
- uses: actions/checkout@v4

- name: Download nargo binary
uses: ./.github/actions/download-nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate Brillig bytecode size report
working-directory: ./test_programs
Expand Down Expand Up @@ -138,7 +160,18 @@ jobs:
- uses: actions/checkout@v4

- name: Download nargo binary
uses: ./.github/actions/download-nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate Brillig execution report
working-directory: ./test_programs
Expand Down Expand Up @@ -187,7 +220,18 @@ jobs:
- uses: actions/checkout@v4

- name: Download nargo binary
uses: ./.github/actions/download-nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate Memory report
working-directory: ./test_programs
Expand Down Expand Up @@ -228,7 +272,18 @@ jobs:
- uses: actions/checkout@v4

- name: Download nargo binary
uses: ./.github/actions/download-nargo
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate Compilation report
working-directory: ./test_programs
Expand Down Expand Up @@ -281,19 +336,29 @@ jobs:

name: External repo compilation and execution reports - ${{ matrix.project.repo }}/${{ matrix.project.path }}
steps:
- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
.github/actions/download-nargo/action.yml
test_programs/compilation_report.sh
test_programs/execution_report.sh
test_programs/parse_time.sh
sparse-checkout-cone-mode: false

- name: Download nargo binary
uses: ./scripts/.github/actions/download-nargo

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -386,17 +451,27 @@ jobs:

name: External repo memory report - ${{ matrix.project.repo }}/${{ matrix.project.path }}
steps:
- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
.github/actions/download-nargo/action.yml
test_programs/memory_report.sh
test_programs/parse_memory.sh
sparse-checkout-cone-mode: false

- name: Download nargo binary
uses: ./scripts/.github/actions/download-nargo

- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -477,22 +552,21 @@ jobs:
uses: actions/download-artifact@v4
with:
name: in_progress_compilation_report
path: ./reports

- name: Download matrix compilation reports
uses: actions/download-artifact@v4
with:
pattern: compilation_report_*
path: ./reports
merge-multiple: true

- name: Merge compilation reports using jq
run: |
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee time_bench.json
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh compilation_report
jq ".compilation_reports | map({name: .artifact_name, value: (.time[:-1] | tonumber), unit: \"s\"}) " ./compilation_report.json > time_bench.json
- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Compilation Time"
Expand Down Expand Up @@ -533,15 +607,15 @@ jobs:
with:
pattern: compilation_mem_report_*
path: ./reports
merge-multiple: true

- name: Merge memory reports using jq
run: |
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee memory_bench.json
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh memory_report
jq ".memory_reports | map({name: .artifact_name, value: (.peak_memory | tonumber), unit: \"MB\"}) " ./memory_report.json > memory_bench.json
- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Compilation Memory"
Expand Down Expand Up @@ -582,15 +656,17 @@ jobs:
with:
pattern: execution_mem_report_*
path: ./reports
merge-multiple: true

- name: Merge memory reports using jq
run: |
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee memory_bench.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
cp memory_report.json execution_memory_report.json
jq ".memory_reports | map({name: .artifact_name, value: (.peak_memory | tonumber), unit: \"MB\"}) " ./execution_memory_report.json > memory_bench.json
- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Execution Memory"
Expand Down Expand Up @@ -632,15 +708,15 @@ jobs:
with:
pattern: execution_report_*
path: ./reports
merge-multiple: true

- name: Merge execution reports using jq
run: |
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee time_bench.json
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh execution_report
jq ".execution_reports | map({name: .artifact_name, value: (.time[:-1] | tonumber), unit: \"s\"}) " ./execution_report.json > time_bench.json
- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Execution Time"
Expand Down
Loading

0 comments on commit 133f89e

Please sign in to comment.