mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:00:52 +01:00
[PR #957] [MERGED] rdna2spirv, shader_disasm: VOPC compares in DPP form (SHADER-VOPC-DPP) #997
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#997
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/957
Author: @quartz-heron-58
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:vopc-dpp📝 Commits (1)
d046559rdna2spirv, shader_disasm: VOPC compares in DPP form (SHADER-VOPC-DPP)📊 Changes
9 files changed (+407 additions, -4 deletions)
View changed files
📝
docs/design.md(+1 -0)📝
runtime/test/shaders/check.py(+3 -1)➕
runtime/test/shaders/cs_dpp_cmp.asm(+22 -0)📝
scripts/run_gpu_tests.py(+16 -2)➕
tests/semantic/fixtures/disasm/cs_dpp_cmp.s(+14 -0)➕
tests/semantic/test_dpp_compare.py(+230 -0)📝
tools/rdna2_decode.py(+25 -0)📝
tools/rdna2spirv.py(+16 -1)📝
tools/shader_disasm.py(+80 -0)📄 Description
Claimed in the coordination issue as: SHADER-VOPC-DPP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136080089)
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.