mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #1110] [MERGED] rdna2spirv: wave64 emulation resets shared words with OpAtomicStore (SHADER-W64-SINK-RACE-CARRY) #1146
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1146
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1110
Author: @klikso
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:carry/shader-w64-sink-race📝 Commits (1)
19e42d6rdna2spirv: wave64 emulation resets shared words with OpAtomicStore📊 Changes
3 files changed (+83 additions, -16 deletions)
View changed files
📝
tests/semantic/test_loop_ballot_barrier.py(+3 -0)📝
tests/semantic/test_wave64_emulate_opt.py(+60 -0)📝
tools/rdna2spirv.py(+20 -16)📄 Description
Claimed in the coordination issue as: SHADER-W64-SINK-RACE-CARRY
What and why
This carries #382 by @natterman12 onto current
main: one commit,5cb32c2b3, cherry-picked with its author kept and no change of mine. #382 was closed by its author on 24 November along with his other open pull requests, after three independent GPU verifications (RTX 3080 Ti Laptop, RTX 4080, Radeon RX 6900 XT on RADV).mainstill has the plain stores, and no open pull request carries the fix.The wave64 emulation resets words of
%x_bufevery round. The lane that owns a word stores to it and every other lane aims the same store at one sink word, so several invocations write one Workgroup word at once. The word is never read, but GPU-assisted validation reports the race in every emulated shader, which hides any real one. Those 16 stores becomeOpAtomicStore(Workgroup scope, relaxed), the same operands as theOpAtomicOralready used on the buffer. The values written do not change.@natterman12: this is your work. If you reopen #382 or want this branch, say so and I will close this.
Tested
Windows 11 26200.9974, Python 3.13.14,
llvm-mc23.1.6 (conda-forge, AMDGPU target), SPIRV-Tools v2026.4. Runtime test programs built frommain3aa975421with MSVC 19.44; this change does not touchruntime/.maintests/semantic/test_wave64_emulate_opt.pywith the newSharedWordStoresTestsOpStorelines)tests/semantic/test_loop_ballot_barrier.pyscripts/run_semantic_tests.py tests/semanticrun_gpu_tests.py, nativerun_gpu_tests.py,LEONIDA_W64_EMULATE=1The first row's
maincolumn is the new test file run againstmain's translator. I do not haveVK_LAYER_KHRONOS_validationinstalled, so the GPU-assisted validation count (44 failed fixtures down to 12 on the author's RTX 3080 Ti) is the original measurement, not mine; what I measured is that the emulated run is unchanged on a 32-wide-subgroup device.python -I scripts/check_no_game_data.pyon the three changed files: no hits.git diff --check: clean.GPUs tested: NVIDIA GeForce RTX 3060 Ti (Ampere), driver 621.14, Vulkan 1.4.357, Windows 11 26200
AI-assisted: yes (Claude Code; run and measured on the machine above)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed: n/a (no new rule; the stores write the same values).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.