Skip to content

Commit

Permalink
Merge branch 'master' into is/fuzzer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rumata888 committed Feb 7, 2025
2 parents d5ff3e3 + 0d78578 commit fa50d57
Show file tree
Hide file tree
Showing 51 changed files with 875 additions and 633 deletions.
2 changes: 1 addition & 1 deletion .aztec-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a7f8d9670902dfa4856b8514ce5eb4ad031a44fc
b60a39d989b77702a89ebb24047e5b2419915dc3
22 changes: 11 additions & 11 deletions .github/actions/download-nargo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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: 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
- 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 .github/scripts/merge-bench-reports.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/playwright-install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -eu

npx -y playwright@1.50 install --with-deps
npx -y playwright@1.49 install --with-deps
115 changes: 94 additions & 21 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ jobs:
sparse-checkout-cone-mode: false

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

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -318,6 +318,18 @@ jobs:
./compilation_report.sh 1 ${{ matrix.project.num_runs }}
env:
FLAGS: ${{ matrix.project.flags }}

- name: Check compilation time limit
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/compilation_report.json)
TIME_LIMIT=80
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$TIME" "$TIME_LIMIT"; then
# Don't bump this timeout without understanding why this has happened and confirming that you're not the cause.
echo "Failing due to compilation exceeding timeout..."
echo "Timeout: "$TIME_LIMIT"s"
echo "Compilation took: "$TIME"s".
exit 1
fi
- name: Generate execution report
working-directory: ./test-repo/${{ matrix.project.path }}
Expand All @@ -326,6 +338,19 @@ jobs:
mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh
mv /home/runner/work/noir/noir/scripts/test_programs/parse_time.sh ./parse_time.sh
./execution_report.sh 1 ${{ matrix.project.num_runs }}
- name: Check execution time limit
if: ${{ !matrix.project.cannot_execute }}
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/execution_report.json)
TIME_LIMIT=60
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$TIME" "$TIME_LIMIT"; then
# Don't bump this timeout without understanding why this has happened and confirming that you're not the cause.
echo "Failing due to execution exceeding timeout..."
echo "Timeout: "$TIME_LIMIT"s"
echo "Execution took: "$TIME"s".
exit 1
fi
- name: Move compilation report
id: compilation_report
Expand Down Expand Up @@ -390,7 +415,7 @@ jobs:
with:
path: scripts
sparse-checkout: |
./.github/actions/download-nargo/action.yml
.github/actions/download-nargo/action.yml
test_programs/memory_report.sh
test_programs/parse_memory.sh
sparse-checkout-cone-mode: false
Expand All @@ -416,12 +441,37 @@ jobs:
env:
FLAGS: ${{ matrix.project.flags }}

- name: Check compilation memory limit
run: |
MEMORY=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/compilation_memory_report.json)
MEMORY_LIMIT=6000
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$MEMORY" "$MEMORY_LIMIT"; then
# Don't bump this limit without understanding why this has happened and confirming that you're not the cause.
echo "Failing due to compilation exceeding memory limit..."
echo "Limit: "$MEMORY_LIMIT"MB"
echo "Compilation took: "$MEMORY"MB".
exit 1
fi
- name: Generate execution memory report
working-directory: ./test-repo/${{ matrix.project.path }}
if: ${{ !matrix.project.cannot_execute }}
run: |
./memory_report.sh 1 1
- name: Check execution memory limit
if: ${{ !matrix.project.cannot_execute }}
run: |
MEMORY=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/memory_report.json)
MEMORY_LIMIT=1300
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$MEMORY" "$MEMORY_LIMIT"; then
# Don't bump this limit without understanding why this has happened and confirming that you're not the cause.
echo "Failing due to execution exceeding memory limit..."
echo "Limit: "$MEMORY_LIMIT"MB"
echo "Execution took: "$MEMORY"MB".
exit 1
fi
- name: Move compilation report
id: compilation_mem_report
shell: bash
Expand All @@ -442,7 +492,6 @@ jobs:
- name: Move execution report
id: execution_mem_report
if: ${{ !matrix.project.cannot_execute }}
shell: bash
run: |
PACKAGE_NAME=${{ matrix.project.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
Expand Down Expand Up @@ -477,21 +526,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 @@ -532,15 +582,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 @@ -581,17 +631,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 @@ -633,15 +681,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 All @@ -655,3 +703,28 @@ jobs:
fail-on-alert: false
alert-comment-cc-users: "@TomAFrench"
max-items-in-chart: 50

# This is a job which depends on all test jobs and reports the overall status.
# This allows us to add/remove test jobs without having to update the required workflows.
reports-end:
name: End
runs-on: ubuntu-22.04
# We want this job to always run (even if the dependant jobs fail) as we want this job to fail rather than skipping.
if: ${{ always() }}
needs:
- upload_compilation_report
- upload_compilation_memory_report
- upload_execution_report
- upload_execution_memory_report

steps:
- name: Report overall success
run: |
if [[ $FAIL == true ]]; then
exit 1
else
exit 0
fi
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
28 changes: 16 additions & 12 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -527,26 +527,31 @@ jobs:
nargo test --silence-warnings --skip-brillig-constraints-check --format json ${{ matrix.project.nargo_args }} | tee $output_file
TIME=$(($SECONDS-$BEFORE))
if [ "TIME" -gt "${{ matrix.project.timeout }}" ]; then
# Library testing time has regressed past the set timeout.
# Don't bump this timeout without understanding why this has happened and confirming that you're not the cause.
exit 1
fi
NAME=${{ matrix.project.repo }}/${{ matrix.project.path }}
# Replace any slashes with underscores
NAME=${NAME//\//_}
TEST_REPORT_NAME=test_report_$NAME
echo "test_report_name=$TEST_REPORT_NAME" >> $GITHUB_OUTPUT
jq --null-input "{ test_reports: [{ name: \"$NAME\", value: (\"$TIME\" | tonumber), unit: \"s\" }]}" > $TEST_REPORT_NAME.json
jq --null-input "[{ name: \"$NAME\", value: (\"$TIME\" | tonumber), unit: \"s\" }]" > $TEST_REPORT_NAME.json
if [ ! -s $output_file ]; then
# The file is empty so we delete it to signal that `nargo test` failed before it could run any tests
rm -f $output_file
fi
env:
NARGO_IGNORE_TEST_FAILURES_FROM_FOREIGN_CALLS: true

- name: Check test time limit
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/${{ steps.test_report.outputs.test_report_name }}.json)
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$TIME" "${{ matrix.project.timeout }}"; then
# Don't bump this timeout without understanding why this has happened and confirming that you're not the cause.
echo "Failing due to test suite exceeding timeout..."
echo "Timeout: ${{ matrix.project.timeout }}"
echo "Test suite took: $TIME".
exit 1
fi
- name: Compare test results
working-directory: ./noir-repo
Expand Down Expand Up @@ -613,16 +618,15 @@ jobs:
with:
pattern: test_report_*
path: ./reports
merge-multiple: true

- name: Merge test reports using jq
run: |
jq --null-input "{ test_reports: [] }" > test_report.json
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh test_report
jq ".test_reports" < ./test_report.json > test_bench.json
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
jq --slurp '. | flatten' ./reports/* | tee test_bench.json
- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Test Suite Duration"
Expand Down
6 changes: 4 additions & 2 deletions EXTERNAL_NOIR_LIBRARIES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ libraries:
timeout: 2
noir-bignum:
repo: noir-lang/noir-bignum
timeout: 360
noir_bigcurve:
repo: noir-lang/noir_bigcurve
timeout: 290
noir_base64:
repo: noir-lang/noir_base64
timeout: 2
Expand All @@ -39,7 +41,7 @@ libraries:
timeout: 2
noir_json_parser:
repo: noir-lang/noir_json_parser
timeout: 10
timeout: 12
sha256:
repo: noir-lang/sha256
timeout: 3
Expand All @@ -50,7 +52,7 @@ libraries:
noir_contracts:
repo: AztecProtocol/aztec-packages
path: noir-projects/noir-contracts
timeout: 60
timeout: 80
blob:
repo: AztecProtocol/aztec-packages
path: noir-projects/noir-protocol-circuits/crates/blob
Expand Down
7 changes: 3 additions & 4 deletions compiler/integration-tests/web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ export default {
// playwrightLauncher({ product: "webkit" }),
// playwrightLauncher({ product: "firefox" }),
],
middleware: [async function setGzHeader(ctx, next) {
if (ctx.url.endsWith('.gz')) {
ctx.set('Content-Encoding', 'gzip');
ctx.res.removeHeader('Content-Length');
middleware: [async (ctx, next) => {
if (ctx.url.endsWith('.wasm.gz')) {
ctx.url = ctx.url.replace('/', "/node_modules/@aztec/bb.js/dest/browser/");
}
await next();
}],
Expand Down
Loading

0 comments on commit fa50d57

Please sign in to comment.