tests: a GPU fixture and whole-corpus counts for one-register wave64 mask destinations (TEST-W64-SDST-PAIR-GPU) #1090
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1090
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1090/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@milk4sale on GitHub · 2026-11-24 18:14 UTC · original
milk4sale:test-w64-sdst-pair-gpu→main· +381 −2 · 6 files · 3 commits · merged 2026-11-25 01:50 UTCItem: TEST-W64-SDST-PAIR-GPU
Depends on: #1021 (its commit is the first one in this branch; only the second is this change)
#1021 makes the SGPR a wave64 VALU instruction names for a lane mask the pair it is on hardware. Its own test compares the two printed forms on the interpreter. This adds a GPU fixture and the counts over the whole corpus.
What is in it
runtime/test/shaders/cs_w64x_cmp_sdst.asm: written like the game's listings. It has nomattrline, so llvm-mc printsv_cmp_gt_u32_e64 s4, ...for the pair, as it does for the game; every other wave64 fixture names the pair, which is why none of them saw the stale high register. Six compares and a carry-out, each with lanes on both sides of lane 32, read back bys_and_b64,s_or_b64,s_xor_b64,s_andn2_b64,s_and_saveexec_b64,s_mov_b64 exec,s_bcnt1_i32_b64/s_ff1_i32_b64and SCC. The high register holds another mask, 0 or nothing beforehand. The eight expected words are derived from the ISA in the header. Registered incheck.pyandscripts/run_gpu_tests.py.tests/semantic/test_wave64_sdst_pair_fixture.py: the fixture on a 64-wide subgroup and under--wave64-emulate; the same program with pair destinations translates to the same SPIR-V text; wave32 code throughtranslate()keeps its single register; and whattools/wave64_halves.pymakes of the one-register form (the LLVM form of a uniform branch is tier A with equal words from one wave of 64 lanes and two of 32; the mask read as data is still tier C).docs/design.mdunder #1021's, with the counts below.Counts (1.0.2.1, all 26,503 listings, llvm-mc backend)
mainspirv-val; 19,453 modules change, all wave64main-> #1021Tested
LEONIDA_W64_EMULATE=1 scripts/run_gpu_tests.py --filter cs_w64x_cmp_sdst: PASS with #1021 (10240 6144 2053 8224 7714 6184 4144 5);main1504c1af6stores16384 16384, five times0xffffffffand1. This confirms the translated SPIR-V against the ISA reference, not native RDNA2 behaviour. This card has no 64-wide subgroup (--require-wave64skips here).--require-wave64): 0 of 8 words with the translator before #1021, 8 of 8 with it, on each of three dispatches; thesubtleties on gfx1036 (RADV, Mesa 26.3.1): passes with native 64-wide subgroups and under emulation, and withmain's translator fails with the same eight wrong words as above.python -I scripts/run_semantic_tests.py tests/semantic: 472 files, 6,176 tests, 0 files failed.tests/semantic/regen_fixtures.py --check,tests/test_regen_fixtures.py,test_run_gpu_tests.py,test_shader_checks.py,test_design_contract_rows.py,test_docs_design_rows.py: pass.No game data: counts and opcode names only. AI-assisted (Claude Code).
🤖 Generated with Claude Code
@KernelSmoker on GitHub · 2026-11-24 18:43 UTC · original · approved these changes
Independently checked exact head
9f1a072f70. The focused fixture suite passes 8/8. On an RTX 3090 (NVIDIA subgroup 32), LEONIDA_W64_EMULATE=1 with run_gpu_tests.py --filter cs_w64x_cmp_sdst passed 1/1 and returned the expected eight words: 10240 6144 2053 8224 7714 6184 4144 5. The generated module also passed spirv-val --target-env vulkan1.2 in the Fedora tool container (the host runner itself skipped validation because spirv-val is not installed on the host). This is an independent subgroup-32 emulation result, not native wave64 hardware validation. Upstream changes since the PR's base do not touch its changed files; GitHub reports this head mergeable.@sodove on GitHub · 2026-11-24 19:08 UTC · original
The new
cs_w64x_cmp_sdstfixture also passes on a native 64-lane Vulkan compute subgroup. Tested9f1a072f7on Windows 11 using the Ryzen 5 9600X Radeon iGPU (driver 32.0.21045.29003) and RTX 5070 Ti (610.74).3ed8e50b7--require-wave64)Each cell is the number of readback words matching the fixture's ISA-derived reference on each of three independent dispatches. Used the same PR fixture and Windows Vulkan harness throughout, switching only the translator revision and execution mode. The harness confirmed the selected adapter and subgroup size. All four translated modules passed
spirv-val --target-env vulkan1.2. Requesting native 64 on the RTX returned the expected skip (77). The eight focused semantic tests also passed.This exercises the translated Vulkan path on hardware. The expected words come from the fixture's reference calculation. Only the repo's synthetic fixture was used.
AI-assisted: yes (OpenAI Codex).
@Okachamie on GitHub · 2026-11-24 19:09 UTC · original
Independently verified
cs_w64x_cmp_sdstat9f1a072f7056b420096125317ceb001142e33f11on CachyOS with an NVIDIA GeForce RTX 5090 Laptop GPU and driver620.73.04. WithLEONIDA_W64_EMULATE=1, GPU readback matched all eight expected words. Native wave64 skipped with exit 77 because the device exposes only subgroup size 32.Both modules passed
spirv-val --target-env vulkan1.2, and all eight focused semantic tests passed. The #1021 translator produced byte-identical SPIR-V in both modes. The pre-fix translator also passed SPIR-V validation, but its emulated GPU readback missed all eight expected words. This verification used a synthetic fixture. AI-assisted (Codex).@thesubtleties on GitHub · 2026-11-24 19:21 UTC · original
Tested
bc7143b5f(#1021) and9f1a072f7(#1090), each merged onto main3aa97542. NVIDIA RTX 3080 (620.73.04) and AMD Raphael RDNA2 iGPU gfx1036 (RADV, Mesa 26.3.1), CachyOS.cs_w64x_cmp_sdstpasses on gfx1036 with native 64-wide subgroups, and withLEONIDA_W64_EMULATE=1on gfx1036 and the 3080. With main'srdna2spirv.pyit fails in all three (16384 16384, five0xffffffff,1).run_semantic_tests.py tests/semantic: 471 files / 6,171 tests (#1021) and 472 / 6,179 (#1090), 0 failed.This runs translated SPIR-V, not native RDNA2 code. Not tested: game corpus. AI-assisted (Claude Code)
@milk4sale on GitHub · 2026-11-25 02:55 UTC · original
Local stand-in for this pull request's CI, which has been queued here since 22:31 UTC (about 580 runs waiting).
Tested:
b57a5b870merged withmainb4b7756e8(2026-11-25 01:13 UTC), in one tree together with #1087, #1089, #1114, #413, next tomainalone. The trees came fromgit merge-tree, and nothing was pushed. Each job used the workflow's own selection fromci.ymlandruntime.yml.main+ the five pull requestsmainalonechecksteps: compileall,make_game.py --helpstdlib-tests-linux(every standalone file, run to the end)translator-tests(pytest files)viewer-testssemantic-testslinux-gpu-tools: ctestlinux-gpu-tools:run_gpu_tests.py, plain,LEONIDA_W64_EMULATE=1 --filter cs_,LEONIDA_BARY_FALLBACK=1no-game-data:scripts/check_no_game_data.pyon this pull request's filesThis pull request's fixture,
cs_w64x_cmp_sdst, passes in theLEONIDA_W64_EMULATE=1 --filter cs_pass on lavapipe (CI's CPU path) and on the RTX 4070 Ti. In the other two passes it is skipped, since neither device has a 64-wide compute subgroup, as on CI's runners.tests/semantic/test_wave64_sdst_pair_fixture.pypasses in the translator suite.The two pytest failures are
main's:tests/test_translate.pyon the text-only fixturecs_dpp_cmp.asm(test_gpu_samples_translate_and_validate,test_wave64_emulate_uses_no_subgroup_ops). With #1375 applied, both pass.Not covered: the Windows and macOS jobs.
Setup: Linux (CachyOS), Python 3.14.10 (CI uses 3.12), llvm-mc 23.1.4 (CI uses 19), Node 26.13.1. GPU suite on lavapipe from Mesa 26.2.6 with
GALLIUM_OVERRIDE_CPU_CAPS=avx, the code path of CI's runners, which lack AVX-512; and on an RTX 4070 Ti, NVIDIA 620.70.06.AI-assisted (Claude Code).