From d018b768374cea6f10d0cd4a0404f56c7b36b860 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 22 May 2024 17:32:00 -0400 Subject: [PATCH 1/5] chore: acir tests in bb --- barretenberg/Earthfile | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index 4c203496ec0e..739dfc9e1aef 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -12,3 +12,87 @@ sol: COPY ./sol . SAVE ARTIFACT ./* + +barretenberg-acir-tests-bb: + FROM ../build-images/+build + + COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb + COPY +acir-tests/ /usr/src/barretenberg/acir_tests + COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts + + WORKDIR /usr/src/barretenberg/acir_tests + RUN rm -rf ./acir_tests + + ENV TEST_SRC /usr/src/acir_artifacts + ENV VERBOSE=1 + # Run every acir test through native bb build prove_then_verify flow for UltraPlonk. + # This ensures we test independent pk construction through real/garbage witness data paths. + RUN FLOW=prove_then_verify ./run_acir_tests.sh + # Construct and separately verify a UltraHonk proof for a single program + RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof + # Construct and separately verify a GoblinUltraHonk proof for all acir programs + RUN FLOW=prove_then_verify_goblin_ultra_honk ./run_acir_tests.sh + # Construct and verify a UltraHonk proof for a single program + RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof + # Construct and verify a Goblin UltraHonk (GUH) proof for a single arbitrary program + RUN FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array + # Construct and verify a UltraHonk proof for all ACIR programs using the new witness stack workflow + RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh + # This is a "full" Goblin flow. It constructs and verifies four proofs: GoblinUltraHonk, ECCVM, Translator, and merge + RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array + # Run 1_mul through native bb build, all_cmds flow, to test all cli args. + RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul + +barretenberg-acir-tests-sol: + FROM ../build-images/+build + + COPY ./cpp/+preset-sol/ /usr/src/barretenberg/cpp/build + COPY ./cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb + COPY ./+acir-tests/ /usr/src/barretenberg/acir_tests + COPY ./+sol/ /usr/src/barretenberg/sol + COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts + + WORKDIR /usr/src/barretenberg/acir_tests + + ENV TEST_SRC /usr/src/acir_artifacts + ENV VERBOSE=1 + + RUN (cd sol-test && yarn) + RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh assert_statement double_verify_proof double_verify_nested_proof + +barretenberg-acir-tests-bb.js: + # Playwright not supported on base image ubuntu:noble, results in unmet dependencies + FROM node:18.19.0 + RUN apt update && apt install -y curl jq lsof + + COPY ./ts/+build/build/ /usr/src/barretenberg/ts + COPY ./+acir-tests/ /usr/src/barretenberg/acir_tests + COPY ../noir/+build-acir-tests/ /usr/src/acir_artifacts + + WORKDIR /usr/src/barretenberg/acir_tests + + # Build/install ts apps. + RUN cd browser-test-app && yarn && yarn build + RUN cd headless-test && yarn && npx playwright install && npx playwright install-deps + RUN cd ../ts && yarn + ENV VERBOSE=1 + ENV TEST_SRC /usr/src/acir_artifacts + + # Run double_verify_proof through bb.js on node to check 512k support. + RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_acir_tests.sh double_verify_proof + # Run a single arbitrary test not involving recursion through bb.js for UltraHonk + RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh 6_array + # Run a single arbitrary test not involving recursion through bb.js for GoblinUltraHonk + RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array + # Run a single arbitrary test not involving recursion through bb.js for full Goblin + RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array + # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. + RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul + # Run double_verify_proof through bb.js on chrome testing multi-threaded browser support. + # TODO: Currently headless webkit doesn't seem to have shared memory so skipping multi-threaded test. + RUN BROWSER=chrome THREAD_MODEL=mt ./run_acir_tests_browser.sh double_verify_proof + # Run 1_mul through bb.js on chrome/webkit testing single threaded browser support. + RUN BROWSER=chrome THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul + # Commenting for now as fails intermittently. Unreproducable on mainframe. + # See https://github.com/AztecProtocol/aztec-packages/issues/2104 + #RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul From f1f526f9df4c2a3603b76eeb7a6d98773994c1ad Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 22 May 2024 17:32:29 -0400 Subject: [PATCH 2/5] Update Earthfile --- noir/Earthfile | 84 -------------------------------------------------- 1 file changed, 84 deletions(-) diff --git a/noir/Earthfile b/noir/Earthfile index fbe55a156b4f..bed6e934b42a 100644 --- a/noir/Earthfile +++ b/noir/Earthfile @@ -259,87 +259,3 @@ bench-publish-acir-bb: RUN docker run -v "$(pwd)/log":/log -e LOG_FILE=/log/bench-acir.jsonl --rm aztecprotocol/barretenberg-acir-benches:$AZTEC_DOCKER_TAG ./bench_acir_tests.sh sha256 DO ../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH - -barretenberg-acir-tests-bb: - FROM ../build-images/+build - - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - COPY +build-acir-tests/ /usr/src/acir_artifacts - - WORKDIR /usr/src/barretenberg/acir_tests - RUN rm -rf ./acir_tests - - ENV TEST_SRC /usr/src/acir_artifacts - ENV VERBOSE=1 - # Run every acir test through native bb build prove_then_verify flow for UltraPlonk. - # This ensures we test independent pk construction through real/garbage witness data paths. - RUN FLOW=prove_then_verify ./run_acir_tests.sh - # Construct and separately verify a UltraHonk proof for a single program - RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof - # Construct and separately verify a GoblinUltraHonk proof for all acir programs - RUN FLOW=prove_then_verify_goblin_ultra_honk ./run_acir_tests.sh - # Construct and verify a UltraHonk proof for a single program - RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh double_verify_nested_proof - # Construct and verify a Goblin UltraHonk (GUH) proof for a single arbitrary program - RUN FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array - # Construct and verify a UltraHonk proof for all ACIR programs using the new witness stack workflow - RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh - # This is a "full" Goblin flow. It constructs and verifies four proofs: GoblinUltraHonk, ECCVM, Translator, and merge - RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array - # Run 1_mul through native bb build, all_cmds flow, to test all cli args. - RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul - -barretenberg-acir-tests-sol: - FROM ../build-images/+build - - COPY ../barretenberg/cpp/+preset-sol/ /usr/src/barretenberg/cpp/build - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - COPY ../barretenberg/+sol/ /usr/src/barretenberg/sol - COPY +build-acir-tests/ /usr/src/acir_artifacts - - WORKDIR /usr/src/barretenberg/acir_tests - - ENV TEST_SRC /usr/src/acir_artifacts - ENV VERBOSE=1 - - RUN (cd sol-test && yarn) - RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh assert_statement double_verify_proof double_verify_nested_proof - -barretenberg-acir-tests-bb.js: - # Playwright not supported on base image ubuntu:noble, results in unmet dependencies - FROM node:18.19.0 - RUN apt update && apt install -y curl jq lsof - - COPY ../barretenberg/ts/+build/build/ /usr/src/barretenberg/ts - COPY ../barretenberg/+acir-tests/ /usr/src/barretenberg/acir_tests - COPY +build-acir-tests/ /usr/src/acir_artifacts - - WORKDIR /usr/src/barretenberg/acir_tests - - # Build/install ts apps. - RUN cd browser-test-app && yarn && yarn build - RUN cd headless-test && yarn && npx playwright install && npx playwright install-deps - RUN cd ../ts && yarn - ENV VERBOSE=1 - ENV TEST_SRC /usr/src/acir_artifacts - - # Run double_verify_proof through bb.js on node to check 512k support. - RUN BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_acir_tests.sh double_verify_proof - # Run a single arbitrary test not involving recursion through bb.js for UltraHonk - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for GoblinUltraHonk - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin_ultra_honk ./run_acir_tests.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for full Goblin - RUN BIN=../ts/dest/node/main.js FLOW=prove_and_verify_goblin ./run_acir_tests.sh 6_array - # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. - RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul - # Run double_verify_proof through bb.js on chrome testing multi-threaded browser support. - # TODO: Currently headless webkit doesn't seem to have shared memory so skipping multi-threaded test. - RUN BROWSER=chrome THREAD_MODEL=mt ./run_acir_tests_browser.sh double_verify_proof - # Run 1_mul through bb.js on chrome/webkit testing single threaded browser support. - RUN BROWSER=chrome THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul - # Commenting for now as fails intermittently. Unreproducable on mainframe. - # See https://github.com/AztecProtocol/aztec-packages/issues/2104 - #RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul From 25875a619519483630a24fc6ce7299295e11be96 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 22 May 2024 17:49:57 -0400 Subject: [PATCH 3/5] Update ci.yml --- .github/workflows/ci.yml | 116 +++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d77c85d3e02..89ee90e1ac2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,6 +244,61 @@ jobs: timeout-minutes: 40 run: earthly-ci --no-output ./+test + noir-build-acir-tests: + needs: build + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: build-acir-tests-x86 + - name: "Build Acir Tests" + timeout-minutes: 40 + run: earthly-ci --no-output ./noir/+build-acir-tests + + bb-acir-tests-bb: + needs: noir-build-acir-tests + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: barretenberg-acir-tests-bb-x86 + - name: "BB Native Acir Tests" + working-directory: ./barretenberg/ + timeout-minutes: 40 + run: earthly-ci --no-output ./+barretenberg-acir-tests-bb + + bb-acir-tests-sol: + needs: noir-build-acir-tests + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: barretenberg-acir-tests-sol-x86 + - name: "BB Solidity Acir Tests" + working-directory: ./barretenberg/ + timeout-minutes: 40 + run: earthly-ci --no-output ./+barretenberg-acir-tests-sol + + bb-acir-tests-bb-js: + needs: build-acir-tests + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: barretenberg-acir-tests-bb-js-x86 + - name: "BB JS Acir Tests" + working-directory: ./noir/ + timeout-minutes: 40 + run: earthly-ci --no-output ./+barretenberg-acir-tests-bb.js + noir-format: needs: setup runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 @@ -353,61 +408,6 @@ jobs: timeout-minutes: 40 run: earthly-ci --no-output ./yarn-project/+prover-client-test - build-acir-tests: - needs: build - runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ env.GIT_COMMIT }}" } - - uses: ./.github/ci-setup-action - with: - concurrency_key: build-acir-tests-x86 - - name: "Build Acir Tests" - timeout-minutes: 40 - run: earthly-ci --no-output ./noir/+build-acir-tests - - barretenberg-acir-tests-bb: - needs: build-acir-tests - runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ env.GIT_COMMIT }}" } - - uses: ./.github/ci-setup-action - with: - concurrency_key: barretenberg-acir-tests-bb-x86 - - name: "BB Native Acir Tests" - working-directory: ./noir/ - timeout-minutes: 40 - run: earthly-ci --no-output ./+barretenberg-acir-tests-bb - - barretenberg-acir-tests-sol: - needs: build-acir-tests - runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ env.GIT_COMMIT }}" } - - uses: ./.github/ci-setup-action - with: - concurrency_key: barretenberg-acir-tests-sol-x86 - - name: "BB Solidity Acir Tests" - working-directory: ./noir/ - timeout-minutes: 40 - run: earthly-ci --no-output ./+barretenberg-acir-tests-sol - - barretenberg-acir-tests-bb-js: - needs: build-acir-tests - runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ env.GIT_COMMIT }}" } - - uses: ./.github/ci-setup-action - with: - concurrency_key: barretenberg-acir-tests-bb-js-x86 - - name: "BB JS Acir Tests" - working-directory: ./noir/ - timeout-minutes: 40 - run: earthly-ci --no-output ./+barretenberg-acir-tests-bb.js - l1-contracts-test: needs: setup runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 @@ -507,9 +507,9 @@ jobs: - yarn-project-formatting - yarn-project-test - prover-client-test - - barretenberg-acir-tests-bb-js - - barretenberg-acir-tests-bb - - barretenberg-acir-tests-sol + - bb-acir-tests-bb-js + - bb-acir-tests-bb + - bb-acir-tests-sol - noir-test - noir-projects - l1-contracts-test From b46f5b13106e6164071f7d9e7de46f0c9b7ed1ca Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 22 May 2024 17:54:12 -0400 Subject: [PATCH 4/5] Update ci.yml --- .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 6bef2167c370..03ad45502d8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -286,7 +286,7 @@ jobs: run: earthly-ci --no-output ./+barretenberg-acir-tests-sol bb-acir-tests-bb-js: - needs: build-acir-tests + needs: noir-build-acir-tests runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 steps: - uses: actions/checkout@v4 From a8cc7783f2fe2a2642330bf5152f12f1485960a3 Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 22 May 2024 18:09:37 -0400 Subject: [PATCH 5/5] fix --- .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 03ad45502d8d..82fcb645ce41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -295,7 +295,7 @@ jobs: with: concurrency_key: barretenberg-acir-tests-bb-js-x86 - name: "BB JS Acir Tests" - working-directory: ./noir/ + working-directory: ./barretenberg/ timeout-minutes: 40 run: earthly-ci --no-output ./+barretenberg-acir-tests-bb.js