AMD/RADV + 8 GB: boot ends at 54 s with a null write at game+0x2215c35, with or without the shader library #1915

Closed
opened 2026-11-25 15:42:30 +00:00 by YaBulochka · 5 comments
YaBulochka commented 2026-11-25 15:42:30 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by YaBulochka on 2026-11-25T15:42:30Z.


AMD/RADV + 8 GB: the boot ends at 54 s with a null write at game+0x2215c35, with or without the shader library

Machine: Linux (CachyOS, kernel 7.3.5), Ryzen 5 9600X, 30 GB RAM, Radeon RX 7600 XT 8 GB, RADV 27.0.0 (Mesa), Wine 11.22. main b0f3d399.

Build: the runtime per docs/linux_proton.md (clang-cl + xwin SDK, no SDL3, so input comes from LEONIDA_INPUT_SCRIPT). Shaders via make_game.py --stages shaders: 26,503 main + 2,683 library/ + 27 fspx/ + 52 bvh/ + 12 exe/, 17 GB, 29 minutes.

Result: process exit 5 after 54 s, one exception 0xc0000005 (write to 0x0) at game_scarlett_master.exe+0x2215c35, 2 presents (package splash). D3D12 calls 107,723: 85,910 ok, 4 failed (CreatePipelineState), 12,245 accepted. No unimplemented imports, no device-loss report (LEONIDA_DEVICE_FAULT=1), no kernel OOM/amdgpu lines. Fence slot 12 mirrors: 5 live, 0 waits ended on an event, ~5,000 per 10 s on the 10 ms timeout.

It is not the shader library and not the arena. The same address and the same exit come from a run with --shaders none + LEONIDA_STUB_PIPELINES=1 (25,452 failed pipeline creations instead of 4) and from LEONIDA_ARENA_MB=1024 (default otherwise). The crash follows a burst of about 107,700 CreateShaderResourceView calls; the last traced event before it is a CreateFileW of G:\pack\core_licenses\core_licenses_data.rpf at t=7.5 s, with the exception at t=40.7 s.

Two things that do not count as data points here: Proton 11.0's wine exits at 3 s at +0xb5a5f8 with 0 presents (environment, not this bug), and LEONIDA_VK_VALIDATION=1 fails D3D12XboxCreateDevice and stops at a breakpoint, so the validation layer is unusable on this host.

Logs and traces stay on this machine; this report is counts only. If the address is known, a pointer to the stop/issue is enough; I can rerun with any switch you want.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6608231642 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/1915). Originally posted by [YaBulochka](https://github.com/YaBulochka) on 2026-11-25T15:42:30Z. --- AMD/RADV + 8 GB: the boot ends at 54 s with a null write at `game+0x2215c35`, with or without the shader library **Machine:** Linux (CachyOS, kernel 7.3.5), Ryzen 5 9600X, 30 GB RAM, Radeon RX 7600 XT 8 GB, RADV 27.0.0 (Mesa), Wine 11.22. `main` `b0f3d399`. **Build:** the runtime per `docs/linux_proton.md` (clang-cl + xwin SDK, no SDL3, so input comes from `LEONIDA_INPUT_SCRIPT`). Shaders via `make_game.py --stages shaders`: 26,503 main + 2,683 `library/` + 27 `fspx/` + 52 `bvh/` + 12 `exe/`, 17 GB, 29 minutes. **Result:** process exit 5 after 54 s, one exception `0xc0000005` (write to `0x0`) at `game_scarlett_master.exe+0x2215c35`, 2 presents (package splash). D3D12 calls 107,723: 85,910 ok, 4 failed (`CreatePipelineState`), 12,245 accepted. No unimplemented imports, no device-loss report (`LEONIDA_DEVICE_FAULT=1`), no kernel OOM/amdgpu lines. Fence slot 12 mirrors: 5 live, 0 waits ended on an event, ~5,000 per 10 s on the 10 ms timeout. **It is not the shader library and not the arena.** The same address and the same exit come from a run with `--shaders none` + `LEONIDA_STUB_PIPELINES=1` (25,452 failed pipeline creations instead of 4) and from `LEONIDA_ARENA_MB=1024` (default otherwise). The crash follows a burst of about 107,700 `CreateShaderResourceView` calls; the last traced event before it is a `CreateFileW` of `G:\pack\core_licenses\core_licenses_data.rpf` at t=7.5 s, with the exception at t=40.7 s. Two things that do not count as data points here: Proton 11.0's wine exits at 3 s at `+0xb5a5f8` with 0 presents (environment, not this bug), and `LEONIDA_VK_VALIDATION=1` fails `D3D12XboxCreateDevice` and stops at a breakpoint, so the validation layer is unusable on this host. Logs and traces stay on this machine; this report is counts only. If the address is known, a pointer to the stop/issue is enough; I can rerun with any switch you want.
BubsMcgee commented 2026-11-25 17:13:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T17:13:12Z.


The stopping address is interesting: on NVIDIA this same game+0x2215c35 is the caller of the title's hang watchdog (+0x23cf683) in the elevated-cap runs recorded in #1537, so a write to null there may be the title's fatal path running after an earlier failure rather than the first fault. The four failed CreatePipelineState calls (and the CreateShaderResourceView burst before the exception) are the part I would look at first. If you can rerun with LEONIDA_DEVICE_FAULT=1 --trace-d3d12, the failed-PSO diagnostics and the last few calls before +0x2215c35 would tell whether a shim returned null. No game data needed in the report; counts and HRESULTs are enough.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169182639 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/issues/1915#issuecomment-7169182639). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T17:13:12Z. --- The stopping address is interesting: on NVIDIA this same game+0x2215c35 is the caller of the title's hang watchdog (+0x23cf683) in the elevated-cap runs recorded in #1537, so a write to null there may be the title's fatal path running after an earlier failure rather than the first fault. The four failed CreatePipelineState calls (and the CreateShaderResourceView burst before the exception) are the part I would look at first. If you can rerun with LEONIDA_DEVICE_FAULT=1 --trace-d3d12, the failed-PSO diagnostics and the last few calls before +0x2215c35 would tell whether a shim returned null. No game data needed in the report; counts and HRESULTs are enough.
BubsMcgee commented 2026-11-25 17:26:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T17:26:57Z.


game+0x2215c35 is the title's own hang-watchdog trap, not a runtime null write. runtime/src/main.cpp documents it: the watchdog thread at RVA 0x2215a60 waits 30 one-second ticks for the kick byte at RVA 0x71b6331, then calls the crash callback and executes movl $0, 0 at 0x2215c35 (the bytes at that RVA are c7 04 25 00 00 00 00 00 00 00 00, then int3). The process is deliberately killing itself because the main loop did not report progress for 30 s — which is also why there is no device-fault report and only the splash presents.

That fits 54 s and ~2 presents: the 30-tick window runs out while the title is still in its resource-creation burst, with the ~107,700 CreateShaderResourceView calls the largest candidate. Two things to try on that host:

  • Run with LEONIDA_TITLE_WATCHDOG=0. It only disarms when the trap bytes match this exact build (it logs when it does), and it sets the kick byte twice a second. If the run then gets past 54 s, this is our layer being slower than the watchdog window on this CPU/driver rather than a new fault, and the next stop is the one to chase.
  • With --trace-d3d12, the time between the start of the SRV burst and the last trace line before the trap shows how much of the 30 s is resource creation. The four failed CreatePipelineState HRESULTs are still worth having: not the stall by themselves, but they may explain what comes after.

If disarming the watchdog ends at a different stop, that stop is the real bug and this issue becomes that one.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169518438 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/issues/1915#issuecomment-7169518438). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T17:26:57Z. --- `game+0x2215c35` is the title's own hang-watchdog trap, not a runtime null write. `runtime/src/main.cpp` documents it: the watchdog thread at RVA `0x2215a60` waits 30 one-second ticks for the kick byte at RVA `0x71b6331`, then calls the crash callback and executes `movl $0, 0` at `0x2215c35` (the bytes at that RVA are `c7 04 25 00 00 00 00 00 00 00 00`, then `int3`). The process is deliberately killing itself because the main loop did not report progress for 30 s — which is also why there is no device-fault report and only the splash presents. That fits 54 s and ~2 presents: the 30-tick window runs out while the title is still in its resource-creation burst, with the ~107,700 `CreateShaderResourceView` calls the largest candidate. Two things to try on that host: - Run with `LEONIDA_TITLE_WATCHDOG=0`. It only disarms when the trap bytes match this exact build (it logs when it does), and it sets the kick byte twice a second. If the run then gets past 54 s, this is our layer being slower than the watchdog window on this CPU/driver rather than a new fault, and the next stop is the one to chase. - With `--trace-d3d12`, the time between the start of the SRV burst and the last trace line before the trap shows how much of the 30 s is resource creation. The four failed `CreatePipelineState` HRESULTs are still worth having: not the stall by themselves, but they may explain what comes after. If disarming the watchdog ends at a different stop, that stop is the real bug and this issue becomes that one.
BubsMcgee commented 2026-11-25 18:12:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T18:12:19Z.


Measured step back from the 54 s exit: --trace-d3d12 itself costs a mutex, fprintf and fflush per D3D12 call (runtime/shims/d3d12_trace.h), and that is now measured rather than assumed.

  • A standalone copy of record() (global mutex + fprintf + fflush, stderr redirected to a file) takes 18.9 µs per call on this Windows host: 100,000 calls in 1.89 s, twice, with fflush accounting for under 3% of it (the formatting dominates). 107,700 traced calls are therefore about 2.0 s here.
  • Your report has ~107,700 CreateShaderResourceView calls between the last traced CreateFileW at 7.5 s and the trap at 40.7 s: about 308 µs per call in that window, i.e. 16× the trace cost measured here. So on that host either the Wine write path is much more expensive than native fprintf, or the per-call work in RADV/our layer dominates.
  • The SRV path itself does not block: CreateShaderResourceView -> write_image_descriptor takes one global descriptor_mutex, does a hash lookup on the T# words, and for a new view creates a VkImageView; there is no sleep, no fence wait and no readback on the path.

That leaves one run that separates the two causes: rerun without --trace-d3d12, watchdog still armed, and note whether 54 s is still where it ends. If it gets past it, the trace was the dominant cost on that host; if it still trips, the burst itself is the cost — then LEONIDA_TITLE_WATCHDOG=0 shows the next stop. If you can keep the trace but make it cheaper, stderr to a pipe or to NUL instead of a file is the cheap A/B (the cost is the write, not the mutex).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7170586801 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/issues/1915#issuecomment-7170586801). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T18:12:19Z. --- Measured step back from the 54 s exit: `--trace-d3d12` itself costs a mutex, `fprintf` and `fflush` per D3D12 call (`runtime/shims/d3d12_trace.h`), and that is now measured rather than assumed. - A standalone copy of `record()` (global mutex + `fprintf` + `fflush`, stderr redirected to a file) takes **18.9 µs per call** on this Windows host: 100,000 calls in 1.89 s, twice, with `fflush` accounting for under 3% of it (the formatting dominates). 107,700 traced calls are therefore about **2.0 s** here. - Your report has ~107,700 `CreateShaderResourceView` calls between the last traced `CreateFileW` at 7.5 s and the trap at 40.7 s: about 308 µs per call in that window, i.e. 16× the trace cost measured here. So on that host either the Wine write path is much more expensive than native `fprintf`, or the per-call work in RADV/our layer dominates. - The SRV path itself does not block: `CreateShaderResourceView` -> `write_image_descriptor` takes one global `descriptor_mutex`, does a hash lookup on the T# words, and for a *new* view creates a `VkImageView`; there is no sleep, no fence wait and no readback on the path. That leaves one run that separates the two causes: **rerun without `--trace-d3d12`**, watchdog still armed, and note whether 54 s is still where it ends. If it gets past it, the trace was the dominant cost on that host; if it still trips, the burst itself is the cost — then `LEONIDA_TITLE_WATCHDOG=0` shows the next stop. If you can keep the trace but make it cheaper, `stderr` to a pipe or to `NUL` instead of a file is the cheap A/B (the cost is the write, not the mutex).
JoshRob297 commented 2026-11-28 21:53:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by JoshRob297 on 2026-11-28T21:53:04Z.


Intel iGPU data point for the same trap, plus a Linux memory wall that reads like a null write.

Machine: Intel Meteor Lake iGPU, Mesa ANV 26.2.6, 30 GB RAM, Wine 11.22, Linux CachyOS, runtime from
main, 1280x720 window, LEONIDA_WINDOW=1280x720.

  • Run A: exit at 1m51 with Unhandled page fault on write access to 0x0 at 0x142215C35 (game+0x2215c35),
    memory peak 2 GB, before the landing. That is the watchdog trap described above.
  • Run B, same build: 335 s, 14 GB RSS, then write to 0x0 at 0x1423CF683 while the runtime was writing its
    session pipeline cache at exit.

Both fit a >30 s stall on this GPU. The front-end load compiles pipelines on demand (up to 266
fspx_compute builds in one run) and this device reports subgroups 8..32, so the 64-wide shaders are
translated as tier C; a stall is easy to reach.

Separate Linux finding, same symptom class (process dies under memory pressure): Wine's server tmpmaps live
in /tmp/.wine-$UID, and /tmp is tmpfs, so they are RAM. On a 30 GB machine the title mapped 20,217
tmpmap files (~22 GB) while /tmp is a 16 GB tmpfs; allocations fail and the process dies. Binding that
directory to disk keeps /tmp at ~30 MB:

sudo mount --bind /home/$USER/wine-server /tmp/.wine-1000

wineserver requires that directory to be mode 0700, hardcodes /tmp/.wine-%u (it ignores TMPDIR) and
rejects a symlink with "is not a directory", so the bind mount is the only option without root-level
changes.

This is not the watchdog cause, but it is the difference between an oom-kill at 4 minutes and a run that
reaches the front-end.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246342829 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/1915#issuecomment-7246342829). Originally posted by [JoshRob297](https://github.com/JoshRob297) on 2026-11-28T21:53:04Z. --- Intel iGPU data point for the same trap, plus a Linux memory wall that reads like a null write. Machine: Intel Meteor Lake iGPU, Mesa ANV 26.2.6, 30 GB RAM, Wine 11.22, Linux CachyOS, runtime from `main`, 1280x720 window, `LEONIDA_WINDOW=1280x720`. - Run A: exit at 1m51 with `Unhandled page fault on write access to 0x0 at 0x142215C35` (`game+0x2215c35`), memory peak 2 GB, before the landing. That is the watchdog trap described above. - Run B, same build: 335 s, 14 GB RSS, then `write to 0x0 at 0x1423CF683` while the runtime was writing its session pipeline cache at exit. Both fit a >30 s stall on this GPU. The front-end load compiles pipelines on demand (up to 266 `fspx_compute` builds in one run) and this device reports subgroups 8..32, so the 64-wide shaders are translated as tier C; a stall is easy to reach. Separate Linux finding, same symptom class (process dies under memory pressure): Wine's server tmpmaps live in `/tmp/.wine-$UID`, and `/tmp` is tmpfs, so they are RAM. On a 30 GB machine the title mapped 20,217 tmpmap files (~22 GB) while `/tmp` is a 16 GB tmpfs; allocations fail and the process dies. Binding that directory to disk keeps `/tmp` at ~30 MB: ```sh sudo mount --bind /home/$USER/wine-server /tmp/.wine-1000 ``` wineserver requires that directory to be mode 0700, hardcodes `/tmp/.wine-%u` (it ignores `TMPDIR`) and rejects a symlink with "is not a directory", so the bind mount is the only option without root-level changes. This is not the watchdog cause, but it is the difference between an oom-kill at 4 minutes and a run that reaches the front-end.
aslan2142 commented 2026-12-01 17:06:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T17:06:28Z.


Closing this issue because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the report/contribution! If you believe this issue was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318764333 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/1915#issuecomment-7318764333). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T17:06:28Z. --- Closing this issue because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the report/contribution! If you believe this issue was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
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#1915
No description provided.