Recompiler: report every DS instruction with GDS=1 as unsupported #1238

Manually merged
github merged 1 commit from gh-pr/1238/head into gh-pr/1238/base 2026-11-26 04:48:06 +00:00
Owner

@⁠emirduran707 on GitHub · 2026-11-24 13:34 UTC · original
emirduran707:recomp-ds-gds-unsupported → main · +23 −3 · 2 files · 1 commits · merged 2026-11-25 01:13 UTC

Only the two ADDTID forms checked a DS instruction's GDS bit. Every other DS instruction with GDS=1 was translated as an access to the group's LDS (xcl_lds), and nothing was recorded as unsupported. This covers plain reads and writes, the 8/16-bit and d16 forms, ds_wrxchg2 and the atomics. So ds_add_rtn_u32 … gds added into the title's groupshared data and returned old LDS values instead of the global data share's. The global data share is a separate memory, and the recompiler already decided that a GDS access is reported as unsupported: #79 for ADDTID, with the test comment "GDS=1 must be reported as unsupported and not allocate LDS".

The GDS check now sits before the ADDTID branch, so it covers every DS instruction that reaches LDS. ds_swizzle_b32 and ds_bpermute_b32 use no memory and return earlier; they are unchanged.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: the check moved out of the ADDTID branch.
  • crates/xcl/src/gpu/recomp/tests.rs: ds_gds_plain_forms_are_unsupported, which needs no GPU. It translates DS_ADD_U32, DS_WRITE_B32 and DS_READ_B32 with GDS=1, and checks that each is reported unsupported and that no xcl_lds is declared.

Tested

  • AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release
  • cargo test --workspace -- --test-threads=4 on e642921: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU tests
  • the new test without the change: DS_ADD_U32 not in unsupported (left: None, right: Some(1)); with it it passes
  • smoke log against main's: the same 40 pipelines without a translation, and 0 skipped draws in both runs

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1541 (PresentX 1541)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19650 MB

this PR:

xcl-smoke v1
commit: e642921c533eebe9071495d896ce2edc106c9fbd
gpu: AMD Radeon RX 9060 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1552 (PresentX 1552)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 19618 MB

Not tested

  • A title shader that uses GDS through these forms: none was refused in the smoke run.
  • NVIDIA and Intel GPUs.

AI use

  • Claude Code with Claude Opus 5.5: found the problem, wrote the change, the test and this description; I reviewed the diff and ran the tests and smoke runs above.

🤖 Generated with Claude Code

**@⁠emirduran707** on GitHub · 2026-11-24 13:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1238) `emirduran707:recomp-ds-gds-unsupported` → `main` · +23 −3 · 2 files · 1 commits · merged 2026-11-25 01:13 UTC Only the two ADDTID forms checked a DS instruction's GDS bit. Every other DS instruction with GDS=1 was translated as an access to the group's LDS (`xcl_lds`), and nothing was recorded as unsupported. This covers plain reads and writes, the 8/16-bit and d16 forms, `ds_wrxchg2` and the atomics. So `ds_add_rtn_u32 … gds` added into the title's groupshared data and returned old LDS values instead of the global data share's. The global data share is a separate memory, and the recompiler already decided that a GDS access is reported as unsupported: #79 for ADDTID, with the test comment "GDS=1 must be reported as unsupported and not allocate LDS". The GDS check now sits before the ADDTID branch, so it covers every DS instruction that reaches LDS. `ds_swizzle_b32` and `ds_bpermute_b32` use no memory and return earlier; they are unchanged. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: the check moved out of the ADDTID branch. - `crates/xcl/src/gpu/recomp/tests.rs`: `ds_gds_plain_forms_are_unsupported`, which needs no GPU. It translates `DS_ADD_U32`, `DS_WRITE_B32` and `DS_READ_B32` with GDS=1, and checks that each is reported unsupported and that no `xcl_lds` is declared. **Tested** - AMD Radeon RX 9060 XT (driver 32.0.31044.16), Ryzen 5 5600, Windows 11 Pro 26300, Rust 1.100.0; tests debug, smoke release - `cargo test --workspace -- --test-threads=4` on e642921: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU tests - the new test without the change: `DS_ADD_U32` not in `unsupported` (`left: None`, `right: Some(1)`); with it it passes - smoke log against main's: the same 40 pipelines without a translation, and 0 skipped draws in both runs **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1541 (PresentX 1541) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19650 MB ``` this PR: ``` xcl-smoke v1 commit: e642921c533eebe9071495d896ce2edc106c9fbd gpu: AMD Radeon RX 9060 XT title: retail-title seconds: 60 exit: 0x0 frames shown: 1552 (PresentX 1552) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 19618 MB ``` **Not tested** - A title shader that uses GDS through these forms: none was refused in the smoke run. - NVIDIA and Intel GPUs. **AI use** - Claude Code with Claude Opus 5.5: found the problem, wrote the change, the test and this description; I reviewed the diff and ran the tests and smoke runs above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Only ds_write_addtid_b32 / ds_read_addtid_b32 checked the GDS bit (#79).
Every other DS instruction with GDS=1 (plain and read2/write2 forms,
d16 and 8/16-bit forms, wrxchg2, the read-modify-write atomics) was
translated as an access to the group's LDS (xcl_lds): it overwrote the
title's groupshared data, read LDS instead of the global data share,
and nothing was recorded as unsupported.

The GDS check now runs for every DS instruction that reaches LDS
memory, after the "LDS outside compute" check, so the ADDTID forms
behave exactly as before. ds_swizzle_b32 / ds_bpermute_b32 use no
memory and are left as they were.

ds_gds_plain_forms_are_unsupported translates DS_ADD_U32, DS_WRITE_B32
and DS_READ_B32 with GDS=1; before the change none was recorded as
unsupported and each declared groupshared xcl_lds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:48:04 +00:00
github manually merged commit e642921c53 into gh-pr/1238/base 2026-11-26 04:48:06 +00:00
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 13:52 UTC · original

Independent RTX 3080 Ti check on e642921, Windows 11 build 26300, driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug.

I added a synthetic kernel that writes one LDS word per lane, inserts a DS_WRITE_B32 with GDS=1, then reads the LDS words back. With the parent emitter restored, the mixed kernel ran and the GDS write silently overwrote all 64 LDS words. The PR reports one unsupported ds_write_b32 and the GPU runner declines the mixed kernel. The LDS-only control still ran and returned all 64 expected words. The stock GDS regression and the added test passed at the PR head with no skips.

Synthetic shaders only. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 13:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/1238#issuecomment-7133472127) Independent RTX 3080 Ti check on [`e642921`](https://github.com/ivall/xcl/commit/e642921c533eebe9071495d896ce2edc106c9fbd), Windows 11 build 26300, driver 621.35, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug. I added a synthetic kernel that writes one LDS word per lane, inserts a `DS_WRITE_B32` with `GDS=1`, then reads the LDS words back. With the parent emitter restored, the mixed kernel ran and the GDS write silently overwrote all 64 LDS words. The PR reports one unsupported `ds_write_b32` and the GPU runner declines the mixed kernel. The LDS-only control still ran and returned all 64 expected words. The stock GDS regression and the added test passed at the PR head with no skips. Synthetic shaders only. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch fixture and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 14:02 UTC · original

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

  • cargo test -p xcl --lib lib recomp: 191 passed, 0 failed.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 14:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1238#issuecomment-7133738239) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - cargo test -p xcl --lib lib recomp: 191 passed, 0 failed. Thanks!
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 04:17 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 04:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/1238#issuecomment-7182464384) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
This discussion has been locked. Commenting is limited to contributors.
No description provided.