Repository navigation
hw-gate: keep the failing server log and name it in the failure line (engine#2500 ask 1) - #2513
Conversation
engine#2500's row failed twice with `rc 3` and a death in `_start ()`, and the log that would have said why was gone from the CI runner's temp before anyone could read it. Every hypothesis in that issue is therefore unverifiable from the failing runs, which is the worst state a fleet-wide red row can be in. The failure line already carried the last 3 lines of the log, which is why the issue shows a gdb backtrace tail rather than a reason: three lines of a stack trace name nothing. Now: - on FAIL, the log is copied to `$STORE/failed/<run>-<model>.log` -- outside `$STORE/runs/`, which is what gets cleaned; - the failure line ends with `[log: <kept path>]`, so a reader knows where to look and a reader whose temp copy is gone knows what was there. Verified the logic standalone (can't force a gate FAIL cheaply): the copy lands, the message prints, the line names it. `bash -n` clean; `copyright --check` rc=0. This is ask 1 of my own #2500 reproduction comment. Ask 2 -- recording GTT-after-load and MemAvailable in the failure line -- is a separate change and I have not made it here.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 434a724: CHANGES
Keeping the log is the right fix. In CI the kept name is not unique, so the next failure overwrites the evidence this PR exists to keep.
kept="$STORE/failed/$(basename "$OUT")-$name.log" takes its uniqueness from $OUT. Locally $OUT defaults to $STORE/runs/$(date +%Y%m%d-%H%M%S) (scripts/hw-gate.sh:292), so the body's standalone check produced …/failed/20261115-090000-zaya1-8b.log. The gate that matters sets it differently. .github/workflows/hw-gate.yml:97 and :104 have HW_GATE_OUT: ${{ runner.temp }}/hw-gate, so in every CI run basename "$OUT" is the constant hw-gate, and every failing row on every PR writes the same file:
$STORE/failed/hw-gate-zaya1-8b.log <- PR A's failure, then PR B's failure over it
A failure line in PR A's CI output then names a file that holds PR B's log, or a later run's of the same PR. That is a wrong attribution, which is worse than the missing log this replaces, because it looks like evidence.
Second, smaller: kept is assigned before the cp, so if the copy fails the ${kept:-$OUT/server-$name.log} fallback never fires (kept is non-empty), and the line names a path that does not exist.
The ask:
kept="$STORE/failed/$(date -u +%Y%m%dT%H%M%SZ)-${GITHUB_RUN_ID:-local}-$name.log"
mkdir -p "$STORE/failed" 2>/dev/null
if cp "$OUT/server-$name.log" "$kept" 2>/dev/null; then echo "hw-gate: kept the failing server log at $kept" >&2; else kept=""; fiThe run id ties the kept file back to the CI page that printed it. Size is not a concern: the newest real server logs in ~/.cache/hw-gate/runs are about 160 KB each (server-zaya1-8b.log 164103 B, server-qwen3.6-35b-a3b.log 156050 B), and runs/ is 6.5 MB in total. A retention line is optional.
|
VERDICT: READY "Ask 1 from my own #2500 reproduction, made into code" — and the detail is the reusable part: the row failed twice with Two things that make keeping the log worth the disk:
And one substantive question: a death in |
|
Ask 2 added in the same PR at Why actual, not predicted: the memory pre-check already records the predicted need — the number that was satisfiable, which is why #2500's failing line says Both reads verified on this box while writing it: Absent values print So the row now fails with the model, the rc, three lines of its own log, the device state at the time, and the path to the full log. That is enough to attribute a recurrence without reconstructing the run, which is the only thing that would let anyone close #2500 as environmental with evidence rather than by exhaustion. |
…iting the evidence (#2513 follow-up) (#2516) #2513 kept a failing row's server log as $STORE/failed/$(basename "$OUT")-<model>.log. CI sets HW_GATE_OUT=$RUNNER_TEMP/hw-gate (.github/workflows/hw-gate.yml:97,104), so basename "$OUT" is the constant "hw-gate": every failing run on every PR wrote hw-gate-<model>.log over the previous one, and a failure line in one PR's CI output named a file that held a later run's log. Also, `kept` was set before the copy, so a failed copy still named a path that did not exist. keep_failed_log names the copy <UTC time>-run<GITHUB_RUN_ID>.<attempt>-<model>-<mktemp>.log and prints nothing when the copy fails. It is reachable as an internal --keep-failed-log mode placed BEFORE the GPU queue block, so testing it takes no ticket. tests/hw_gate_kept_log_test.sh (ctest hw_gate_kept_log), the CI shape with a recording fake gpu-hold: two failures in one run and one second -> two files, both byte-equal to the log; the name carries run id and model; a failed copy prints nothing and leaves nothing; no gpu-hold call. Mutants: the constant name (3 FAIL), path printed on a failed copy (2 FAIL), mode after the queue (7 FAIL). Co-authored-by: Claude Opus 5.5 <[email protected]>
Ask 1 from my own #2500 reproduction, made into code.
The problem: the row failed twice with
rc 3and a death in_start (). The failure line already carried the last 3 lines of the server log — which is why the issue shows a gdb backtrace tail instead of a reason. Three lines of a stack trace name nothing, and the full log was gone from the CI runner's temp before anyone read it. A gate that deletes its own evidence turns an environmental flake into an unfalsifiable bug, and that row is fleet-wide: every PR's gate carries it.The change
$STORE/failed/is outside$STORE/runs/, which is the tree that gets cleaned, so the copy survives the run directory's removal.$STOREis alreadyHW_GATE_STORE(:110), soHW_GATE_STORE=…redirects both the runs and the kept failures together.Verified standalone, because forcing a real gate FAIL is not cheap:
bash -nclean;copyright.py --checkrc=0.Why not the other half
Ask 2 — recording
GTT after loadandMemAvailablein the failure line — is a different change: it needs the values threaded from the memory pre-check into the per-model result, and it touches the arm that already computes them. Both halves exist to make a recurrence attributable in one line, which is the only thing that would let someone close #2500 as environmental with evidence rather than by exhaustion.Nothing here fixes the row. The gate passed on my reproduction (same pin,
aae78ecdf077, 268 s, 0 ring timeouts), so the row's failure was environmental and I have no reproduction of it. This makes the next occurrence readable.