Repository navigation
Conversation
|
Tested 64bdaf1 (merged on
|
|
Tested
AI-assisted (Claude Code). |
Kam471
left a comment
There was a problem hiding this comment.
Head 64bdaf13 — tools/rdna2spirv.py (+119), tools/wave64_halves.py, new semantic test (+417), GPU fixture + check.py + run_gpu_tests.py.
python tests/semantic/test_lds_wrap_cmpst_f32_mskor64.py→ Ran 10 tests, OK. Regressions:test_lds_atomics_cas.py12 OK,test_lds_mskor.py4 OK,test_lds_bitwise_b64.py6 OK,test_text_write_line_endings.py3 OK.- GPU, our build on an RTX 5070 Ti:
LEONIDA_VK_DEVICE='RTX 5070 Ti' LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build <build> --filter lds→ 8/8 passed;cs_w32_lds_ext_atomicsprinted0xa0003 0x40009 0xc0000000 0x7fc01234 0xbf800000 0xddccee33 0x88888888 0xd8ca601f, the PR's words. Without emulation 6/8 pass, 2 skipped (no 64-wide subgroup). - CAS loops read every source (incl. vdst pair) before writing, go through
lds_access(EXEC mask, SHADER-309 kept), and use Workgroup scope.ds_wrapuses unsignedUGreaterThanEqualwith wrappingISub/IAdd;ds_cmpst_f32usesFOrdEqual(-0.0 == +0.0, NaN != NaN), as tested. - Change requested: CONTRIBUTING.md:35 asks for a new translator rule in
docs/design.md's contract table; this adds three (ds_wrap_rtn_b32,ds_cmpst_f32,ds_mskor_b64) and touches no doc.ds_mskor_b64also updates its two dwords in separate CAS loops, so the 64-bit update is not atomic across dwords and_rtn_reads the pair at two moments — the same approximationds_and/or/xor_b64documents; it should be written down too. git diff --check origin/main...HEAD→ clean.
Verdict: code and tests good; add the design.md row(s) before merge.
|
Tested 64bdaf1 on AMD RADV RAPHAEL_MENDOCINO (Ryzen 9 9950X3D iGPU), subgroup 32..64: run_gpu_tests.py --filter lds with LEONIDA_W64_EMULATE=1 passes 8/8, including "PASS cs_w32_lds_ext_atomics 0xa0003 0x40009 0xc0000000 0x7fc01234 0xbf800000 0xddccee33 0x88888888 0xd8ca601f" and cs_lds_b64_cmpst. The semantic modules test_lds_wrap_cmpst_f32_mskor64.py (10 tests), test_lds_atomics_cas.py (12), test_lds_mskor.py (4) and test_lds_bitwise_b64.py (6) and tests/test_text_write_line_endings.py (3) all pass. AI-assisted. |
64bdaf1 to
c01ad34
Compare
|
Tested
|
c01ad34 to
c4f5348
Compare
|
Rebased cleanly onto Re-verified:
AI-assisted (Gemini 4 Neon). |
|
Tested
Counts and pass/fail only; no game data. No code changes. AI-assisted. |
Claim: #5256 (comment)
Summary
Implements 5 standard AMD RDNA2 LDS atomic instructions in
tools/rdna2spirv.py(Gen.lds_op), routed throughself.lds_accessso bothEXECactive-lane masking andSHADER-309bounds checks are preserved without requiringInt64Atomicsor float atomic extensions:ds_wrap_rtn_b32(vD, vAddr, vData0, vData1):old = M[A]; M[A] = (old >= DATA0) ? (old - DATA0) : (old + DATA1); return old(unsigned 32-bitOpUGreaterThanEqual+ 32-bit wrappingOpISub/OpIAdd) via Workgroup-scopeOpAtomicCompareExchangeCAS loop.ds_wrapto the DS atomic prefix classification intools/wave64_halves.py.ds_cmpst_f32&ds_cmpst_rtn_f32([vD,] vAddr, vData0, vData1):OpBitcast %float+OpFOrdEqual): treats-0.0 == +0.0as equal andNaN == NaNas unequal, lowered via Workgroup-scopeOpAtomicCompareExchangeCAS loop.vDso destination aliasing (vD == vAddr/vData0/vData1) is safe.ds_mskor_b64&ds_mskor_rtn_b64([vD,] vAddr, vData0, vData1):old = M64[A]; M64[A] = (old & ~DATA0) | DATA1; [return old], lowered as per-dword Workgroup-scopeOpAtomicCompareExchangeCAS loops atoffandoff + 4(matchesds_and/or/xor_b64layout, avoidsInt64Atomics, and prevents tearing between&and|within each dword).Tests & Verification
spirv-val --target-env vulkan1.2(tests/semantic/test_lds_wrap_cmpst_f32_mskor64.py):10/10passed (edges,-0.0 == +0.0,NaN != NaN,offset:, destination aliasing,EXECinactive-lane preservation,SHADER-309zero-LDS bounds check,gfx1030llvm-mcbinary decode + translate round-trip,spirv-valon unbounded/bounded/wave64-emulateshrunk LDS).test_lds_atomics_cas.py(12/12),test_lds_mskor.py(4/4),test_lds_bitwise_b64.py(6/6),tests/test_text_write_line_endings.py(3/3) all passed.runtime/test/shaders/cs_w32_lds_ext_atomics.asm) on NVIDIA GeForce RTX 5090:LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build ... --filter lds:8/8passed (8 shaders: 8 translated, 8 pass spirv-val), includingcs_lds,cs_lds_b64_cmpst, andcs_w32_lds_ext_atomics(0xa0003 0x40009 0xc0000000 0x7fc01234 0xbf800000 0xddccee33 0x88888888 0xd8ca601f).AI-assisted (Gemini 4 Neon).