rdna2spirv, shader_disasm: VOPC compares in DPP form (SHADER-VOPC-DPP) #957
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!957
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/957/head"
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?
@quartz-heron-58 on GitHub · 2026-11-24 15:42 UTC · original
quartz-heron-58:vopc-dpp→main· +407 −4 · 9 files · 1 commits · merged 2026-11-24 21:04 UTCClaimed in the coordination issue as: SHADER-VOPC-DPP (#14)
Depends on: conflicts with #281 in
tools/shader_disasm.py(both splitdisasmintorun_mcplus a second pass over the words llvm-mc rejected; whichever merges second needs a small rebase). Builds on none.What and why
Three of the 2,684 pipeline-library compute programs of 1.0.2.1 hold a VOPC compare whose src0 field is a DPP marker: 4
v_cmp_gt_f32each, withquad_perm:[1,0,3,2],quad_perm:[2,3,0,1],row_ror:8(allbound_ctrl:1, masks 0xF) anddpp8:[4,5,6,7,0,1,2,3], besidev_min/max_f32_dppandv_mov_b32_dppon the same lanes. llvm-mc (LLVM 21.1.8,gfx1013) rejects the first word, so the listing dropped 7 words per program and the translator refused all three (fall-through into undecodable words). The retail boot asks for these pipelines at device slot 67.These are the three small programs still refused with #674 + #647 + #593 + #583 applied (2,672 of 2,684 translate then, measured for the first three and counted from the header census for #583; the other 9 are the large vcc-tuple family). This change needs none of them.
tools/shader_disasm.py: a rejected VOPC word with a DPP src0 is decoded with its first word turned intov_max_f32intov0, which takes the same DPP second word, so llvm-mc prints the two sources and the DPP controls; the line then gets the compare's name, avcc_lodestination and the real encoding back (with_vopc_dpp). A word that does not come out as the stand-in at an instruction boundary is left as it was.tools/rdna2_decode.py: decodes the pair directly. Before, it printed the DPP marker as an operand.tools/rdna2spirv.py(Gen.dpp_insn): a compare takes src0 through the existing DPP lane selection and writes its mask as the plain compare does. Only the forms where every lane writes its bit are translated:row_maskandbank_mask0xF and eitherbound_ctrl1 or DPP8. Any other form, andv_cmpx, is refused (DPP compare with lanes that keep their mask bit).scripts/run_gpu_tests.py: llvm-mc does not assemble the form either (dpp variant of this instruction is not supported), so a.asmcan carry a marker line that passes its text through as the listing, the wayregen_fixtures.pywrites fixtures.cs_dpp_cmp.asmis the only one.docs/design.md: the contract row "DPP on a VOPC compare".Not measured on hardware. The rule follows from the encoding, LLVM's GFX11 definition of the same form and the VOP2 DPP rules already measured;
tools/crosslane_fuzz.py --dpp-sweep --oracle hwdoes not cover compares and I have no Linux AMD machine for it. That is why the forms that leave a lane unwritten are refused rather than guessed. If someone with the oracle rig can run the four forms above, the row should say so.Tested
spirv-val(--wave64-emulate). Withmain's listings and translator: 0 of 3.python -I tests/semantic/test_dpp_compare.py: 9 pass. Lane values for 3 compares x 8 forms x 3 EXEC cases in the SPIR-V interpreter against a reference; refusals; both printers give the same line for 5 synthetic pairs (the llvm-mc cases skip withoutLLVM_MC).python -I scripts/run_semantic_tests.py tests/semantic: 466 files, 6,117 tests, 1 file fails (test_image_cube_store_glc), which also fails onmainhere.tests/test_rdna2_decode.py,tests/test_shader_disasm.py,tests/semantic/test_dpp_eager_subgroup.py,tests/test_run_gpu_tests*.py,tests/semantic/regen_fixtures.py --check,tests/test_docs_design_rows.py,tests/test_docs_repo_paths.py,tests/test_docs_table_rows.py: pass.scripts/run_gpu_tests.py --filter cs_dpp:cs_dpp_cmppasses (3 2 3 2 1 0 1 0) on all three runs below, with the othercs_dpp*unchanged.main).GPUs tested: NVIDIA GeForce RTX 4080 (driver 621.24, Windows 11 26300), native 9/10 with
cs_dpp_w64skipped (no 64-wide subgroup) andLEONIDA_W64_EMULATE=110/10; AMD Radeon integrated graphics (PCI 1002:13C0, driver 32.0.21042.62, same machine), native 10/10.AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
@KernelSmoker on GitHub · 2026-11-24 15:48 UTC · original · approved these changes
Verified on exact head
d046559435c22f1dc834001b1e117a992358f89e. In the Fedora 45 container with LLVM 23.1.5 (LLVM_MC=llvm-mc),test_dpp_compare.pypassed 9/9 with both llvm-mc-dependent cases enabled;test_rdna2_decode.py19/19;test_shader_disasm.py30/30;test_dpp_eager_subgroup.py7/7;test_run_gpu_tests.py64/64;test_run_gpu_tests_python_assembler.py10/10;test_run_gpu_tests_paths.py21/21; design rows 5/5; docs repo paths 3/3; docs table rows 2/2.regen_fixtures.py --check,check_no_game_data.py, andgit diff --checkalso passed.These are CPU/interpreter, assembler/disassembler, and fixture checks; I did not run the GPU shader probe locally. No local GPU result is claimed.
@Timon360SB on GitHub · 2026-11-24 17:49 UTC · original
Independent GPU testing results
Verified the new VOPC DPP compare fixture on NVIDIA Blackwell hardware using both native execution and Wave64 emulation with Vulkan validation enabled.
The new
cs_dpp_cmpfixture passed consistently. An existing Wave64 shared-memory validation issue was reproduced on both BASE and HEAD.Tested revisions
8f05e09e224656740e8a53f5047e1338d7a52588d046559435c22f1dc834001b1e117a992358f89eTest environment
Test configuration
cs_dpp.Both revisions compiled successfully.
Execution logs confirm nine GPU runner invocations per mode on each revision, for 36 GPU runner invocations overall.
Shader translation
Every invocation reported successful translation and SPIR-V validation for all selected shaders.
The additional HEAD shader is
cs_dpp_cmp, which is absent from BASE.GPU test results
Results across all three attempts:
cs_dppcs_dpp8cs_dpp_bankcs_dpp_boundcs_dpp_cmpcs_dpp_fics_dpp_maskcs_dpp_opscs_dpp_rowcs_dpp_w64Aggregate fixture results:
The fixture totals exclude aggregate runner summary records.
New VOPC DPP compare fixture
The new
cs_dpp_cmpfixture passed in all native and Wave64 emulation executions.All 144 compared output words across the 18 executions matched the expected values.
No validation failure was attributed to the new fixture in the examined runner results.
Existing Wave64 validation issue
Native
cs_dpp_w64execution was skipped on both revisions because the device does not expose a 64-wide compute subgroup:Under Wave64 emulation, the fixture produced correct functional output but failed due to validation diagnostics:
The validation layer reported shared-memory data races during compute dispatch.
Representative diagnostic:
Every affected invocation reported six validation errors.
Across both revisions, all 18 affected Wave64 executions reported zero functional output mismatches and a combined 108 validation errors.
The runner returned exit code 1 for these emulated runs. Native runner invocations returned exit code 0.
The issue was already present on BASE and was not newly introduced by this PR. Whether the reported race represents a genuine synchronization defect or a validation-layer issue requires separate investigation.
Test execution note
During the second attempt, live GitHub PR metadata verification was temporarily unavailable because of a network connection failure.
The recorded pinned revisions and merge base remained unchanged. Live PR metadata verification succeeded in the first and third attempts.
Limitations
Conclusion
Result: PASS for the new VOPC DPP compare fixture; overall suite requires review due to a pre-existing Wave64 validation issue.
The new
cs_dpp_cmpfixture passed all 18 native and emulated executions, with every compared output word matching the expected result.All eight previously existing non-Wave64 DPP fixtures also remained successful.
The existing
cs_dpp_w64validation failure reproduced identically on BASE and HEAD despite correct functional output.No new functional regression was identified within the tested DPP coverage.
AI-assisted log analysis and report preparation.
@kawaii-shakal on GitHub · 2026-11-24 17:54 UTC · original
Independent run of
d04655943on the real pipeline library, with a different llvm-mc than the PR's measurement.Setup: Windows 11 Pro 26300, native
llvm-mc23.1.5 (built with MSVC from the 23.1.5 source release, AMDGPU target), an own 1.0.2.1 copy.tools/shader_library.py --stages cs --disasmfrom this branch, thentools/rdna2spirv.py --wave64-emulatefrom this branch over all 2,684 compute programs.lib_cs_01473..01475; kind-6 hashes20032d8b…,50b2f2b9…,4cf325ec…): 0 invalid words each (7 each onmain's listings), with fourv_cmp_gt_f32_dpp vcc_lolines each:quad_perm:[1,0,3,2],quad_perm:[2,3,0,1],row_ror:8(allbound_ctrl:1, masks 0xf) anddpp8:[4,5,6,7,0,1,2,3], with the encodings as in the blob. So the stand-in decode also works under LLVM 23.1.5, which still rejects the form for bothgfx1013andgfx1030.spirv-val, against 2,528 onmain82a2aabccwith the same llvm-mc. Exactly these three are added.fall-through into undecodable wordsgoes from 51 to 48, and every other refusal count is unchanged (vcc tuples, lane-masks_flbit/s_bitreplicate, one normalized encoding).vk_pipeline_checkon the three modules, NVIDIA GeForce RTX 5070 Ti (driver 617.42, subgroup 32): 3/3 modules and 3/3 compute pipelines created, 0 failed. Creation only: the compares' lane results were not read back on this GPU.AI-assisted.
@QemmHD on GitHub · 2026-11-24 21:04 UTC · original
Merging.
Why merged: SHADER-VOPC-DPP decodes and translates VOPC compares in DPP16/DPP8 form.
shader_disasmgets a second llvm-mc pass that patches the word llvm-mc rejects to av_max_f32stand-in, then restores the name and encoding. KernelSmoker approved it, Timon360SB ran it on Blackwell native and w64, and kawaii-shakal ran all 2,684 CS programs of the real library through it.Why it's good: on the RTX 4070 SUPER,
scripts/run_gpu_tests.py --filter cs_dpp:cs_dpp_w64is skipped (no 64-wide compute subgroup on this device);LEONIDA_W64_EMULATE=1under the Khronos validation layer: 10/10 pass, with no VUIDs;cs_dpp_cmpreads the expected3 2 3 2 1 0 1 0, and all 10 shaders pass spirv-val.Own tests (dpp_compare, dpp_eager_subgroup, rdna2_decode, shader_disasm, run_gpu_tests*, docs): 207 passed, 0 skipped. The llvm-mc cases ran with a real AMDGPU llvm-mc.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main
66d4f5aa3. With it in, the repo-consistency set gives 573 passed / 5 skipped / 0 failed, and check_no_game_data is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: decoder and translator branches plus the tool changes above, with no binaries, downloads, network calls or CI changes. Heads-up from the PR body: this conflicts with #281 inshader_disasm.py, so #281 will need a rebase.AI-assisted (Claude Code, Claude Opus 5.5).