Repository navigation
ptx-spill-check: a failed count or comparison read fails the binary - #486
Conversation
The entry and pin counts were read with wc pipelines, and the comparison with an awk and sort pipeline, whose status nothing checked. A read that failed without output left an empty count or an empty comparison, and with no violation line the binary printed its PASS banner and the script exited 0. Each read now fails the binary by name: comparison=unread, entries=unread or pinned=unread, then FAIL and exit 1. A violation count that fails to read is printed as violations=unread on the FAIL line. The self-test fails each read once, through the wc stand-in of tools/ref/read-stubs.sh (which now fails on a text that holds the word fail-wc, not only on a text that is that word) and a sort that exits 1.
There was a problem hiding this comment.
Verdict: CLEAN: Failed comparison and entry/pin count reads now fail the named binary while later binaries remain checked.
Checked
Duplicates: 0 new functions, types or constants; the fixtures reuse read_stubs. No duplicate found; no dryer pairs were supplied.
Complexity: no Rust functions changed; no crapper flags were supplied. The added shell branches handle read failures.
Silent failure: 4 changed reads followed. Comparison and entry/pin count failures produce named failures. An unread violation count preserves the failure verdict.
Tests: Bash syntax check passes. The three new fixtures assert exit 1 and a named failure. Removing the comparison, entry-count or pin-count guard at tools/ptx-spill-check.sh:330, L331 or L332 defeats its corresponding assertion. pipefail preserves upstream comparison and count errors.
Gates: no pins, thresholds or cases relaxed or removed. The PR supplies FAIL-first results for all three new cases.
Escape catalog: no matching defect. The checked substitutions retain pipeline failures through pipefail.
Notes
Dryer and crapper did not run because no Rust file changed.
The PR reports passing self-tests and FAIL-first runs; the validator did not rerun them.
🔨 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. |
What and why
Fixes #453, fixes #484.
tools/ptx-spill-check.shcompared each binary's scan with its pins throughawk | sort, then counted entries, pins and violations withwc -l, and checked none of those statuses. A failed count left an empty field, and when the comparison found no violations the binary still printedPASSand the tool exited 0. A failed comparison was worse: its empty output read as no violations at all. Each read now has a failure branch, so the binary's verdict iscomparison=unread FAIL,entries=unread FAILorpinned=unread FAILand the tool exits 1.Release notes: internal: a PTX spill check that cannot read its comparison or a count fails that binary by name instead of printing PASS with empty fields.
Code shape
read_stubsfromtools/ref/read-stubs.shfor itswcstand-in. No new helper.FAIL. The violation count only runs on theFAILpath and falls back toviolations=unread.cargo fmtandcargo clippy: no Rust changes (shell only).Duplication found or removed (
path:line), or "none": none.What changed:
tools/ptx-spill-check.sh: the comparison,nandpreads each end in|| { echo "ptx-spill bin=$BIN <field>=unread FAIL"; rc=1; continue; }, so the other binaries are still checked.vfalls back tounread.tools/ptx-spill-check.shself-test: three new cases on their own table. Inrnboth the scan rows and the pins hold the wordfail-wc, so nothing but the lost entry count could stop a PASS. Inrponly the pins hold it. The third case puts asortthat exits 1 first on PATH. The stand-ins are built in a subshell, because sourcingread-stubs.shwould replace the self-test's owncheckfunction.What I ran
All on an RTX 5090 machine.
1efa41f9).bash tools/ptx-spill-check.sh --self-testendedptx-spill-check: self-test 3 failed. The entry count case printed the issue's symptom,ptx-spill bin=rn entries= pinned= nonzero=none violations=0 PASS, at rc 0. The pin count case exited 1 but left the field empty:entries=7 pinned= nonzero=none violations=7 FAIL. The comparison case printedviolations=0 PASSat rc 0.ptx-spill-check: self-test ok,lds-scan: self-test ok (7 cases, 0 failed),ptx-scan: self-test ok (30 cases, 0 failed),dump-dequant self-test: ok (0 failures)andoracle self-test: ok (0 failures).LC_ALL=C just contrib-check --tier t0with the fix:DONE tier=t0 total=94 red=0 wall=283s. Itscheck-recipesunit runs these self-tests (check-recipes rc=0 101s).The checks with the fix ran on
60955ce8. The PR head8566170bis the sametools/ptx-spill-check.shchange rebased on current main, which already carries thetools/ref/read-stubs.shstand-ins these cases use (#483); thetools/ptx-spill-check.shchange is unchanged.I did not run
just gate-ptx-spillagainst a real gate binary, since that needs a full GPU build. The existing fixture cases run the success path with the realwcandsort, and the verdict format is unchanged.What I ran into
None of this blocks the PR. The
nz=$(awk ...)read just after the counts (tools/ptx-spill-check.sh:333) has no status check either. The verdict is already settled by then; a failure would only printnonzero=noneon a PASS line. This PR leaves it alone.Hardware (if the change is for a machine)
Not a hardware change.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.