Shaders: xcl disasm prints DPP controls, masks and source modifiers #791

Manually merged
github merged 2 commits from gh-pr/791/head into gh-pr/791/base 2026-11-26 04:32:37 +00:00
Owner

@⁠upipibi on GitHub · 2026-11-24 05:31 UTC · original
upipibi:disasm-dpp-controls → main · +218 −8 · 1 files · 2 commits · merged 2026-11-25 18:11 UTC

Stacked on the SDWA PR #790; only the top commit (ec0aa67) belongs here.

xcl disasm prints a DPP instruction as its registers only: v_mov_b32_dpp v5, v1 stands for every lane permutation there is. Left out: the control that says which lane each lane's first source comes from (quad_perm:[…], row_shl / row_shr / row_ror, row_mirror, row_half_mirror, row_share, row_xmask), row_mask / bank_mask, bound_ctrl, fi, the sources' neg / abs, and the eight lane selects of DPP8. The recompiler reads all of these (emit.rs, upper_lanes.rs); only the printed line drops them. Same kind of gap as #664, in an encoding that issue and its PRs (#687, #706, #716) do not cover; I found no issue or PR for it.

What is in it

  • crates/xcl/src/gpu/rdna2.rs: dpp_source (-v1, |v1|), dpp_modifiers (DPP16: control, row_mask, bank_mask, bound_ctrl:1, fi:1; DPP8: dpp8:[…], fi:1), in LLVM's words and order, called from operand_text / format.
  • Tests in the same file: llvm_gfx10_dpp_text compares the whole line with LLVM's for all 2229 DPP lines of tests/data/llvm-amdgpu (2117 DPP16 in gfx10_vop1_dpp16.txt / gfx10_vop2_dpp16.txt, 112 DPP8 in gfx10_vop1_dpp8.txt); sdwa_and_dpp_src0 gets the new tail and a control without a name.
  • Deliberately not LLVM's: the implicit vcc / vcc_lo operands stay out, as in the plain forms; DPP8 keeps this disassembler's _dpp8 suffix (LLVM: _dpp); a control RDNA2 has no name for (wave_*, row_bcast of older GPUs, the unassigned ones) is printed as dpp_ctrl:<number>, where LLVM prints a comment.

The text also goes into the // pc: … comment lines of the translated HLSL, so the HLSL of a program with DPP instructions changes in its comments (no code line changes).

Tested

  • NVIDIA GeForce RTX 3070 8 GB, driver 616.56 (32.0.16.1656), 32-lane waves only; Ryzen 9 5950X; Windows 11 Pro 26100; Rust 1.100.0 MSVC, debug.
  • cargo test -p xcl --lib gpu::rdna2: 12 passed, 0 failed. With the tests on the parent commit's format: 2 failed – llvm_gfx10_dpp_text "2229 of [2117, 112] DPP lines differ from LLVM's", sdwa_and_dpp_src0.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on ec0aa67: 704 passed, 0 failed, 41 ignored (xcl lib: 663 passed, 0 failed, 21 ignored), from a clean build of the workspace crates.
  • SKIPPED GPU tests: 2, both no wave64: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

Regression run
Run by @⁠eizispark on an AMD Radeon RX 9070 XT (posted in this PR's comments; we have no retail title here).

main:

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR:

xcl-smoke v1
commit: ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1659 (PresentX 1659)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14861 MB

Not tested

  • No retail title, no XCL_SAMPLE_* data: the game-data tests passed without running.
  • AMD / Intel GPUs, wave64 hardware.
  • No D3D12 debug layer on this machine (Graphics Tools not installed): test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state return early.
  • The dpp_ctrl:<number> form has no LLVM line to compare with.

AI use

  • Claude Code with Claude Fable 5.2 (Anthropic): found the gap by comparing xcl disasm with the LLVM test lines in the repository, wrote the code, the tests and this description, and ran the tests.

🤖 Generated with Claude Code

**@⁠upipibi** on GitHub · 2026-11-24 05:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/791) `upipibi:disasm-dpp-controls` → `main` · +218 −8 · 1 files · 2 commits · merged 2026-11-25 18:11 UTC Stacked on the SDWA PR #790; only the top commit (ec0aa67) belongs here. `xcl disasm` prints a DPP instruction as its registers only: `v_mov_b32_dpp v5, v1` stands for every lane permutation there is. Left out: the control that says which lane each lane's first source comes from (`quad_perm:[…]`, `row_shl` / `row_shr` / `row_ror`, `row_mirror`, `row_half_mirror`, `row_share`, `row_xmask`), `row_mask` / `bank_mask`, `bound_ctrl`, `fi`, the sources' neg / abs, and the eight lane selects of DPP8. The recompiler reads all of these (`emit.rs`, `upper_lanes.rs`); only the printed line drops them. Same kind of gap as #664, in an encoding that issue and its PRs (#687, #706, #716) do not cover; I found no issue or PR for it. **What is in it** - `crates/xcl/src/gpu/rdna2.rs`: `dpp_source` (`-v1`, `|v1|`), `dpp_modifiers` (DPP16: control, `row_mask`, `bank_mask`, `bound_ctrl:1`, `fi:1`; DPP8: `dpp8:[…]`, `fi:1`), in LLVM's words and order, called from `operand_text` / `format`. - Tests in the same file: `llvm_gfx10_dpp_text` compares the whole line with LLVM's for all 2229 DPP lines of `tests/data/llvm-amdgpu` (2117 DPP16 in `gfx10_vop1_dpp16.txt` / `gfx10_vop2_dpp16.txt`, 112 DPP8 in `gfx10_vop1_dpp8.txt`); `sdwa_and_dpp_src0` gets the new tail and a control without a name. - Deliberately not LLVM's: the implicit `vcc` / `vcc_lo` operands stay out, as in the plain forms; DPP8 keeps this disassembler's `_dpp8` suffix (LLVM: `_dpp`); a control RDNA2 has no name for (`wave_*`, `row_bcast` of older GPUs, the unassigned ones) is printed as `dpp_ctrl:<number>`, where LLVM prints a comment. The text also goes into the `// pc: …` comment lines of the translated HLSL, so the HLSL of a program with DPP instructions changes in its comments (no code line changes). **Tested** - NVIDIA GeForce RTX 3070 8 GB, driver 616.56 (32.0.16.1656), 32-lane waves only; Ryzen 9 5950X; Windows 11 Pro 26100; Rust 1.100.0 MSVC, debug. - `cargo test -p xcl --lib gpu::rdna2`: 12 passed, 0 failed. With the tests on the parent commit's `format`: 2 failed – `llvm_gfx10_dpp_text` "2229 of [2117, 112] DPP lines differ from LLVM's", `sdwa_and_dpp_src0`. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on ec0aa67: 704 passed, 0 failed, 41 ignored (xcl lib: 663 passed, 0 failed, 21 ignored), from a clean build of the workspace crates. - SKIPPED GPU tests: 2, both `no wave64`: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. **Regression run** Run by @⁠eizispark on an AMD Radeon RX 9070 XT (posted in this PR's comments; we have no retail title here). main: ``` xcl-smoke v1 commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1660 (PresentX 1660) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14862 MB ``` PR: ``` xcl-smoke v1 commit: ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1659 (PresentX 1659) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14861 MB ``` **Not tested** - No retail title, no `XCL_SAMPLE_*` data: the game-data tests passed without running. - AMD / Intel GPUs, wave64 hardware. - No D3D12 debug layer on this machine (Graphics Tools not installed): `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state` return early. - The `dpp_ctrl:<number>` form has no LLVM line to compare with. **AI use** - Claude Code with Claude Fable 5.2 (Anthropic): found the gap by comparing `xcl disasm` with the LLVM test lines in the repository, wrote the code, the tests and this description, and ran the tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
An SDWA instruction's text stopped at its registers: which byte or word
each source is read from and the result written to, sext / neg / abs on
the sources, clamp and the output modifier were left out, a second
source with its S bit set was printed as a VGPR, and a compare that
writes an SGPR instead of VCC did not show it. The decoder and the
recompiler have all of these; only the printed line dropped them (the
same gap as #664, in the encodings that issue does not list).

The text follows LLVM's: all 2816 lines of its gfx10 SDWA tests in
tests/data/llvm-amdgpu now read the same (none did), apart from the
implicit vcc operands that the plain forms leave out too.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A DPP instruction's text stopped at its registers too: the control that
says which lane each lane's first source comes from (quad_perm, row_shl
/ shr / ror, row_mirror, row_half_mirror, row_share, row_xmask), the row
and bank masks, bound_ctrl, fi, the sources' neg / abs and the DPP8 lane
selects were left out, so `v_mov_b32_dpp v5, v1` stood for every one of
them. The recompiler reads all of these; only the printed line dropped
them.

The text follows LLVM's: all 2229 lines of its gfx10 DPP16 and DPP8
tests in tests/data/llvm-amdgpu now read the same (none did), apart from
the implicit vcc operands and the `_dpp8` suffix this disassembler has.
A control RDNA2 has no name for is printed as `dpp_ctrl:<number>`.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:32:36 +00:00
github manually merged commit ec0aa67f44 into gh-pr/791/base 2026-11-26 04:32:37 +00:00
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 05:46 UTC · original

Test run of ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2 on AMD RDNA4. I merged it onto current main e50836b locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 707 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 666 passed, 0 failed, 21 ignored
  • 0 SKIPPED; llvm_gfx10_dpp_text and sdwa_and_dpp_src0 pass.

Review: Disassembler text only. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 05:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/791#issuecomment-7123256807) Test run of `ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2` on AMD RDNA4. I merged it onto current `main` `e50836b` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **707 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 666 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `llvm_gfx10_dpp_text` and `sdwa_and_dpp_src0` pass. **Review:** Disassembler text only. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 06:55 UTC · original

Regression runs for this PR's head ec0aa67 and for its base main f4ce27c, on a retail title (same title, 60 s each), made with scripts/smoke.ps1 (release, clean tree at each commit) and pasted unedited, for Regression run.

main:

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1615 (PresentX 1615)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16472 MB

this PR:

xcl-smoke v1
commit: ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1634 (PresentX 1634)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17194 MB

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974, Rust 1.90.0

Not tested

  • the unit tests on this machine
  • xcl disasm output itself: a title run does not use it, so this is a regression check only

Report written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 06:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/791#issuecomment-7124423519) Regression runs for this PR's head `ec0aa67` and for its base `main` `f4ce27c`, on a retail title (same title, 60 s each), made with `scripts/smoke.ps1` (release, clean tree at each commit) and pasted unedited, for **Regression run**. main: ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1615 (PresentX 1615) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16472 MB ``` this PR: ``` xcl-smoke v1 commit: ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2 gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1634 (PresentX 1634) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17194 MB ``` **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974, Rust 1.90.0 **Not tested** - the unit tests on this machine - `xcl disasm` output itself: a title run does not use it, so this is a regression check only Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 07:03 UTC · original

Hardware check of ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2 (verified clean merge with main beaa245): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 704 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • cargo test -p xcl --lib gpu::rdna2: 12 passed, 0 failed (including llvm_gfx10_dpp_text and sdwa_and_dpp_src0)

Regression run
main (beaa245):

xcl-smoke v1
commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14862 MB

PR (ec0aa67):

xcl-smoke v1
commit: ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1659 (PresentX 1659)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14861 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 07:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/791#issuecomment-7124568647) Hardware check of `ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2` (verified clean merge with `main` `beaa245`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `704 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `cargo test -p xcl --lib gpu::rdna2`: `12 passed, 0 failed` (including `llvm_gfx10_dpp_text` and `sdwa_and_dpp_src0`) **Regression run** `main` (`beaa245`): ``` xcl-smoke v1 commit: beaa245ca04e212f064efc7cafcdce104bc5c0a2 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1660 (PresentX 1660) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14862 MB ``` PR (`ec0aa67`): ``` xcl-smoke v1 commit: ec0aa67f44ffb13fcf73db4e9f9d8548a972d2e2 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1659 (PresentX 1659) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14861 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 10:07 UTC · original

Thanks @⁠eizispark: both blocks are now in Regression run, credited.

**@⁠upipibi** on GitHub · 2026-11-24 10:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/791#issuecomment-7128341241) Thanks @⁠eizispark: both blocks are now in **Regression run**, credited.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 10:58 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 10:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/791#issuecomment-7160422343) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.