fix(ci): give AVM check-circuit a workable timeout and CPU budget - #24959
fix(ci): give AVM check-circuit a workable timeout and CPU budget#24959AztecBot wants to merge 1 commit into
Conversation
be606f4 to
1af48e2
Compare
39a295f to
319af5b
Compare
|
Current failure matches this PR's root cause. Run 30327434657 failed in I rechecked the branch locally:
So today's red run is another occurrence of the same too-tight per-input CI budget addressed here. Created by claudebox · group: |
The multiple_blobs tx produces a ~700k row AVM trace and had been checking at 21-30s against a flat 30s per-input timeout, so ordinary CI variance was enough to abort the whole parallel run with exit 124. Raise the budget to 2m and give each check 4 CPUs / 16g, which brings the 16-way parallel run to total quota == nproc on the 64-vCPU CI instances instead of leaving half the box idle.
319af5b to
cdaf649
Compare
|
Tonight's failure is another occurrence of this PR's root cause, and it is the cleanest proof yet that the circuit is fine and only the budget is wrong. Run 30400452994 failed in No assertion, no OOM. Measured stages sum to ~26.4s (simulation 1.73s + tracegen 4.90s + check 19.75s) inside a 30s cap, and total wall clock landed on 30.0s — zero headroom, so spot-instance variance decides red vs. green. Four of the last five runs of this workflow have been red on this one input; the one green run took 31s wall. One correction to the PR body, now applied: earlier occurrences were killed mid-check at ~2.1 GiB peak, so this PR previously said memory was nowhere near the cap. Tonight's run got all the way through and peaked at 4.82 GiB against the 8g cap (60%). Memory still isn't the binding constraint, but it has less slack than stated, which makes the Re-verified on this branch in this session: The branch still merges onto current Created by claudebox · group: |
Re-evidenced against run 30400452994 (2026-07-28 21:53 UTC,
63aa610) — the fourth red run of this workflow in the last five. This PR consolidates the duplicate PRs opened for earlier occurrences. It is mergeable onto currentnextwith no rebase needed. One manual step is required to land it — see the last section.Problem
avm-check-circuitkeeps going red onnext. Exit code 124: a wall-clock timeout, not a circuit-check failure.Every dumped input but one checks in 1–4s. Exactly one blows its budget, and it is the same one every time:
Root cause
avm_check_circuit_cmdsgives every dumped input the same flat budget —TIMEOUT=30splus the harness defaultsCPUS=2/MEM=8g— but the inputs are wildly uneven. Almost all check in 1–4s. The heaviest is themultiple_blobstx, which by design emits a full-size public log and enough side effects to fill more than one blob; it produces a ~700k-row trace.The circuit is valid — the process is killed at the wall, not failing a check. Tonight's test log is the clearest instance yet: the check completed successfully and printed its full stats block, and the
timeoutwrapper fired in the same second, before the process could exit.The measured stages sum to ~26.4s of a 30s budget, and total wall clock lands on 30.0s. There is no headroom left at all — the run is decided by ordinary spot-instance variance. Because
parallelizeruns with--halt now,fail=1(ci3/parallelize), that one input aborts the whole run and turns the check red.Last five runs on
next:multiple_blobsheavy txThe trace did not grow and the AVM did not change. The row count is identical — 700560 — in the green run and in every red one; only the wall clock moves. The green→red boundary contains no
barretenberg/change, and tonight's head is an accumulated-ports commit that touches nothing in the AVM.The original
WARNINGcomment called this exact failure mode in advance: "theoretically, transactions could need more CPU and MEM than we allocate by default. In that case, they might start timing out."Fix
TIMEOUT=2mgives ~4x headroom over the worst observed run instead of 1.0x. The fast inputs still finish in 1–4s, so this costs nothing in the happy path. The timeout is a hang guard, not a performance assertion —parallelizeseparately warns on any test exceeding 5 minutes, so a real blowup still gets flagged.CPUS=4/MEM=16g(up from the defaults 2 / 8g).avm_check_circuitis CPU bound and the run was leaving half the box idle: this file callsparallelize 16, so at 2 CPUs each it used only 32 of the 64 vCPUs the CI instance reports. 16 × 4 = 64 restores total quota == nproc, the same ratioparallelizeassumes by default (jobs = num_cpus / 2atCPUS=2), and 64 vCPU is the floor of the spot fleet's instance pools.MEM=16gis now doing real work rather than being purely cosmetic. 16 × 16g sits well inside the 493 GiB the failing box reported.Testing
I could not run the failing command in this container to show red-then-green, and I am stating that plainly rather than implying a local repro: no barretenberg build, no AWS credentials for the input tarball in
s3://aztec-ci-artifacts/build-cache/, and the dumped inputs are regenerated per run.Verified directly against this branch in this session:
bash -O extglob -O globstar -n yarn-project/end-to-end/bootstrap.shpasses on the branch's version of the file.ci3/source_test_paramsresolves it toISOLATE=1 CPUS=4 MEM=16g TIMEOUT=2mwithtest_cmdintact — the harness reads the new fields as intended.timeout -v 2mis accepted by the coreutils build in the CI image's lineage.ci3/parallelizeto confirm the fail-fast (--halt now,fail=1) and 5-minute slow-test warning claims above.Real verification is the next run of this workflow on
next.This failure has recurred for months and the fix has never been reviewed
Worth a maintainer's attention more than the one-line diff:
git log --all -S'TIMEOUT=30s' -- yarn-project/end-to-end/bootstrap.shreturns 69 commits, and there are now 71cb/*avm*branches on the remote. Nearly all are bot attempts at this same fix since the line was introduced in #18747.next, the only commit that has ever touched that line is test(avm): e2e tests can optionally dump avm circuit inputs to files #18747 itself. No bump has ever landed.Each failure spawns a draft PR, the draft expires before anyone looks, and the next failure spawns another. Merging one of these ends the loop.
The one manual step: the stale-closer targets drafts, so this PR needs to be marked "Ready for review" or it will expire the same way its predecessors did. Claudebox has no tool that can un-draft a PR, so a human has to click it.
Note for reviewers
Targeting
nextdirectly rather thanmerge-train/spartan, whereyarn-project/**normally routes, because the check is red onnextnow and this only touches a CI resource budget.Separately, and deliberately not bundled here: bb sizes its thread pool from
min(32, std::thread::hardware_concurrency())(barretenberg/cpp/src/barretenberg/common/thread.cpp:17), which is not cgroup-quota aware. Tonight's log again showsnum threads: 32inside a container capped at--cpus=2— 32 threads contending for a 2-CPU quota, which invites CFS throttling stalls and is a plausible source of the run-to-run jitter on identical work.docker_isolatealready passesCPUSinto the container and bb already honours aHARDWARE_CONCURRENCYenv var, so aligning the two would be a small change. I left it out because I cannot measure the effect in this environment, and an unverified performance change does not belong in a CI unblock.Updated by claudebox for run 30400452994
Created by claudebox · group:
slackbot