Skip to content

Commit

Permalink
feat: Sync from noir (#12119)
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(cli): add noir-execute binary
(noir-lang/noir#7384)
chore!: make `ResolverError::OracleMarkedAsConstrained` into a full
error (noir-lang/noir#7426)
chore: simplify reports (noir-lang/noir#7421)
fix: do not discard negative sign from field literals in comptime
interpreter (noir-lang/noir#7439)
chore: bump aztec-packages commit
(noir-lang/noir#7441)
fix: require loop/for/while body to be unit
(noir-lang/noir#7437)
feat: simplify assertions that squared values are equal to zero
(noir-lang/noir#7432)
chore(benchmark): Improve noir msm benchmark
(noir-lang/noir#7390)
chore: Add SSA security checks description
(noir-lang/noir#7366)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <tom@tomfren.ch>
  • Loading branch information
AztecBot and TomAFrench authored Feb 19, 2025
1 parent 13ad91c commit 8422594
Show file tree
Hide file tree
Showing 47 changed files with 1,102 additions and 350 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49a095ded5cd33795bcdac60cbd98ce7c5ab9198
fdfe2bf752771b9611dc71953d50423b4ae7ec44
4 changes: 2 additions & 2 deletions noir/noir-repo/.github/benchmark_projects.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define: &AZ_COMMIT 6c0b83d4b73408f87acfa080d52a81c411e47336
define: &AZ_COMMIT 1350f93c3e9af8f601ca67ca3e67d0127c9767b6
projects:
private-kernel-inner:
repo: AztecProtocol/aztec-packages
Expand Down Expand Up @@ -73,7 +73,7 @@ projects:
path: noir-projects/noir-protocol-circuits/crates/rollup-block-root
num_runs: 1
timeout: 60
compilation-timeout: 100
compilation-timeout: 110
execution-timeout: 40
compilation-memory-limit: 7000
execution-memory-limit: 1500
Expand Down
225 changes: 104 additions & 121 deletions noir/noir-repo/.github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ jobs:
strategy:
fail-fast: false
matrix:
project: ${{ fromJson( needs.benchmark-projects-list.outputs.projects )}}
include: ${{ fromJson( needs.benchmark-projects-list.outputs.projects )}}

name: External repo compilation and execution reports - ${{ matrix.project.repo }}/${{ matrix.project.path }}
name: External repo compilation and execution reports - ${{ matrix.repo }}/${{ matrix.path }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -302,32 +302,77 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ matrix.project.repo }}
repository: ${{ matrix.repo }}
path: test-repo
ref: ${{ matrix.project.ref }}
ref: ${{ matrix.ref }}

- name: Fetch noir dependencies
working-directory: ./test-repo/${{ matrix.project.path }}
working-directory: ./test-repo/${{ matrix.path }}
run: |
# We run `nargo check` to pre-fetch any dependencies so we don't measure the time to download these
# when benchmarking.
nargo check
- name: Generate compilation report
working-directory: ./test-repo/${{ matrix.project.path }}
id: compilation_report
working-directory: ./test-repo/${{ matrix.path }}
run: |
mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh
touch parse_time.sh
chmod +x parse_time.sh
cp /home/runner/work/noir/noir/scripts/test_programs/parse_time.sh ./parse_time.sh
./compilation_report.sh 1 ${{ matrix.project.num_runs }}
./compilation_report.sh 1 ${{ matrix.num_runs }}
PACKAGE_NAME=${{ matrix.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
REPORT_NAME=compilation_report_$PACKAGE_NAME.json
REPORT_PATH=$(pwd)/$REPORT_NAME
mv ./compilation_report.json $REPORT_PATH
echo "report_name=$REPORT_NAME" >> $GITHUB_OUTPUT
echo "report_path=$REPORT_PATH" >> $GITHUB_OUTPUT
env:
FLAGS: ${{ matrix.project.flags }}
FLAGS: ${{ matrix.flags }}

- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: ${{ steps.compilation_report.outputs.report_name }}
path: ${{ steps.compilation_report.outputs.report_path }}
retention-days: 3
overwrite: true

- name: Generate execution report
id: execution_report
working-directory: ./test-repo/${{ matrix.path }}
if: ${{ !matrix.cannot_execute }}
run: |
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.num_runs }}
PACKAGE_NAME=${{ matrix.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
REPORT_NAME=execution_report_$PACKAGE_NAME.json
REPORT_PATH=$(pwd)/$REPORT_NAME
mv ./execution_report.json $REPORT_PATH
echo "report_name=$REPORT_NAME" >> $GITHUB_OUTPUT
echo "report_path=$REPORT_PATH" >> $GITHUB_OUTPUT
- name: Upload execution report
if: ${{ !matrix.cannot_execute }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.execution_report.outputs.report_name }}
path: ${{ steps.execution_report.outputs.report_path }}
retention-days: 3
overwrite: true

- name: Check compilation time limit
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/compilation_report.json)
TIME_LIMIT=${{ matrix.project.compilation-timeout }}
TIME=$(jq '.[0].value' ${{ steps.compilation_report.outputs.report_path }})
TIME_LIMIT=${{ matrix.compilation-timeout }}
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..."
Expand All @@ -336,19 +381,11 @@ jobs:
exit 1
fi
- name: Generate execution report
working-directory: ./test-repo/${{ matrix.project.path }}
if: ${{ !matrix.project.cannot_execute }}
run: |
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 }}
if: ${{ !matrix.cannot_execute }}
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/execution_report.json)
TIME_LIMIT=${{ matrix.project.execution-timeout }}
TIME=$(jq '.[0].value' ${{ steps.execution_report.outputs.report_path }})
TIME_LIMIT=${{ matrix.execution-timeout }}
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..."
Expand All @@ -357,41 +394,6 @@ jobs:
exit 1
fi
- name: Move compilation report
id: compilation_report
shell: bash
run: |
PACKAGE_NAME=${{ matrix.project.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/compilation_report.json ./compilation_report_$PACKAGE_NAME.json
echo "compilation_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Move execution report
id: execution_report
shell: bash
if: ${{ !matrix.project.cannot_execute }}
run: |
PACKAGE_NAME=${{ matrix.project.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/execution_report.json ./execution_report_$PACKAGE_NAME.json
echo "execution_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: compilation_report_${{ steps.compilation_report.outputs.compilation_report_name }}
path: compilation_report_${{ steps.compilation_report.outputs.compilation_report_name }}.json
retention-days: 3
overwrite: true

- name: Upload execution report
uses: actions/upload-artifact@v4
with:
name: execution_report_${{ steps.execution_report.outputs.execution_report_name }}
path: execution_report_${{ steps.execution_report.outputs.execution_report_name }}.json
retention-days: 3
overwrite: true

external_repo_memory_report:
needs: [build-nargo, benchmark-projects-list]
runs-on: ubuntu-22.04
Expand All @@ -415,6 +417,9 @@ jobs:
- name: Download nargo binary
uses: ./scripts/.github/actions/download-nargo

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

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -423,44 +428,62 @@ jobs:
ref: ${{ matrix.ref }}

- name: Generate compilation memory report
id: compilation_report
working-directory: ./test-repo/${{ matrix.path }}
run: |
mv /home/runner/work/noir/noir/scripts/test_programs/memory_report.sh ./memory_report.sh
mv /home/runner/work/noir/noir/scripts/test_programs/parse_memory.sh ./parse_memory.sh
./memory_report.sh 1
# Rename the memory report as the execution report is about to write to the same file
cp memory_report.json compilation_memory_report.json
PACKAGE_NAME=${{ matrix.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
REPORT_NAME=compilation_mem_report_$PACKAGE_NAME.json
REPORT_PATH=$(pwd)/$REPORT_NAME
mv ./memory_report.json $REPORT_PATH
echo "report_name=$REPORT_NAME" >> $GITHUB_OUTPUT
echo "report_path=$REPORT_PATH" >> $GITHUB_OUTPUT
env:
FLAGS: ${{ matrix.flags }}

- name: Check compilation memory limit
run: |
MEMORY=$(jq '.[0].value' ./test-repo/${{ matrix.path }}/compilation_memory_report.json)
MEMORY_LIMIT=${{ matrix.compilation-memory-limit }}
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: Upload compilation memory report
uses: actions/upload-artifact@v4
with:
name: ${{ steps.compilation_report.outputs.report_name }}
path: ${{ steps.compilation_report.outputs.report_path }}
retention-days: 3
overwrite: true

- name: Check compilation memory limit
- name: Generate execution memory report
id: execution_report
working-directory: ./test-repo/${{ matrix.path }}
if: ${{ !matrix.cannot_execute }}
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
./memory_report.sh 1 1
PACKAGE_NAME=${{ matrix.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
REPORT_NAME=execution_mem_report_$PACKAGE_NAME.json
REPORT_PATH=$(pwd)/$REPORT_NAME
mv ./memory_report.json $REPORT_PATH
echo "report_name=$REPORT_NAME" >> $GITHUB_OUTPUT
echo "report_path=$REPORT_PATH" >> $GITHUB_OUTPUT
- name: Upload execution memory report
if: ${{ !matrix.cannot_execute }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.execution_report.outputs.report_name }}
path: ${{ steps.execution_report.outputs.report_path }}
retention-days: 3
overwrite: true

- name: Check compilation memory limit
run: |
MEMORY=$(jq '.[0].value' ./test-repo/${{ matrix.project.path }}/compilation_memory_report.json)
MEMORY_LIMIT=6000
MEMORY=$(jq '.[0].value' ${{ steps.compilation_report.outputs.report_path }})
MEMORY_LIMIT=${{ matrix.compilation-memory-limit }}
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..."
Expand All @@ -469,16 +492,10 @@ jobs:
exit 1
fi
- name: Generate execution memory report
working-directory: ./test-repo/${{ matrix.path }}
if: ${{ !matrix.cannot_execute }}
run: |
./memory_report.sh 1 1
- name: Check execution memory limit
if: ${{ !matrix.cannot_execute }}
run: |
MEMORY=$(jq '.[0].value' ./test-repo/${{ matrix.path }}/memory_report.json)
MEMORY=$(jq '.[0].value' ${{ steps.execution_report.outputs.report_path }})
MEMORY_LIMIT=${{ matrix.execution-memory-limit }}
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.
Expand All @@ -488,40 +505,6 @@ jobs:
exit 1
fi
- name: Move compilation report
id: compilation_mem_report
shell: bash
run: |
PACKAGE_NAME=${{ matrix.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.path }}/compilation_memory_report.json ./memory_report_$PACKAGE_NAME.json
echo "memory_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload compilation memory report
uses: actions/upload-artifact@v4
with:
name: compilation_mem_report_${{ steps.compilation_mem_report.outputs.memory_report_name }}
path: memory_report_${{ steps.compilation_mem_report.outputs.memory_report_name }}.json
retention-days: 3
overwrite: true

- name: Move execution report
id: execution_mem_report
if: ${{ !matrix.cannot_execute }}
run: |
PACKAGE_NAME=${{ matrix.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.path }}/memory_report.json ./memory_report_$PACKAGE_NAME.json
echo "memory_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
- name: Upload execution memory report
uses: actions/upload-artifact@v4
with:
name: execution_mem_report_${{ steps.execution_mem_report.outputs.memory_report_name }}
path: memory_report_${{ steps.execution_mem_report.outputs.memory_report_name }}.json
retention-days: 3
overwrite: true

upload_compilation_report:
name: Upload compilation report
needs: [generate_compilation_and_execution_report, external_repo_compilation_and_execution_report]
Expand Down
23 changes: 11 additions & 12 deletions noir/noir-repo/.github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -541,18 +541,6 @@ jobs:
fi
env:
NARGO_IGNORE_TEST_FAILURES_FROM_FOREIGN_CALLS: true

- name: Check test time limit
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.path }}/${{ steps.test_report.outputs.test_report_name }}.json)
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$TIME" "${{ matrix.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.timeout }}"
echo "Test suite took: $TIME".
exit 1
fi
- name: Compare test results
working-directory: ./noir-repo
run: .github/scripts/check_test_results.sh .github/critical_libraries_status/${{ matrix.repo }}/${{ matrix.path }}.failures.jsonl .github/critical_libraries_status/${{ matrix.repo }}/${{ matrix.path }}.actual.jsonl
Expand All @@ -566,6 +554,17 @@ jobs:
retention-days: 3
overwrite: true

- name: Check test time limit
run: |
TIME=$(jq '.[0].value' ./test-repo/${{ matrix.path }}/${{ steps.test_report.outputs.test_report_name }}.json)
if awk 'BEGIN{exit !(ARGV[1]>ARGV[2])}' "$TIME" "${{ matrix.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.timeout }}"
echo "Test suite took: $TIME".
exit 1
fi
compile-noir-contracts:
needs: [build-nargo]
runs-on: ubuntu-22.04
Expand Down
Loading

1 comment on commit 8422594

@AztecBot
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'C++ Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 8422594 Previous: 1e4ad1c Ratio
wasmconstruct_proof_ultrahonk_power_of_2/20 11084.949202 ms/iter 9695.749147 ms/iter 1.14

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ludamad @codygunton

Please sign in to comment.