From b48ba4db10a6fdd7c0f0b3a45971923e5240185d Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Fri, 3 May 2024 19:33:57 +0000 Subject: [PATCH 1/4] chore(ci): migrate `protocol-circuits-gate-diff` to earthly --- .github/workflows/ci.yml | 33 ++++++ .../workflows/protocol-circuits-gate-diff.yml | 104 ------------------ noir-projects/Earthfile | 10 ++ 3 files changed, 43 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/protocol-circuits-gate-diff.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad0e789d6ca..e81c24a6ddc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -348,6 +348,39 @@ jobs: working-directory: ./barretenberg/cpp/ timeout-minutes: 15 run: earthly-ci --no-output +bench-ultra-honk --bench_mode=cache + + protocol-circuits-gates-report: + needs: setup + runs-on: ${{ inputs.username || github.actor }}-x86 + steps: + - { + uses: actions/checkout@v4, + with: { ref: "${{ github.event.pull_request.head.sha }}" }, + } + # Only allow one memory-hunger prover test to use this runner + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}" + concurrency_key: protocol-circuits-gates-report-${{ inputs.username || github.actor }}-x86 + - name: "Noir Protocol Circuits Report" + working-directory: ./noir-projects/ + timeout-minutes: 25 + run: earthly-ci --artifact +gates-report/gates_report.json + + - name: Compare gates reports + id: gates_diff + uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6 + with: + report: gates_report.json + summaryQuantile: 0 # Display any diff in gate count + + - 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 + with: + # delete the comment in case changes no longer impact circuit sizes + delete: ${{ !steps.gates_diff.outputs.markdown }} + message: ${{ steps.gates_diff.outputs.markdown }} merge-check: runs-on: ubuntu-latest diff --git a/.github/workflows/protocol-circuits-gate-diff.yml b/.github/workflows/protocol-circuits-gate-diff.yml deleted file mode 100644 index b31e371d471..00000000000 --- a/.github/workflows/protocol-circuits-gate-diff.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Report gates diff - -on: - push: - branches: - - master - pull_request: - -jobs: - compare_protocol_circuits_gates: - concurrency: - group: compare_protocol_circuits_gates-${{ github.ref_name == 'master' && github.run_id || github.ref_name }} - cancel-in-progress: true - if: "!startsWith(github.head_ref, 'release-please--')" - runs-on: ubuntu-20.04 - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - - name: Install bleeding edge cmake - run: | - sudo apt -y remove --purge cmake - sudo snap install cmake --classic - - - name: Create Build Environment - run: | - sudo apt-get update - sudo apt-get -y install ninja-build - - - name: Install Clang16 - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - tar -xvf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - sudo cp clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/* /usr/local/bin/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/include/* /usr/local/include/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/* /usr/local/lib/ - sudo cp -r clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/share/* /usr/local/share/ - rm -rf clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04 - - - uses: actions/cache@v4 - with: - path: | - barretenberg/cpp/build - barretenberg/cpp/build-wasm - barretenberg/cpp/build-threads - key: ${{ runner.os }}-bb-build - - - name: Compile Barretenberg - run: | - cd barretenberg/cpp - - cmake --preset default -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_BUILD_TYPE=RelWithAssert -DTARGET_ARCH=westmere - cmake --build --preset default --target bb - - - name: Install noirup - run: | - curl -L $INSTALL_URL | bash - echo "${HOME}/.nargo/bin" >> $GITHUB_PATH - env: - INSTALL_URL: https://raw.githubusercontent.com/noir-lang/noirup/main/install - NOIRUP_BIN_URL: https://raw.githubusercontent.com/noir-lang/noirup/main/noirup - - - uses: actions/cache@v4 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo - - - name: Install Barretenberg dependencies - run: sudo apt update && sudo apt install clang lld cmake libomp-dev - - - name: Install nargo from source with noirup - run: noirup $toolchain - env: - toolchain: --path ./noir/noir-repo - - - name: Check nargo installation - run: nargo --version - - - name: Generate gates report - working-directory: ./noir-projects/noir-protocol-circuits - run: | - nargo info --json --silence-warnings > protocol_circuits_report.json - mv protocol_circuits_report.json ../../protocol_circuits_report.json - env: - NARGO_BACKEND_PATH: ../../barretenberg/cpp/build/bin/bb - - - name: Compare gates reports - id: gates_diff - uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6 - with: - report: protocol_circuits_report.json - summaryQuantile: 0 # Display any diff in gate count - - - 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 - with: - # delete the comment in case changes no longer impact circuit sizes - delete: ${{ !steps.gates_diff.outputs.markdown }} - message: ${{ steps.gates_diff.outputs.markdown }} diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index 85fe5130a92..645eddc4973 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -29,3 +29,13 @@ test: RUN cd noir-protocol-circuits && nargo test --silence-warnings RUN cd aztec-nr && nargo test --silence-warnings RUN cd noir-contracts && nargo test --silence-warnings + +gates-report: + FROM +build + WORKDIR /usr/src/noir-projects/noir-protocol-circuits + + COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb + + RUN NARGO_BACKEND_PATH=/usr/src/barretenberg/cpp/build/bin/bb nargo info --json > gates_report.json + + SAVE ARTIFACT gates_report.json gates_report.json \ No newline at end of file From aea67a0c75f00ff42acab41401597d6225e9f58f Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Fri, 3 May 2024 19:51:00 +0000 Subject: [PATCH 2/4] chore: fix location of report --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e81c24a6ddc..564ee38e31b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -365,7 +365,9 @@ jobs: - name: "Noir Protocol Circuits Report" working-directory: ./noir-projects/ timeout-minutes: 25 - run: earthly-ci --artifact +gates-report/gates_report.json + run: | + earthly-ci --artifact +gates-report/gates_report.json + mv gates_report.json ../gates_report.json - name: Compare gates reports id: gates_diff From daad0fa813c9b4578030f499c473abd95dd2d959 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Fri, 3 May 2024 19:55:15 +0000 Subject: [PATCH 3/4] chore: retain old report name --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 564ee38e31b..920c61b6274 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -366,14 +366,14 @@ jobs: working-directory: ./noir-projects/ timeout-minutes: 25 run: | - earthly-ci --artifact +gates-report/gates_report.json - mv gates_report.json ../gates_report.json + earthly-ci --artifact +gates-report/protocol_circuits_report.json + mv gates_report.json ../protocol_circuits_report.json - name: Compare gates reports id: gates_diff uses: vezenovm/noir-gates-diff@acf12797860f237117e15c0d6e08d64253af52b6 with: - report: gates_report.json + report: protocol_circuits_report.json summaryQuantile: 0 # Display any diff in gate count - name: Add gates diff to sticky comment From 66dee6d709f0f4bb60b90d018d14846dbf647613 Mon Sep 17 00:00:00 2001 From: TomAFrench Date: Fri, 3 May 2024 19:57:00 +0000 Subject: [PATCH 4/4] chore: oops --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 920c61b6274..5ec2c874b1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -366,7 +366,7 @@ jobs: working-directory: ./noir-projects/ timeout-minutes: 25 run: | - earthly-ci --artifact +gates-report/protocol_circuits_report.json + earthly-ci --artifact +gates-report/gates_report.json mv gates_report.json ../protocol_circuits_report.json - name: Compare gates reports