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

Open
MrToucann wants to merge 2 commits from upstream-pr/1247 into main
MrToucann commented 2026-11-26 01:53:56 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MrToucann on 2026-11-26T01:53:56Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:issue:6617745100 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1247). Originally posted by [MrToucann](https://github.com/MrToucann) on 2026-11-26T01:53:56Z. --- ## 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
IxMxAMAR commented 2026-11-26 02:08:45 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by IxMxAMAR on 2026-11-26T01:57:33Z.


#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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7180318551 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1247#issuecomment-7180318551). Originally posted by [IxMxAMAR](https://github.com/IxMxAMAR) on 2026-11-26T01:57:33Z. --- #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.
upstream-sync changed title from [PR #1247] Keep AMD's shader compiler (RX 9060 XT) from failing on 13 translated programs to [PR #1247] AMD RX 9060 XT: run one clean-up pass for nine programs its compiler fails on (complements #1213) 2026-11-26 03:06:47 +00:00
MrToucann commented 2026-11-26 03:06:50 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MrToucann on 2026-11-26T02:16:04Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7180628760 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1247#issuecomment-7180628760). Originally posted by [MrToucann](https://github.com/MrToucann) on 2026-11-26T02:16:04Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1247:upstream-pr/1247'
git switch 'upstream-pr/1247'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1247'
git switch 'upstream-pr/1247'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1247'
git switch 'upstream-pr/1247'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1247'
git switch 'main'
git merge --squash 'upstream-pr/1247'
git switch 'main'
git merge --ff-only 'upstream-pr/1247'
git switch 'main'
git merge 'upstream-pr/1247'
git push origin 'main'
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
fxceless/victory-fork!1244
No description provided.