Conversation
…per test Each `nargo test --exact <test>` process elaborates the whole package before running its one test, which is most of the ~15s every aztec-nr and noir-contracts test takes. Run the tests as chunks of up to 64 per (package, kind) in one nargo process each, so the package is elaborated once per test thread instead of once per test: 45 commands instead of 1,040. Batched runs load the TXE far more heavily, so CI runs 4 TXEs. Commands carry the TXE port range and the runner picks a TXE at random, keeping the port out of the cache key. The chunking scripts are part of the test hashes.
…CPU budget Run each chunk on CPUS test threads, which the test engine defaults to 2 with one command per 2 CPUs, instead of 4. A chunk then uses no more CPU than the single-test command it replaces, so the chunked layout does not rely on cores the engine does not budget for. On an equal 32-core budget it still runs the suite in 132-160s against 836s for one process per test.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runs the TXE-backed noir tests (aztec-nr and noir-contracts) as 45 chunks of up to 64 tests each, one nargo process per chunk, instead of 1,040 nargo processes with one test each. Also raises CI's TXE count from 1 to 4.
Why
Each
nargo test --exact <test>process parses and type-checks the whole package before running its single test. That costs ~13s of the ~15s average per test (a trivial test that makes no oracle calls takes 12.9s locally). On a PR that touches anything in the TXE's import closure, every one of these tests reruns: on a recent PR run (1790153506230403) they took 13,779 CPU-s of the test engine, ~28% of its total, and ran at the end of the run after the build. In a single process nargo elaborates the package once per test thread, not once per test.What changes
noir-projects/scripts/test_chunks.shgroupsnargo test --list-testsoutput by (package, kind), where kind isoraclefor__oracle_test__tests andtxefor the rest, and splits each group into as few chunks as keep each at or under 64 tests.noir-projects/scripts/run_test_chunk.shlists the package's tests, selects the chunk's slice (sorted, dealt round-robin), and runs them in onenargo test --exact ... --test-threads min(CPUS, n)process.CPUSis the test engine's per-command budget (default 2, with one command per 2 CPUs), so a chunk stays within the CPU share a single-test command already had. It fails if the slice is empty.test_cmdsin aztec-nr and noir-contracts emit one command per chunk. Cache keys are unchanged: they were already shared per package (noir-contracts) or across all tests (aztec-nr). They now also covernoir-projects/scripts/.<base_port> <num_ports>, and the runner picks a TXE at random. The command line is the cache key, so a per-chunk port assignment would re-key chunks whenever the chunk list changes.NUM_TXES=4in the root bootstrap. Batched runs load the TXE much more heavily than per-test runs. With one TXE the batched run peaked at ~4.8 cores in the TXE and was TXE-bound (279s vs 223s with 4 TXEs). The CI box has ~430 GB free at its lowest point, and a TXE peaked at ~7 GB RSS.Measurements
Both layouts run through
ci3/parallelize 16→exec_teston the same 32 cores (tasksetandCPU_LIST), with the TXEs and resolver pinned to those cores too, so neither layout gets more CPU than the other:At equal budget the chunked layout is 5-6x faster and does ~10x less nargo work, with the same peak core usage. Its critical path is the largest contract packages, each a single chunk (
amm_contractandtoken_contract, ~105-120s). Most chunks finish well before them.In earlier exploratory runs on 64 cores, plain per-package runs (no chunking) were limited by
noir_aztec(623 TXE tests in one job, 222s even with 4 TXEs), which is why chunks are capped at 64 tests. With a single TXE, batched runs were TXE-bound.Running the runner against a stub
NARGOshows the chunks select exactly the 1,041 testsnargo test --list-testsreports, each once, with oracle tests only in oracle chunks.Trade-offs
ci-*modes (build_and_test); the subproject./bootstrap.sh testpaths still start one TXE. A TXE peaked at ~7 GB RSS here. No.test_patterns.ymlentry targets a noir test today.nargo test --no-context-reuse), so they are less isolated than one-process-per-test../bootstrap.sh test-onestill runs a single test in its own process.