Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync from noir #11796

Merged
merged 5 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
130d99125a09110a3ee3e877d88d83b5aa37f369
819a53a7db921f40febc0e480539df3bfaf917a2
18 changes: 18 additions & 0 deletions noir/noir-repo/.github/actions/download-nargo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Download Nargo
description: Downloads the nargo binary from an artifact and adds it to the path

runs:
using: composite
steps:
- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
shell: bash
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
27 changes: 0 additions & 27 deletions noir/noir-repo/.github/scripts/merge-bench-reports.sh

This file was deleted.

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

- 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: ./.github/actions/download-nargo

- name: Format stdlib
working-directory: ./noir_stdlib
Expand Down
136 changes: 30 additions & 106 deletions noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,7 @@ jobs:
echo "$HOME/.bb/" >> $GITHUB_PATH

- 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: ./.github/actions/download-nargo

- name: Generate gates report
working-directory: ./test_programs
Expand Down Expand Up @@ -100,18 +89,7 @@ jobs:
- uses: actions/checkout@v4

- 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: ./.github/actions/download-nargo

- name: Generate Brillig bytecode size report
working-directory: ./test_programs
Expand Down Expand Up @@ -160,18 +138,7 @@ jobs:
- uses: actions/checkout@v4

- 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: ./.github/actions/download-nargo

- name: Generate Brillig execution report
working-directory: ./test_programs
Expand Down Expand Up @@ -220,18 +187,7 @@ jobs:
- uses: actions/checkout@v4

- 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: ./.github/actions/download-nargo

- name: Generate Memory report
working-directory: ./test_programs
Expand Down Expand Up @@ -272,18 +228,7 @@ jobs:
- uses: actions/checkout@v4

- 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: ./.github/actions/download-nargo

- name: Generate Compilation report
working-directory: ./test_programs
Expand Down Expand Up @@ -336,29 +281,19 @@ 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 @@ -451,27 +386,17 @@ 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 @@ -552,21 +477,22 @@ 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: |
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
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee 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 @@ -607,15 +533,15 @@ jobs:
with:
pattern: compilation_mem_report_*
path: ./reports
merge-multiple: true

- name: Merge memory reports using jq
run: |
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
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee 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 @@ -656,17 +582,15 @@ jobs:
with:
pattern: execution_mem_report_*
path: ./reports
merge-multiple: true

- name: Merge memory reports using jq
run: |
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
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee 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 @@ -708,15 +632,15 @@ jobs:
with:
pattern: execution_report_*
path: ./reports
merge-multiple: true

- name: Merge execution reports using jq
run: |
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
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee 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
Loading