Skip to content

Commit

Permalink
feat: Sync from noir (#11796)
Browse files Browse the repository at this point in the history
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat: simplify `Ord` implementation for arrays
(noir-lang/noir#7305)
feat: `assert` and `assert_eq` are now expressions
(noir-lang/noir#7313)
chore: fix memory reports in CI
(noir-lang/noir#7311)
chore: remove Recoverable (noir-lang/noir#7307)
feat: Sync from aztec-packages
(noir-lang/noir#7293)
chore: reduce number of benchmarking scripts
(noir-lang/noir#7285)
fix: error on if without else when type mismatch
(noir-lang/noir#7302)
fix: error on trailing doc comment
(noir-lang/noir#7300)
fix: always normalize ssa when priting at least one pass
(noir-lang/noir#7299)
fix: mark field division and modulo as requiring predicate for all
necessary types (noir-lang/noir#7290)
chore: push inlining info code into a submodule
(noir-lang/noir#7266)
chore: create a CI action to download nargo and add to path
(noir-lang/noir#7281)
chore: add sha256 library to test suite
(noir-lang/noir#7278)
feat: infer lambda parameter types from return type and let type
(noir-lang/noir#7267)
chore: replace benchmarks on fast test suites with a cut-off
(noir-lang/noir#7276)
fix(ssa): Unused functions removals post folding constant Brillig calls
(noir-lang/noir#7265)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Maxim Vezenov <[email protected]>
  • Loading branch information
AztecBot and vezenovm authored Feb 7, 2025
1 parent 8a320bf commit 3840e8e
Show file tree
Hide file tree
Showing 47 changed files with 1,327 additions and 1,157 deletions.
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
Empty file.
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

0 comments on commit 3840e8e

Please sign in to comment.