Skip to content

gpu tests: cs_w64x_null_mask, the null mask source row on Intel UHD 630 - #5713

Open
gertify wants to merge 1 commit into
ItsNotRexed:mainfrom
gertify:fix-contract-null-mask-source
Open

gertify wants to merge 1 commit into
ItsNotRexed:mainfrom
gertify:fix-contract-null-mask-source

Conversation

@gertify

@gertify gertify commented Nov 23, 2026

Copy link
Copy Markdown

The Null mask source row of the translator contract table was confirmed on the CPU interpreter only (tests/semantic/fixtures/null_mask_source.asm); this adds the GPU fixture that closes it and records the measurement in the row.

runtime/test/shaders/cs_w64x_null_mask.asm is a wave64 compute fixture in the shape of the other cs_w64x_* fixtures. It reads null as a lane mask four ways: s_bitcmp0_b64 null, 42 (bit 42 of the 64-bit zero), s_bcnt0_i32_b64 null (64 zero bits), s_ff1_i32_b64 null (no set bit, 0xffffffff), and a v_mov_b32_e32 under the EXEC that s_and_saveexec_b64 s[4:5], null leaves, so EXEC = EXEC & 0 and the write lands in no lane. The 32-bit forms (s_bcnt0_i32_b32, s_ff1_i32_b32), the complements (s_bitcmp1_b64, s_bcnt1_i32_b64) and one more vector write after s_mov_b64 exec, -1 fill the eight words; the last one shows the restore works, so out[3] is the null mask and not a dead write. The four words the CPU fixture asserts are the first four of these.

Measured with LEONIDA_W64_EMULATE=1 on Intel UHD Graphics 630 (Mesa 25.2.8 ANV, subgroups 8..32): scripts/run_gpu_tests.py --filter cs_w64x_null_mask gives PASS cs_w64x_null_mask 1 64 4294967295 7 9 0 32 4294967295, 1/1 passed, and vk_compute_test cs_w64x_null_mask.spv 1 dump prints the same out[0..7]. The device reports subgroups 8..32, so the wave64 program runs through --wave64-emulate; the row now names the measurement where it said the fixture was not GPU-verified. The expected words are registered in runtime/test/shaders/check.py and scripts/run_gpu_tests.py.

The negative control makes mask_src read null as -1 instead of 0. The same run then fails with FAIL cs_w64x_null_mask 1 32 0 9 9 32 32 4294967295 (0/1 passed), and tests/test_shader_checks.py (83 tests), tests/test_run_gpu_tests.py (41 tests) and the test_docs_*.py set (30 tests) pass.

AI-assisted.

@milas6669

Copy link
Copy Markdown

Tested cd1c3c9a on NVIDIA GeForce RTX 3070 (Ampere, GA104, driver 32.0.16.2124, subgroups 32..32), Windows 11, MSVC 19.44 + Ninja, RelWithDebInfo, Vulkan SDK 1.4.363, llvm-mc 21.1.8, with LEONIDA_VK_VALIDATION=1 and LEONIDA_W64_EMULATE=1: pass. The description's run is Intel UHD 630 (Mesa ANV); this is a second vendor and a different driver, and the output is identical.

  • scripts/run_gpu_tests.py --filter cs_w64x_null_mask --require-pass: 1 shaders: 1 translated, 1 pass spirv-val; PASS cs_w64x_null_mask 1 64 4294967295 7 9 0 32 4294967295, exit 0. Those eight words are exactly the ones in the description's Intel run, so the row's measurement now holds on two vendors.
  • --filter cs_w64x (the neighbouring wave64 fixtures, to check the runner/check.py change disturbs nothing): 20/20 passed.
  • CPU: tests/semantic/test_saveexec_variants.py (the test that uses null_mask_source.asm) and tests/test_shader_checks.py pass.

Worth knowing for other reviewers with a 32-wide GPU: without LEONIDA_W64_EMULATE=1 all of these skip here (SKIP (no 64-wide compute subgroup on this device), 0/20 passed, 20 skipped, and --require-pass then exits 1 with "no GPU tests passed"). That is the documented behaviour, not a failure of this PR, but a plain run on an NVIDIA or Intel card will look like a skip, not a pass.

Not tested: a native 64-wide device (AMD), Linux/Mesa, and the sentence the PR changes in docs/design.md beyond reading it.

AI-assisted. Synthetic shader only; no game data.

@javdc

javdc commented Nov 23, 2026

Copy link
Copy Markdown

Tested cd1c3c9 on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073.

  • Filter cs_w64x_null_mask: PASS (1/1).
  • Full GPU suite (run from PR worktree against existing runtime build): 213 passed / 233 total, 16 skipped, 0 failed (expected skips; no failures).

No runtime C++ changes in this PR; validated shader test/scripts/docs changes on-device.

AI-assisted (OpenCode).

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown
Author

Tested cd1c3c9 on AMD RADV RAPHAEL_MENDOCINO (Ryzen 9 9950X3D iGPU), native wave64 (subgroup 32..64, "native64_compute": true, LEONIDA_W64_EMULATE unset): run_gpu_tests.py --filter cs_w64x_null_mask prints "PASS cs_w64x_null_mask 1 64 4294967295 7 9 0 32 4294967295" and "1/1 passed". With LEONIDA_VK_DEVICE=NoSuchDevice it fails with "no Vulkan physical device matches". tests/test_shader_checks.py runs 86 tests OK and tests/test_run_gpu_tests.py runs 47 tests OK.

AI-assisted.

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

Reviewed head cd1c3c9a (4 files, +64/-3). Adds cs_w64x_null_mask.asm, expected words in both runners, and the design.md row.

Commands (RTX 5070 Ti):

  • no emulation: ... --filter cs_w64x_null_mask -> SKIP (no 64-wide compute subgroup), 0/1 passed
  • LEONIDA_W64_EMULATE=1 ... --filter cs_w64x_null_mask --require-pass -> PASS cs_w64x_null_mask 1 64 4294967295 7 9 0 32 4294967295, 1/1
  • negative control (mask_src null -> 0xFFFFFFFF) -> FAIL cs_w64x_null_mask 1 32 0 9 9 32 32 4294967295, matching the body; reverted
  • python -I -m pytest tests/test_shader_checks.py tests/test_run_gpu_tests.py tests/test_docs_links.py tests/test_docs_design_rows.py -q -> 143 passed, 374 subtests
  • git diff --check -> clean

The Intel UHD 630 / Mesa 25.2.8 ANV measurement in the design row is unverified here: no Intel GPU. This run corroborates the expected words through wave64 emulation on NVIDIA, not the Intel hardware result the row now cites.

Verdict: pass, with the Intel claim explicitly unverified.

@lunarminus

Copy link
Copy Markdown

Tested cd1c3c9a on an AMD Radeon 760M (RDNA3 iGPU, gfx1103, subgroup 32..64), RADV Mesa 26.3.1, CachyOS Linux: pass

  • What was tested: the branch already contains main d0835dd9 (its base is 561b65a8), so merging onto d0835dd9 was a fast-forward to cd1c3c9a. The comparison below therefore also covers main's changes from d0835dd9 to 561b65a8, not only this PR's 4 files.
  • Test programs: built (RelWithDebInfo) in a separate worktree whose runtime/ sources, apart from runtime/test/shaders, are identical to cd1c3c9a.
  • CPU tests: all OK.
    • tests/test_shader_checks.py: 82 tests.
    • tests/test_run_gpu_tests.py: 47 tests.
    • tests/test_docs_*.py: 33 tests.
    • tests/semantic/test_saveexec_variants.py: 9 tests, including test_null_mask_source.
  • scripts/run_gpu_tests.py, full suite:
    • Native: 239/239 shaders translated and spirv-val clean; 217/233 passed, 16 skipped.
    • LEONIDA_W64_EMULATE=1: the same, 217/233 passed, 16 skipped.
    • PASS cs_w64x_null_mask 1 64 4294967295 7 9 0 32 4294967295 in both modes.
  • Per-test comparison with d0835dd9 without the PR (196/210 passed, 14 skipped, in both modes): no PASS/FAIL/SKIP change on any test present in both runs, in either mode. 23 test names are new:
    • cs_w64x_null_mask comes from this PR.
    • The other 22 (20 PASS, 2 SKIP: ps_live_width, ps_m2_literal) are fixtures main added between d0835dd9 and 561b65a8.
  • --filter cs_w64x_null_mask: 1/1 passed in each mode.
  • Native wave64: vk_compute_test cs_w64x_null_mask.spv 1 dump --require-wave64 printed compute subgroup size: 64, 0 mismatches, and out[0..7] = 1 64 4294967295 7 9 0 32 4294967295. That is the same as the PR's LEONIDA_W64_EMULATE=1 result on Intel UHD 630, here on a 64-wide subgroup without emulation.
  • Emulated translation: the SPIR-V from LEONIDA_W64_EMULATE=1, run without --require-wave64, gave the same eight words.

AI-assisted (Claude Code).

@vanoizer

Copy link
Copy Markdown
Contributor

Tested cd1c3c9 (CPU part only), Windows 11:

Setup: Windows 11. GPUs are an AMD Ryzen 7 9800X3D iGPU (RDNA2 gfx1036, driver 26.11.2, subgroup 32..64) and an RTX 4070 Ti SUPER (NVIDIA 621.14, subgroup 32). Each PR was tested in its own worktree with:

  • the PR's own tests (pytest);
  • python -m unittest discover -s tests/semantic;
  • scripts/run_gpu_tests.py three times: AMD native wave64, NVIDIA native, and NVIDIA with LEONIDA_W64_EMULATE=1.

Baseline is main 561b65a8:

Run Passed
AMD native 215/232, 0 failed
NVIDIA native 183/232, 1 failed
NVIDIA emulated 214/232, 1 failed

The NVIDIA failure is ms_wave_info_s3 (known, #5741).

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.

6 participants