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

Merged
upipibi merged 2 commits from upstream-pr/791 into main 2026-11-25 18:11:48 +00:00
upipibi commented 2026-11-24 05:31:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T05:31:19Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:6575348127 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/791). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T05:31:19Z. --- 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)
MesshM commented 2026-11-24 07:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:46:12Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7123256807 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/791#issuecomment-7123256807). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T05:46:12Z. --- 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.
Anon64 commented 2026-11-24 07:06:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-24T06:55:04Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7124423519 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/791#issuecomment-7124423519). Originally posted by [Anon64](https://github.com/Anon64) on 2026-11-24T06:55:04Z. --- 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.
eizispark commented 2026-11-24 07:06:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T07:03:29Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7124568647 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/791#issuecomment-7124568647). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T07:03:29Z. --- 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.
upipibi commented 2026-11-24 11:05:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T10:07:12Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7128341241 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/791#issuecomment-7128341241). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T10:07:12Z. --- Thanks @eizispark: both blocks are now in **Regression run**, credited.
DavidM1911 commented 2026-11-25 11:09:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:58:37Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7160422343 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/791#issuecomment-7160422343). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T10:58:37Z. --- 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!
upstream-sync closed this pull request 2026-11-25 19:07:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!785
No description provided.