Recompiler: treat SDST=null (125) as Dst::Null in ENC_SOPK #1162

Open
github-bot wants to merge 1 commit from github-bot/gh-1162 into main AGit
Owner

@⁠b3IKK on GitHub · 2026-11-24 12:43 UTC · original
b3IKK:recomp/sopk-null-sdst → main · +19 −1 · 2 files · 1 commits · open

ENC_SOPK unconditionally constructed Dst::S(sd), so writes with SDST == 125 (null, e.g. s_addk_i32 null, K to update SCC without clobbering an SGPR) emitted invalid HLSL (0u = t1;) and failed DXC compilation.

This matches dst_of by mapping sd == 125 to Dst::Null.

What is in it

  • crates/xcl/src/gpu/recomp/emit.rs: map sd == 125 to Dst::Null in ENC_SOPK.
  • crates/xcl/src/gpu/recomp/tests.rs: add GPU test gpu_sopk_null_sdst_emits_valid_hlsl covering S_ADDK_I32, S_MOVK_I32, S_CMOVK_I32, and S_MULK_I32 with SDST = 125 across wave32 and split wave64 (verified failing DXC compilation before the fix).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib gpu_sopk_null_sdst_emits_valid_hlsl: 1 passed, 0 failed across wave32 and split wave64 (failed DXC compilation with error: expression is not assignable before the fix)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: cdbb516a5277f033bfaa871ed09f633dd7d1727f
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1646 (PresentX 1646)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14454 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited emit.rs, wrote the fix and GPU test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
**@⁠b3IKK** on GitHub · 2026-11-24 12:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1162) `b3IKK:recomp/sopk-null-sdst` → `main` · +19 −1 · 2 files · 1 commits · open `ENC_SOPK` unconditionally constructed `Dst::S(sd)`, so writes with `SDST == 125` (`null`, e.g. `s_addk_i32 null, K` to update `SCC` without clobbering an SGPR) emitted invalid HLSL (`0u = t1;`) and failed DXC compilation. This matches `dst_of` by mapping `sd == 125` to `Dst::Null`. **What is in it** - `crates/xcl/src/gpu/recomp/emit.rs`: map `sd == 125` to `Dst::Null` in `ENC_SOPK`. - `crates/xcl/src/gpu/recomp/tests.rs`: add GPU test `gpu_sopk_null_sdst_emits_valid_hlsl` covering `S_ADDK_I32`, `S_MOVK_I32`, `S_CMOVK_I32`, and `S_MULK_I32` with `SDST = 125` across wave32 and split wave64 (verified failing DXC compilation before the fix). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 742 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`) - `cargo test -p xcl --lib gpu_sopk_null_sdst_emits_valid_hlsl`: 1 passed, 0 failed across wave32 and split wave64 (failed DXC compilation with `error: expression is not assignable` before the fix) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: cdbb516a5277f033bfaa871ed09f633dd7d1727f gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1646 (PresentX 1646) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14454 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `emit.rs`, wrote the fix and GPU test, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
ENC_SOPK unconditionally constructed Dst::S(sd), so writes with
SDST == 125 (null, e.g. s_addk_i32 null, K to update SCC without
clobbering an SGPR) emitted invalid HLSL (`0u = t1;`) and failed DXC
compilation.

Match dst_of by mapping sd == 125 to Dst::Null, with a GPU test
covering S_ADDK_I32 / S_MOVK_I32 / S_CMOVK_I32 / S_MULK_I32 into null.

Assisted-by: OpenCode (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:45:37 +00:00
Author
Owner

@⁠bjarngard on GitHub · 2026-11-24 13:05 UTC · original

Test report for head cdbb516 (AMD, native wave64)

Tested

  • AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPED
  • With XCL_REQUIRE_GPU=wave64: gpu_sopk_null_sdst_emits_valid_hlsl passed

Not tested: retail titles, RDNA3/RDNA4.

AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.

**@⁠bjarngard** on GitHub · 2026-11-24 13:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1162#issuecomment-7132326923) Test report for head `cdbb516` (AMD, native wave64) **Tested** - AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: 742 passed, 0 failed, 41 ignored, no SKIPPED - With `XCL_REQUIRE_GPU=wave64`: `gpu_sopk_null_sdst_emits_valid_hlsl` passed **Not tested:** retail titles, RDNA3/RDNA4. **AI use:** the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
Author
Owner

@⁠JoaoPauluu on GitHub · 2026-11-24 13:57 UTC · original

A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. cdbb516 as it is (based on 47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).
  • gpu::recomp::tests::gpu_sopk_null_sdst_emits_valid_hlsl: ok, no SKIPPED.

Not tested

  • whether the new test fails without the fix on this stack; the rest of the suite on this head; native Windows; AMD / native wave64.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
**@⁠JoaoPauluu** on GitHub · 2026-11-24 13:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1162#issuecomment-7133588522) A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `cdbb516` as it is (based on `47efa2e`), no uncommitted changes. The lib test binary runs under Wine, one test per process (`--exact`). - `gpu::recomp::tests::gpu_sopk_null_sdst_emits_valid_hlsl`: **ok**, no SKIPPED. **Not tested** - whether the new test fails without the fix on this stack; the rest of the suite on this head; native Windows; AMD / native wave64. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 06:12 UTC · original

Independent RX 6800M GPU check on exact PR head cdbb516a5277f033bfaa871ed09f633dd7d1727f.

Tested

  • Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver 30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.
  • XCL_ADAPTER=6800M XCL_REQUIRE_GPU=wave64 cargo test --locked -p xcl --lib -j 2 gpu_sopk_null_sdst_emits_valid_hlsl -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored in 1.08 s. No SKIPPED line was emitted. The test covers four SOPK instructions with SDST=125 on the GPU's native wave64 and split wave64 forms.

I did not run the full workspace suite, a pre-fix negative control on this machine, or a retail title smoke comparison. This is a focused GPU regression result on an older PR head, not a current-main integration result. No game data was used or uploaded.

AI-assisted testing and report drafting with OpenAI Codex (GPT-6); I checked the exact revision and test log before posting.

**@⁠luckyteagirl** on GitHub · 2026-11-25 06:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1162#issuecomment-7154551545) Independent RX 6800M GPU check on exact PR head `cdbb516a5277f033bfaa871ed09f633dd7d1727f`. **Tested** - Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver `30.0.13002.13003`, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. - `XCL_ADAPTER=6800M XCL_REQUIRE_GPU=wave64 cargo test --locked -p xcl --lib -j 2 gpu_sopk_null_sdst_emits_valid_hlsl -- --test-threads=1 --show-output`: **1 passed, 0 failed, 0 ignored** in 1.08 s. No `SKIPPED` line was emitted. The test covers four SOPK instructions with `SDST=125` on the GPU's native wave64 and split wave64 forms. I did not run the full workspace suite, a pre-fix negative control on this machine, or a retail title smoke comparison. This is a focused GPU regression result on an older PR head, not a current-main integration result. No game data was used or uploaded. AI-assisted testing and report drafting with OpenAI Codex (GPT-6); I checked the exact revision and test log before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 07:46 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 07:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/1162#issuecomment-7156244175) 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 pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1162/head:github-bot/gh-1162'
git switch 'github-bot/gh-1162'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1162'
git switch 'github-bot/gh-1162'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1162'
git switch 'github-bot/gh-1162'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1162'
git switch 'main'
git merge --squash 'github-bot/gh-1162'
git switch 'main'
git merge --ff-only 'github-bot/gh-1162'
git switch 'main'
git merge 'github-bot/gh-1162'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.