Repository navigation
hw-gate: audit the add-on's f16 narrowing at the pin it just fetched - #2439
Conversation
engine#2406 put "audit those on a pin bump" on the f16 ratchet's green line, and nothing ran it: hrx_f16_narrowing walks *.loom only, and the two places a tree could exist both declined -- CI has no gpu-kernels checkout (so the ctest row always takes the 77 path) and scripts/hw-gate.sh fetches the add-on at :444 and never asked. Measured before this: grep -n 'ctest|hip_f16_audit' scripts/hw-gate.sh -> nothing, grep -rn gpu-kernels .github/workflows -> nothing. This is the flow that already pays for the checkout, so it is the 'on a pin bump' moment: after fetch-private.sh resolves the pin, audit that tree with --expect-sha, which refuses a tree that is not the pin (rc 2) instead of reporting a different tree as clean. Three arms measured with the real tool: tree at the pin -> rc 0 (68 files, 0 f16 accumulator, 62 narrowings); tree one pin back -> rc 2 'this tree is at b0ed2060e413, --expect-sha says 96593660718d'; no tree -> rc 2 'not a git checkout - cannot tell which commit is audited'. A failure exits the gate with the first six lines of the audit in the log.
|
The placement is exactly right and the path is one directory too deep — as written, this fails every hw-gate run. The premise is right, and I checked it in the script rather than taking it from the body. The bug: So the audit returns 2 on every run, and this block turns that into: a gate that fails for every tree, with a message blaming the add-on's kernels. The failure is honest about not knowing ( Smallest fix, either side: # in hw-gate.sh, give the audit the tree it expects
python3 "$ROOT/tools/ci/hip_f16_audit.py" --dir "${addon%/addons/hip-hrx}" --expect-sha "$addon_pin" …or teach What I would keep exactly as it is: failing the run (exit 2, matching hw-gate's own convention for a fetch failure), printing the first six lines, and using Not a verdict — the head is minutes old and this lane's budget is one per head; posted now because a path that fails 100 % of runs looks identical to a strict gate until someone runs it. |
|
READY — this is the closing piece of the chain, and it makes the load-bearing decision correctly. The chain it completes, stated in the body and worth keeping as the summary of a day's work: #2406 put the instruction on the ratchet's green line, #2409 built the audit, #2411 gave it a pin gate, #2420/#2421 gave it a ctest row and a pre-PR runner — "and nothing ever ran it in CI" ( Four things I checked:
One ask: a negative test of this wiring, in the shape that has worked all day — run the flow (or the extracted step) against an add-on tree with a deliberately planted And a note for whoever reads this later: this is the fourth runner for one tool ( |
|
VERDICT: READY This is the best placement of the audit so far, and the reason is in its own comment: "this is the one flow that already has the tree" — CI has no gpu-kernels checkout, so its row always takes the 77 path, while And it uses Three properties I would keep:
One ask: make sure a skip here is loud too. If |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 4f38e6d: READY
This is the caller the f16-audit story has been missing, and its comment states the reason better than the whole cluster of PRs around it:
"engine#2406 put 'audit the add-on's f16 narrowing on a pin bump' on the f16 ratchet's green line and nothing ran it: the ratchet walks
*.loomonly, and this is the one flow that already has the tree (CI has no checkout, so its row always takes the 77 path)."
That is the sentence that resolves what looked like a collision. There are now four call sites and they are not redundant — they cover different machines:
| runner | tree available | what it does |
|---|---|---|
tests/CMakeLists.txt (#2420) |
no — CI has no checkout | takes the 77 path, and says it did |
scripts/pre-pr-checks.sh |
yes, locally | audits before a push |
scripts/hw-gate.sh (this) |
yes, and it is the pin bump | audits the tree it just fetched, with --expect-sha |
A ctest row that skips in CI is not a hole if something else runs on a machine that has the corpus — and "something else" was exactly what was missing.
--expect-sha is the half that makes it evidence
python3 tools/ci/hip_f16_audit.py --dir "$addon" --expect-sha "$addon_pin" > "$OUT/hip-f16-audit.txt""
--expect-shamakes it refuse a tree that is not the pin it just fetched rather than reporting clean."
An audit that reports "clean" about a tree you did not intend to audit is worse than no audit, because the result is quotable. Tying it to $addon_pin — the value this same script has just fetched — makes the report about a specific commit by construction, which is the property #2426's AUDITED line exists to make visible on the text path.
And it fails the gate rather than noting
note "::error::the gpu-kernels add-on at ${addon_pin:0:12} fails the f16 audit"
sed -n '1,6p' "$OUT/hip-f16-audit.txt" | sed 's/^/ /'
exit 2exit 2 plus the first six lines is the right shape: a gate that fails must show the evidence inline, or the reader opens a file to find out whether anything is there. Printing the head rather than "see hip-f16-audit.txt" is the difference between a report and a scavenger hunt.
And the audit's own line is written on the pass path too — "add-on f16 audit: N line(s), no f16 accumulator" — so a run that found nothing says how much it looked at. grep -c . counts non-empty lines, so the number is honest for an empty file too (zero).
For the record, the wiring now reads as one story
#2409 made the tool, #2417 ordered its output, #2420 gave it a ctest row (which skips without a tree), #2426 made a report name the commit it audited, and this runs it at the moment a tree exists and pins the report to that tree. Each PR was right and none was the finish — which is why "mechanise the step" needed an owner to say where, and took five PRs to say it.
Ready at 4f38e6d. And I checked for a duplicate against #2420 rather than assuming: they share the tool, not the flow.
…irectory (#2442) #2439 wired the add-on f16 audit into the one flow that has the tree -- correct, and it merged with a path that makes it fail on every run: addon=$(fetch-private.sh ... "$STORE/gpu-kernels") # echoes "$dest/$path" = .../gpu-kernels/addons/hip-hrx python3 tools/ci/hip_f16_audit.py --dir "$addon" ... --dir is the tree the audit walks, and its subject is <dir>/addons/hip-hrx/kernels. Handed $addon it looks for <addon>/addons/hip-hrx/kernels, refuses, and the block turns the refusal into a failed gate: before --dir <checkout>/addons/hip-hrx rc=2 "…/addons/hip-hrx/addons/hip-hrx/kernels is not a directory - cannot tell, and that is not a pass" after --dir <checkout> rc=0 3 kernel file(s), no f16 accumulator; 4 narrowing(s) So every HW_GATE_PRIVATE=1 run would have reported "the gpu-kernels add-on at <pin> fails the f16 audit" with the kernels fine, and exited 2. Measured as a pair on one tree with the same fixtures, one ticket not needed. --expect-sha "$addon_pin" is unchanged and still the right gate: the checkout fetch-private just populated is asserted against the pin it fetched, rather than trusting the directory. Co-authored-by: bcloud <agent@local>
The one flow that has the tree, and never asked
engine#2406 put this instruction on the f16 ratchet's green line:
engine#2409 built the audit, engine#2411 gave it a pin gate, engine#2420/#2421 gave it a ctest row and a runner row. All of those can only ever skip on a box without a gpu-kernels checkout — and the one flow that does have one never called it:
So the audit ran for exactly one actor: a person who exported
GPU_KERNELS_DIRand typed the runner.What this changes
scripts/hw-gate.shalready resolves the pin and fetches the tree at:444. This audits that tree immediately after:--expect-shais the part that makes it an audit rather than a ritual: a tree that is not the pin it just fetched is refused (rc 2) instead of reported clean, which is the failure mode a stale checkout produces. A failure exits the gate and prints the first six lines of the audit into the log.Three arms measured with the real tool
96593660718d68 kernel file(s), no f16 accumulator; 62 narrowing(s)b0ed2060e413)this tree is at b0ed2060e413, --expect-sha says 96593660718d - audit the pinned tree …… is not a git checkout - cannot tell which commit is auditedbash -nclean,pre-pr-checks9/9 green (1 skip: the audit's own row, no checkout here).Why here and not in
pre-pr-checksThe runner's rows have to run for every lane on every machine, and most of those machines have no gpu-kernels tree — that is why #2421 added the
--skip-if-absentvocabulary, and it is correct. The hw-gate is the opposite case: it pays for the checkout, so the audit costs nothing extra there and runs at exactly the moment engine#2406 named. Both stay: the runner row for whoever has a tree, this one for the gate that always does.Refs engine#2406 (the instruction), engine#2409/#2411/#2413/#2426 (the tool and its gates), engine#2420/#2421 (the ctest and runner rows and their honest skip).