Skip to content

rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP) - #1647

Merged
aslan2142 merged 4 commits into
ProjectLeonida:mainfrom
OreoFR:shader-vopcx-dpp
Nov 26, 2026
Merged

aslan2142 merged 4 commits into
ProjectLeonida:mainfrom
OreoFR:shader-vopcx-dpp

Conversation

@OreoFR

@OreoFR OreoFR commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: SHADER-VOPCX-DPP (#1608 (comment))

Depends on: #1375

#1375 makes tests/test_translate.py take the new cs_dpp_cmpx.asm as text, as it does cs_dpp_cmp.asm from #957: without it, both stop at llvm-mc's "dpp variant of this instruction is not supported".

What and why

Gen.dpp_insn refused every v_cmpx in DPP form (DPP on v_cmpx, tools/rdna2spirv.py). In the #1592 census of the pipeline library's graphics programs, that refusal accounts for 78 of the 344 programs that don't translate, all pixel shaders. Rain156 listed it as one of the remaining causes in #1608.

This extends #957's DPP VOPC compare to v_cmpx. The lane selection is the same, and the result goes to EXEC as for a plain v_cmpx: a lane that was off stays off. v_cmpx prints no destination, so its src0 is the first operand. The same forms as for v_cmp are taken, those where every lane writes its bit: row_mask and bank_mask 0xF, plus bound_ctrl:1 or DPP8. Any other form is still refused with DPP compare with lanes that keep their mask bit. The disassemblers already print the form (tools/shader_disasm.py with_vopc_dpp, tools/rdna2_decode.py), so the change is in the translator only.

All 113 instructions in those 78 programs have the same form: v_cmpx_gt_f32_dpp vN, -vM quad_perm:[2,3,0,1] row_mask:0xf bank_mask:0xf bound_ctrl:1 fi:1. That compares against the lane two above or below in the quad, with src1 negated.

  • tools/rdna2spirv.py: the src0 index follows the compare kind. Nothing else in dpp_insn changes.
  • docs/design.md: the "DPP on a VOPC compare" row covers v_cmpx, with the count and the GPU check.
  • tests/semantic/test_dpp_compare.py:
    • EXEC values from the SPIR-V interpreter for v_cmpx_gt_f32, v_cmpx_lt_u32 and v_cmpx_eq_u32 over the written forms and the game's form, with a lane off and with src1 negated;
    • the refused forms still refused;
    • both printers on the game's encoding (fa 02 28 7c 01 4e 4c ff).
    • The old "v_cmpx is refused" test is replaced.
  • runtime/test/shaders/cs_dpp_cmpx.asm, with its translator fixture: a GPU test of the game's form, with and without the negated src1.

Tested

  • Refused programs: the 344 programs the shaders: build the graphics program index for device slot 57 (RT-SLOT57-NATIVE-GRAPHICS-PSO) #1592 census refused (1.0.2.1, --wave64-emulate, listings from llvm-mc 23.1.6; with llvm-mc 21 far more programs stop earlier at undecodable words, and quartz-heron-58 measured 14 new programs there), translated again with this branch. Before: 0 translated. After: 78 translated, 78 pass spirv-val. The other 266 are refused as before: v_interp_p2_f16 242, s_getpc_b64 18 (rdna2spirv: support vcc and null destinations on s_getpc_b64 and reject odd pairs #1632), no shader container 6. The 18,493 programs that already translated contain no v_cmpx in DPP form, since it was refused, so their output is unchanged.
  • python -I scripts/run_gpu_tests.py --filter cs_dpp: 10/11 pass with cs_dpp_cmpx = 1 1 0 0 3 3 2 2 (cs_dpp_w64 skipped: no 64-wide subgroup). With LEONIDA_W64_EMULATE=1, 11/11 pass.
  • tests/semantic/test_dpp_compare.py: 13 tests pass, including the llvm-mc listing test (LLVM 23).
  • Fixtures and full suite: regen_fixtures.py --check is clean. scripts/run_semantic_tests.py tests/semantic: 487 files, 6,283 tests, 0 failed.
  • Hardware: no RDNA2 hardware here. As for rdna2spirv, shader_disasm: VOPC compares in DPP form (SHADER-VOPC-DPP) #957, the rule follows from the encoding and from the VOP2 DPP rules already measured, and is checked against the interpreter and on NVIDIA.

GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 591.59 (32.0.15.9159), Windows 11

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🤖 Generated with Claude Code

@GeorgiyDemo

Copy link
Copy Markdown
Contributor

Tested 844dd42b6 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main 3f81d46ac (translator + new GPU fixture; binaries from the build at 66d4f5aa3):

  • tests/semantic/test_dpp_compare.py: OK (2 skipped) at this head; copied onto main it fails 5 + 85 errors.
  • GPU, --filter cs_dpp_cmpx: 1/1 PASS on MoltenVK 1.4.2 and 1/1 PASS on KosmicKrisp (Mesa 26.3.1), words 1 1 0 0 3 3 2 2.
  • Coverage: the same worktree with main's tools/rdna2spirv.py fails exactly as before the PR — 1 DPP on v_cmpx, then missing .spv (translation failed).

AI-assisted; synthetic fixtures only, no game data.

@ecox982745

Copy link
Copy Markdown

I tested the compare in a pixel shader on an RTX 4090, since all 78 programs in the reported bucket are pixel shaders. On 844dd42b6, eight synthetic 64×64 draws matched the independent per-pixel reference in all 32,768 pixel results. Parent 42537e7b6 refused all eight translations with DPP on v_cmpx.

I used two distinct lane-dependent float operands with quad_perm:[2,3,0,1], negated src1, full row/bank masks, bound_ctrl:1 and fi:1. One draw starts with full EXEC. A second disables lane 2 of each quad after initializing both operands and before the DPP compare. The shader saves the result, restores EXEC, and exports the result, lane ID and both inputs. This lets the CPU reference check each actual fragment lane independently of its screen position.

The partially masked draw produced 512 true results out of 4,096. Treating an inactive source as zero would change 384 pixels. Omitting the quad permutation would change 1,024 pixels, and omitting src1 negation would change 1,536. Both disassemblers (LLVM 23.1.6 and Python) and both source wave declarations gave exact results, and all eight modules passed SPIR-V validation. The wave64-source draw ran on physical 32-wide NVIDIA subgroups (observed lanes 0–31).

Windows, NVIDIA 616.64. Synthetic shaders only. AI-assisted verification.

@whoalin1

Copy link
Copy Markdown
Contributor

Independent verification (native Windows): diff reviewed — v_cmpx handled as a DPP compare (src0 = first operand, result -> EXEC), conservative gating (full row/bank + bound_ctrl/DPP8 only), contract row in docs/design.md extended, new semantic test + GPU fixture wired. test_dpp_compare.py 13 OK (2 llvm-mc skips, environmental); FULL semantic suite 487 files / 6,283 tests / 0 failed; run_gpu_tests.py --filter cs_dpp_cmpx PASS on both RTX 4070 SUPER and AMD gfx1036 iGPU, output matches check.py. The "78 pipeline-library shaders" claim needs game files — unverifiable here, but the mechanism is sound. AI-assisted verification.

@adrianmjim

Copy link
Copy Markdown

Tested 844dd42b6 applied onto main 42537e7b6, on AMD: Radeon RX 7900 XT (RDNA3, gfx1100, subgroup 32..64), AMD driver 32.0.32029.2010 (26.11.2), Windows 11 build 26300, Vulkan SDK 1.4.363.0, llvm-mc 23.1.5, test programs from a main 42537e7b6 build. That adds an RDNA3 and wave64-capable run to the gfx1036 one above. No game files.

GPU:

One problem this PR makes reachable: the wave64 halves analysis does not see the EXEC write of a DPP v_cmpx. In tools/wave64_halves.py transfer(), the cross-lane branch (around line 912) catches every op with _dpp or a DPP modifier. It taints dests, which is empty for v_cmpx, and returns before the "exec" in defs → exec_write() step (around line 927).

So after v_cmpx_*_dpp, SHADER-10 still believes EXEC is what it was before the compare (in the repro below, the launch mask). Until this PR every DPP v_cmpx was refused, so the gap could not be reached.

The same wave64 pixel shader body, with an e32 and a DPP compare. test_wave64_halves.ps() wraps the body and exports v6 through exp mrt0 v6, v7, v5, v5 done vm:

v_mov_b32_e32 v5, 0
s_mov_b64 s[10:11], exec
<cmpx>
v_mov_b32_e32 v5, s4
s_mov_b64 exec, s[10:11]
v_readlane_b32 s5, v5, 0
v_mov_b32_e32 v6, s5
<cmpx> w64g with this PR
v_cmpx_gt_f32_e32 v1, v2 tier C, reasons ['cross-lane'], no idioms
v_cmpx_gt_f32_dpp v1, -v1 quad_perm:[2,3,0,1] row_mask:0xf bank_mask:0xf bound_ctrl:1 fi:1 tier B, no reasons, idiom readlane-uniform, one entry in uniform_readlane

On main the DPP form stops with Unsupported: DPP on v_cmpx.

With the DPP form, the analysis treats v5 = s4 as uniform in every lane. So v_readlane_b32 s5, v5, 0 becomes a read of each lane's own copy:

  • If the compare kept lane 0, hardware gives every lane s4, but the lanes the compare dropped get their own v5 (0).
  • If it dropped lane 0, hardware gives every lane 0, but the lanes the compare kept get s4.

A vcc vote after such a compare could be given tier A/B in the same way.

A fix: in that cross-lane branch, fall through to exec_write() when "exec" in defs, or check the EXEC write before the branch. This needs no game data to reproduce. The repro calls tests/semantic/test_wave64_halves.py's listing/ps/translate_listing, then reads rdna2spirv.translate.last_gen.w64g.

Two smaller points:

  • restore_skipped_instructions (tools/rdna2spirv.py, around 17572) only recovers DPP compares named v_cmp_*_f32_dpp, and "v_cmpx_gt_f32_dpp".startswith("v_cmp_") is False. So a listing made without with_vopc_dpp (or where that pass returned None) should stop with fall-through into undecodable words. I worked that out from reachable_code and did not run it. It fails safe, and listings from the current shader_disasm.py are not affected.
  • For v_cmpx_class_f32_dpp with a negated src0, on a lane whose DPP source reads 0 (out of its row with bound_ctrl:1, or inactive without fi:1), neg is applied before the zero substitution. The lane classifies +0 (class bit 6). Hardware, if it applies neg after the DPP fetch as the ISA describes, classifies -0 (bit 5). The game's form (src1 negated, quad_perm) can't hit it, and v_cmp_class on main behaves the same.

OreoFR added a commit to OreoFR/leonida that referenced this pull request Nov 25, 2026
…tore pass recovers it (SHADER-VOPCX-DPP review)

- wave64_halves.transfer: the cross-lane branch caught v_cmpx in DPP form and
  returned before its EXEC write, so the analysis kept the old EXEC and could
  call a value uniform that is not (tier B readlane-uniform instead of C).
  It now goes through exec_write, never as a uniform vote.
- restore_skipped_instructions recovers v_cmpx_*_f32_dpp as it does v_cmp_*.

Found by adrianmjim's review of ProjectLeonida#1647.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OreoFR

OreoFR commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@adrianmjim thanks, that's a real hole, and this PR is what made it reachable. Fixed in 2b639a367:

  • tools/wave64_halves.py: in transfer(), the cross-lane branch still taints the DPP sources, then goes through exec_write() when "exec" in defs, with a new vote=False. A DPP v_cmpx is never taken as a uniform vote, because a lane whose DPP source is invalid compares 0. Your repro is now tests/semantic/test_wave64_halves.py VcmpxDppExec. The DPP form classifies exactly as the e32 one does: tier C, ['cross-lane'], no idioms. Before the fix it was tier B with readlane-uniform.
  • restore_skipped_instructions: it now also recovers v_cmpx_*_f32_dpp. test_library_compute_forms.py covers it with the game's encoding (fa 02 28 7c 01 4e 4c ff), decoded to two operands and restored at pc 0.
  • The v_cmpx_class neg/zero order: left out here. As you say, v_cmp_class on main behaves the same and the game's form can't reach it. It's better fixed for both compares together, in a separate PR.

None of the 78 programs this PR unblocks is wave64. All are wave32 (wave64: false in the index), so the halves analysis never ran on them. Re-translated with the fix: still 78 translated and 78 passing spirv-val. The full suite passes: 487 files, 6,285 tests, 0 failed.

AI-assisted.

@ecox982745

Copy link
Copy Markdown

I confirmed the rendering consequence of the EXEC-tracking issue on an RTX 4090 (Windows, NVIDIA 616.64) and rechecked 2b639a367 against its parent 844dd42b6.

My synthetic wave64 pixel shader initializes v5 to zero, uses an alternating screen-space input for the DPP compare, writes 1.0 to v5 only in the surviving lanes, restores EXEC, then broadcasts v_readlane_b32 s5, v5, 0 to the red channel. Whichever value lane 0 held, every lane in its wave should read the same red value.

  • On 844dd42b6, --wave64-graphics error accepted the shader as tier B (readlane-uniform). The frame contained 2,048 red zeros and 2,048 red ones. To check whether variation occurred within a subgroup, I added OpGroupNonUniformAllEqual on red at the final export and recorded the vote in alpha. All 4,096 pixels reported a mixed subgroup. The RGB bytes matched the uninstrumented draw. A control with EXEC kept full reported uniform red at all 4,096 pixels.
  • On 2b639a367, strict mode correctly refuses both the DPP case and the ordinary compare control as tier C (cross-lane). The full-EXEC control still draws correctly. All eight previously tested DPP draws without the unsafe readlane still match their references, 32,768/32,768 pixels across both decoders.

The hardware subgroups were 32-wide. The new result for the unsafe shader is a translator refusal before GPU execution. Separately, all 154 CPU tests in test_wave64_halves, test_library_compute_forms, and test_dpp_compare passed with LLVM 23.1.6. AI-assisted verification.

@quartz-heron-58

Copy link
Copy Markdown
Contributor

Author of #957 here. A check on a real copy of the pipeline library, which the reports above could not do, plus one test file that is red on this head.

Setup: head 2b639a3 against its base on main 42537e7. Windows 11 build 26300, own 1.0.2.1 copy, llvm-mc 21.1.8 (so an older assembler than the PR's LLVM 23 runs), SPIRV-Tools v2026.4, Python 3.12.

Pipeline library, graphics programs. tools/shader_library.py shaders.rpf --stages ps,vs,ms --disasm --carve ... from this branch writes 18,837 programs, the same total as your census (18,493 + 344). Both translators then ran over the same listings with --wave64-emulate:

translated refused
base 42537e7 16,914 1,923
this head 16,928 1,909
  • 14 programs are new, all pixel shaders, and all 14 pass spirv-val. Nothing that translated on the base is lost.
  • The refusal counts on this head: 1,708 fall-through into undecodable words (1,722 on the base), 151 v_interp_p2_f16, 43 normalized encoding, 6 no shader container, 1 s_getpc_b64. Only the first count moves.

So the direction is confirmed on a second copy and toolchain, but not the number 78. With llvm-mc 21 far more programs stop at undecodable words for reasons that have nothing to do with this PR (1,708 here against a total of 344 refusals in your census), and the rest of your 78 are presumably behind those. On these listings the base never reports DPP on v_cmpx at all: the 14 come through the restore pass added in 2b639a3. I did not rerun with LLVM 23 or the Python backend, so I cannot say whether 78 reproduces there.

pytest tests/test_translate.py: 4 failed, 705 passed on this head; 2 failed, 705 passed on the base. The two on the base are cs_dpp_cmp.asm, which is my doing from #957. The two new ones are the same two tests on cs_dpp_cmpx.asm: test_gpu_samples_translate_and_validate and test_wave64_emulate_uses_no_subgroup_ops, both stopping at the llvm-mc assertion in tests/conftest.py ("dpp variant of this instruction is not supported"). The new fixture carries the ; run_gpu_tests: text only line, so #1375 (open) fixes all four once it lands; until then this PR adds two failures to the translator-tests job. Nothing to change in the fixture, as far as I can see. It only needs #1375 first, or a Depends on.

Also run, all passing: test_dpp_compare.py 13, test_wave64_halves.py 128, test_library_compute_forms.py 13. GPU, run_gpu_tests.py --filter cs_dpp with test programs from a main 2376e7d build: cs_dpp_cmpx gives 1 1 0 0 3 3 2 2 on an AMD Radeon iGPU (Ryzen 9 9950X3D, driver 32.0.21042.62, subgroup 32..64), natively and with LEONIDA_W64_EMULATE=1 (11/11 both), and on an RTX 4080 (621.24): 10/11 with one 64-wide skip natively, 11/11 emulated.

Not run: the full semantic suite, LLVM 23, the Python disassembler backend. One run of each. Counts only, no game data. AI-assisted: yes (Claude Code)

@OreoFR

OreoFR commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@quartz-heron-58 thanks, especially for the run on a real library with another toolchain.

AI-assisted.

@MoonEyes MoonEyes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on Windows 11, Python 3.14, Vulkan SDK 1.4.363 spirv-val on PATH, LLVM_MC=wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc (LLVM 21.1.8). Head 2b639a3. Main moved during the checks, so each result names the main commit it was run on.

Translator tests (scripts/run_semantic_tests.py, main 604ddff):

file main this PR
test_dpp_compare.py 9 tests OK 13 tests OK
test_library_compute_forms.py 12 tests OK 13 tests OK
test_wave64_halves.py 127 tests OK 128 tests OK

tests/test_translate.py (pytest 9.2.0, main 57ba40b), confirming the Depends on: #1375:

tree result
main 2 failed, 705 passed: test_gpu_samples_translate_and_validate and test_wave64_emulate_uses_no_subgroup_ops on cs_dpp_cmp.asm (from #957)
this PR 4 failed, 705 passed: the same two tests, each on cs_dpp_cmp.asm and cs_dpp_cmpx.asm
this PR + #1375 (local merge) 711 passed

GPU: NVIDIA GeForce RTX 4060 (Ada), driver 610.88, vk_compute_test built with MSVC 19.44 from main 3f81d46, fixtures and translator from this PR. python -I scripts/run_gpu_tests.py --build <build> --filter cs_dpp --disasm-dir tests/semantic/fixtures/disasm gives PASS cs_dpp_cmp and PASS cs_dpp_cmpx (2/2; both translate and pass spirv-val).

Not checked: the 78 graphics programs from the #1592 census (my work folder's shaders/library has 2,680 programs, not the graphics library), and the main corpus with this branch. None of its 26,503 shaders/dxbc/disasm listings contains a v_cmpx_*_dpp in text (grep), but restore_skipped_instructions can now recover that form from the raw bytes, so a text grep does not show the corpus output is unchanged; I did not re-translate it.

AI-assisted: yes (Claude Code ran the checks; a separate agent checked this text against the logs; I read both).

@quartz-heron-58

Copy link
Copy Markdown
Contributor

The check @MoonEyes lists as not done, the main corpus re-translated with this branch: the output does not change.

All 26,503 listings of a 1.0.2.1 copy (shaders/dxbc/disasm, llvm-mc 21.1.8 backend), translated with rdna2spirv.py --no-asm --wave64-emulate once from the base 42537e7 and once from this head 2b639a3, each into its own folder:

  • 26,503 translated in both runs.
  • All 26,503 .spv files are byte-identical between the two (SHA-256 of each pair), and so is the merged index.json.

So on this corpus neither the new compare path nor the extended restore pass changes a module. Together with the library result above (14 new pixel programs, none lost), that is every program I can translate here.

Not covered: listings from LLVM 23 or the Python backend, a run without --wave64-emulate, and the fallback flags. One run of each side. Hashes and counts only, no game data. AI-assisted: yes (Claude Code)

@OreoFR

OreoFR commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@quartz-heron-58 thanks, that closes the check left open: all 26,503 modules byte-identical, plus the 14 new pixel programs from the library run. And thanks @MoonEyes for the review on the 4060.

AI-assisted.

@adrianmjim

Copy link
Copy Markdown

Rechecked at dec076574. The wave64 halves gap is closed. My repro, the same wave64 pixel shader with an e32 and a DPP compare followed by v_readlane_b32 after the EXEC restore, now gives:

<cmpx> w64g at 844dd42b6 at dec076574
v_cmpx_gt_f32_e32 v1, v2 tier C, cross-lane tier C, cross-lane
v_cmpx_gt_f32_dpp v1, -v1 quad_perm:[2,3,0,1] ... bound_ctrl:1 fi:1 tier B, readlane-uniform tier C, cross-lane

So the DPP form is now treated like the e32 one.

On the RX 7900 XT (driver 32.0.32029.2010, test programs from a main 42537e7b6 build):

  • All 11 cs_dpp* fixtures pass, with cs_dpp_cmpx = 1 1 0 0 3 3 2 2.
  • With LEONIDA_W64_EMULATE=1, cs_dpp_cmpx passes too.
  • test_dpp_compare.py and the five test_wave64_halves*.py files pass.

No game files.

@EvgHaze

EvgHaze commented Nov 25, 2026

Copy link
Copy Markdown

Apple check of the new DPP fixture, on both drivers.

Machine:  Apple M3, 10-core (MacBook Air 13", Mac15,13), macOS 27.0 (26A5406e), arm64
Drivers:  MoltenVK 1.4.2 (Homebrew), ICD loaded directly, subgroup 4..32
          KosmicKrisp, Mesa 26.3.1 (Homebrew), through the Vulkan loader, subgroup 32..32
Base:     main `0d80bc5` + this diff (clean `git apply`)

scripts/run_gpu_tests.py --filter cs_dpp — identical on both drivers, 10/11 passed, 1 skipped:

Test Words
cs_dpp 1 0 3 2 5 4 7 6
cs_dpp8 7 6 5 4 3 2 1 0
cs_dpp_bank 4294967295 4294967294 4294967293 4294967292 7 7 7 7
cs_dpp_bound 10 10 11 12 13 14 15 16
cs_dpp_cmp 3 2 3 2 1 0 1 0
cs_dpp_cmpx (new) 1 1 0 0 3 3 2 2
cs_dpp_fi 1 2 3 30583 5 6 7 30583
cs_dpp_mask 1 0 3 2 4008636142 4008636142 4008636142 4008636142
cs_dpp_ops 100 10 11 12 13 14 15 16
cs_dpp_row 0 0 1 2 3 4 5 6

The skip is the 64-wide case (no 64-wide compute subgroup on this device).

python3 -I scripts/run_semantic_tests.py tests/semantic → 489 files, 6294 tests, 0 failed (main is 6288, so this diff adds six), 148 s.

Worth noting for the record: these run at subgroup size 32 natively on both Apple drivers, so the DPP forms are not being emulated here.

AI-assisted. No game data: hand-written fixtures, and the numbers above are test output.

@aslan2142 aslan2142 added the needs rebase Conflicts with the base branch: rebase it on main label Nov 25, 2026
OreoFR and others added 4 commits November 25, 2026 23:36
Extend ProjectLeonida#957's DPP VOPC compare to v_cmpx: the same lane selection, with the
result written to EXEC. v_cmpx prints no destination, so src0 is its first
operand. Only the forms where every lane writes its bit are taken, as for
v_cmp. 78 pipeline-library pixel shaders of 1.0.2.1 were refused for it; all
78 now translate and pass spirv-val.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tore pass recovers it (SHADER-VOPCX-DPP review)

- wave64_halves.transfer: the cross-lane branch caught v_cmpx in DPP form and
  returned before its EXEC write, so the analysis kept the old EXEC and could
  call a value uniform that is not (tier B readlane-uniform instead of C).
  It now goes through exec_write, never as a uniform vote.
- restore_skipped_instructions recovers v_cmpx_*_f32_dpp as it does v_cmp_*.

Found by adrianmjim's review of ProjectLeonida#1647.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… of unwritten lanes (SHADER-VOPCX-DPP review)

On RDNA3 a lane DPP leaves unwritten does not keep its mask bit: v_cmp writes 0 to
its VCC bit and v_cmpx turns it off in EXEC (mcpeacebir-lang, RX 7800 XT, ubiquitarianism#1608).
The refusal text and the docs/design.md row said the bit was kept, as fact. The
forms stay refused, since RDNA2 is not measured; the wording now says that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…name for the pass (SHADER-VOPCX-DPP)

main replaced restore_skipped_instructions with restore_vcc_tuples and its skipped_form predicate while this branch
was open; the rebase carries the v_cmpx case into skipped_form, and the test now takes the listing entry the way
main's own v_cmp DPP case does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aslan2142

Copy link
Copy Markdown
Collaborator

Merging.

  • Why: v_cmpx in DPP form is now translated instead of refused, for the forms where every lane writes its bit. The result goes into EXEC as for a plain v_cmpx, and the contract-table row records how it was confirmed.
  • Tested on main e57bc63bc + tests: the pytest helper takes a text-only sample's lines as its listing, as run_gpu_tests.py does (TEST-TRANSLATE-TEXT-ONLY) #1375 + this PR (0df371254):
    • pytest tests/test_translate.py: 720 passed, including the four DPP compare cases.
    • The PR's own test files pass: test_dpp_compare 13, test_library_compute_forms 13, test_wave64_halves 128. With main's translator they fail.
    • Translator suite: 500 files, 6,373 tests, 0 failed.
    • The docs tests, test_ci_registration.py, compileall and check_no_game_data.py pass.
  • Effect on the current build: none. With llvm-mc 23.1.5 none of our 29,268 listings contains the instruction, and the translator's output is byte-identical on 4,369 modules of our pack. The 78 pixel shaders it unblocks are graphics programs of the pipeline library, which make_game.py does not carve yet.

Thanks @OreoFR, and @GeorgiyDemo, @ecox982745, @whoalin1, @adrianmjim, @quartz-heron-58, @MoonEyes and @EvgHaze for the reviews and runs.

AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)

@aslan2142
aslan2142 merged commit 2d43417 into ProjectLeonida:main Nov 26, 2026
5 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants