Skip to content

fuzzers: skip wave32 runs vk_compute_test could not pin to 32 lanes - #1447

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
HQasper:fuzz-skip-unpinned-wave32
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
HQasper:fuzz-skip-unpinned-wave32

Conversation

@HQasper

@HQasper HQasper commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: FUZZ-35 (#1380)

What and why

valu_fuzz.py, lds_fuzz.py and crosslane_fuzz.py ask vk_compute_test for 32-lane subgroups (VKC_SUBGROUP_SIZE=32) for wave32 programs, but they never read its answer. Where the device can't pin that size, vk_compute_test prints compute subgroup size: 32 not available (#774) and runs at whatever size the driver picks. The fuzzers then judged those words anyway, so a wave32 program's cross-lane results showed up as translator mismatches. TEST-71 asks people to open an issue for each mismatch, so on such a device (Mesa llvmpipe at 8 lanes, or any driver that can't pin 32 for compute) the fuzzers asked for bogus issues.

On Mesa llvmpipe (subgroup 8..8), before this change:

Run Result on main
lds_fuzz --emulate --programs 400 --seed 5150 (f85582e) 215 mismatches, all in wave32 programs; 0 in the 400 emulated wave64 ones
lds_fuzz --emulate --programs 60 --seed 5150 (c2967a5) 32 mismatches, all wave32
crosslane_fuzz --wave 32 --no-maskdata --programs 100 --seed 5150 (f85582e) 68 mismatches, 32 hyp_only, 0 match

The fix:

  • New compute_fixture.unpinned_subgroup(out) reads that line (the same pattern as check.py's unpinned_subgroup_skip).
  • In all three fuzzers, a wave32 program whose run printed it is a SKIP with the reason, not a mismatch, as check.py and run_gpu_tests.py already do for the wave32 lane-mask dumps.
  • Wave64 programs translated with --wave64-emulate stay compared at any subgroup size. They use no subgroup operations (Gen.x_round), and on llvmpipe they match: 400/400 in lds_fuzz, and 0 mismatches over 100 in crosslane_fuzz --no-maskdata. So llvmpipe stays a real test of the emulation.
  • crosslane_fuzz counts skipped in its summary and exits 2 when every program was skipped, as the other two fuzzers already do for "nothing ran".
  • The docstrings and the LDS section of docs/shader_validation.md describe the rule.

Tested

Linux container, Mesa llvmpipe 25.2.8 (LLVM 20.1.2, subgroup 8), llvm-mc 18.1.3, spirv-tools from Ubuntu 24.04, Python 3.13. Branch rebased on main c2967a5. No game files.

  • With this branch on llvmpipe:
    • lds_fuzz --emulate --programs 60 --seed 5150: 60/60 emulated programs match, 60 wave32 skipped, exit 0. Before the rebase, with 400 programs: 400/400 match, 400 skipped, exit 0.
    • lds_fuzz --wave 32: everything is skipped, so exit 2.
    • valu_fuzz --family mem --emulate --programs 200: 200/200 match, 200 skipped, exit 0.
    • crosslane_fuzz --no-maskdata --programs 100: wave32 native gives skipped 50; wave64 emulate gives 34 match, 0 mismatch and 16 hyp_only (the permlane FI = 0 hypothesis, Translator: v_permlane16/x16 FI=0 and BOUND_CTRL for source lanes off in EXEC (SHADER-74) #580). Exit 0.
    • crosslane_fuzz --wave 32: skipped 20, "no program ran", exit 2.
  • New tests (13). On main's tools, the skip tests fail and the "still compared" tests pass:
    • tests/test_lds_fuzz.py: an unpinned wave32 run is a skip, a pinned one is still compared, an unpinned emulated wave64 run is still compared, and the parser itself is checked.
    • tests/test_valu_fuzz.py: the same three runner cases.
    • tests/test_crosslane_fuzz.py: run_gpu raises Unpinned only for wave32; an all-skipped run exits 2; skips next to matches exit 0.
  • Full suites on the rebased branch:
    • python -m unittest discover -s tests/semantic: 1,194 tests OK.
    • python -m pytest tests --ignore=tests/semantic: 3,511 passed, 37 skipped.
    • All 151 standard-library test files (python -I tests/test_*.py, as CI runs them): pass.
    • python -m compileall -q make_game.py tools tests and python -I make_game.py --help: clean.
  • Not run on a 32-wide GPU. There, vk_compute_test prints compute subgroup size: 32, so nothing is skipped and the behaviour is unchanged; the "pinned wave32 is still compared" tests cover that path.

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

🤖 Generated with Claude Code

valu_fuzz.py, lds_fuzz.py and crosslane_fuzz.py ask vk_compute_test for
32-lane subgroups (VKC_SUBGROUP_SIZE=32) for wave32 programs, but they
ignored its "compute subgroup size: 32 not available" line. On a device
that can't pin that size (Mesa llvmpipe: 8 lanes) every wave32 program
was judged at the driver's size and its cross-lane results came out as
translator mismatches. On main f85582e with llvmpipe, lds_fuzz --emulate
--programs 400 --seed 5150 gave 215 mismatches, all wave32, and
crosslane_fuzz --wave 32 --no-maskdata gave 68 of 100.

Those wave32 programs are now skips, as check.py's unpinned_subgroup_skip
does for its lane-mask dumps. Programs translated with --wave64-emulate
use no subgroup operations, so they are still compared at any size
(400 of 400 match on llvmpipe). crosslane_fuzz counts the skips in its
summary and exits 2 when every program was skipped, as the other two
fuzzers already do.

The line is parsed by compute_fixture.unpinned_subgroup, shared by the
three fuzzers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@UlteriorMotive00

Copy link
Copy Markdown
Contributor

This covers the "Not run on a 32-wide GPU" case, on two of them. Tested 449cb7b (0 behind main) against main bb2e184 on Windows 11 Home 10.0.26300, Python 3.14.7, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0, with main's vk_compute_test (MSVC 14.44) and VK_LOADER_LAYERS_DISABLE=~implicit~. Seed 1, 50 programs each:

run AMD Radeon RDNA2 iGPU (32..64, 32.0.21042.62) RTX 5070 (32..32, 617.42)
lds_fuzz --wave 32 50/50 match, 0 skipped 50/50 match, 0 skipped
valu_fuzz --family mem 100/100 match, 0 skipped 50/50 match, 50 skipped
crosslane_fuzz --wave 32 28 match, 11 mismatch, 11 hyp_only, skipped 0 same counts, skipped 0

Each line is identical on main and this PR, so as you expected, a device that pins 32 lanes skips nothing new. The 50 valu_fuzz skips on the RTX 5070 are the wave64 programs without --emulate, and main skips those too. The 11 crosslane_fuzz mismatches are also on main, and they go to 0 with --no-maskdata --no-w32-hi-lanes on both GPUs (39 match, 11 hyp_only), so they're the known mask-as-data and high-lane classes, not this change.

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

@Amzi-01

Amzi-01 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 449cb7b on NVIDIA GeForce RTX 3060 (Ampere, subgroup 32..32, pins 32 for compute), NVIDIA driver 610.88, Windows 11 Pro 26200: pass. This is the other side of the PR's llvmpipe runs: on a device that can pin 32 lanes, nothing is skipped and the results are the same as main.

Worktree of the PR head; vk_compute_test from a main (bb2e184) MSVC build; llvm-mc 21.1.8; LEONIDA_VK_DEVICE=3060; seed 5150:

  • tests/test_lds_fuzz.py: 27 OK; tests/test_crosslane_fuzz.py: 37 OK (1 skipped). tests/test_valu_fuzz.py not run (it imports pytest, which this machine doesn't have).
  • lds_fuzz --wave 32 --programs 100: 100/100 match, 0 skipped
  • lds_fuzz --emulate --programs 100: 200/200 match, 0 skipped
  • valu_fuzz --family mem --wave 32 --programs 100: 100/100 match, 0 skipped
  • crosslane_fuzz --wave 32 --programs 100, PR vs main: identical, match 56, mismatch 15, hyp_only 29, skipped 0 (PR) on both; with --no-maskdata: match 72, mismatch 0, hyp_only 28 on both. So the 15 mismatches are pre-existing on main with mask data on this GPU, not something this PR introduces or hides; I'll look at them separately.

AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit cbb770f into ItsNotRexed:main Nov 22, 2026
10 of 11 checks passed
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.

5 participants