AMD RX 9060 XT: run one clean-up pass for nine programs its compiler fails on (complements #1213) #1247

Open
github-bot wants to merge 2 commits from github-bot/gh-1247 into main AGit
Owner

@⁠MrToucann on GitHub · 2026-11-26 01:53 UTC · original
MrToucann:amd-shader-fixes → main · +72 −1 · 4 files · 2 commits · open

Problem

On an AMD Radeon RX 9060 XT (driver 32.0.32029.2010, amdxc64.dll 8.18.10.0514), AMD's shader compiler fails creating the pipelines of some translated programs. It either reads a null pointer (0xC0000005) or ends the process (0xFFFFFFFF). The DXIL passes dxil.dll validation.

The programs were found by creating every program's pipeline in a process of its own: 2,684 compute programs, and 23,279 others each with a stand-in partner stage.

Scope: what #1213 doesn't cover

The buffer size query programs are #1213's: a non-uniform handle per query. I tested it on the 9060 XT and it clears all four of them (see the thread). This PR now only covers the programs #1213 doesn't target, which build once one clean-up pass runs:

Program Without it Pass
indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays the process ends (0xFFFFFFFF), here and on DexNom FOLD
Eight PS_*_PBR_MATERIAL_*GLINTS* pixel programs build here as it is; crash on DexNom's translator, so kept for forks of it FACTS

The pass runs for these programs whatever VICTORY_SHADER_OPT says. On this card the full clean-up has to stay off, since it trips the same compiler elsewhere. Programs are chosen by container digest, so other programs keep their passes as they are, and a pass doesn't change what a program computes.

All of it is in emit/lower/amd.rs, with one-line hooks:

  • lower.rs: mod amd;
  • mod.rs: lower::amd::begin(c.digest); before lowering
  • shader.rs: | super::lower::amd::passes() in the pass set

Testing (RX 9060 XT, VICTORY_SHADER_OPT=0)

  • cargo test -p victory-shader: 218 passed.
  • This branch + #1213: all 13 programs validate and create their pipelines.
  • This branch alone: 11 of 13. The two tree programs still fail, as they do without #1213.
  • Not yet verified in-game.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut

**@⁠MrToucann** on GitHub · 2026-11-26 01:53 UTC · [original](https://github.com/fxceless/victory-fork/pull/1247) `MrToucann:amd-shader-fixes` → `main` · +72 −1 · 4 files · 2 commits · open ## Problem On an **AMD Radeon RX 9060 XT** (driver 32.0.32029.2010, `amdxc64.dll` 8.18.10.0514), AMD's shader compiler fails creating the pipelines of some translated programs. It either reads a null pointer (`0xC0000005`) or ends the process (`0xFFFFFFFF`). The DXIL passes `dxil.dll` validation. The programs were found by creating every program's pipeline in **a process of its own**: 2,684 compute programs, and 23,279 others each with a stand-in partner stage. ## Scope: what #1213 doesn't cover The **buffer size query** programs are #1213's: a non-uniform handle per query. I tested it on the 9060 XT and it clears all four of them (see the thread). This PR now only covers the programs #1213 doesn't target, which build once **one clean-up pass** runs: | Program | Without it | Pass | |---|---|---| | `indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays` | the process ends (`0xFFFFFFFF`), here and on DexNom | `FOLD` | | Eight `PS_*_PBR_MATERIAL_*GLINTS*` pixel programs | build here as it is; crash on DexNom's translator, so kept for forks of it | `FACTS` | The pass runs for these programs **whatever `VICTORY_SHADER_OPT` says**. On this card the full clean-up has to stay off, since it trips the same compiler elsewhere. Programs are chosen by container digest, so other programs keep their passes as they are, and a pass doesn't change what a program computes. All of it is in **`emit/lower/amd.rs`**, with one-line hooks: - `lower.rs`: `mod amd;` - `mod.rs`: `lower::amd::begin(c.digest);` before lowering - `shader.rs`: `| super::lower::amd::passes()` in the pass set ## Testing (RX 9060 XT, `VICTORY_SHADER_OPT=0`) - `cargo test -p victory-shader`: 218 passed. - **This branch + #1213:** all 13 programs validate and create their pipelines. - **This branch alone:** 11 of 13. The two tree programs still fail, as they do without #1213. - **Not yet verified in-game.** 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
amdxc64 8.18.10.0514 (Radeon RX 9060 XT, driver 32.0.32029.2010) dereferences
null, or ends the process, creating the pipelines of 13 programs as
translated. They were found by creating every program's pipeline (2,684
compute; 23,279 others with a stand-in partner stage) in a process of its
own.

- Four compute programs load from a raw view at an offset computed from that
  view's own size, with a branch on the loaded value guarding a loop (reduced
  to 46 instructions with DXC's dxa/dxopt). For them the size is read in the
  entry block and passed through groupshared memory across a group barrier,
  which hides where the offset came from. Every thread meets the barrier
  there.
- One compute program and the eight glints pixel programs build once one
  clean-up pass runs (constant folding, or what a taken branch says about its
  condition). It runs for them whatever VICTORY_SHADER_OPT says.

They are chosen by container digest, so every other program translates as
before, and these compute the same values. Everything lives in
emit/lower/amd.rs with a one-line hook where each change acts, so the change
carries to forks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
#1213 asks a buffer's size through a non-uniform handle of its own. On the
RX 9060 XT that clears the size-read programs on its own, without a digest
list, so the groupshared hoist and the Module helpers it needed go. What
remains is what #1213 does not target. The constant-folding pass runs for
indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays, which ends the
process without it. The FACTS pass runs for the eight glints pixel programs.

This branch with #1213: all 13 programs validate and create their
pipelines. Alone, the two tree programs still fail, as they do without
#1213. cargo test -p victory-shader: 218 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:00:19 +00:00
Author
Owner

@⁠IxMxAMAR on GitHub · 2026-11-26 01:57 UTC · original

#1213 targets the same pattern without a digest list. Here (RX 9070 XT, same driver) it is a buffer's getDimensions asked through the same uniform heap handle as its loads that crashes AMD's compiler; asking it through a non-uniform handle of its own builds bvh_skinning:CSComputeSkinningTreeAnimVelocity, CS_UpdateSkinnedAttachMeshTreeParticles (c1eee35dbc50a9ef) and three more, and a whole-archive translate --pipelines made all 25,636 pipelines.

If you can, it would be good to know whether #1213 alone also clears your four size-read programs on the 9060 XT.

**@⁠IxMxAMAR** on GitHub · 2026-11-26 01:57 UTC · [original](https://github.com/fxceless/victory-fork/pull/1247#issuecomment-7180318551) #1213 targets the same pattern without a digest list. Here (RX 9070 XT, same driver) it is a buffer's `getDimensions` asked through the same uniform heap handle as its loads that crashes AMD's compiler; asking it through a non-uniform handle of its own builds `bvh_skinning:CSComputeSkinningTreeAnimVelocity`, `CS_UpdateSkinnedAttachMeshTreeParticles` (`c1eee35dbc50a9ef`) and three more, and a whole-archive `translate --pipelines` made all 25,636 pipelines. If you can, it would be good to know whether #1213 alone also clears your four size-read programs on the 9060 XT.
Author
Owner

@⁠MrToucann on GitHub · 2026-11-26 02:16 UTC · original

Thanks. I tested #1213 on an RX 9060 XT (driver 32.0.32029.2010, amdxc64 8.18.10.0514) with the 13 programs from this PR, each in its own process, with VICTORY_SHADER_OPT=0:

  • fxceless main (fc63ce1) + #1213: 12 of 13 build and validate, including all four size-read programs (bvh_skinning:CSComputeSkinningTreeAnimVelocity, CS_UpdateSkinnedAttachMeshTreeParticles and both rtdirectionalshadows traces).
  • DexNom main (64bd58f) + #1213's lower.rs/shader.rs change, ported by hand: the same four build there too. Both RT shadow traces fail on DexNom without it.

So #1213 alone clears the size-read programs on the 9060 XT too, and without a digest list. That's better than the groupshared hoist in this PR.

One data point from reducing it: giving the query a separate handle on the same index that stays uniform still crashed, so the non-uniform marking seems to be what matters.

Two things are still failing with #1213, and it doesn't target them:

  • indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays ends the process (0xFFFFFFFF) on both forks unless the constant-folding pass (FOLD) runs.
  • The eight *_GLINTS* pixel programs crash on DexNom unless FACTS runs. They build on fxceless as it is.

I'll trim this PR to just those per-program passes and leave the size-read programs to #1213.

**@⁠MrToucann** on GitHub · 2026-11-26 02:16 UTC · [original](https://github.com/fxceless/victory-fork/pull/1247#issuecomment-7180628760) Thanks. I tested #1213 on an **RX 9060 XT** (driver 32.0.32029.2010, amdxc64 8.18.10.0514) with the 13 programs from this PR, each in its own process, with `VICTORY_SHADER_OPT=0`: - **fxceless `main` (fc63ce1) + #1213:** 12 of 13 build and validate, including all four size-read programs (`bvh_skinning:CSComputeSkinningTreeAnimVelocity`, `CS_UpdateSkinnedAttachMeshTreeParticles` and both `rtdirectionalshadows` traces). - **DexNom `main` (64bd58f) + #1213's `lower.rs`/`shader.rs` change, ported by hand:** the same four build there too. Both RT shadow traces fail on DexNom without it. So #1213 alone clears the size-read programs on the 9060 XT too, and without a digest list. That's better than the groupshared hoist in this PR. One data point from reducing it: giving the query a separate handle on the same index that stays **uniform** still crashed, so the non-uniform marking seems to be what matters. Two things are still failing with #1213, and it doesn't target them: - `indirect_diffuse_lighting:CS_ScreenProbes_ActivateRays` ends the process (`0xFFFFFFFF`) on both forks unless the constant-folding pass (`FOLD`) runs. - The eight `*_GLINTS*` pixel programs crash on DexNom unless `FACTS` runs. They build on fxceless as it is. I'll trim this PR to just those per-program passes and leave the size-read programs to #1213.
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/1247/head:github-bot/gh-1247'
git switch 'github-bot/gh-1247'

Merge

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