Skip to content

gpu tests: record cs_tbuffer_store, drop the duplicated cs_fmt_d16_xyz row - #5265

Open
TurboSosiska304 wants to merge 1 commit into
ItsNotRexed:mainfrom
TurboSosiska304:fix/runner-tbuffer-result
Open

TurboSosiska304 wants to merge 1 commit into
ItsNotRexed:mainfrom
TurboSosiska304:fix/runner-tbuffer-result

Conversation

@TurboSosiska304

Copy link
Copy Markdown

Claimed in the coordination issue as a new item (no tracker ID yet).

What was wrong

scripts/run_gpu_tests.py has a dispatch branch per fixture, and each one appends exactly one (name, ok, detail) row. Two branches were wrong:

elif name == "cs_tbuffer_store":
    problem = tbuffer_store_test(a.build, spirv_dir, cs_env)      # no results.append
elif name == "cs_fmt_d16_xyz":
    problem = fmt_d16_xyz_test(a.build, spirv_dir, cs_env)
    results.append((name, not problem, problem or "80/80 dumped words exact"))
    results.append((name, not problem, problem or "128/128 dumped words exact"))   # belongs to tbuffer

So the cs_tbuffer_store fixture produced no row at all, and cs_fmt_d16_xyz produced two:

$ python3 -I scripts/run_gpu_tests.py --build <build> --filter cs_tbuffer_store
error: --filter 'cs_tbuffer_store' selected cs_tbuffer_store but no runnable GPU test cases (inputs without a GPU test row)
$ python3 -I scripts/run_gpu_tests.py --build <build> --filter cs_fmt_d16_xyz
  PASS  cs_fmt_d16_xyz        80/80 dumped words exact
  PASS  cs_fmt_d16_xyz        128/128 dumped words exact
2/2 passed

A full run therefore printed 217 rows for 216 distinct fixtures, and the tbuffer fixture — which check.py does run — could not be run through the scripted runner at all. check.py was always fine; this is the run_gpu_tests.py dispatch only.

The change

  • cs_tbuffer_store appends its row (128/128 dumped words exact, the 128 words tbuffer_store_test checks);
  • the stray 128/128 append is removed from cs_fmt_d16_xyz;
  • result_audit(names, results, optional=...) reports a selected fixture with no row, one with more than one row, and a row for a fixture that was not selected; run_suite prints each problem as result audit: ... and exits 1. Names in optional may have no row: helper shaders built only for another test (vs_ids, vs_f16_pack, vs_interp_consts, the DRAWN_WITH/PIXEL_VERTEX/mip-dependency values) and the cs_bench_* inputs, which are not tests. ps_clip_color is both a drawn helper and a test, so it is only exempt when it has no row — a row is never "unexpected" for it.
  • five unit tests in tests/test_run_gpu_tests.py cover the helper.

The audit is what makes this class of bug loud instead of silent: a forgotten or copy-pasted results.append now fails the run.

Tested

RX 570 (Polaris 10, gfx803), RADV Mesa 26.2.6, Vulkan 1.4.354, Linux 7.3.4, native 64-wide subgroups; harness built from the same commit 3faac55:

  • --filter cs_tbuffer_store -> PASS, 128/128 dumped words exact, 1/1 (before: exit 2, no row);
  • --filter cs_fmt_d16_xyz -> 1/1, one row (before: 2/2, two rows);
  • --filter cs_ -> 81/104 passed, 23 skipped, no result audit lines, exit 0 (the cs_bench_* exclusion was found by running this: cs_bench_mix was reported before the fix);
  • full suite -> 172/217 passed, 45 skipped, exit 0, no result audit lines (the partner exclusion was found the same way: vs_ids, vs_f16_pack and vs_interp_consts were reported before it);
  • python3 -I tests/test_run_gpu_tests.py -> 46 tests OK (41 before, 5 new).

No game files; the fixtures are the repository's own synthetic shaders.

@tylerstraub

Copy link
Copy Markdown
Contributor

Replying to @TurboSosiska304.

There is a second measured example for the row audit on #2311. On that branch at 89c15aaa, changing one expected bit in cs_fmt_sint32 still gave 5/5 passed under the grouped cs_fmt_ filter: the missing fixture and the duplicate cs_fmt_d16_xyz row cancelled in the total. Moving the result append back to its owner exposed the wrong word immediately.

That gives an integration check when the branches come together: with the misplaced append, the audit should name both the missing and duplicate fixtures even though the counts balance. With the append repaired and the expected bit still flipped, the runner should report one failing cs_fmt_sint32 row. The 64-word append on #2311 and the 128-word tbuffer append fixed here belong to different fixtures.

AI-assisted.

@tylerstraub

Copy link
Copy Markdown
Contributor

Tested 3122e733539a5faa7cf5eb200f6a4865a12f7f6e on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

On Linux with a GeForce RTX 5090 (driver 595.99.02), I rebuilt the harnesses at 3122e733 and ran the two filters separately. Each produced exactly one PASS row: cs_tbuffer_store matched 128/128 words and cs_fmt_d16_xyz matched 80/80.

I then checked the balanced-count case in a temporary copy. I limited selection to those two fixtures and moved the 128-word result append back under cs_fmt_d16_xyz, leaving the audit and shaders intact. Both shaders translated and validated. The runner printed 2/2 passed, but exited 1 and named both problems: cs_tbuffer_store: selected but no result recorded and cs_fmt_d16_xyz: 2 results recorded. This verifies that the audit catches the reporting error even when the total looks correct.

AI-assisted verification.

@Kam471 Kam471 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.

Head 3122e7335. git diff --check clean.

  • python -I -m pytest tests/test_run_gpu_tests.py -q -> 46 passed, 49 subtests passed (41 before + 5 ResultAudit).
  • Negative control with the parent runner (3faac557b) and the same build: --filter cs_tbuffer_store -> exit 2, error: --filter 'cs_tbuffer_store' selected cs_tbuffer_store but no runnable GPU test cases; --filter cs_fmt_d16_xyz -> two rows, 2/2 passed. With the PR: PASS cs_tbuffer_store 128/128 dumped words exact, 1/1; PASS cs_fmt_d16_xyz 80/80 dumped words exact, 1/1.
  • Full suite, RTX 5070 Ti (Vulkan 1.4.363, harness built from 3faac557b): 170/217 passed, 47 skipped, exit 0. 217 result lines for 217 distinct selected fixture names, and 0 result audit: lines, so no branch on this device forgot, duplicated, or invented a row. --filter cs_: 70/104 passed, 34 skipped, exit 0, no audit lines. (The two skip-count differences from the body are device capabilities, not rows.)
  • Static read of run_suite: the two continue paths (ps_ij_computed without PerVertexKHR, missing .spv) each append first, and every branch of the dispatch appends exactly once, so the new exit-1 condition cannot fire on a legitimate skip.
  • optional= only relaxes the "selected but no row" side; a row is still flagged if its name was not selected, so the exemption can't hide the cs_fmt_d16_xyz class of bug.

Verdict: merge. This makes the original silent row shift loud, and the dispatch is now complete for both fixtures.

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 3122e73 on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_run_gpu_tests.py -> Ran 46 tests, OK
  • Negative control (scripts/run_gpu_tests.py swapped to upstream/main): FAILED (errors=5)
  • Runner itself not exercised (no GPU); only its test suite.

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@sovljanskii

Copy link
Copy Markdown
Contributor

AI-assisted. Independent run on an Apple M4 (macOS, MoltenVK 1.4.2) at 3122e733, which already contains main 3faac557. The runtime was built from main, because the branch changes no C++.

Full suite. scripts/run_gpu_tests.py gives 152/217 passed and 58 skipped, the same totals as main on this machine. Compared row by row, the only change is the one this PR describes:

  • on main, the second cs_fmt_d16_xyz row reads PASS cs_fmt_d16_xyz 128/128 dumped words exact;
  • here, that row reads PASS cs_tbuffer_store 128/128 dumped words exact.

No other row changed status or detail. The new result audit printed nothing.

Single fixtures.

--filter main this PR
cs_tbuffer_store error: ... selected cs_tbuffer_store but no runnable GPU test cases PASS cs_tbuffer_store 128/128 dumped words exact, 1/1
cs_fmt_d16_xyz two PASS rows (80/80 and 128/128), 2/2 one PASS row (80/80), 1/1

Unit tests. tests/test_run_gpu_tests.py: 46 tests OK on Python 3.12, 3.14 and 3.15.

…6_xyz row

The dispatch branch for cs_tbuffer_store computed `problem` and never appended it, so the fixture produced no
row at all: `--filter cs_tbuffer_store` answered "selected ... but no runnable GPU test cases" (exit 2) and a
full run showed 217 rows for 216 fixtures. The `128/128 dumped words exact` append that belonged to it sat in
the cs_fmt_d16_xyz branch, which therefore recorded that fixture twice (80/80 and 128/128).

Both fixed. result_audit() then checks that every selected fixture recorded exactly one row and that no row
names a fixture that was not selected, and run_suite fails when it does not, so a forgotten or duplicated
append cannot pass silently again. Helper shaders built only for another test (DRAWN_WITH/PIXEL_VERTEX/
TEXTURE_MIP_DEPENDENCIES values) and the cs_bench_* inputs are exempt from the "no row" check: they are not
tests, though a row for one is still accepted (ps_clip_color is both). Five unit tests cover the helper.

On RX 570 (gfx803, RADV Mesa 26.2.6) at 3faac55, harness built from the same commit:
--filter cs_tbuffer_store now PASS 128/128 dumped words exact, --filter cs_fmt_d16_xyz 1/1, the full suite
172/217 with 0 audit problems and exit 0, and tests/test_run_gpu_tests.py 46 tests OK.
@TurboSosiska304
TurboSosiska304 force-pushed the fix/runner-tbuffer-result branch from 3122e73 to 69d71dc Compare November 23, 2026 14:41
@TurboSosiska304

Copy link
Copy Markdown
Author

Rebased onto 1cc6e3c (the PR was DIRTY after the last merges). One conflict, in the cs_global_neg_offset branch header, which now reads elif name in ("cs_global_neg_offset", "cs_global_mem_ext") on main; both changes are kept and the two-line fix plus the audit are unchanged. python3 -I tests/test_run_gpu_tests.py -> 54 tests OK on the rebased head 69d71dc (the file grew from 46 to 54 with other merges).

@tylerstraub

Copy link
Copy Markdown
Contributor

Tested 69d71dccaf67ba21484e2be42bf16437f4676c5d on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

On the rebased head, each filtered fixture produced exactly one PASS row: cs_tbuffer_store matched 128/128 words and cs_fmt_d16_xyz matched 80/80. All 54 runner tests passed.

For a negative control I moved the tbuffer result append back under the d16 branch in a temporary copy, leaving the audit in place. I selected both affected fixtures together. Both shaders translated and passed SPIR-V validation. The summary still printed 2/2 passed, but the audit named both errors: no row for cs_tbuffer_store and two rows for cs_fmt_d16_xyz. The process exited 1. This verifies the audit catches the original failure even when the total number of rows equals the number of selected fixtures.

AI-assisted verification.

@Mortify7612

Copy link
Copy Markdown

Tested 69d71dcc merged onto main 1cc6e3c1 (clean) on AMD Radeon RX 9060 XT (RDNA4, GFX1200), RADV Mesa 25.0.7, Debian 12 Linux: pass. The bug shows up on main here exactly as described.

run_gpu_tests.py main this PR
--filter cs_tbuffer_store no result row at all PASS cs_tbuffer_store 128/128 dumped words exact, 1/1
--filter cs_fmt_d16 PASS cs_fmt_d16_xyz 80/80 and PASS cs_fmt_d16_xyz 128/128 (the tbuffer result under the wrong name), 2/2 PASS cs_fmt_d16_xyz 80/80, 1/1

#1529 has the same pattern (a new elif between problem = ... and its results.append), and anything else of that shape would be worth a quick scan. AI-assisted (Claude Code).

@Nithin1777

Copy link
Copy Markdown

Tested 69d71dcc on Bazzite 45 (Kinoite), NVIDIA GeForce RTX 3050 6GB Laptop GPU, driver 620.70.06. The harness binaries were built from the identical runtime sources at base 1cc6e3c1.

  • --filter cs_tbuffer_store --require-pass: one PASS row, 128/128 words exact.
  • --filter cs_fmt_d16_xyz --require-pass: one PASS row, 80/80 words exact.
  • python3 -I tests/test_run_gpu_tests.py: 54/54 passed.
  • --filter cs_fmt --require-pass: the new audit correctly returned exit 1 for cs_fmt_all: selected but no result recorded. Base 1cc6e3c1 already lacked that dispatch row. I tested a separate local change to call the existing check.py verifier for that fixture. With it applied, the format group was 6/6, cs_fmt_all matched 336/336 words, and the broader cs_ run gave 104/108 passed, four skipped, no audit errors.

Synthetic fixtures only. AI-assisted with Codex.

@bunbeans2-arch

Copy link
Copy Markdown

Tested 69d71dc on AMD Radeon RX 9070 XT (RDNA4, subgroup 32..64), AMD Windows Vulkan driver, Windows 11 23H2.

  • py -I scripts/run_gpu_tests.py --require-pass: 219/235 passed, 16 skipped, no FAIL rows. Exit 1 only from the new
    audit, result audit: cs_fmt_all: selected but no result recorded, the same gap reported above (main's
    cs_fmt_all.asm has no dispatch row yet).
  • wave64 graphics run: 25 ok, 4 skipped (tier C needs a device that can require both 64 and 32).
  • pytest tests/test_run_gpu_tests.py: 54 passed, 84 subtests passed.

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

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