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 #12119

Merged
merged 4 commits into from
Feb 19, 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 @@
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