Skip to content

gpu-hold: refuse the ticket when the kernel log shows a recent amdgpu/MES reset (the rule had no implementation anywhere) - #2480

Merged
bong-water-water-bong merged 1 commit into
mainfrom
lane/hold-reset-guard
Nov 15, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
lane/hold-reset-guard

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

What

The standing rule is "on any amdgpu reset or amdxdna fault: stop, release the ticket, log time + command". Nothing implemented it. Measured tonight:

grep -cE 'dmesg|reset|MES'  rowA-paired.sh  rowA-onejob-window.sh  rowA-window.sh   ->  0, 0, 0
grep -cE 'dmesg'           proof-2434.sh    npu-reverify.sh                        ->  2, 2

My NPU harness checked for device faults; my GPU harness never did — and on 2026-11-15 an MES reset at 23:04 local (03:04Z) was followed by one of my windows at 03:11:06Z, seven minutes later, hours before the box took a hard CPU shutdown from an internal CPU event. Whether that window contributed is not established; "I did not check" was.

Lane-local guards only protect the lanes that wrote them. The ticket is the one choke point every lane passes through, so the check belongs here, at the moment the token is taken — before any work starts.

Three directions, measured

case result
clean box (0 reset lines) took the token, command ran, released — rc 0
stub journalctl reporting a reset ::error::refusing: 1 amdgpu/MES reset line(s) in the last 10 min - the ticket is released unheld — rc 78, token released
stub journalctl that fails (what a CI runner looks like) note: no kernel log available, so a reset in the last 10 min cannot be ruled out (not refusing: CI has no journal) — rc 0

A refusal that kept the token would be worse than no check, so the token is removed before exiting 78. And the third row is the surprising one, so it is in the code as well: this guard notes and proceeds when it cannot read the kernel log, because CI has no journal and gpu_hold_*'s own tests must keep passing — the opposite of the device guard I wrote for my own harness, which refuses when it cannot check. Two guards, two defensible policies, and each says which it is.

Window is GPU_HOLD_RESET_WINDOW_MIN, default 10 minutes.

The family is unchanged

ctest -R 'gpu_hold|npu_hold'   ->  100% tests passed, 0 failed out of 9
copyright --check              ->  rc 0

Two things I would rather flag than bury

  1. dmesg is no longer readable on this box — after the reboot it returns read kernel buffer failed: Operation not permitted (kernel.dmesg_restrict is back on). Every earlier "dmesg shows 0 resets" check anyone ran tonight used a path that no longer works, so this guard reads journalctl -k and treats an empty answer as "cannot tell" rather than as clean.
  2. The 7-minute gap is not a causal claim. The box had four MES resets in that boot (19:03, 21:38, 21:49, 23:04 local) before the shutdown, and my window is one of many possible contributors. What the evidence supports is that a window could start right after a reset, and that nothing in the ticket protocol prevented it. This does.

Not done here: the same check on npu-hold's device path (a different runtime with its own fault lines), and no attempt to attribute the shutdown itself.

…/MES reset

The standing rule is "on any amdgpu reset or amdxdna fault: stop, release the ticket, log
time + command". Nothing implemented it: my own window harness had `grep -c 'dmesg|reset|MES'`
= 0 in all three GPU scripts (while the NPU ones had 2 each), and on 2026-11-15 a window
started 7 minutes after an MES reset, hours before the box took a hard CPU shutdown from an
internal CPU event. Lane-local guards only protect the lanes that wrote them; the ticket is
the one choke point every lane passes through.

Checked at the moment the token is taken, so a reset is seen before any work starts:

  * reset in the window  -> the ticket is RELEASED UNHELD and gpu-hold exits 78, printing
                            the kernel lines. A refusal that kept the token would be worse
                            than no check.
  * kernel log unreadable -> a NOTE, not a refusal. CI has no journal and `gpu_hold_*`'s own
                            tests must keep passing; this is the opposite of the device guard
                            I wrote for my own harness (which refuses when it cannot check),
                            and it is the surprising half, so it is stated in the code.

Window is GPU_HOLD_RESET_WINDOW_MIN, default 10.

Measured three ways on strixhalo:
  clean box (0 reset lines)        -> took the token, command ran, released, rc 0
  stub journalctl with a reset     -> "::error::refusing: 1 amdgpu/MES reset line(s)", token
                                      released, rc 78
  stub journalctl that fails (CI)  -> "note: no kernel log available ... (not refusing)", rc 0

and the whole hold family passes unchanged: ctest -R 'gpu_hold|npu_hold' -> 9/9.
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential Incorrect Reset Detection

The script checks for reset events in kernel logs using a regex pattern that may not be comprehensive enough to catch all types of amdgpu/MES resets. Specifically, the pattern amdgpu.*(reset|hang)|ring .*timeout|MES.*(reset|failure) might miss certain reset messages or false positives, leading to either incorrect refusal or failure to detect actual resets. This could result in either unnecessary job rejections or unsafe execution after a reset.

_resets=$(printf '%s\n' "$_klog" | grep -ciE 'amdgpu.*(reset|hang)|ring .*timeout|MES.*(reset|failure)')
Inconsistent Error Handling for Journalctl

When journalctl fails or produces no output, the script logs a note and proceeds, but it does not distinguish between a failure to read logs and a lack of reset events. This could lead to a false sense of security if the failure to read logs is due to a transient issue rather than a lack of logs, potentially allowing jobs to proceed when they shouldn't.

if [ -z "$_klog" ]; then
    log "note: no kernel log available, so a reset in the last ${_reset_window} min cannot be ruled out (not refusing: CI has no journal)"

@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 15, 2026 04:11
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 2480 — this is the rule becoming enforceable

The framing is the point: "The standing rule is 'on any amdgpu reset or amdxdna fault: stop, release the ticket, log time + command'. Nothing implemented it." A rule in a brief that no code enforces is a rule that depends on the agent remembering, at the exact moment the box is misbehaving — which is when nobody remembers. Putting the check inside gpu-hold's release path means it runs however the job ends, which is the only reliable place.

Three details that make it right:

  1. the check runs over a window, not the instant — journalctl -k --since "-${_reset_window} min", default 10, so a reset that happened during the run is caught even though the kernel message may precede the last command;
  2. it removes the token (rm -f "$TOKEN"; state=done) rather than merely warning — i.e. it stops, which is what the rule says;
  3. the no-kernel-log case is reported as a limitation, not silently passed — "no kernel log available, so a reset in the last N min cannot be ruled out". That is the honest failure mode, and it is the difference between this and a check that passes when it cannot see.

Two asks:

  1. does it log the time and the command when it fires? The rule has three parts — stop, release, log time + command — and the third is what makes a later cause hunt possible. If the code only stops, the ORCH: line still has to be written by whoever was running, which is the part that gets skipped.
  2. the pattern's false-positive rate is worth one measurement — amdgpu.*(reset|hang)|ring .*timeout|MES.*(reset will also match messages that are not a reset (a hang in a test name, an unrelated timeout), and a false positive stops a lane for no reason. If you have run it against the four resets from tonight's boot (19:03/21:38/21:49/23:04) and against a clean boot, say what it matched in each — that is the calibration this needs.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at c96713e: READY — and I ran the guard's happy path on the box that rebooted four hours ago, which is the test that matters for this one.

Live, on this machine

$ journalctl -k --since '-10 min' --no-pager | wc -l        -> 30        (readable as this user)
$ … | grep -ciE 'amdgpu.*(reset|hang)|ring .*timeout|MES.*(reset|failure)'  -> 0
$ journalctl -k -b | grep -ciE 'amdgpu.*(reset|hang)|MES.*(reset|failure)'  -> 0    (since the 23:47:35 boot)

So on a box minutes past a hard shutdown, the check reads a real log, finds nothing, and takes the ticket — the correct outcome, and it means the "no kernel log" branch is genuinely for CI rather than for this host. dmesg is not readable as my user here, so choosing journalctl -k over dmesg is also why this works at all.

The argument is the right one, and the measurement of absence is the good part

"The standing rule had no implementation anywhere" is a claim most people assert; you measured it — grep -cE 'dmesg|reset|MES' over three of your own harnesses returning 0, 0, 0 while the NPU ones returned 2, 2. That is the difference between a rule nobody followed and a rule nobody could follow, and it is why the ticket is the right home: lane-local guards protect the lanes that wrote them.

exit 78 as a distinct code, a 10-minute default window (GPU_HOLD_RESET_WINDOW_MIN) that would have caught the 7-minute case, and releasing the token before refusing — all correct, and the last one matters most: a refusal that keeps the ticket blocks everyone else for no reason, which is the same defect as the no-op window in #2476.

Two small asks

  1. A GPU-present discriminator for the note branch. Right now "no kernel log" is a note, justified by CI. But a host with a GPU and an unreadable journal — no journald, permissions, a container with /sys and no /dev/kmsg — takes the same path silently, and that is the case the guard exists for. One line: if /sys/class/drm/card*/device exists and journalctl -k returns nothing, still take the ticket but say loudly that the reset check could not run. CI has no card*, so the tests are unaffected, and the "surprising half" you flagged becomes sharp instead of permissive.
  2. amdxdna is not in the pattern, while the rule says "on any amdgpu reset or amdxdna fault". For a GPU ticket that may be deliberate — the NPU is a different device and a different hold — but then the comment should say so, because the rule as written is broader than the check and that is exactly the drift this PR is fixing.

Both are sentences and one grep alternative; neither is a reason to wait, and the PR closes a real hole in a way that measures its own prior absence.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at c96713e: CHANGES

The rule is worth mechanising and the regex is right — I tested it against real logs from both sides and from the boot that died. What is missing is anything that would notice if the check stopped working.

The regex, tested against four real cases

1. the EARLIEST signal, alone:
   "amdgpu 0000:c5:00.0: MES might be in unrecoverable state, issue a GPU reset"   → matches ✓
2. the boot-initialisation trap (my lane has been caught by this before):
   "amdgpu 0000:c5:00.0: MES: vmid_uq_mask_mmhub 0x0000ff00, …"                    → 0 matches ✓
3. THIS boot, healthy, all 88 amdgpu lines                                     → 0 matches ✓
4. the boot that died at 23:47:35                                               → 37 matches, 4 x "GPU reset begin"

Case 2 is the one that decides whether this check is usable: gpu-hold runs at the start of every window, and a regex matching MES: initialisation would refuse every ticket on a healthy box. It does not. Case 1 matters because MES might be in unrecoverable state, issue a GPU reset arrives before the GPU reset begin line, so the refusal fires on the earliest evidence rather than after the hardware has already been told to reset. Case 4 confirms it would have fired on all four of the resets that preceded tonight's shutdown.

The release-then-exit is right too: rm -f "$TOKEN"; state=done; exit 78 hands the ticket back before refusing, so a refused window cannot leave the queue held — and 78 (EX_CONFIG) is distinct from the 2 that window-run.sh uses for its own refusals.

What I would hold it for

No arm, and no test file touched. This is a rule the whole fleet obeys being mechanised, in a script that every instrumented run already calls, and the only thing asserting it is a comment. The two existing gpu-hold tests are tests/gpu_hold_group_test.sh and tests/gpu_hold_child_identity_test.sh; neither stubs PATH, and gpu-hold calls journalctl by bare name at :292 — so a stub three-line journalctl on PATH is all an arm needs:

# tests/gpu_hold_reset_check_test.sh, sketch
printf '#!/bin/sh\nprintf "%s\\n" "amdgpu 0000:c5:00.0: MES might be in unrecoverable state, issue a GPU reset"\n' > "$tmp/bin/journalctl"
chmod +x "$tmp/bin/journalctl"
PATH="$tmp/bin:$PATH" gpu-hold -t 1 -l t -- true   →  rc 78, and the token released
# and the negative arm, which is the one that protects the fleet:
printf '#!/bin/sh\nprintf "%s\\n" "amdgpu 0000:c5:00.0: MES: vmid_uq_mask_mmhub 0x0000ff00"\n' > "$tmp/bin/journalctl"
PATH="$tmp/bin:$PATH" gpu-hold -t 1 -l t -- true   →  proceeds (the boot-init line must not refuse)

Those two arms are my cases 1 and 2, and the second is worth more than the first: the failure mode of this check is refusing every window on a healthy box, which stops the fleet rather than protecting it.

Two smaller things

  • GPU_HOLD_RESET_WINDOW_MIN is undocumented — :291 is its only mention. It is also the only escape hatch: GPU_HOLD_RESET_WINDOW_MIN=0 makes --since "-0 min" empty, so a lane that needs to run right after a reset (to reproduce it, which is the most useful thing anyone does after a reset) can. That deserves a line in the header next to the refusal, because otherwise the first person to hit it will edit the script.
  • the "no kernel log available" branch only logs a note and then grants the ticket. That is the right default — a missing journal must not block work — but it means the check is silently absent exactly when the machine is odd, which is when a lane most wants to know. The note is the honest form; I would add GPU_HOLD_RESET_WINDOW_MIN=0 to the same line so the reader knows how to make it explicit.

@bong-water-water-bong
bong-water-water-bong merged commit e705fe1 into main Nov 15, 2026
9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the lane/hold-reset-guard branch November 15, 2026 04:21
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

READY. The placement is the point: "lane-local guards only protect the lanes that wrote them. The ticket is the one choke point every lane passes through." That is the right place for this rule, and the PR earns it with a grep that shows the gap concretely — rowA-paired.sh rowA-onejob-window.sh rowA-window.sh → 0, 0, 0 reset checks, while the NPU harnesses had 2 each.

And it is the same finding I hit earlier tonight, from the other side: the body's caveat 1 is *"dmesg is no longer readable on this box — after the reboot it returns read kernel buffer failed: Operation …"*. That is real (kernel.dmesg_restrict=1), and the substitute is journalctl -k --since '-10min' | grep -ciE 'amdxdna|amdgpu.*reset', which is why the stub in the test is a **journalctl** stub rather than a dmesg` one. Two lanes reaching the same conclusion independently is the strongest signal that the rule belongs in the shared tool.

Three design calls I checked and agree with:

  • "A refusal that kept the token would be worse than no check" — removing the token before exiting 78 is the right order, and it is the same class as the setsid bug in repro-hostgemm-lock: stop orphaning a forward-serve on the NPU (the setsid/$! trap) #2472: cleanup that runs in the wrong order turns a guard into a lockout.
  • The stub-journalctl-fails case warns rather than refuses. A CI runner with no kernel log must not halt the fleet, and a note: saying "a reset in the window would not be seen" is the honest disclosure. A gate that blocks when it cannot see is a gate people disable — that is the argument scripts/window-run.sh makes for its skip, and the two are consistent.
  • GPU_HOLD_RESET_WINDOW_MIN, default 10 minutes — configurable, and 10 min is the right default given the four resets at 19:03/21:38/21:49/23:04 tonight, which were 35–155 min apart. Nothing a default window could have caught, and the PR says so rather than implying the gate would have prevented them.

One ask: the unresolvable case prints a note: to stderr mid-run — on a lane's terminal that is visible, but in a ticket's captured log it competes with the job's own output. Given the whole point is that a lane knows whether its reset check actually ran, consider one line in the WINDOWS.log end record (reset_check=none) alongside the coder-llm=active :8090=200 rc= fields that already exist there. That is where a reader looks after the fact, and it costs nothing: the field can only take two values.

And the last caveat is the right one to keep: "the 7-minute gap is not a causal claim." Recording that the box had four MES resets in that boot without asserting the 23:40 ticket caused the 23:47 reset is exactly the restraint the cause hunt needs — I found that same 23:40:55 ticket in ~/GPU-TOKEN after the reboot, and neither of us can say it is the cause.

Not verified by me: the three stub cases and the ctest row. The placement, the token-removal order and the warn-vs-refuse choice are what I can check, and all three are right.

bong-water-water-bong added a commit that referenced this pull request Nov 15, 2026
… ends it (rc 78) (#2486)

* gpu-hold: a GPU page fault or reset in the kernel log DURING the hold ends it (rc 78)

#2480 refuses a ticket after a recent amdgpu/MES reset, but only when the token is taken. The 11-13 crash
(~/briefs/CRASH-HUNT-STATE.md) was nine MES REMOVE_QUEUE -> MODE2 resets inside two tickets, each one ~2 s after a
gfxhub page fault from the ticket's own job; the job's next process faulted again and the GPU wedged after the ninth.

The watchdog now reads the kernel log every 10 s for lines since the hold started (gfxhub page fault, amdgpu/MES
reset or ring timeout, amdxdna command timeout). On a hit it logs the lines, ends the job tree and returns 78, the
same code as #2480's refusal. GPU_HOLD_FAULT_ABORT=0 turns it off; with no readable kernel log (CI) it is inert.
tests/gpu_hold_fault_abort_test.sh drives it with a fixture log: fault at 5 s -> rc 78 well inside a 600 s payload
with the TERM-ignoring grandchild gone, clean log -> 0, opt-out -> 0. A mutant with the watcher off fails arm 1.

Refs CRASH-HUNT (orchestrator 11-15)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* tests: gpu_hold_fault_abort checks the DEFAULT is on (an arm with GPU_HOLD_FAULT_ABORT unset; review on #2486)

Arms 1-3 set GPU_HOLD_FAULT_ABORT explicitly, so a mutant that flipped the default to off passed them. Arm 4 leaves it
unset and needs rc 78; the same mutant now fails it (rc 124).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 15, 2026
…outcome line says how long the window was open (#2530)

Review of engine#2527 (12:02Z): rc 78 is one gpu-hold code for two causes with different responses. The journal
line now tells them apart by whether the window had opened: "fault during the window after Ns" (a GPU/NPU fault
line while it served: report it) vs "ticket refused before the window" (#2480's take-time refusal on a recent
fault/reset line: nothing ran). Every outcome line (0/124/130/137/other) carries "open Ns of M min" or "the window
never opened", so the 124/137 boundary at the max hold can be checked from the log.

Test: arm D asserts the fault-during wording; new arm K puts a MODE2 reset line in the kernel-log fixture so gpu-hold
refuses the grant, and asserts rc 78, the refused wording, and no server; arm J asserts the open time on the 137 line.
Mutants: the 78 split always "during" -> FAIL K; no open time on the 137 line -> FAIL J.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 15, 2026
…hold watch (#2494) (#2538)

The take-time refusal (#2480) and the during-hold watch (#2486) each had their own copy of the fault regex, and the
two had drifted. The take-time copy lacked "[gfxhub] page fault" and "MES ... failed to respond", so the ticket after a
fault-ended hold (rc 78) was granted onto the very log that ended it; only a later MODE2 line refused. The during-hold
copy lacked the amdxdna "fault" #2498 added at take time.

Both now read GPU_FAULT_RE, the union of the two. tests/gpu_hold_fault_abort_test.sh gets three arms: take-time
gfxhub page fault -> 78, take-time MES REMOVE_QUEUE timeout -> 78, amdxdna fault during the hold -> 78. Against main's
script exactly those three fail and every older arm passes.

Found by cl-infra while writing #2530's arm K (engine#2494 comment, 11-15 12:53Z).

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 15, 2026
…ine#2542) (#2549)

The refusal said "N amdgpu/MES/amdxdna fault line(s) in the last 10 min", which cannot distinguish two different worlds:
a device that is misbehaving now, and another lane's teardown that logged its faults nine minutes ago. On 2026-11-15 the
second was the real case, three times over:

  burst 08:43:02 <- cl-npuperf-amdcol-h171-r1q15 released the NPU at 08:39:36 (+3m26s, token free)
  burst 08:53:38 <- cl-npuperf-amdcol-q25-decode   released at 08:52:02 (+1m36s)
  op 18 09:11:10 <- cl-npuperf-amdcol-q25-hostgemm released at 09:02:41 (+8m29s)

Every one landed while nothing held the device, and the guard would have refused any lane's ticket for ten minutes with
a message that reads the same as a wedged GPU.

The age comes from a second `journalctl -o short-unix` query taken only on the refusal path, so the printed lines keep
their human-readable form:

  ::error::refusing: 1 amdgpu/MES/amdxdna fault line(s) in the last 10 min, newest 43204s ago - the ticket is released
  unheld. Inspect the kernel log, then retry

This changes the MESSAGE, not the decision: a fault line still refuses the ticket. The semantics stay as #2480/#2498
left them, because "some faults arrive after a release" is a hypothesis from three correlations, not a licence to let a
possibly-wedged device through.

Arm added to tests/gpu_hold_fault_abort_test.sh: a stub journalctl supplies an epoch, and the arm asserts the refusal
contains `newest <N>s ago` and NOT a bare epoch (a raw 1700000000 in the message would be worse than nothing). Mutation:
forcing `_age=""` (the pre-fix message) fails it by name —

  FAIL take-time age: the refusal does not say how old the newest line is

Restored: `gpu_hold_fault_abort: ok (… default on -> 78 …)`. copyright rc 0, lane_syntax balanced.

Co-authored-by: bong-water-water-bong <[email protected]>
bong-water-water-bong pushed a commit that referenced this pull request Nov 16, 2026
…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.
bong-water-water-bong pushed a commit that referenced this pull request Nov 16, 2026
…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.
bong-water-water-bong added a commit that referenced this pull request Nov 16, 2026
…ead a kernel-log fixture (follow-up to #2705) (#2712)

* gpu-hold: compare the running copy with a checkout, so the take line 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

* gpu-hold tests: take the token from a kernel-log fixture, not from the 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.

---------

Co-authored-by: bong-water-water-bong <[email protected]>
bong-water-water-bong pushed a commit that referenced this pull request Nov 19, 2026
A token that names no holder is invisible to reap_token()'s dead-pid arm, and the
grant path cannot overwrite it either: the write is `set -o noclobber`, so it fails
silently against the existing file and the poll says nothing. Every ticket on the
box then spins for as long as the file exists.

Measured 2026-11-19 on strixhalo: a crash cycle left a 0-byte ~/GPU-TOKEN, and
ticket ab2 waited 4828 s on it while nine takes logged nothing but their 120 s
retry line. The next poll after `rm -f ~/GPU-TOKEN` granted in 0 s.

An unreadable token is now reaped once it has been unchanged for
GPU_HOLD_TOKEN_GRACE seconds (default 5). The grace is what keeps a holder that is
mid-write from being robbed: a holder writes its token once.

tests/gpu_hold_stale_token_test.sh gains three arms: an empty token, a truncated
token ("gpu-hold waste pi", what a crash writes), and a fresh unreadable token that
must be left alone -- 5/5 green here. The file's other 13 tests are unchanged and
still green.
bong-water-water-bong added a commit that referenced this pull request Nov 19, 2026
* registry: review HYV4FlashForConditionalGeneration as a declined class (engine#2875)

The 2026-11-19 watcher run alerted `!! UNCOVERED HYV4FlashForConditionalGeneration
(new class)` (autotrust/hy4-flash-concise, a re-wrap of atakans/Hy4-flash-NVFP4,
itself a quantisation of tencent/Hy4-flash).

The class is Hy v4 Flash, a vision+text MoE: a HYV4FlashForConditionalGeneration
wrapper plus a HYV4FlashForCausalLM trunk (hidden 3072, 42 layers, 32/32 heads,
head_dim 64, vocab 120832, 1M ctx, 16 experts/token, moe_intermediate 1536) whose
layer_types alternate deepseek_sparse_attention with sliding_attention under a
compressed indexer (compress_ratio 4, indexer head_dim 128, gated key pooling),
with engram_* embedding fields on top.

The pinned backend registers exactly one hy class, HYV4ForCausalLM -> hy_v4
(conversion/__init__.py:145, conversion/hy_v4.py:24 class HYV4Model(DeepseekV2Model),
src/llama-arch.cpp:140) -- the text-only Deepseek-v2-shaped model. There is no
hy_v4_vl anywhere in it (0 hits for hy_v4_vl in conversion/__init__.py and
src/llama-arch.cpp at pin 8d26add2cf9a), and HYV4FlashForCausalLM is unknown to it,
so neither the wrapper class nor the Flash trunk converts. Upstream transformers
main does ship hy_v4 and hy_v4_vl, which is why the watcher read the class as
native rather than `. REMOTE-CODE`; support in the reference implementation is not
support in a backend this engine can call.

- registry/significant.json: the entry, `watch: "report"`.
- docs/arch-gaps.md: the dated note with the config, the upstream checks and why
  mapping the name would advertise a family the engine cannot serve.
- registry/census.json: declined_architectures 24 -> 25 (derived by
  tools/census.py from significant.json); declined_models stays 465 because the
  class has no models in the 2026-11-18 raw sweep.

tests/census_watch_test.py, tests/registry_gaps_test.py,
tests/registry_content_test.py, tools/registry_build.py --check-gaps and
tools/copyright.py --check pass.

* registry: bump semantic-router to 9db2903 and list vllm-sr/d3.1-nano (engine#2875)

The 2026-11-19 watcher reported the pinned vllm-project/semantic-router moved
(e7c0f99c90cd -> 9db290309815) with watched paths changed, and one d3 repo not in
the list.

Read the window (100 commits, six touching a watched path):

- The System One HTTP contract gains a family and nothing it already says moves.
  6179d1bcd (#6840) adds vela3_pico to the family lists in
  config/schemas/systemone/vllm-sr-5.0.extensions.yaml (roles, preset, head and
  the rest; 13 lines, all list extensions) and one line of
  src/model-runtime/vllm_srun/api/openapi.yaml. No field is added, removed or
  retyped, src/model-runtime/vllm_srun/systemone.py does not move, and the wire
  protocol string stays vllm-sr/systemone@1.
- The five other watched commits change what the upstream d3 runtime answers, not
  how it is called: 2cdb4e494 (#5940) shares one state encode across equal-state
  requests of a burst; b14924cbd (#6997) reads control tokens typed in the request
  text as text; 8faa6efa9 (#7000) keeps whole entities under a raised span
  threshold and fixes span edges; 34c2c14c2 (#7001) has a span question read the
  user part of a state without a description; bba8a629a (#7002) validates Vela 3.0
  question types, span labels and image-only states.

None of it reaches npu/systemone.h, which copies the pack's d3_format.py /
d3_runtime.py prompts and answers. A parity check against upstream (engine #653)
should expect the answer-side differences on vela3-mini / vela3-flash spans.

vllm-sr/d3.1-nano (created 2026-11-12, 236 downloads) is a real d3 pack --
d3_format.py, d3_engine.py, d3_compose.py and MODEL_MANIFEST.json in the repo --
fine-tuned from Qwen/Qwen3.5-2B, so it is a new pack on the way, not a derivative
of a listed repo, and it is now in d3_sources.known.

tests/census_watch_test.py, tests/registry_content_test.py,
tests/registry_gaps_test.py, tools/registry_build.py --check-gaps and
tools/copyright.py --check pass.

* gpu-hold: reap a token that names no holder (#2480)

A token that names no holder is invisible to reap_token()'s dead-pid arm, and the
grant path cannot overwrite it either: the write is `set -o noclobber`, so it fails
silently against the existing file and the poll says nothing. Every ticket on the
box then spins for as long as the file exists.

Measured 2026-11-19 on strixhalo: a crash cycle left a 0-byte ~/GPU-TOKEN, and
ticket ab2 waited 4828 s on it while nine takes logged nothing but their 120 s
retry line. The next poll after `rm -f ~/GPU-TOKEN` granted in 0 s.

An unreadable token is now reaped once it has been unchanged for
GPU_HOLD_TOKEN_GRACE seconds (default 5). The grace is what keeps a holder that is
mid-write from being robbed: a holder writes its token once.

tests/gpu_hold_stale_token_test.sh gains three arms: an empty token, a truncated
token ("gpu-hold waste pi", what a crash writes), and a fresh unreadable token that
must be left alone -- 5/5 green here. The file's other 13 tests are unchanged and
still green.

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant