diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml new file mode 100644 index 00000000000..1e912a05438 --- /dev/null +++ b/.github/workflows/vm_full_tests.yml @@ -0,0 +1,60 @@ +name: AVM Full Tests + +on: + schedule: + - cron: "15 4 * * 1-5" # Monday to Friday at 4:15 AM UTC + workflow_dispatch: + inputs: + username: + description: "Username (optional)" + required: false + action: + description: "Default to 'start'" + required: false + default: "start" + +concurrency: + # force parallelism in master + group: avm-full-tests-${{ github.ref }} + cancel-in-progress: true + +env: + DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}" + RUN_ID: ${{ github.run_id }} + RUN_ATTEMPT: ${{ github.run_attempt }} + USERNAME: ${{ github.event.pull_request.user.login || github.actor }} + GITHUB_TOKEN: ${{ github.token }} + GH_SELF_HOSTED_RUNNER_TOKEN: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }} + GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} + # kludge until we move away from runners + WAIT_FOR_RUNNERS: false + +jobs: + setup: + uses: ./.github/workflows/setup-runner.yml + with: + username: ${{ github.event.pull_request.user.login || github.actor }} + runner_type: builder-x86 + secrets: inherit + + # barretenberg (prover) native and AVM (public VM) tests + # only ran on x86 for resource reasons (memory intensive) + avm-full-tests: + needs: [setup] + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + # Only allow one memory-hunger prover test to use this runner + - uses: ./.github/ci-setup-action + with: + # must be globally unique for build x runner + concurrency_key: avm-full-tests-x86 + - name: "AVM Full Tests" + working-directory: ./barretenberg/cpp/ + timeout-minutes: 90 + # limit our parallelism to half our cores + run: earthly-ci --no-output +vm-full-test --hardware_concurrency=64 diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 831eb535d83..555b05e9b9b 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -247,6 +247,22 @@ test: END RUN cd build && GTEST_COLOR=1 ctest -j$(nproc) --output-on-failure +vm-full-test: + ARG hardware_concurrency="" + # prefetch + BUILD +test-binaries + BUILD +preset-release-assert-test + BUILD ./srs_db/+build # prefetch + FROM +source + COPY --dir +test-binaries/build build + FROM +preset-release-assert-test + COPY --dir ./srs_db/+build/. srs_db + # limit hardware concurrency, if provided + IF [ "$HARDWARE_CONCURRENCY" != "" ] + ENV HARDWARE_CONCURRENCY=$hardware_concurrency + END + RUN cd build && GTEST_COLOR=1 AVM_ENABLE_FULL_PROVING=1 ctest -j4 --test-dir src/barretenberg/vm --output-on-failure + build: BUILD +preset-wasm BUILD +preset-wasm-threads diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp index 40dde3ae6e9..1ff41a277cd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_common.hpp @@ -15,9 +15,8 @@ namespace bb::avm_trace { using Flavor = bb::AvmFlavor; using FF = Flavor::FF; -} // namespace bb::avm_trace - -namespace bb::avm_trace { +// To toggle all relevant unit tests with proving, set the env variable "AVM_ENABLE_FULL_PROVING". +static const bool ENABLE_PROVING = std::getenv("AVM_ENABLE_FULL_PROVING") != nullptr; // There are 4 public input columns, 1 for context inputs, and 3 for emitting side effects using VmPublicInputs = std::tuple, // Input: Kernel context inputs diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp index 9c9b157b48f..b0d86f4c5da 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_trace.hpp @@ -33,7 +33,7 @@ class AvmTraceBuilder { ExecutionHints execution_hints = {}, uint32_t side_effect_counter = 0); - std::vector finalize(uint32_t min_trace_size = 0, bool range_check_required = false); + std::vector finalize(uint32_t min_trace_size = 0, bool range_check_required = ENABLE_PROVING); void reset(); uint32_t getPc() const { return pc; } diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp index 6c8aa4fd068..cd7c010b94b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp @@ -21,16 +21,13 @@ using ThreeOpParam = std::array; using ThreeOpParamRow = std::tuple; using VmPublicInputs = bb::avm_trace::VmPublicInputs; -// To toggle all relevant unit tests with proving, set the env variable "AVM_TESTS_ENABLE_PROVING". -static const bool ENABLE_PROVING = std::getenv("AVM_TESTS_ENABLE_PROVING") != nullptr; - // If the test is expecting a relation to fail, then use validate_trace_check_circuit. // Otherwise, use validate_trace with a single argument. If the proving needs to be // enabled all the time in a given test, use validate_trace with setting with_proof = true. void validate_trace_check_circuit(std::vector&& trace, VmPublicInputs public_inputs = {}); void validate_trace(std::vector&& trace, VmPublicInputs const& public_inputs = {}, - bool with_proof = ENABLE_PROVING); + bool with_proof = bb::avm_trace::ENABLE_PROVING); void mutate_ic_in_trace(std::vector& trace, std::function&& selectRow, FF const& newValue, diff --git a/yarn-project/end-to-end/src/e2e_prover/full.test.ts b/yarn-project/end-to-end/src/e2e_prover/full.test.ts index cbcb387292c..bbc1c8b7404 100644 --- a/yarn-project/end-to-end/src/e2e_prover/full.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/full.test.ts @@ -7,6 +7,8 @@ const TIMEOUT = 1_800_000; // This makes AVM proving throw if there's a failure. process.env.AVM_PROVING_STRICT = '1'; +// Enable proving the full lookup tables (no truncation). +process.env.AVM_ENABLE_FULL_PROVING = '1'; describe('full_prover', () => { const t = new FullProverTest('full_prover', 2);