Repository navigation
rdna2spirv: GFX10.1 scalar stores (s_store_dword*, s_buffer_store_dword*) - #3589
evilclanker9000 wants to merge 6 commits into
Conversation
…rd*) s_store_dword/x2/x4 and s_buffer_store_dword/x2/x4 exist on gfx1010-gfx1013 (the console) only. They now write SDATA as PhysicalStorageBuffer stores at the address an s_load / s_buffer_load of the same operands reads, with the buffer bound; a lane-mask source is refused. Scalar atomics stay Unsupported. Not measurable on the gfx1036 oracle. GPU fixture cs_w32_scalar_store, semantic test ScalarStores, design.md row; the old contract test that expected Unsupported now checks the emitted stores. AI-assisted.
|
Tested 13ce90b on NVIDIA GeForce RTX 4090 (Ada, subgroup 32..32), 621.14, Windows 11 (26200): pass. The new Test programs: MSVC 19.44 RelWithDebInfo build of
That is 0x11111111 through 0x88888888, so all four forms land where the header says: the x4 buffer store at 0, the x2 pointer store at 0x10, the SGPR-offset buffer store at 0x18 and One thing to mention for honesty: my very first On the branch: Not run: the full |
kacper-serewis
left a comment
There was a problem hiding this comment.
At 13ce90b a synthetic single s_store_dword wrote 32 times per wave32 and 64 times per wave64 in the CPU interpreter, for empty, lane-1-only and full EXEC. All wrote the same word, so final buffer comparison hides the duplicate stores. Elect one writer per logical guest wave independently of EXEC on a reached scalar store. The buffered lowering shares the unguarded path at rdna2spirv.py:8829. The emulated two-subgroup interpreter stopped at a control barrier; no runtime count for that case. AI-assisted CPU validation.
|
Tested 13ce90b on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass
No runtime C++ changes; GPU suite run from the PR worktree against the existing main runtime build. AI-assisted (OpenCode). |
…omic AI-assisted.
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested
AI-assisted (Claude Code). Synthetic test shaders only, no game files. |
runtime/test/shaders/check.py scripts/run_gpu_tests.py tools/rdna2spirv.py AI-assisted.
|
Tested Ran the PR’s synthetic fixture through
AI-assisted verification with synthetic inputs. |
docs/design.md tools/rdna2spirv.py AI-assisted.
|
Apple M2 / MoltenVK validation of head
No code changes, no game data; synthetic fixture and counts only. AI-assisted. |
|
Tested
New in this PR:
Every other test has the same result as on One earlier Intel run of this PR crashed the runner while the machine was busy with other test suites. Three reruns on an idle GPU were clean, as were three |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested
No game files. AI-assisted (Claude Code). |
tools/rdna2spirv.py AI-assisted.
|
Tested 1b5deb1 on RTX 5070, driver 616.86, Windows 10.0.26200: pass. Built
The 35 skips are the device-feature and wave64 cases |
|
Tested 1b5deb1 on Intel UHD Graphics 630 (CFL GT2, subgroup 8..32), Mesa 25.2.8 ANV, Ubuntu 24.04: pass.
The full tests/semantic suite was not run to completion here. AI-assisted. |
docs/design.md scripts/run_gpu_tests.py tests/semantic/regen_fixtures.py AI-assisted.
|
Tested a94420f on two Vulkan devices, Windows 11, Vulkan SDK 1.4.363, llvm-mc 23.1.6 (AMDGPU, LLVM-MinGW build):
The only failures on both GPUs — cs_bvh, cs_bvh32, cs_heap_init, ps_array_resinfo — reproduce identically with main's shaders on the same binaries, so they are environmental here, not from this change. AI-assisted. No game files. |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
rdna2spirv: GFX10.1 scalar stores (s_store_dword*, s_buffer_store_dword*). Changes docs/design.md and runtime/test/shaders/check.py (plus 7 more). sstoredword, sstoredwordx2, sstoredwordx4 and sbufferstoredword, x2, x4 raised Unsupported. These scalar stores exist on GFX10.1 only (gfx1010-gfx1013, so the console's gfx1013 has them).
New tests: test_translator_raises_unsupported_on_s_store, test_translator_emits_one_store_per_dword, test_words_follow_from_the_masks, test_buffer_store_bound_and_mask_refusal.
Why merge
Addresses a concrete failure mode with a focused, scoped change and regression coverage. The patch stays within the affected code path, so it is low risk and prevents bad output or failures in real use.
Verdict: Approve
Summaryrdna2spirv: GFX10.1 scalar stores (s_store_dword*, s_buffer_store_dword*). Changes Why mergeAddresses a concrete failure mode with a focused, scoped change and regression coverage. The patch stays within the affected code path, so it is low risk and prevents bad output or failures in real use. Verdict: Approve |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-SMEM-STORE, #3381 (comment)
What and why
s_store_dword,s_store_dwordx2,s_store_dwordx4ands_buffer_store_dword,_x2,_x4raisedUnsupported. These scalar stores exist on GFX10.1 only (gfx1010-gfx1013, so the console's gfx1013 has them).llvm-mcrejects them for gfx1030 and gfx1036.Change (
tools/rdna2spirv.py,Gen.scalar_load(..., store=True)): SDATA's N dwords are written as PhysicalStorageBufferOpStores at the address ans_load/s_buffer_loadof the same operands reads. The address and offset rules are the measured ones from the Scalar/buffer memory row:sOFF offset:IMM;Other details:
s_buffer_storedword whose end passes the V# limit is not written.s_dcache_wb. That instruction becomes a device memory barrier in rdna2spirv: cache invalidate/write-back ops are a device memory barrier (EGEN-MEM-CACHE-INV) #2878. The direct store here is visible at least as early.s_atomic_*,s_buffer_atomic_*) stayUnsupported. If every invocation ran them, they would apply once per lane, so they need a one-writer-per-wave design of their own.tests/semantic/test_scalar_mem_store.pyasserted the oldUnsupported. That contract test now checks that the store form emits one store per dword. New contract row indocs/design.md.Not measured natively. The gfx1036 oracle has no scalar stores. The address and bound reuse the measured load rules, assumed shared. An RDNA1 part (gfx1010-gfx1013) can check them natively, for example the V540 farm announced in the coordination issue.
Tested
Windows 11, LLVM
llvm-mc(-mcpu=gfx1013),VK_LOADER_LAYERS_DISABLE=~implicit~, one GPU at a time,python -I scripts/run_gpu_tests.py --filter cs_w32_scalar_store. Thevk_compute_testdevice lines readAMD Radeon(TM) Graphics (subgroup 32..64)andNVIDIA GeForce RTX 5080 (subgroup 32..32).0x11111111 .. 0x88888888(8 words)runtime/test/shaders/cs_w32_scalar_store.asm: both forms, with immediate, run-time SGPR and SGPR + immediate offsets. The words are derived in its header. It is registered incheck.py,run_gpu_tests.pyandregen_fixtures.py.ScalarStoresintest_value_semantics.pychecks the words against a plain-Python reference. It also checks thes_buffer_storebound (an x4 at 0x38 with NUM_RECORDS 0x40 writes two dwords) and the lane-mask refusal.ScalarStoreserrors onmain(Unsupported: s_buffer_store_dwordx4).ScalarStoresfails, and the Radeon run fails (... 1431655765 1431655765 ...). Then I reverted it.python -m unittest discover -s tests/semantic,python tests/semantic/regen_fixtures.py --check(clean),python -I tests/test_shader_checks.py, andpytest tests/test_docs_design_rows.py tests/test_run_gpu_tests.py tests/test_shader_meta.py.AI-assisted.
Checklist
docs/design.md, with how it was confirmed.