Skip to content

check.py: run cs_buf_load_sub, cs_buf_fmt8 (TEST-510) and cs_f64_add, which only run_gpu_tests.py checked - #7741

Open
fearkov wants to merge 3 commits into
ItsNotRexed:mainfrom
fearkov:tests/check-compute-rows
Open

fearkov wants to merge 3 commits into
ItsNotRexed:mainfrom
fearkov:tests/check-compute-rows

Conversation

@fearkov

@fearkov fearkov commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Claimed in #7333 as: #7333 (comment)

What and why

runtime/test/shaders/check.py has no check for three GPU fixtures that scripts/run_gpu_tests.py judges:

  • cs_buf_load_sub and cs_buf_fmt8, the sub-dword MUBUF loads and GFX10_FORMAT_8_UINT (TEST-510);
  • cs_f64_add.

CONTRIBUTING.md and docs/testing.md describe the two-step run, build.py <out> then check.py <out> <programs>. build.py builds all three, but check.py never runs them: none of them is among the 211 rows check.py prints on main 042c5f3. So a translator change that breaks the byte and short loads, the element-size end check or the 8_UINT format passes that run.

A scan of every cs_*.asm fixture, against the names check.py's main() reports, finds exactly these three. The fixtures another harness owns (OTHER_HARNESS) and the benchmark input cs_bench_mix are left out of the scan.

The fix adds them with the words their .asm headers derive, the same words run_gpu_tests.py judges:

  • cs_buf_load_sub and cs_buf_fmt8 go into BOUNDS, next to the other one-group raw-MUBUF rule dumps.
  • cs_f64_add gets F64_ADD_WORDS and its own compute_test row. A device without shaderFloat64 makes vk_compute_test exit 77 with an unsupported: line, and that row then reads as a skip.

Commits:

  1. check.py: run cs_buf_load_sub and cs_buf_fmt8 (TEST-510).
  2. check.py: run cs_f64_add.
  3. Tests: tests/test_shader_check_compute_rows.py (standard library, no GPU). It collects check.py's rows with stand-in helpers and fails when a compute fixture run_gpu_tests.py judges has none. It also checks that the words are the ones the .asm headers name, and that compute_test passes the right dump, fails a dump with one wrong word and skips cs_f64_add without Float64. tests/test_shader_checks.py gets the new row in TOTAL and an answer for cs_f64_add in its harness. Note: tests/test_shader_checks: stub table_fetch_test in the Wave64Checks harness (15 errors on main) #7433 also bumps TOTAL (for ps_table_fetch), so whichever lands second makes it + 17. With both applied, all 84 tests pass.

Tested

Linux, Python 3.14.10 (python3 -I), NVIDIA GeForce RTX 2060 SUPER (driver 620.70.06), on main 042c5f3:

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.

@CourtyardGames

Copy link
Copy Markdown

Integration check on Windows, CPython 3.12.13 and 3.14: I combined the checker in b3557e4 with #7740 at 34fb524 using their common checker blob. With a stand-in reporting a wrong high word for the new cs_f64_add row and the table fetch returning a silent 77, this PR alone prints the cs_f64_add failure but exits 0. With both patches the checker prints the failure, labels the table fetch SKIP, and exits 1. Both interpreters agreed. This is the existing skip-accounting issue, and #7740 fixes it for the new row too. Synthetic runner test, CPU only, AI-assisted.

@inf1425

inf1425 commented Nov 23, 2026

Copy link
Copy Markdown

Tested b3557e4c9 on native Windows: pass, on two GPUs. The PR's check.py and main's were run against the same programs and fixtures.

Setup: Windows 11 build 26300, VS 2026 (MSVC 14.52) RelWithDebInfo, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.1, llvm-mc 23.1.6 (conda-forge), Python 3.15.2. The test programs were built from main 603d53eb3. build.py ran from this PR's tree: 269/269 translated, 269 pass spirv-val. I switched GPUs with LEONIDA_VK_DEVICE.

GPU, driver main check.py this PR's check.py
NVIDIA GeForce RTX 4060 Laptop (Ada, subgroup 32), 616.64 176 of 211 pass, 35 skipped 179 of 214 pass, 35 skipped
AMD Radeon 780M (RDNA3 iGPU, 0x15bf), 26.11.2 (LLPC) 208 of 211 pass, 3 skipped 211 of 214 pass, 3 skipped
  • On both GPUs the three new rows, cs_buf_load_sub, cs_buf_fmt8 and cs_f64_add, report ok with the words in the .asm headers. cs_f64_add ran on both GPUs (both have shaderFloat64), so the exit-77 skip path wasn't exercised on hardware.
  • The other 211 rows are identical between main and the PR on each GPU (line diff of the output: 0). The skips are the same as main's: the 3 mesh fixtures build.py doesn't build on AMD, plus the wave64-on-request ones on NVIDIA.
  • tests/test_shader_check_compute_rows.py: 4/4 OK. Negative control: with main's check.py swapped in, it fails and names cs_buf_fmt8, cs_buf_load_sub and cs_f64_add.
  • tests/test_run_gpu_tests.py: 58 OK. tests/test_shader_checks.py: the same 15 errors on main and the PR (the harness() cwd issue you mention, fixed by tests/test_shader_checks: stub table_fetch_test in the Wave64Checks harness (15 errors on main) #7433).

Synthetic fixtures only, no game files. AI-assisted (Claude Code).

@kamilolejnik

Copy link
Copy Markdown

Tested b3557e4 on Intel Iris Xe Graphics (TGL GT2, Xe-LP, no shaderFloat64), Mesa ANV 26.3.1, Vulkan 1.4.363, Linux 6.12 (Arch container), llvm-mc 23.1.5, CPython 3.14: pass. This covers the exit-77 path for cs_f64_add that the Windows runs above couldn't reach.

The CONTRIBUTING two-step run (build.py <out> then check.py <out> <programs>), programs built once from the merge-base 042c5f3:

merge-base check.py this PR's check.py
summary 166 of 211 pass, 45 skipped, exit 0 168 of 214 pass, 46 skipped, exit 0
cs_buf_load_sub (not run) ok
cs_buf_fmt8 (not run) ok
cs_f64_add (not run) SKIP (unsupported: …cs_f64_add.spv uses Float64 and the device has no shaderFloat64)

Every one of the other 211 rows is identical to the merge-base's (only the out-dir name differs in the skip reasons). tests/test_shader_check_compute_rows.py: 4 OK.

Synthetic fixtures only, no game files. AI-assisted (Claude Code).

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

Merge-skew defect: the new test requires every cs_* fixture judged by run_gpu_tests.py to have a check.py row, but the PR’s actual base dde82f27 contains runtime/test/shaders/cs_div_fmas_f64.asm (added by #6635) and run_gpu_tests.py:1093-1105 judges it, while check.py has zero cs_div_fmas_f64 rows. The PR adds only cs_buf_load_sub, cs_buf_fmt8 and cs_f64_add.

I ran the test’s check_rows()/judged logic against base dde82f27:

base check rows 211
fixtures 113, judged 108
missing ['cs_buf_fmt8', 'cs_buf_load_sub', 'cs_div_fmas_f64', 'cs_f64_add']

At the head it passes only because the branch is based on 042c5f37, before cs_div_fmas_f64 existed; on the actual base the new test fails with cs_div_fmas_f64 missing.

Fix: add the cs_div_fmas_f64 row with the same rule run_gpu_tests.py uses — fused [0, 0x3c300000]; split [0, 0] allowed only without shaderFmaFloat64; exit 77 without shaderFloat64 is a Skip — and increment TOTAL. Head currently prints 214 rows vs TOTAL 213; with #7433 it is 214/214, so the new row makes 215 and TOTAL needs adjusting. The test_shader_check_compute_rows does not compare TOTAL.

The three added rows themselves match their headers/semantics. Synthetic only; no game files. AI-assisted (OpenCode).

@Kev-Ball

Kev-Ball commented Nov 23, 2026 •

Copy link
Copy Markdown

Tested b3557e4c9 on CachyOS, GeForce RTX 3080 Ti (Ampere), NVIDIA 620.73.04, native Vulkan. Both versions of check.py used the same six Linux test binaries and the same 269 shaders built from the PR. All 269 passed spirv-val.

Checker Passed Skipped Failed
Parent 042c5f378 176 35 0
PR b3557e4c9 179 35 0

The three added rows, cs_buf_load_sub, cs_buf_fmt8 and cs_f64_add, all ran and passed. Comparing by fixture name, every one of the original 211 rows retained its exact result. Both checker processes exited 0. Synthetic fixtures only. AI-assisted QA.

Integration follow-up. I reproduced the current-main inventory failure on a clean merge with dde82f27e. The merged test enumerated 214 checker rows, including all three additions above, but cs_div_fmas_f64 was missing. That single missing row failed 1 of 4 inventory tests. The hardware table above describes the standalone PR head.

@rojasruiz

Copy link
Copy Markdown

Tested b3557e4 on Linux 7.2.15, CPython 3.14. At the head, tests/test_shader_check_compute_rows.py passes (4 OK). Merged onto current main dde82f2 (clean textual merge), it fails:

FAIL: test_every_compute_fixture_run_gpu_tests_judges_has_a_check_py_row
AssertionError: Lists differ: ['cs_div_fmas_f64'] != []

cs_div_fmas_f64 came to run_gpu_tests.py with #6635 (--fma khr covers the f64 FMAs), after this branch's base 042c5f3, and check.py has no row for it. So the new test does what it's for, but this PR needs a check.py row for cs_div_fmas_f64 (or a merge of main plus that row) to be green when it lands.

The 15 errors in tests/test_shader_checks.py (harness() got an unexpected keyword argument 'cwd') are not from this PR. main has them too, and #7094 / #7433 / #7122 fix them.

On the GPU (NVIDIA RTX 3080, 615.78.08), check.py <build> <build> gives 176 of 211 pass, 35 skipped on this branch merged, the same as main. run_gpu_tests.py gives 192/241, also the same as main.

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.

7 participants