Repository navigation
fix(testrun): count only the flock wait in the GPU line's 'waited' (#968) - #1037
Conversation
|
Final check (independent, first review): PASS ae46476 Reviewer: R2a, a Cursor-session review agent. It is neither the builder nor the orchestrator.
|
|
Second review (adversarial): FAIL ae46476 Adversarial second review (R2b; did not build this change). The script fix is sound. The test change re-creates the CI flake in a different assertion. Required change
Checked (measured)
|
…GPU waited cases on their own (#968) Signed-off-by: Jayden Vasquez <jaydenvasquez1711@gmail.com>
|
FAIL 89964cd Independent final check (R2c; did not build this change). The fix to Required changes
Checked (measured)
|
|
Second review (adversarial): FAIL 89964cd Adversarial second review (R2d; did not build this change). R2b's item is resolved (measured). Three changes are required.
Checked (measured)
|
|
PASS f3e3c26 Independent final check (R2e; I did not build this change).
Required: none. Optional: a test for the branch where root's file is unreadable. |
|
Second review (adversarial): FAIL f3e3c26 Adversarial second review (R2f; I did not build this change). Every item R2c and R2d required is resolved and CI is green, but the new timeout-cause check in Required
Prior items (measured)
Checked (measured)
Mutants (measured)
Optional
|
… out (#968) Signed-off-by: Jayden Vasquez <jaydenvasquez1711@gmail.com>
|
PASS 31f1e4a Independent final check (R2g; I did not build this change). R2f's required item is fixed. When root lowers R2f's required item: root lowers
Mutants against
Whole-PR checks (measured)
Diff hygiene (inferred, from reading
Required changes: none. Optional: add a test where root raises |
|
Second review (adversarial): FAIL 31f1e4a Adversarial second review by R2h. I did not build this change. The fixes in both helpers and in Required
Optional
What I checked
|
…d the unit's max after a slow setup (#968) Signed-off-by: Jayden Vasquez <jaydenvasquez1711@gmail.com>
|
PASS 3a807e7 Final check (independent): R2i. I did not build this change. I reviewed the whole diff against Both of R2h's required items are fixed (measured). Each mutant below was applied in my worktree, rebuilt with
At this head (measured). Every suite was run as
The new tests don't look timing-flaky.
CI at this head (measured,
Diff hygiene (inferred, from reading the diff).
Required changes: none. Optional (inferred, carried from R2h): if root changes |
|
Second review (adversarial): PASS 3a807e7 Adversarial second review by R2j. I did not build this change. I reviewed head Required changes: none. The changes to both helpers and to Mutants (measured). For each one I applied the change in my scratch worktree, rebuilt with
Fail-before (measured). I took
After restoring the head's files, all three pass. Timing flakiness
CI parity (measured)
PR CI at head (measured, from
Other checks (inferred, from reading the code)
Optional
|
|
Owner decision (recorded by the coordinator, at the owner's instruction): the engine weakening scan's flag on this PR at 3a807e7 is not a weakening. The flag is for platform skips on 8 new tests (bash 4/GNU tools, POSIX or perl missing), which Linux CI runs. No existing test or assertion changed. It may merge under |
What
The test-run helper's GPU line (
worklane-testrun: gpu <N> (devices …; max <s> s; waited <s> s)) now reports aswaitedonly the seconds spent inflock, summed across the run's GPUs. Before, it was the span from beforegpu_lock, so it also counted each lock file's setup (about 14 forks: id, stat, mkdir, chgrp, chmod…).Closes #968.
Why
CI flake on PR #920 (run 39555627878): "GPU on for the instance" saw
waited 3 son an uncontended per-test lock because the runner stalled during lock-file setup. The docs and the test describewaitedas the wait for the lock alone. No check is weakened: the[01]assertion stays as it is, and the wait still counts against the run's timeout (runtime is still computed fromstarted).How verified
gpuHelper()'sstatstub sleeps 0.6 s for each stat of a lock path under the test's temprun/(about 3 s in total).node --import ./dist/test/isolate.js --test dist/test/testrun-gpu-helper.test.jsgave 7 pass, 1 fail (… max 57 s; waited 3 s)).testrun-gpu-helper,testrun-gpu,helper-protocolandtestrun-sandboxgave 59/59 pass.bash -non the script passed;npm run typecheckwas clean;npm run check:denylistwas clean (1628 files). shellcheck isn't installed on this machine, so it was not run.What remains
left <= 40 - waited) is looser, because waited no longer includes setup time. The direction is safe.Critical set
In:
scripts/machine/root helper (setup and machine scripts). Needs an independent final check and an adversarial second review, both naming this head.Built in a Cursor-coordinated session (normal development, not the installed coordinator).
Round 2 (head 89964cd)
max 60 s,60 sand59 sin three runs, against the>= 55check.waited [01] s. With main's script: 9 pass, 1 fail (max 57 s; waited 3 s). At head: 10/10.waited >= 2. WithGPU_WAITED=instead of+=: 9 pass, 1 fail (waited 0 s). At head: 10/10.merge-policy56/56,change-files-renames63/63,changelog27/27,owner-terminal-removed8/8. The push gate is clean.Round 3 (f3e3c26)
Answers R2c and R2d (both FAIL at 89964cd).
worklane-exp.sh'sgpu_lockis byte-identical to the test-run helper's again, which fixes CI shard 1/4's "one GPU lock…" test. The job record'swaited_sis nowGPU_WAITED. Measured: with the helper reverted, 10 pass and 2 fail (waited_s 3, plus the byte-identity test); at head, 12/12.waited >= 5. Measured: the=and keep-the-longest mutants both fail (waited 3 s); with a 3 s setup stall per lock file, 3 of 3 runs pass (waited 6 s, from an uncommitted probe copy of the compiled test).src/testrun/run.tsnames the GPU'smax_minutesas a timeout's cause only when the opt-in ison, the unit's max equalsmax_minutes× 60, and it is undertimeout_s. Measured: a new uncapped-timeout test fails withrun.tsreverted (23 pass, 1 fail) and passes at head (24/24).coordinator(142 pass, 0 fail, 4 skip, run with--test-timeout=400000and the sandbox cache variables unset), typecheck and denylist all pass.Round 3 (R2f)
max_minutesmid-run: the helper reads root's file for each GPU command, but the coordinator only read it once, at the run's start. When a granted GPU tier times out,src/testrun/run.tsnow reads root's file again. The GPU's max_minutes is named as the cap when the unit's max equals either reading × 60 and is undertimeout_s. With neither readingon, it uses the old comparison.; <note>field would swallow a new marker. The helper is versioned (PROTOCOL=11), so a format change would need a bump and a root reinstall on every machine. Already-installed helpers would never send it, so the fallback is needed regardless.f3e3c26c'srun.ts(25 pass, 1 fail: "after 30 min (its timeout_s …, 1800)") and passes at head (26/26).max_minutesbelowtimeout_s, and the unknown-file fallback. On main'srun.ts, 2 tests fail ("after 23.3 min (the GPU runs' max_minutes …, 1400)").origin/main..HEADis clean. The CI-parity lints, the testrun and experiments tests,coordinator(146 tests, 142 pass, 4 skipped, with the cache variables unset), typecheck and denylist all pass.Round 4 (R2h)
The cap the helper read. A new testrun-runs test covers root changing
max_minutesafter the helper read it, withtimeout_s1800:[d.gpuOptIn?.()]) and the minimum mutant (g.maxS === Math.min(...rootMaxS)) each fail it, with 26 pass, 1 fail ("after 30 min (its timeout_s …, 1800)").A held experiment lock. The experiments-helper
flockstub now sleeps 3 s on-w, and a new test assertswaited_s >= 2.waited=0inworklane-exp.shfails it, with 12 pass, 1 fail (waited_s 0).The unit's max after a slow setup. The slow-setup test also asserts
max <= 57.runtime=$((timeout - GPU_WAITED))fails it (max 60 s).Other checks (measured). Head passes all of these. The push gate over
origin/main..HEADis clean. The CI-parity lints, the testrun, experiments and helper tests, typecheck and denylist all pass.