Repository navigation
gpu-gate: the cancellation self-tests signal once the timeout sleeps past its fork - #1035
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: No behavior or contract defect was found in the changed self-tests.
Checked
Duplicates: 0 new functions, types or constants; the waits reuse cancel_ready. No dryer pairs were available.
Complexity: no Rust functions changed; the added shell branches wait for monitor readiness.
Silent failure: 3 readiness probes followed through retries, safety bounds and the final exit-code and cleanup assertions.
Tests (static mutation check): dropping signal forwarding at tools/gate-bound.sh:195 breaks the held-run, watched-run and library exit-code assertions. Adding a cancel before the return at tools/boxq.py:575 fails the revised cancel-log assertion; its matcher was checked in memory against cancel, poll and tail commands.
Validation: all 3 changed scripts pass bash -n; the changed Python fixture parses.
Gates: the cancel-log matcher has a dated PIN and a false-positive reason. Expected exits 7 and 23 remain unchanged.
Escape catalog: no C1–C4 pattern matched the changed code.
Notes
Dryer and crapper did not run because no Rust file changed. Full self-tests were not run during this review.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
gpu-gate.sh --self-test의 취소 테스트가 GNU timeout 9.4에서 가끔 exit 7 대신 143을 받던 경합을 고쳤습니다.What and why
tools/gpu-gate.sh --self-testsometimes failed in CI because a cancelled run reported 143, where the test expects the binary's own code (7 for the held-run cases, 23 for the lib-path signal case). The cause is a race in GNU coreutilstimeoutbefore 9.5, which is what Ubuntu 24.04 ships (9.4). The cases signalled the outertimeoutas soon as the stub printedup, but that line does not meantimeouthas returned from itsfork(). A signal that arrives before it returns is not forwarded: 9.4'scleanup()runs_exit (128 + sig)when it has no child pid yet, and 9.5 fixed that.The two cases now send the signal only after
timeoutis asleep, which is after its fork has returned. They reusecancel_readyfromtools/ref/cancel-stubs.sh, which the held-run case already needed for the watch cases. The expected codes are unchanged, and 143 is never accepted.tools/gate-bound.shgets one comment sentence that says GNUtimeoutbefore 9.5 reports 143 for a TERM that comes before its fork returns, and that the group TERM ends the child.Release notes: internal: the gpu-gate self-test no longer fails on runners with GNU timeout before 9.5.
Code shape
cancel_readyfromtools/ref/cancel-stubs.sh; no new helper.timeoutasleep ends at the existing failsafe bound and the case then fails.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line): none.What I ran
The race, on a DGX Spark with GNU
timeout9.4 (Ubuntu 24.04), with threeyesloops and a small script pinned to one core (taskset -c 0). The script startstimeout 100 <stub>, where the stub traps TERM withexit 7, waits for the stub'supline, sendstimeoutone TERM and counts the exit codes. The first two rows signal onup, which is what the cases did. The last row also waits untiltimeoutis asleep (process stateS), which is what the cases do now:The changed cases, on the head, on an RTX 5090 machine (GNU
timeout9.7, so the race itself does not occur there), under CPU contention (taskset -c 0,1,GPU_GATE_SELFTEST_LOAD=6):The held-run cases on a DGX Spark with GNU
timeout9.4,--self-test --part 1four times each on the base and on the change, same contention: all eight runsrc=0, both held-run casesok.The change touches only self-test code and a comment, so no card gate applies.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.