Skip to content

check: name a lost stdout when a compute test exits 0 with no result - #7439

Open
bobcatchris wants to merge 2 commits into
ItsNotRexed:mainfrom
bobcatchris:fix/check-empty-stdout
Open

bobcatchris wants to merge 2 commits into
ItsNotRexed:mainfrom
bobcatchris:fix/check-empty-stdout

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

Claimed on board #7333 (unclaimed finding 7107367864 by iTzAlvar). CPU-side diagnostic fix; no game data, no GPU needed to test it.

The finding reports compute runs that exit 0 with empty stdout, where check.py reported only exit 0: device: ... — the last stderr line — so the failure looked like a test result rather than a lost result line. compute_test() now appends an explicit note when the exit is 0 and no out[0..7], N mismatches or compute subgroup size: line was seen. This does not change which tests pass or fail, only the diagnostic.

Tested: new regression Wave32LaneDumps.test_exit_zero_without_a_result_line_says_stdout_was_lost fails on unpatched main with the exact message from the finding (exit 0: device: RTX 5080 ...), passes with the fix. python3 -I tests/test_shader_checks.py 85 tests, with the same 15 pre-existing harness() got an unexpected keyword argument 'cwd' errors as clean main 8575d36ed (84 tests, same 15 errors) — reproduced in a separate worktree, so no new errors. git diff --check clean.

AI-assisted.

@devnull34 devnull34 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verified: passes all 13 tests in Wave32LaneDumps. When a compute test exits 0 with no result line matching expected patterns, it accurately clarifies '(no result line from vk_compute_test; stdout may have been lost)' instead of an ambiguous failure report.

@philip-roy-jones

Copy link
Copy Markdown

I checked 2b470901 against a Windows 11 replay with 12 synthetic child-process cases. The replay checked stdout, stderr and exit status separately before passing the output to compute_test(). The original case is covered: with empty stdout, a device line on stderr and exit 0, the checker preserves the device line and reports the missing result.

Four exit-zero inputs show where the final prefix check disagrees with the expected result format:

Captured stdout Diagnostic on this revision
out[0..7] = truncated in dump mode The prefix suppresses the missing-result note even though the eight words are absent.
compute subgroup size: 32 alone in dump mode The subgroup line also suppresses the note. The expected dump is absent.
1 groups x 64: 2 mismatches The checker prints the count and adds a note saying no result line appeared.
2x3x4 workgroup Y/Z: 2 mismatches The same note appears alongside the workgroup mismatch count.

A fifth child printed only running compute. The result was missing, but stdout contained the progress line. I'd have each mode distinguish a missing or malformed result from a parsed result with wrong values, and name the expected result in the diagnostic. That would preserve a reported mismatch count and avoid guessing why an expected line is absent. Result parsing and diagnostic at the tested revision

Valid results in all three formats passed. A wrong numeric dump retained its output, exit 1 retained the pipeline error, and exit 77 retained the unsupported-device skip. A local comparison change passed four focused regression methods on Windows Python 3.11.9 and 3.12.6. Discovery on its base and patch showed the same 15 existing mock errors. With #7094 applied to a scratch copy of the local patch, discovery passed 92/92. This replay exercised the Python checker on CPU. The cause of the GPU process's intermittent missing output remains open.

@morodirule

Copy link
Copy Markdown

Tested 2b47090 on Arch Linux, Python 3.14.10, CPU only: pass — Wave32LaneDumps 13/13 OK including the new lost-stdout test. Negative control: merge-base check.py → exactly 1 failure (the new test; old code prints the bare device line); the full file's 15 mock-harness errors are identical before/after, i.e. pre-existing. Complements #7484 (verified composable, different layers). No game files, no GPU. AI-assisted.

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested 2b47090 on Windows 11 (CPU only, no GPU needed): pass

Windows 11 Pro, Python 3.14.7, CPU only (no GPU or game files involved); pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto main 51e7c9d, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).

Note: this PR and #7433 touch the same test file; with both applied the whole file is green.

AI-assisted (Claude Code, Claude Opus 5.5).

The exit-0 lost-stdout note matched a line prefix, so a truncated dump
or a prefixed mismatch count silenced or contradicted it. Check the
mode's actual result line and call an unreadable dump malformed.
@bobcatchris

Copy link
Copy Markdown
Contributor Author

Thanks for the replay. All five cases are handled at 62dcdb2d7:

  • dump mode now looks for the mode's own line: missing out[0..7] = <8 words> names that expected line; a present but unreadable line (your truncated case) is reported as malformed result line, not lost stdout.
  • workgroup_yz looks for its exact 2x3x4 workgroup Y/Z: <n> mismatches line, so a count is preserved and not labelled lost.
  • other modes use the same <n> mismatches search as the parser, so 1 groups x 64: 2 mismatches keeps its count.
  • stdout with only running compute (or only a device/subgroup line) still gets the explicit lost-stdout note.

Four focused regression methods cover the four table rows. They fail 4/4 at 2b4709018 (the old prefix check) and pass here.

python -I tests/test_shader_checks.py: 89 tests, the same 15 pre-existing harness() got an unexpected keyword argument 'cwd' errors as main, no new failures. compileall, check_no_game_data.py and git diff --check: pass. CPU only; no game data.

AI-assisted.

@Saa1001zp

Copy link
Copy Markdown

CPU-only check on Linux (Python 3.14.10, no GPU needed), base dde82f27e.

  • The five new tests pass: python -I tests/test_shader_checks.py -k stdout_was_lost, -k subgroup_line_names, -k truncated_dump, -k prefixed_mismatch, -k workgroup_mismatch → 1 test each, OK.
  • Whole file: 89 tests, 15 errors. On unpatched main the same file gives 84 tests and the same 15 errors, so the errors are pre-existing and not this PR (harness() got an unexpected keyword argument 'cwd').
  • Read the new block against the pass paths above it: a real N mismatches line, a 2x3x4 workgroup Y/Z: N mismatches line and a well-formed but wrong out[0..7] dump all fall through to the plain failure(code, out, 2) without a lost-stdout note, so only the exit-0-with-no-result case gains text. The diagnostic is appended last and failure(..., 3) keeps it.

Nothing found beyond the author's own report. AI-assisted.

@NiHuShu

NiHuShu commented Nov 23, 2026

Copy link
Copy Markdown

AI-assisted check on CachyOS x86-64, CPython 3.14.10. CPU only; GPU not used. Compared 8575d36edc479218972497a7bded8651a42856c0 and 62dcdb2d7830d457649b0478db134354a6928219. python -I independent.py called check.compute_test with a real synthetic child named vk_compute_test. It exited 0, wrote the mode’s result to stdout, then wrote two lines to stderr (device and subgroup). Six inputs per revision, zero skips.

The correct eight-word dump passed on both. Head distinguished missing stdout from a truncated dump; base gave the same two stderr lines for both. One limit remains when the child returns a valid but wrong result: for a wrong eight-word dump, 1 groups x 64: 2 mismatches, and 2x3x4 workgroup Y/Z: 2 mismatches, both revisions correctly failed the check, but all three messages contained only the device and subgroup lines. None retained the words or mismatch count. run() joins stdout before stderr and failure(..., 2) keeps the final two lines. This is pre-existing and separate from the missing-result fix.

@matheusfermiano-source

Copy link
Copy Markdown

Tested 62dcdb2d7 (the PR's diff applied on main dde82f2), full python -I scripts/run_gpu_tests.py, each GPU compared with main on the same machine and binaries, CachyOS Linux: pass.

GPU Driver main this PR Difference
AMD Radeon 660M (RDNA2 iGPU, gfx1035, Ryzen 5 7535HS), subgroup 32..64 RADV, Mesa 26.3.1 225/241 passed, 16 skipped 225/241 passed, 16 skipped same results as main
NVIDIA GeForce RTX 3050 Laptop (Ampere), subgroup 32 NVIDIA 620.73.04 192/241 passed, 48 skipped 192/241 passed, 48 skipped fails on main too: ms_wave_info_s3 (#6172)
AMD Radeon Vega 8 (GCN 5 iGPU, gfx90c, Ryzen 7 5825U), subgroup 64 RADV, Mesa 26.2.6 193/241 passed, 48 skipped 193/241 passed, 48 skipped same results as main

No game files. AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants