Skip to content
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
92 changes: 72 additions & 20 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,100 @@ name: Benchmarks

on:
push:
branches:
- master
branches:
- master
pull_request:

env:
MINIMUM_NOIR_VERSION: 1.0.0-beta.18

jobs:
test:
name: Benchmark library
runs-on: ubuntu-latest
permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
uses: noir-lang/noirup@v0.1.4
with:
toolchain: 1.0.0-beta.3
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}

- name: Install bb
run: |
npm install -g bbup
bbup -nv 1.0.0-beta.3
sudo apt install libc++-dev
curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/next/barretenberg/bbup/install | bash
~/.bb/bbup -nv ${{ env.MINIMUM_NOIR_VERSION }}

- name: Build Noir benchmark programs
run: nargo export

- name: Generate gates report
- name: Generate gate report
run: ./scripts/build-gates-report.sh
env:
BACKEND: /home/runner/.bb/bb
BACKEND: /home/runner/.bb/bb


- name: Store ACIR opcode benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: "ACIR Opcodes"
tool: "customSmallerIsBetter"
output-file-path: "benchmark-opcodes.json"
gh-pages-branch: "gh-pages"
benchmark-data-dir-path: "dev/bench"
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/master' }}
comment-always: ${{ contains( github.event.pull_request.labels.*.name, 'bench-show') }}
comment-on-alert: true
alert-threshold: "101%"
fail-on-alert: false
max-items-in-chart: 50

- name: Compare gates reports
id: gates_diff
uses: noir-lang/noir-gates-diff@dbe920a8dcc3370af4be4f702ca9cef29317bec1
- name: Store gates benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
report: gates_report.json
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)
name: "Circuit Size"
tool: "customSmallerIsBetter"
output-file-path: "benchmark-circuit.json"
gh-pages-branch: "gh-pages"
benchmark-data-dir-path: "dev/bench"
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/master' }}
comment-always: ${{ contains( github.event.pull_request.labels.*.name, 'bench-show') }}
comment-on-alert: true
alert-threshold: "101%"
fail-on-alert: false
max-items-in-chart: 50
skip-fetch-gh-pages: true

- name: Delete export files
run: rm -rf export

- name: Build Brillig benchmark programs
run: nargo export --force-brillig

- name: Generate brillig report
run: ./scripts/build-brillig-report.sh

- name: Add gates diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
- name: Store brillig benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
# delete the comment in case changes no longer impact circuit sizes
delete: ${{ !steps.gates_diff.outputs.markdown }}
message: ${{ steps.gates_diff.outputs.markdown }}
name: "Brillig Bytecode Size"
tool: "customSmallerIsBetter"
output-file-path: "benchmark-brillig.json"
gh-pages-branch: "gh-pages"
benchmark-data-dir-path: "dev/bench"
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/master' }}
comment-always: ${{ contains( github.event.pull_request.labels.*.name, 'bench-show') }}
comment-on-alert: true
alert-threshold: "101%"
fail-on-alert: false
max-items-in-chart: 50
skip-fetch-gh-pages: true
48 changes: 16 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
pull_request:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: v1.0.0-beta.3
MINIMUM_NOIR_VERSION: v1.0.0-beta.5

jobs:
noir-version-list:
Expand Down Expand Up @@ -43,38 +42,24 @@ jobs:
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
uses: noir-lang/noirup@v0.1.4
with:
toolchain: ${{ matrix.toolchain }}

- name: Run Noir tests
run: nargo test

rust-equivalence-tests:
name: Test for equivalence against Rust impl
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
with:
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}

- name: Install Cargo
uses: dtolnay/rust-toolchain@1.85.0
with:
targets: x86_64-unknown-linux-gnu

- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
key: x86_64-unknown-linux-gnu
cache-on-failure: true
node-version: 22.15.0
cache: "yarn"
cache-dependency-path: "yarn.lock"

- name: Export and Test Noir Functions
run: ./scripts/fuzz-test.sh
- name: Install dependencies
run: |
yarn --immutable

- name: Run all tests (including oracle tests)
working-directory: ./scripts
run: ./run.sh

format:
runs-on: ubuntu-latest
Expand All @@ -83,7 +68,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
uses: noir-lang/noirup@v0.1.4
with:
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}

Expand All @@ -97,10 +82,9 @@ jobs:
runs-on: ubuntu-latest
# 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:
needs:
- test
- format
- rust-equivalence-tests

steps:
- name: Report overall success
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
target
export
gates_report.json

node_modules/
dist/

Loading