fix: mask inactive source lanes in wave64 ds_bpermute_b32 #281
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/281"
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?
Imported from LooperSalty/AnyXboxX. Originally posted by Tiimonprog on 2026-11-26T00:28:48Z.
Change
The wave64 HLSL translator for
ds_bpermute_b32publishes the source VGPR even when that lane is inactive in EXEC. An active destination can then read a stale value. In the synthetic regression case, lane 1 reads3on the GPU while the interpreter returns0.Publish zero for inactive source lanes. All 64 threads still call
ReadLane64and execute the group barriers. The regression test uses different EXEC masks in the two halves and checks active reads, inactive sources, untouched inactive destinations, and wraparound at lane 63. The HLSL and interpreter outputs are compared byte for byte.Validation
Based on
c4c93bd. The regression fails before the fix and passes afterwards on RTX 4060 Laptop, Intel UHD, and WARP.python -m pytest -q -p no:cacheprovider tests/test_rdna2_exec_wave64.py tests/test_rdna2_hlsl_wave64.py tests/test_rdna2_alu_parity.py— 31 passed on each adapter.python -m pytest -q -p no:cacheprovideron WARP with Python's Windows default encoding — 1649 passed, 17 skipped.python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools— passed.The test uses synthetic shader code. Tested on the PC through the D3D12 runner.
Implemented and verified with assistance from OpenAI Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.