Repository navigation
Conversation
cs_w32_lds_bitops has all 32 lanes of a wave32 group run the atomics on shared LDS words (ds_sub_u32 also EXEC-masked and at per-lane addresses); lane 0 stores the eight results. Registered in check.py and run_gpu_tests.py, with the fixture and a value check in test_value_semantics.py. Passes on an RDNA2 iGPU and an RTX 5080. AI-assisted.
|
Tested |
|
Tested 1378873 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. The PR's diff applied cleanly to
|
|
Tested 1378873 on AMD Radeon RX 9070 (RDNA4, subgroup 32..64), AMD 26.10.1 (LLPC), Vulkan 1.4.359, Windows 11 26300: pass. Python 3.12.10, llvm-mc 21.1.8, Vulkan SDK 1.4.363.0; harness programs built from
GitHub now reports a conflict with current |
Conflicts: tests/semantic/regen_fixtures.py AI-assisted.
|
Merged main (871cffb) again; CPU checks and the PR's GPU tests pass on Radeon RDNA2 iGPU. AI-assisted. |
runtime/test/shaders/check.py scripts/run_gpu_tests.py AI-assisted.
runtime/test/shaders/check.py scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py AI-assisted.
|
Tested Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), native Windows
This PR's shaders:
AI-assisted (Claude Code); I checked the results. |
|
Tested
No game files. AI-assisted (Claude Code). |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-GPU-DS-BITOPS (#1902 (comment))
What and why
An opcode inventory of
tools/rdna2spirv.pyagainstmain(4eb6155) lists LDS atomics that only the CPU tests run. This adds a GPU test for five of them:ds_and_b32,ds_or_b32,ds_xor_b32,ds_sub_u32andds_and_b64.ds_or_b64/ds_xor_b64are in #1850 and are left out here.runtime/test/shaders/cs_w32_lds_bitops.asm: lane 0 of a wave32 group seeds LDS words, then afters_barrierall 32 lanes run the atomics on the same words, so a word is only right when every lane's read-modify-write lands:ds_and_b32of~(1 << (L & 15))into 0xFFFFFFFFds_or_b32 offset:4of1 << (L & 30)into 0x80000000ds_xor_b32 offset:8of1 << Linto 0x12345678ds_sub_u32 offset:12ofL + 1, EXEC = lanes 0..19, from 100 (wraps)ds_and_b64 offset:16, low~(1 << (L & 15)), high~(1 << ((L & 15) + 16)), into 0xF0F0F0F0_FFFFFFFFds_sub_u32ofLat the per-lane address4 * (L & 3) + 64, from 1000The derivation from the ISA pseudocode is in the header. Registered like
cs_lds_b64_cmpst(WAVE32_DUMPS/CS_DUMPSincheck.py, the dump list and wave32 exclusion inrun_gpu_tests.py), plus the fixture fromregen_fixtures.py.test_value_semantics.py(LdsBitwiseAtomics) checks the words against a plain-Python model of the pseudocode, checks that both runners expect them, and runs the translated fixture inspirv_mini_interp. That interpreter keeps LDS per invocation and rejectsOpControlBarrier, so the CPU run is lane 0 alone without the twos_barrierlines (the model gives those words too); the 32-lane words are the GPU's.No translator change: all five match on both GPUs.
Tested
Windows 11,
python -I scripts/run_gpu_tests.py --filter cs_w32_lds_bitops:Negative control:
LDS_ATOMICS["ds_and_b32"]set toOpAtomicOr(one line).cs_w32_lds_bitopsfails on both GPUs (word 00xffffffff, want0xffff0000) andtest_translated_shader_lane0fails. Reverted.python -m unittest discover -s tests/semantic: 1674 tests OK (2 skipped).python tests/semantic/regen_fixtures.py --checkclean,python -I tests/test_shader_checks.pyandpython -I tests/test_run_gpu_tests.pyOK.AI-assisted.
Checklist
docs/design.md, with how it was confirmed. (No new rule.)