Skip to content

ptx-spill-check: a failed count or comparison read fails the binary - #486

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-review-bot-issue-453-ptx
Oct 19, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:fix-review-bot-issue-453-ptx

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

What and why

Fixes #453, fixes #484. tools/ptx-spill-check.sh compared each binary's scan with its pins through awk | sort, then counted entries, pins and violations with wc -l, and checked none of those statuses. A failed count left an empty field, and when the comparison found no violations the binary still printed PASS and 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 is comparison=unread FAIL, entries=unread FAIL or pinned=unread FAIL and 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

  • No second copy. The self-test reuses read_stubs from tools/ref/read-stubs.sh for its wc stand-in. No new helper.
  • Model code holds only architecture facts. No model code changes.
  • Dead code is gone.
  • No silent failure. The comparison and the entry and pin counts end the binary with a named FAIL. The violation count only runs on the FAIL path and falls back to violations=unread.
  • Comments state what is true now. The verdict list in the header names the three new lines.
  • No relaxed gate.
  • cargo fmt and cargo clippy: no Rust changes (shell only).

Duplication found or removed (path:line), or "none": none.

What changed:

  • tools/ptx-spill-check.sh: the comparison, n and p reads each end in || { echo "ptx-spill bin=$BIN <field>=unread FAIL"; rc=1; continue; }, so the other binaries are still checked. v falls back to unread.
  • tools/ptx-spill-check.sh self-test: three new cases on their own table. In rn both the scan rows and the pins hold the word fail-wc, so nothing but the lost entry count could stop a PASS. In rp only the pins hold it. The third case puts a sort that exits 1 first on PATH. The stand-ins are built in a subshell, because sourcing read-stubs.sh would replace the self-test's own check function.

What I ran

All on an RTX 5090 machine.

  • FAIL-first: the new self-test cases on the base code (test-only commit 1efa41f9). bash tools/ptx-spill-check.sh --self-test ended ptx-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 printed violations=0 PASS at rc 0.
  • Self-tests with the fix: 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) and oracle self-test: ok (0 failures).
  • LC_ALL=C just contrib-check --tier t0 with the fix: DONE tier=t0 total=94 red=0 wall=283s. Its check-recipes unit runs these self-tests (check-recipes rc=0 101s).

The checks with the fix ran on 60955ce8. The PR head 8566170b is the same tools/ptx-spill-check.sh change rebased on current main, which already carries the tools/ref/read-stubs.sh stand-ins these cases use (#483); the tools/ptx-spill-check.sh change is unchanged.

I did not run just gate-ptx-spill against a real gate binary, since that needs a full GPU build. The existing fixture cases run the success path with the real wc and sort, 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 print nonzero=none on 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 초안 리뷰는 제가 직접 했습니다.

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.
@github-actions github-actions Bot added the tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo label Oct 19, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit e8abdc8 into midagedev:main Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ptx-spill-check: failed line counts still produce PASS ptx-spill-check: failed count reads still produce a PASS banner

1 participant