Repository navigation
rdna2spirv: use OpAtomicLoad in ds_add_f32 CAS preheader and verify row 341 on RDNA2 (gfx1036) - #4230
abnalstlll-byte wants to merge 2 commits into
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran this at adf27a10 on Windows 11: python tests/semantic/test_lds_add_f32.py -> 6 tests, OK; compileall and git diff --check clean.
The CAS preheader now reads the initial word with OpAtomicLoad instead of a plain OpLoad, so it participates in the same atomic ordering as the compare-exchange loop. The new cases pin signed-zero results (-0 + -0 -> -0, +0 + -0 -> +0), infinities, +Inf + -Inf -> qNaN and qNaN propagation through the CAS loop. No blocking issue.
|
Tested adf27a1 on NVIDIA GeForce RTX 4090 (driver 32.0.16.2101) and on AMD Radeon(TM) Graphics (driver 32.0.21043.5001), Windows 11: pass on the GPU. I did not run the full CTest suite, because this change has no runtime C++ code. I translated a hand-written compute shader with this head. In one workgroup, 32 lanes each add 1.0 to the same LDS word with One gap in the test coverage. The added test does not find the change to the atomic load. Script for the shader (run from the repository root; then run import pathlib, sys
sys.path.insert(0, "tests/semantic")
import support, spirv_asm
from test_lds_atomics_values import FSSM
lines = ["v_mov_b32 v1, 0", "v_mov_b32 v2, 0", "v_mov_b32 v3, 0x3f800000", "s_mov_b32 exec_lo, 1", "ds_write_b32 v1, v2",
"s_mov_b32 exec_lo, -1", "s_barrier", "ds_add_rtn_f32 v5, v1, v3", "s_barrier", "ds_read_b32 v6, v1",
"v_lshlrev_b32 v7, 3, v0", "buffer_store_dwordx2 v[5:6], v7, s[0:3], 0 offen", "s_endpgm"]
spv = support.translate_lines("cs_add32", lines, fssm=FSSM)
print("atomic load instructions", spv.count("= OpAtomicLoad"), "CAS", spv.count("= OpAtomicCompareExchange"))
pathlib.Path("../4230-add.spv").write_bytes(spirv_asm.assemble(spv))AI-assisted. |
|
Tested GPU tests (RTX 3080, driver 615.71.09, Vulkan 1.4.351) — identical to
Semantic side, which is what your one-line change touches:
One more test (yours) and the same failing set with the same names — Translator pytest side: 1592 passed, 1 failed on your branch, the same 1592 passed, 1 failed on The RTX 5080 was not run in this pass — 186 MiB free on that card (another job holds it here), so I skipped it Machine: Linux Mint 22 (Ubuntu 24.04 base), |
|
Tested adf27a1 (merge base = main aa2988c) on NVIDIA GeForce RTX 5080, driver 580.65.06, Ubuntu 22.04 (Linux): pass The PR is a one-line translator change ( Setup
Commands and results
Negative control
Not tested
AI-assisted. No game files. |
|
Tested
No game files. AI-assisted (Claude Code). |
…ow 341 on RDNA2 (gfx1036)
adf27a1 to
241b8a7
Compare
|
Tested 241b8a7 merged with main 98fa503 on Linux, Python 3.12.16: fail (docs test)
|
|
Tested 241b8a7 merged onto main 98fa503 on an RTX 5090 (driver 616.92), Windows 11, Vulkan SDK 1.4.363. The GPU test programs were built from the same tree:
AI-assisted (Claude Code). |
|
Tested f055624 merged with main 3faac55 on Linux (WSL2), Python 3.12.16: pass. |
|
Tested Build note: the pinned
Verdict: pass — the GPU behaviour row 341 claims is confirmed on native RDNA2 No game files. AI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Re-checked the current head
The GPU figures I reported at |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/design.md
|
Corpus check of
That is expected. No listing in the corpus contains AI-assisted (Claude Code). Counts only. |
Summary
Uses \OpAtomicLoad %uint {p} {sc} {sem}\ (\Workgroup\ scope 2, relaxed semantics 0) in the \ds_add_f32\ / \ds_add_rtn_f32\ CAS preheader in \ ools/rdna2spirv.py, adds edge-case tests, and documents full hardware verification for Row 341 on native RDNA2 silicon.