Skip to content

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

Open
MrToucann wants to merge 2 commits into
fxceless:mainfrom
MrToucann:amd-shader-fixes
Open

MrToucann wants to merge 2 commits into
fxceless:mainfrom
MrToucann:amd-shader-fixes

Conversation

@MrToucann

@MrToucann MrToucann commented Nov 26, 2026 •

Copy link
Copy Markdown

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)

🤖 Generated with 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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
@IxMxAMAR

Copy link
Copy Markdown

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

@MrToucann

Copy link
Copy Markdown
Author

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:

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.

…ram clean-up passes

fxceless#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 fxceless#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 fxceless#1213: all 13 programs validate and create their
pipelines. Alone, the two tree programs still fail, as they do without
fxceless#1213. cargo test -p victory-shader: 218 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A752X7rKCzD2ViPbSWcyut
@MrToucann MrToucann changed the title Keep AMD's shader compiler (RX 9060 XT) from failing on 13 translated programs AMD RX 9060 XT: run one clean-up pass for nine programs its compiler fails on (complements #1213) Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants