Repository navigation
Conversation
|
Tested
On the parent, both lanes in group 0 return I built the head checker and ran the synthetic fixture with these commands. cmake --build E:/Leonida-review-work-build --config RelWithDebInfo --target vk_compute_test
py -3.14 -I scripts/run_gpu_tests.py --filter cs_lds_mskor_contended --require-pass --build E:/Leonida-review-work-build/RelWithDebInfo --work E:/Leonida-review-work-build/mskorFor the control, I translated the same listing with the parent and ran its SPIR-V with the head checker. Both shaders pass spirv-val. I selected each adapter with VK_LOADER_DRIVERS_DISABLE and checked each device line. All 106 targeted CPU tests pass across test_lds_mskor.py, test_cs_shared_memory_limit.py, and test_shader_checks.py. AI-assisted. |
|
Independent Windows check of 33ba4bf9 after the merge. RTX 3080 Ti, NVIDIA 621.35, subgroup size 32, MSVC 19.44, LLVM MC 23.1.6, Vulkan SDK 1.4.363.0. The stock AI-assisted. |
|
Tested Three rounds alternating this PR's
AI-assisted (Claude Code). |
|
Tested
So ANV, like RADV, hits the race in every group, and the fixture catches it. Nothing else in the suite changed on either GPU. |
devnull34
left a comment
There was a problem hiding this comment.
Verification & Semantic Review
- Host: Windows 11 Build 26300 x64
- Toolchain: Python 3.15
Verification Summary
-
Semantic Test Suite:
tests/semantic/test_lds_mskor.py,tests/semantic/test_cs_shared_memory_limit.py, andtests/test_shader_checks.py: passed all 110 tests (2.189s).- Validated that
ds_mskor_b32andds_mskor_rtn_b32now execute inside the atomic CAS (OpAtomicCompareExchange) loop instead of two distinct atomic operations (OpAtomicAndthenOpAtomicOr), preventing intermediate data corruption and race conditions under multi-lane write contention. - Verified that contended updates produce exact serial order results matching hardware expectations.
-
Hygiene & Compliance:
- Clean-room compliant: pure synthetic instruction sequences and semantic tests; zero game assets or proprietary code.
git diff HEAD~1..HEAD --check: Clean (0 whitespace/formatting defects).
LGTM!
|
Native wave64 (64-wide execution) row — RX 7900 XT (RADV NAVI31, Mesa 26.2.5, Arch). On this card the race is not occasional and not rare: it is deterministic 100%. Method: one worktree at current main
So on RDNA3 the "two lanes write 1 and 2 into the same two bits" interleaving happens on essentially every run at wave64 — matching @Mortify7612's RDNA4 observation that the race is systematic on RADV, and extending it to full 64-wide waves: with 64 lanes the window widens further than at wave32. The CAS fix closes it completely in all four cells. No impossible-result survivors anywhere with the PR applied. No game files - the PR's own synthetic fixture, bare hardware. Posted by Hermes (agent) on my machine (also the boxb/GTX 1070 reporter in #6296). |
|
Tested
AI-assisted (Claude Code). |
|
Tested on NVIDIA GeForce GTX 1080 (Pascal, subgroup 32), Linux (Ubuntu 26.04.1), driver 580.178.04. No game files.
New: PASS cs_lds_mskor_contended, 64 LDS mskor groups: 0 non-serial results, in both runs. Every other row, words included, is identical to main. The one failure is ms_wave_info_s3, which also fails on main (SHADER-766, #5741). AI-assisted. |
Claimed in the coordination issue as SHADER-1094.
What and why
Two lanes writing 1 and 2 into the same two bits of a shared word could leave 3. The translator lowered each masked update to a separate atomic AND and OR. Both lanes could read the same old word and then combine their replacement values, which no serial execution of the RDNA2 instruction permits.
Use the existing Workgroup-scope compare-and-exchange loop for both
ds_mskor_b32andds_mskor_rtn_b32. On a failed exchange the lane recomputes its full update using the observed word. The returning form reports the word from its successful exchange. The new handwritten GPU fixture checks the two possible lane histories and the final word for each opcode. It runs through both GPU test entry points, including on devices with a native subgroup smaller than 32.Tested
1cc6e3c12and this branch each translated and validated 1/1. With the base translator, both lanes returned0xabcd1200and both words ended at0xabcd1203in 64/64 groups. With this patch all 64 groups matched a serial outcome. The filteredscripts/run_gpu_tests.py --filter cs_lds_mskor_contended --require-passpassed 1/1 and the targetedcheck.pycase passed.0xabcd1280from the project's native AMD gfx1036 measurement. All 12 additional SPIR-V variants passed validation. The translation for 20 neighboring opcode variants was byte-for-byte unchanged.14e9f4eb7, the fixture uses the GPU runner's shared unsupported-device handling. All 89 shader-check tests, 58 GPU-runner tests and 34 focused LDS tests passed. The same filtered M3 Pro run on the integrated head33ba4bf98passed 1/1 (64/64 groups).tools/f64_omod_probe.py:268(tracked by #6461) andtools/leonida_tui.py:753.AI-assisted: yes (Codex).
docs/design.md.