AMD RX 9070 XT (RDNA4): black flickering patches on roads and soil outdoors #2770

Open
opened 2026-11-30 17:31:44 +00:00 by notlismcfly · 3 comments
notlismcfly commented 2026-11-30 17:31:44 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by notlismcfly on 2026-11-30T17:31:44Z.


What happens

Outdoors, asphalt and bare soil show black patches that flicker as the camera moves; indoors they don't.

Commit

be454ca (with 3 local patches, see below)

System

Windows 10 Pro 22H2, Ryzen 7 7800X3D, RX 9070 XT (driver 32.0.32015.2008), 32 GB RAM

Where

runtime

Command and steps

What we checked:

  • A frame capture (LEONIDA_CAPTURE_WORLD with LEONIDA_DUMP_TARGETS) shows the base colour of those ground surfaces is already black in the G-buffer, so it happens before lighting.
  • Not the shader clean-up passes: LEONIDA_SHADER_OPT=0 gives the same black ground.
  • Not the skipped ray-tracing resolves: with them compiled and running, the ground is the same.
  • Not the AMD legacy_mad change from #2624: same with it.

Local patches needed to load at all: on this card the stock build crashes while loading because AMD's shader compiler (amdxc64) crashes (0xc0000005) on about 25 pipelines, several of them CS_RaytracingResolve. To get in-game I added three local patches: (1) pipelines in warm-bad.txt are skipped in game, (2) a pipeline worker that crashes in the compiler is caught and replaced (same idea as the Belobug/Whiplash guard), (3) LEONIDA_NO_REUSE_FOR leaves out the REUSE clean-up pass for named programs. Happy to share them as a pull request. The black ground was the same before and after these patches.

I can't share captures or shader files (game data), but I'm happy to run any setting or test build you suggest.

Output

No error, it's a visual problem. The game runs fine otherwise.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6702296064 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/2770). Originally posted by [notlismcfly](https://github.com/notlismcfly) on 2026-11-30T17:31:44Z. --- ### What happens Outdoors, asphalt and bare soil show black patches that flicker as the camera moves; indoors they don't. ### Commit be454ca (with 3 local patches, see below) ### System Windows 10 Pro 22H2, Ryzen 7 7800X3D, RX 9070 XT (driver 32.0.32015.2008), 32 GB RAM ### Where runtime ### Command and steps What we checked: - A frame capture (LEONIDA_CAPTURE_WORLD with LEONIDA_DUMP_TARGETS) shows the base colour of those ground surfaces is already black in the G-buffer, so it happens before lighting. - Not the shader clean-up passes: LEONIDA_SHADER_OPT=0 gives the same black ground. - Not the skipped ray-tracing resolves: with them compiled and running, the ground is the same. - Not the AMD legacy_mad change from #2624: same with it. Local patches needed to load at all: on this card the stock build crashes while loading because AMD's shader compiler (amdxc64) crashes (0xc0000005) on about 25 pipelines, several of them CS_RaytracingResolve. To get in-game I added three local patches: (1) pipelines in warm-bad.txt are skipped in game, (2) a pipeline worker that crashes in the compiler is caught and replaced (same idea as the Belobug/Whiplash guard), (3) LEONIDA_NO_REUSE_FOR leaves out the REUSE clean-up pass for named programs. Happy to share them as a pull request. The black ground was the same before and after these patches. I can't share captures or shader files (game data), but I'm happy to run any setting or test build you suggest. ### Output ```text No error, it's a visual problem. The game runs fine otherwise. ```
notlismcfly commented 2026-11-30 18:27:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by notlismcfly on 2026-11-30T18:27:04Z.


Data point: on the same PC (RX 9070 XT, driver 32.0.32015.2008, Windows 10) the ground draws correctly in Vesper (github.com/monte-alt/vesper, 7b7e556), another VIctory-family runtime: asphalt and soil outdoors in daylight have no black or flickering patches, same save, same area.

So the title's ground material can be written correctly on RDNA4; the difference is somewhere in this runtime's translation or state, not the card or driver.

Vesper ran with its launcher's Series X profile. Settings in it that may matter for comparing: VESPER_RDNA_WAVE32=2, VESPER_LEGACY_MUL_PLAIN=0, VESPER_LDS_INIT_HOIST=1, VESPER_NARROW_BARRIER=1, VESPER_SHADER_OPT=3007, HW BVH on. I haven't isolated which one (if any) is the difference.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7287867597 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/2770#issuecomment-7287867597). Originally posted by [notlismcfly](https://github.com/notlismcfly) on 2026-11-30T18:27:04Z. --- Data point: on the same PC (RX 9070 XT, driver 32.0.32015.2008, Windows 10) the ground draws correctly in Vesper (github.com/monte-alt/vesper, 7b7e556), another VIctory-family runtime: asphalt and soil outdoors in daylight have no black or flickering patches, same save, same area. So the title's ground material can be written correctly on RDNA4; the difference is somewhere in this runtime's translation or state, not the card or driver. Vesper ran with its launcher's Series X profile. Settings in it that may matter for comparing: VESPER_RDNA_WAVE32=2, VESPER_LEGACY_MUL_PLAIN=0, VESPER_LDS_INIT_HOIST=1, VESPER_NARROW_BARRIER=1, VESPER_SHADER_OPT=3007, HW BVH on. I haven't isolated which one (if any) is the difference.
zmasi commented 2026-12-01 05:01:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-01T05:01:51Z.


PR #2834 is up with three opt-in diagnostic/candidate switches (all off by default so main behaviour is unchanged when unset) covering the three AMD-relevant differences between Mandy and Vesper (7b7e556) that could produce the outdoor ground-tile corruption on RDNA 3 (#2771) and RDNA 4 (#2770):

  1. LEONIDA_TARGET_BARRIERS=3 (1 = named texture moves from ID3D12GraphicsCommandList7::Barrier groups, 2 = full target waits on resource-less barriers & pipeline syncs behind target writes; live-toggleable every 4 s inside a single run via -More @{ LEONIDA_AB = '4,LEONIDA_TARGET_BARRIERS' })
  2. LEONIDA_LIST_TWIN_MOVE=1 (moves non-16B-aligned raw buffer twins in per-list view slots via move_raw; also supports -More @{ LEONIDA_AB = '4,LEONIDA_LIST_TWIN_MOVE' })
  3. LEONIDA_HOST_WAVE32=1 (32-lane wave lowering on RDNA 32..64 hosts; retranslates shaders on first run)

If you get a chance to test PR #2834 from an outdoor spot where the flickering tiles appear, running .\scripts\play-d3d12.ps1 -More @{ LEONIDA_AB = '4,LEONIDA_TARGET_BARRIERS' } first (and sharing whether the ground tiles toggle cleanly every 4 s plus the waits for what was drawn into targets and raw twins log lines) will immediately pinpoint which path is responsible so we can flip the confirmed fix on by default.

AI-assisted (Claude Fable 5.2, GPT-6.2 Astra, Claude Opus 5.5, Gemini 4 Carbon).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7301350846 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/2770#issuecomment-7301350846). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-01T05:01:51Z. --- PR #2834 is up with three opt-in diagnostic/candidate switches (all off by default so `main` behaviour is unchanged when unset) covering the three AMD-relevant differences between Mandy and Vesper (`7b7e556`) that could produce the outdoor ground-tile corruption on RDNA 3 (#2771) and RDNA 4 (#2770): 1. **`LEONIDA_TARGET_BARRIERS=3`** (`1` = named texture moves from `ID3D12GraphicsCommandList7::Barrier` groups, `2` = full target waits on resource-less barriers & pipeline syncs behind target writes; live-toggleable every 4 s inside a single run via `-More @{ LEONIDA_AB = '4,LEONIDA_TARGET_BARRIERS' }`) 2. **`LEONIDA_LIST_TWIN_MOVE=1`** (moves non-16B-aligned raw buffer twins in per-list view slots via `move_raw`; also supports `-More @{ LEONIDA_AB = '4,LEONIDA_LIST_TWIN_MOVE' }`) 3. **`LEONIDA_HOST_WAVE32=1`** (32-lane wave lowering on RDNA `32..64` hosts; retranslates shaders on first run) If you get a chance to test PR #2834 from an outdoor spot where the flickering tiles appear, running `.\scripts\play-d3d12.ps1 -More @{ LEONIDA_AB = '4,LEONIDA_TARGET_BARRIERS' }` first (and sharing whether the ground tiles toggle cleanly every 4 s plus the `waits for what was drawn into targets` and `raw twins` log lines) will immediately pinpoint which path is responsible so we can flip the confirmed fix on by default. AI-assisted (Claude Fable 5.2, GPT-6.2 Astra, Claude Opus 5.5, Gemini 4 Carbon).
imribiy commented 2026-12-03 01:56:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by imribiy on 2026-12-03T01:56:38Z.


Same fault on a second RX 9070 XT — a datapoint for this issue, plus a local workaround that gets in-game.

System: RX 9070 XT (RDNA4), Ryzen 7 7800X3D, 32 GB, Windows 11 (10.0.26300), AMD driver 32.0.32015.12012. main of 2026-12-02, the D3D12 runtime (leonida.exe) via play-d3d12.ps1.

What happens: deterministic, 3 of 3 runs, at world load (about 2 minutes into loading the first time, seconds on a warm cache):

unhandled exception 0xc0000005 at amdxc64.dll+0x85ffbf (read 0x8: nothing mapped there)
#0 amdxc64.dll+0x85ffbf ... #29 D3D12Core.dll+0x680cd ... #35 d3d12.dll+0x1707
#36 D3D12Core.dll+0x7877 ... #38 leonida.exe ... #39 leonida.exe ...

Same offset every time, and the synchronous call comes from a pipeline worker: the host pipeline shaders=[...] line of the pipeline being created never prints, the one before it does.

The warm stage confirms it is the compiler, not the input: the first run recorded 83,556 known pipelines, and leonida warm then ended 22 of its child processes with the same 0xc0000005, leaving 111 pipelines in warm-bad.txt. That is the same class of failure notlismcfly describes above.

What did not work for me: feeding the shader hashes of those 111 bad pipelines into LEONIDA_SKIP_PIPELINES did not stop it — the in-game crasher is not among them, and in-game creation does not consult warm-bad.txt (only leonida warm does), so a pipeline the warm-up could not make still reaches the compiler from the run itself.

What did work: a local patch in pipeline/make.rs (make_with) — the host pipeline's build runs on a thread of its own; a vectored exception handler, which only acts on a guarded build's thread and only when the faulting instruction is outside leonida.exe, ends that thread with ExitThread(0), and the caller takes the empty result slot as "refused", the same path a panicking build already takes. No frame of the broken call is resumed and nothing of the driver's state is trusted after the fault.

With that, and the same shader skip list, the run gets in-game: 23 pipelines refused, 0 unhandled exceptions, through the first-run pages into the world. The cost is the picture of those 23 pipelines (dropped draws), which is what I would expect from the approach notlismcfly describes.

Two smaller notes that may save someone time:

  • A per-thread "land and continue" guard (rewriting Rip/Rsp and resuming) is not enough: the continuation after the call needs the frame pointer and the callee-saved registers the driver had at fault time, and restoring those correctly is a much larger job than ending the thread.
  • warm-bad.txt is 111 entries here, all of the form <key> exit code: 0xc0000005; mapping those keys to their shaders' 16-hex skip hashes is possible from known-pipelines.bin (record: u32 size, 16-byte key, u8 count, then per shader u8 stage + 32-byte BLAKE3; the skip hash is the first 8 bytes of that BLAKE3), in case that list is worth wiring into the run itself.

Happy to share the diff if it is useful as a starting point for a real PR, with the caveat that it is a local build patch, not something I would call mergeable as-is.

AI-assisted (Mistral Vibe).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7364909226 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/2770#issuecomment-7364909226). Originally posted by [imribiy](https://github.com/imribiy) on 2026-12-03T01:56:38Z. --- Same fault on a second RX 9070 XT — a datapoint for this issue, plus a local workaround that gets in-game. **System:** RX 9070 XT (RDNA4), Ryzen 7 7800X3D, 32 GB, Windows 11 (10.0.26300), AMD driver 32.0.32015.12012. `main` of 2026-12-02, the D3D12 runtime (`leonida.exe`) via `play-d3d12.ps1`. **What happens:** deterministic, 3 of 3 runs, at world load (about 2 minutes into loading the first time, seconds on a warm cache): ``` unhandled exception 0xc0000005 at amdxc64.dll+0x85ffbf (read 0x8: nothing mapped there) #0 amdxc64.dll+0x85ffbf ... #29 D3D12Core.dll+0x680cd ... #35 d3d12.dll+0x1707 #36 D3D12Core.dll+0x7877 ... #38 leonida.exe ... #39 leonida.exe ... ``` Same offset every time, and the synchronous call comes from a pipeline worker: the `host pipeline shaders=[...]` line of the pipeline being created never prints, the one before it does. **The warm stage confirms it is the compiler, not the input:** the first run recorded 83,556 known pipelines, and `leonida warm` then ended 22 of its child processes with the same `0xc0000005`, leaving 111 pipelines in `warm-bad.txt`. That is the same class of failure notlismcfly describes above. **What did not work for me:** feeding the shader hashes of those 111 bad pipelines into `LEONIDA_SKIP_PIPELINES` did not stop it — the in-game crasher is not among them, and in-game creation does not consult `warm-bad.txt` (only `leonida warm` does), so a pipeline the warm-up could not make still reaches the compiler from the run itself. **What did work:** a local patch in `pipeline/make.rs` (`make_with`) — the host pipeline's build runs on a thread of its own; a vectored exception handler, which only acts on a guarded build's thread and only when the faulting instruction is outside `leonida.exe`, ends that thread with `ExitThread(0)`, and the caller takes the empty result slot as "refused", the same path a panicking build already takes. No frame of the broken call is resumed and nothing of the driver's state is trusted after the fault. With that, and the same shader skip list, the run gets in-game: **23 pipelines refused, 0 unhandled exceptions**, through the first-run pages into the world. The cost is the picture of those 23 pipelines (dropped draws), which is what I would expect from the approach notlismcfly describes. Two smaller notes that may save someone time: - A per-thread "land and continue" guard (rewriting `Rip`/`Rsp` and resuming) is not enough: the continuation after the call needs the frame pointer and the callee-saved registers the driver had at fault time, and restoring those correctly is a much larger job than ending the thread. - `warm-bad.txt` is 111 entries here, all of the form `<key> exit code: 0xc0000005`; mapping those keys to their shaders' 16-hex skip hashes is possible from `known-pipelines.bin` (record: `u32` size, 16-byte key, `u8` count, then per shader `u8` stage + 32-byte BLAKE3; the skip hash is the first 8 bytes of that BLAKE3), in case that list is worth wiring into the run itself. Happy to share the diff if it is useful as a starting point for a real PR, with the caveat that it is a local build patch, not something I would call mergeable as-is. AI-assisted (Mistral Vibe).
Sign in to join this conversation.
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
ProjectLeonida/mandy#2770
No description provided.