Skip to content

check.py: request 32 lanes for the wave32 lane-mask dumps, as run_gpu_tests.py does (#774) - #988

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
jdotcollins:check-py-pin-wave32-lanes
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
jdotcollins:check-py-pin-wave32-lanes

Conversation

@jdotcollins

@jdotcollins jdotcollins commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #774 test-setup part (no item ID yet)

What and why

Settles the runner disagreement in #774. This is the test-setup half only; the remaining single wrong words belong to SHADER-92 / #820.

run_gpu_tests.py runs cs_wqm_w32, cs_w32_lane_wrap, cs_w32_permute and cs_bpermute32 with VKC_SUBGROUP_SIZE taken from index.json (32). check.py sends no subgroup request for them. On a device whose range is 8..32 (Intel ANV), the driver can then pick a narrower size, so the two runners judge different words from the same SPIR-V (see the table in #774). narrow_subgroup_skip looks at the device's maximum, so it can't catch this.

  • check.py: compute_test adds VKC_SUBGROUP_SIZE=32 (WAVE32_LANE_ENV) for WAVE32_LANE_DUMPS.
  • run_gpu_tests.py: requests 32 for those dumps even when index.json is missing.
  • vk_compute_test: when VKC_SUBGROUP_SIZE is set and --require-wave64 isn't, it prints compute subgroup size: N if the request is honoured (subgroup size control, or a device fixed at N), or compute subgroup size: N not available if it isn't.
  • Both runners skip these dumps through a shared wave32_lane_skip (device narrower than 32, or 32 not pinnable) instead of reporting wrong words. Output from an older vk_compute_test has no such line and is judged as before.

Tested

  • python -I tests/test_shader_checks.py (35 OK), tests/test_run_gpu_tests.py (21 OK), tests/test_run_gpu_wavemask.py (5 OK). New tests cover the 32-lane request, the not-pinnable skip, judging when pinned, and both runners sharing the rule.
  • runtime/test/vk_compute_test.cpp: syntax-checked with MSVC 2022 (/Zs /W4 /std:c++20) against Vulkan-Headers, with no new warnings.
  • No GPU run: I don't have an 8..32 device. On Intel ANV, check.py should now report the same words as the pinned run_gpu_tests.py reading in GPU tests cs_exec64, cs_w32_permute and cs_wqm_w32: two runs, different words (Intel ANV, subgroup 8..32) #774. A run there would confirm it.

AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

@whattheflop

Copy link
Copy Markdown
Contributor

Independent AI-assisted CPU-only verification of ad178e85b2379cae1f001ecfa183daeb4c204091 on Windows with uv-managed CPython 3.12.13 (python -I -B): tests/test_shader_checks.py 35/35, tests/test_run_gpu_tests.py 21/21, tests/test_run_gpu_wavemask.py 5/5.

I also mocked the harness at the runner call sites for all four lane dumps (28 check.py cases and 112 run_gpu_tests.py cases). Both requested 32 despite an inherited size of 16, judged matching and mismatching dumps with a confirmed size or an older harness, and skipped when 32 was reported unavailable. The one-step runner behaved the same with no index.json, no shader entry, no subgroup_size field, and an explicit size of 32. No Intel GPU was tested.

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine, runtime built from this PR's head (MSVC 14.51, ctest 33/33 on NVIDIA). check.py on a build.py output:

wave32 lane-mask dump RTX 4080 SUPER (32.0.16.1714) Intel UHD 770 (32.0.101.6129, subgroup 8..32)
cs_w32_lane_wrap ok ok
cs_bpermute32 ok ok
cs_w32_permute ok out[0..7] = 218 29 8 211 0 127 183 15
cs_wqm_w32 ok out[0..7] = 12 1 4 0 16 15728880 4 32

The two Intel mismatches aren't a lane-count problem, so this PR is right to request 32 lanes and still see them. They're exactly the constant-EXEC words that #820 fixes (127 183 in cs_w32_permute's case C, 16 in cs_wqm_w32's word 4), and this branch doesn't include #820. With 32 lanes pinned, check.py and run_gpu_tests.py now agree on this iGPU, which is the point of the PR.

@UlteriorMotive00

Copy link
Copy Markdown
Contributor

Tested ad178e8 (on main) on a GPU: pass on an AMD 32..64 device and a fixed-32 NVIDIA. No Intel here, so the 8..32 case itself is still open.

Windows 11 Home 10.0.26300, MSVC 14.44.35207, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8, VK_LOADER_LAYERS_DISABLE=~implicit~. One PC, two GPUs: AMD Radeon iGPU of a Ryzen 7 9800X3D (RDNA2, AMD 2026.04.17, subgroup 32..64, compute default 64) and NVIDIA GeForce RTX 5070 (617.42, subgroup 32).

  • tests/test_shader_checks.py, tests/test_run_gpu_tests.py, tests/test_run_gpu_wavemask.py: OK (Python 3.14).
  • build.py + check.py: AMD 89 of 92 pass, 3 skipped (the mesh fixtures, as on main); RTX 5070 64 of 92 pass, 28 skipped (wave64, as on main). cs_wqm_w32, cs_w32_lane_wrap, cs_w32_permute and cs_bpermute32 are ok on both. On main 067d3e8, the AMD iGPU also gave 89/92 with those four ok, so nothing regresses on a device whose default compute size is 64.
  • vk_compute_test cs_wqm_w32.spv 1 dump directly: with VKC_SUBGROUP_SIZE=32 it prints compute subgroup size: 32 on both GPUs; without the variable it prints no such line. That's the behaviour the PR describes for a request that can be honoured.
  • ctest with LEONIDA_VK_VALIDATION=1: RTX 5070 33/33; AMD iGPU 32/33. The AMD failure is the two-GPU D3D12_OPTIONS1 comparison fixed in d3d12_vulkan_device_test: compare OPTIONS1 with the same GPU's host device, not the default adapter #962, not this PR.

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

…_tests.py does (ItsNotRexed#774)

check.py ran cs_wqm_w32, cs_w32_lane_wrap, cs_w32_permute and cs_bpermute32
without VKC_SUBGROUP_SIZE, so on a device whose range is 8..32 (Intel ANV) the
driver could pick a narrower size and the two runners judged different words.
check.py now requests 32 for them; run_gpu_tests.py requests it even without
index.json.

vk_compute_test prints whether a VKC_SUBGROUP_SIZE request is honoured
("compute subgroup size: N" or "... N not available"), and both runners skip
these dumps when 32 can't be pinned instead of reporting wrong words. Output
from an older vk_compute_test is judged as before.
@jdotcollins
jdotcollins force-pushed the check-py-pin-wave32-lanes branch from ad178e8 to d1a7bb9 Compare November 22, 2026 06:54
@ddm-j

ddm-j commented Nov 22, 2026

Copy link
Copy Markdown

Tested d1a7bb9 on Linux (Fedora 45), one machine with two GPUs: pass. First GPU run of this PR. AI-assisted.

  • AMD Radeon 610M (RDNA2 iGPU), RADV Mesa 26.2.6, subgroup 32..64
  • NVIDIA RTX 4070 Ti, driver 615.78.08, subgroup 32..32
  • llvm-mc 23.1.5; runtime built from this PR's head; GPU picked with LEONIDA_VK_DEVICE

Unit tests: tests/test_shader_checks.py, tests/test_run_gpu_tests.py and tests/test_run_gpu_wavemask.py all OK.

The new vk_compute_test line, run on cs_bpermute32:

VKC_SUBGROUP_SIZE RADV (32..64) NVIDIA (32..32)
unset no line (as intended) no line
32 compute subgroup size: 32 compute subgroup size: 32
64 compute subgroup size: 64 compute subgroup size: 64 not available

Both branches of the new code ran on real hardware: the size-control branch on RADV, and the fixed-size branch on NVIDIA, which reports not available for 64. main's vk_compute_test prints none of these lines.

Runners, this PR vs main (c63773d), same machine:

RADV NVIDIA
run_gpu_tests.py 110/110 (main: 110/110) 83/110, 27 skipped (wave64) (main: same)
check.py 99/102, 3 skipped (mesh fixtures) (main: same) 73/102, 29 skipped (main: same)

The six WAVE32_LANE_DUMPS pass in check.py on both GPUs, with and without this PR. RADV unpinned didn't produce wrong words on main, so I couldn't reproduce #774's disagreement here. An 8..32 device (Intel ANV) is still the case that would show the fix itself.

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

Tested d1a7bb9 on NVIDIA GeForce RTX 5070 (subgroup 32), driver 621.24, Windows 11 Pro (26300), Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 (built with scripts/build_llvm_mc.ps1), scripts/run_gpu_tests.py:

  • native: 83/110 passed, 27 skipped (main 8df277f here: 64/91 passed, 27 skipped, all wave64 tests needing a 64-wide subgroup)
  • LEONIDA_W64_EMULATE=1: 110/110 passed (main here: 91/91)
  • python -m unittest discover -s tests/semantic: Ran 1082 tests in 195.575s OK

@ItsNotRexed
ItsNotRexed merged commit 2a0de11 into ItsNotRexed:main Nov 22, 2026
@BACONMANXDGOD

Copy link
Copy Markdown
Contributor

Tested d1a7bb9 on an 8..32 device: an Intel Arrow Lake Xe-LPG iGPU (Windows 32.0.101.8132, subgroup 8..32), plus an RTX 5070 Ti Laptop (617.42, subgroup 32). Windows 11 26200, MSVC 19.44 (vk_compute_test rebuilt with this PR), llvm-mc 23.1.6. I applied it to main c63773d (merges cleanly). It does what it says:

check.py, Intel 8..32 main c63773d this PR
cs_w32_permute out[0..7] = 0 29 8 0 0 15 99 15 (wrong) ok
cs_bpermute32 out[0..7] = 0 50 0 99 36 0 0 127 (wrong) ok
cs_exec_const wrong (#820's fixture is in WAVE32_LANE_DUMPS now) ok
cs_wqm_w32, cs_w32_lane_wrap ok ok
whole run 62 of 102 pass, 35 skipped 65 of 102, 35 skipped

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