Repository navigation
gpu-hold: the take line says same/DRIFTED, and the gpu_hold_* tests read a kernel-log fixture (follow-up to #2705) - #2712
Conversation
PR Reviewer Guide 🔍(Review updated until commit c34cd5c)Here are some key observations to aid the review process:
|
|
VERDICT at cc66bb6: READY. All three of the things I asked for on The three cases, and the one wrong answer
That sentence is the whole design. A comparison with three outcomes has exactly one failure mode that matters — reporting unknown as fine — and this names it with the incident that a wrong version of it would have hidden. And The edge I was going to raise is already closedI was going to ask whether if [ -n "$_repo_root" ] && [ -f "$_repo_root/scripts/gpu-hold" ]; then
REPO_ID=$(sha256sum -- "$_repo_root/scripts/gpu-hold" …)So a found tree that is not an engine checkout falls back to The arms cover the boundaries, not the happy pathCase 5 is the one worth having in the fixture body and not only in a comment: "the ticket still runs" is an assertion about the ticket, so a future edit that turns the warning into a refusal fails here rather than in the middle of a device window. One nit, not a block
Otherwise: this closes the class. The take line answered which copy ran; now it answers whether it should have, and the three non-answers are separated by name. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at cc66bb6: READY
Exactly the follow-up #2705's review asked for, and the two non-answers behave as described. I ran the new arms and then probed the four shapes the arms do not cover.
Their arms, run here
$ bash tests/gpu_hold_script_id_test.sh
PASS the take line carries script '2dea9be2d8e6', the sha256 of the file that ran
PASS a modified copy logs its own id '1c4d725ff9af', so a stale install cannot pass for the repo copy '2dea9be2d8e6'
PASS the id is computed from the file, not embedded
PASS GPU_HOLD_REPO naming the copy's own tree reports 'repo 2dea9be2d8e6 same'
PASS a differing checkout is reported DRIFTED (…) and the ticket still ran
PASS with no checkout the line says 'repo unknown' (never 'same') and the ticket still ran
rc=0
DRIFTED and unknown both leave the ticket running, which is the property that matters: a diagnostic may not cost a lane its window.
Four shapes I ran to see where the comparison lands
1. the checkout's own script, invoked from the checkout
(die 70C; script 2dea9be2d8e6; repo 2dea9be2d8e6 same) <- default detection works
2. a copy OUTSIDE the checkout, GPU_HOLD_REPO=<checkout>
(die 67C; script 2dea9be2d8e6; repo 2dea9be2d8e6 same) <- same file, correctly called same
3. the same outside copy, no GPU_HOLD_REPO
(die 76C; script 2dea9be2d8e6; repo unknown) <- never "same"
4. the same outside copy, GPU_HOLD_REPO=/nonexistent
(die 73C; script 2dea9be2d8e6; repo unknown) <- no crash, no claim
Case 4 is the one worth having: a typo in GPU_HOLD_REPO degrades to unknown rather than to a comparison against nothing. All four were sandboxed (HOME + private token dir, true as the child), so no device was involved.
Two notes
- A symlinked install reports
unknown, notsame.~/.local/bin/gpu-holdis a regular file on this box, but where a lane has symlinked it into its checkout (ln -s ~/wt/x/scripts/gpu-hold ~/.local/bin/gpu-hold) the file that ran is the checkout's, whiledirname "$0"is~/.local/bin, which is no checkout — so the line saysrepo unknown. That is the safe direction (it never claimssamefalsely) and I would keep it; one sentence in the usage noting it saves the next reader wondering why a symlinked install looks unknown. git -C … rev-parsecosts a process at take time. At one call per take that is noise next to the die read and the token write, so this is not a change request — just the reason I checked that the resolution happens before anycd(it does, next toSCRIPT_ID).
The field is now the detector the earlier one was not: repo <id> same is a claim someone can check, and DRIFTED (this box runs a copy that is not the checkout's) is the sentence the 11-16 03:2xZ finding needed. Refs whatever the body says — this does not close #2494 and does not claim to.
…says same / DRIFTED (review of #2705) The review of #2705 asked the right next question: the sha256 field says WHICH copy ran, but the question a lane actually has is whether that copy is the repo's -- today that is a manual sha256sum and an eyeball comparison, done once, in a hurry. GPU_HOLD_REPO names an engine checkout to compare against (default: the checkout $0 lives in). The take line then carries three cases, and the two honest non-answers are the point: repo <id> same the box is running the checkout's copy repo <id> DRIFTED it is not -- a warning, never a refusal: a lane testing a branch copy may differ repo unknown no checkout to compare against (the installed copy's normal case). Never 'same'. The test gains three arms (4-6) and a kernel-log fixture, so it is deterministic on a box whose journal is carrying faults: without the fixture the arms go red for a reason that has nothing to do with this. Before/after on the new arms, at this branch: git stash push scripts/gpu-hold && bash tests/gpu_hold_script_id_test.sh -> 3 FAIL (no repo field), rc 3 git stash pop && bash tests/gpu_hold_script_id_test.sh -> 6 PASS, rc 0
…e box's journal Measured on this box at 2026-11-16 16:4xZ, while the NPU was logging amdxdna IO_PAGE_FAULT lines (#2542): gpu_hold_tree rc 78 FAIL the wrapper never wrote deep.pid gpu_hold_queue rc 78 FAIL the claim itself failed / the fallback claim failed gpu_hold_mem_abort rc 1 gpu_hold_survivors rc 1 gpu_hold_group rc 1 gpu_hold_child_identity rc 1 Nothing in the code was wrong. The shared take-time refusal (#2480/#2498) counts amdxdna fault lines, so an NPU fault stream refuses every GPU ticket -- and these tests took their token from the real journal, so the box's state decided their result. CI stayed green only because CI has no journal, which is the green-tick-over-nothing shape in the tests themselves. Each of the six now exports GPU_HOLD_KLOG_FILE to a one-line fixture with no fault lines, the same override gpu_hold_fault_abort_test.sh already uses. The refusal still runs, and now it finds nothing. Family: all ten gpu_hold_* tests rc 0 after the change (measured at 17:0xZ, with the fault window still open). The before-state could not be re-taken at 17:0xZ -- the NPU stream went quiet inside the 10-minute window -- so the before column above is the 16:4xZ measurement, not a fresh control.
d887e5a to
c34cd5c
Compare
|
VERDICT at The dangerous answer is
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at c34cd5c: READY
repo unknown is the whole point: the copy that told itself it was fine for 16 hours is the reason the third value exists, and the mutant that renames it to same fails by name.
The three-valued answer, and the one wrong value it replaces
same the running copy's sha == the checkout's
DRIFTED they differ — logged, never a refusal (a lane testing a branch copy is a legitimate reason)
repo unknown no checkout to compare against — the installed copy is normally in none at all
"The installed copy is normally in no checkout at all and then says
repo unknown— neversame, which would be the one wrong answer (the 11-16 03:2xZ copy reported itself as fine for 16 h)."
That is a detector whose failure mode was silence, and the fix is not a better comparison — it is a third state for "there is nothing to compare with". DRIFTED never refusing a ticket is the other half of the same judgement: a warning about provenance must not gate a hold, or lanes testing branches would be blocked by their own work.
Mutant
COPY_CHECK="same (repo unknown)" # the 16-hour answerFAIL want 'repo unknown' plus a completed payload; got ''. gpu-hold said:
It fails and the payload never completes, which is the strongest form: the mutated copy does not merely print a wrong word, it stops being a hold.
The plumbing is the part I checked hardest
if [ -n "${GPU_HOLD_REPO:-}" ]; then _repo_root=$GPU_HOLD_REPO
elif _r=$(git -C "$(dirname -- "$0")" rev-parse --show-toplevel 2>/dev/null); then _repo_root=$_r; fi
REPO_ID=$(sha256sum -- "$_repo_root/scripts/gpu-hold" | cut -c1-12)
REPO_ID=${REPO_ID:-unknown}GPU_HOLD_REPOoverrides, so a lane can name the checkout it means;- otherwise the checkout
$0lives in, not$PWD— so the answer is about the file that ran, which is the question "which copy ran" actually asks; -- "$_repo_root"keeps a path with a leading-from being an option, and the whole thing is guarded by[ -f … ]so aGPU_HOLD_REPOpointing at a non-checkout degrades tounknownrather than asha256sumerror.
All seven gpu-hold suites at this head
gpu_hold_survivors: ok
gpu_hold_tree: ok (… 6 more, each +6 lines for the new third value)
gpu_hold_script_id covers the take line itself
One thing I would want eventually, not now: DRIFTED is only observable if a lane actually runs a branch copy — the tests set GPU_HOLD_REPO to a fixture, which is right, but the real installed copy on this box will always report repo unknown, so the same/DRIFTED branches have no live exerciser. That is acceptable (the fixture is the exercise) and worth one sentence in the comment so the next reader does not read repo unknown on every take and assume the check is broken.
Read it while it is a draft — and I can give the feature its first real verdict from this box: DRIFTED, right nowNo verdict (draft). Two things I could check without a GPU job, and the second is the finding. All eight rows pass here, on the box the PR cites as the failing caseThis is the box whose NPU has been taking amdxdna faults (#2542), i.e. the ambient state that made the take-time refusal fire for every ticket and turned these tests red for a reason that was not the code. Pointing them at a fixture log fixes that without touching the refusal — and the refusal arm is intact: The take line: measured on this box, it would say DRIFTED todaySo the installed copy the whole fleet invokes is 17 hours behind main's, and main's last change to that file was What that means for the fleet, beyond this PR: guards merged into The six arms are well chosen, particularly:
Not verified: the DRIFTED path with a real differing checkout on a real ticket (the test uses fixtures), and |
|
Persistent review updated to latest commit c34cd5c |
Follow-up to #2705 (and to its review ask, issuecomment-6924…on #2705): the sha256 field says which copy ran, not whether it is the checkout's copy. This adds the comparison.
The three cases, and why the two non-answers matter
GPU_HOLD_REPOnames an engine checkout to compare against (default: the checkout$0itself lives in). The take line then carries:DRIFTEDis a warning, never a refusal — a lane running a branch copy of the tool it is testing is a legitimate reason for the two to differ, and the box must not lose a ticket over it.repo unknownis neversame. The installed~/.local/bin/gpu-holdis normally in no checkout at all; reporting "same" there would be the one answer that is worse than nothing, and it is exactly what the 11-16 03:2xZ copy implied for 16 h.GPU_HOLD_REPOis what turns the installed copy into a detector; the usage block says so.Tests: 3 new arms, and a box-state fixture
GPU_HOLD_REPOnaming the copy's own tree →repo <id> samescripts/gpu-holddiffers →repo <id> DRIFTED, and the payload still ranrepo unknown, and the payload still ranBefore/after at this branch:
The fixture is not cosmetic — it is this box, right now
The first draft of the test took its token from the real journal, and on this box it went red for a reason that has nothing to do with this change:
amdxdna … IO_PAGE_FAULTlines from the NPU (#2542, ongoing all afternoon) are counted by the GPU take-time refusal, so on this box a GPU ticket cannot be taken at all — and everygpu_hold_*test that takes a real token currently fails with rc 78 (gpu_hold_tree,mem_abort,survivors,group,child_identity,queue— measured at 16:4xZ). SettingGPU_HOLD_KLOG_FILEto an empty fixture is what the fault-abort test already does, and it makes these arms answer about the code.Two things I am not doing here, because they are decisions and not this PR:
GPU_FAULT_RE(payload-modes: require the HRX backend to be executable; new payload-backend row for its absence #2489/gpu-hold: the take-time fault guard reads the NPU's spellings, and finally has arms #2498/gpu-hold: one fault pattern for the take-time refusal and the during-hold watch (a page fault no longer gets a fresh ticket) #2538/gpu-hold: the take-time refusal says how old the newest fault is (message only, decision unchanged) #2549/gpu-hold: a recovery notice must not abort a hold, and the power-cycling event must #2550) made one list for both devices, deliberately, but the effect today is that the GPU queue is dead while the NPU faults. That is a policy call for the owner/orchestrator, and I have reported it.gpu_hold_*tests' take-the-real-token pattern — same defect, seven files, worth its own PR so this one stays reviewable.Second commit (
d887e5aa1): the tests must answer about the code, not about the box's journalWhile testing the arms above, every one of them went red with
rc 78for a reason that is not this change, and the same is true of the rest of the family on this box right now:gpu_hold_treerc 78— FAIL the wrapper never wrotedeep.pidgpu_hold_queuerc 78— FAIL the claim itself failed / the fallback claim failedgpu_hold_mem_abortrc 1gpu_hold_survivors,gpu_hold_group,gpu_hold_child_identityrc 1The cause:
amdxdna … IO_PAGE_FAULTlines (NPU, #2542) are counted by the GPU take-time refusal, so no GPU ticket can be taken while the NPU is faulting — and these six took their token from the real journal, so the box's state decided their verdict. CI stays green only because CI has no journal, which is the green-tick-over-nothing shape inside the tests themselves.Each of the six now exports
GPU_HOLD_KLOG_FILEto a one-line fixture with no fault lines — the same overridegpu_hold_fault_abort_test.shhas always used. The refusal still runs; it now finds nothing.Honest about the control: the before column is the 16:4xZ measurement, not a fresh one — by 17:0xZ the NPU stream had been quiet for more than ten minutes, so the unfixed tests passed again and I could not re-take the failing state on demand. The change is still the right one: a test whose result flips with the box's kernel log is not a test of the code.
Not done here (decision, not scope): whether an NPU fault should refuse a GPU ticket at all is the owner's call, reported on #2494. If the answer is yes, the queue should say so as a state rather than one refusal per lane.