d3d12: device removed seconds after world entry on RX 6800 XT with the default LEONIDA_THIN=1; THIN=0 runs fine #3264

Open
opened 2026-12-02 23:24:27 +00:00 by Quentin1814 · 9 comments
Quentin1814 commented 2026-12-02 23:24:27 +00:00 (Migrated from github.com)
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Quentin1814 on 2026-12-02T23:24:27Z.


What happens

On an RX 6800 XT (RDNA 2), play-d3d12.ps1 with its default settings (LEONIDA_THIN=1, 6 threads) loses the device about 4 s after the world starts to draw: "no host list for a state prelude; device removed (0x887A0007)", exit code 0x887A0005. With only LEONIDA_THIN=0 added, it runs fine.

Commit

b83ad5433 (main, 2026-12-02), built with d3d12\scripts\build-nvidia.ps1 (diag profile, no DLSS), no local changes

System

Windows 11 (build 26300), Ryzen 5 9600X (6c/12t, iGPU present), 32 GB DDR5-6000, RX 6800 XT 16 GB (driver 32.0.21045.29003)

Where

runtime

Command and steps

Both runs used the same command. The only extra setting beyond the launcher's defaults is LEONIDA_LOG=info, so the frame lines are kept:

scripts\play-d3d12.ps1 -Game <game folder> -Data <data folder> -Log -More @{LEONIDA_LOG='info'}

This gives Series X, 2560x1440 output, the title's dynamic resolution from 1080 lines, and LEONIDA_THIN=1 with LEONIDA_THIN_THREADS=6. LEONIDA_ADAPTER was not set in either run. The display is on the 6800 XT; a Ryzen 9600X iGPU is also present.

Run THIN Result
1 (thin-on-crash.log) default: THIN=1, 6 threads Full precompile: 88,592 pipelines in 1,131 s, 0 bad. Menus at 60 fps. The world starts to draw at 22:57:17 (632 draws/frame). Device removed at 22:57:21
2 (thin-off-ok.log) -More @{LEONIDA_LOG='info'; LEONIDA_THIN='0'} 8.8 min, exit code 0

Every start I have made with THIN on and 4 or more threads has ended this way, here and on the VIctory fork below. No start with THIN off has.

The README's AMD row describes an RX 6800 at the default settings, so I expected the defaults to run on RDNA 2.

This is not #2821. That issue is on NVIDIA cards, comes after 5 to 46 minutes of play, and stops with LEONIDA_D3D12_BACKGROUND=0. This one is on AMD, comes seconds after the world first draws, and stops with LEONIDA_THIN=0.

The same bug in the VIctory lineage. The same failure happened on the Belobug VIctory fork (VICTORY_THIN, commit 4eb6cfdf), on this card, on 2026-11-28. I bisected it there over 14 runs:

  • THIN=1 with 8 or 4 list threads gave DEVICE_RESET (0x887A0007) at world entry, every time (9 runs).
  • With 1 or 2 threads, or with THIN off, it ran 2.6 to 13 minutes without a problem.
  • JOIN_PARTS, UPLOAD_AHEAD, UNDER_WIDE, LAND_ECHO, ASYNC_SUBMIT, the PORT_* patches and LIST_VIEWS=0 were not the cause.
  • With D3D12_DEBUG=1 it still reset. The DRED breadcrumbs were empty, and the removal context named nothing of ours on the card.

It looks like a race between the list threads that only shows on this card or driver. I can run a THIN build with LEONIDA_D3D12_DEBUG=1, a thread count of your choice, or any other switch you want tested.

With THIN off: what works on this card (run 2)

  • Faces and hair are correct with the defaults, including LEONIDA_WC_NO_BACK=1. Before your 2026-11-29 face fix, this card showed only eyes and teeth unless WC_NO_BACK=0 was set. Copy-back is now about 11 ms a frame, against 22–25 ms with WC_NO_BACK=0 on dd87aa4.
  • Frame rate: in game, 17.9 fps mean, 18.7 fps median, 6.6 fps at the 5th percentile. The median frame is 52 ms, of which 25.7 ms is preparing; GPU time reads 0 on this card. In the heaviest stretches (5,000–8,600 draws/frame) it runs at 14.5–16 fps, close to the README's RX 6800 numbers.
  • Memory: about 29 GB private at most.
  • Still seen on this card on 2026-11-29 (7b907de, dd87aa4): plants flicker in and out. LEONIDA_SAMPLE_MASK was active (140 masked shaders) and the flicker remained.

Both logs are attached, with ANSI colours removed and the Windows user and PC names replaced: mandy-thin-rx6800xt-logs.zip. Neither contains game files.

mandy-thin-rx6800xt-logs.zip

Output

2026-12-02T22:56:24.275646Z  INFO leonida_gpu::host: host wave lanes min=32 max=64
2026-12-02T22:56:24.281594Z  INFO leonida_gpu::list::thin: list calls are written down and translated by threads of ours (LEONIDA_THIN=1) threads=6
2026-12-02T22:57:17.026930Z  INFO leonida_gpu::host: 1.4 fps, 701.2 ms/frame (...), 632 draws/frame
2026-12-02T22:57:21.873952Z  WARN leonida_gpu::host: no host list for a prelude error=L'instance de périphérique GPU a été suspendue. Utilisez GetDeviceRemovedReason pour déterminer l'action appropriée. (0x887A0005)
2026-12-02T22:57:21.874117Z ERROR leonida_gpu::host: no host list for a state prelude; device removed: Le GPU ne répondra à aucune autre commande, probablement parce qu'une autre application a soumis des commandes non valides. (0x887A0007); a diagnostics build with LEONIDA_D3D12_DEBUG=1 names the command
Leonida: host GPU failure: no host list for a state prelude; device removed
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:6756712258 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264). Originally posted by [Quentin1814](https://github.com/Quentin1814) on 2026-12-02T23:24:27Z. --- ### What happens On an RX 6800 XT (RDNA 2), play-d3d12.ps1 with its default settings (LEONIDA_THIN=1, 6 threads) loses the device about 4 s after the world starts to draw: "no host list for a state prelude; device removed (0x887A0007)", exit code 0x887A0005. With only LEONIDA_THIN=0 added, it runs fine. ### Commit b83ad5433 (main, 2026-12-02), built with d3d12\scripts\build-nvidia.ps1 (diag profile, no DLSS), no local changes ### System Windows 11 (build 26300), Ryzen 5 9600X (6c/12t, iGPU present), 32 GB DDR5-6000, RX 6800 XT 16 GB (driver 32.0.21045.29003) ### Where runtime ### Command and steps Both runs used the same command. The only extra setting beyond the launcher's defaults is `LEONIDA_LOG=info`, so the frame lines are kept: ``` scripts\play-d3d12.ps1 -Game <game folder> -Data <data folder> -Log -More @{LEONIDA_LOG='info'} ``` This gives Series X, 2560x1440 output, the title's dynamic resolution from 1080 lines, and `LEONIDA_THIN=1` with `LEONIDA_THIN_THREADS=6`. `LEONIDA_ADAPTER` was not set in either run. The display is on the 6800 XT; a Ryzen 9600X iGPU is also present. | Run | THIN | Result | |---|---|---| | 1 (`thin-on-crash.log`) | default: `THIN=1`, 6 threads | Full precompile: 88,592 pipelines in 1,131 s, 0 bad. Menus at 60 fps. The world starts to draw at 22:57:17 (632 draws/frame). **Device removed at 22:57:21** | | 2 (`thin-off-ok.log`) | `-More @{LEONIDA_LOG='info'; LEONIDA_THIN='0'}` | 8.8 min, exit code 0 | Every start I have made with THIN on and 4 or more threads has ended this way, here and on the VIctory fork below. No start with THIN off has. The README's AMD row describes an RX 6800 at the default settings, so I expected the defaults to run on RDNA 2. This is not #2821. That issue is on NVIDIA cards, comes after 5 to 46 minutes of play, and stops with `LEONIDA_D3D12_BACKGROUND=0`. This one is on AMD, comes seconds after the world first draws, and stops with `LEONIDA_THIN=0`. **The same bug in the VIctory lineage.** The same failure happened on the Belobug VIctory fork (`VICTORY_THIN`, commit `4eb6cfdf`), on this card, on 2026-11-28. I bisected it there over 14 runs: - `THIN=1` with 8 or 4 list threads gave DEVICE_RESET (0x887A0007) at world entry, every time (9 runs). - With 1 or 2 threads, or with THIN off, it ran 2.6 to 13 minutes without a problem. - `JOIN_PARTS`, `UPLOAD_AHEAD`, `UNDER_WIDE`, `LAND_ECHO`, `ASYNC_SUBMIT`, the `PORT_*` patches and `LIST_VIEWS=0` were not the cause. - With `D3D12_DEBUG=1` it still reset. The DRED breadcrumbs were empty, and the removal context named nothing of ours on the card. It looks like a race between the list threads that only shows on this card or driver. I can run a THIN build with `LEONIDA_D3D12_DEBUG=1`, a thread count of your choice, or any other switch you want tested. **With THIN off: what works on this card (run 2)** - **Faces and hair** are correct with the defaults, including `LEONIDA_WC_NO_BACK=1`. Before your 2026-11-29 face fix, this card showed only eyes and teeth unless `WC_NO_BACK=0` was set. Copy-back is now about 11 ms a frame, against 22–25 ms with `WC_NO_BACK=0` on `dd87aa4`. - **Frame rate**: in game, 17.9 fps mean, **18.7 fps median**, 6.6 fps at the 5th percentile. The median frame is 52 ms, of which 25.7 ms is preparing; GPU time reads 0 on this card. In the heaviest stretches (5,000–8,600 draws/frame) it runs at 14.5–16 fps, close to the README's RX 6800 numbers. - **Memory**: about 29 GB private at most. - **Still seen on this card** on 2026-11-29 (`7b907de`, `dd87aa4`): plants flicker in and out. `LEONIDA_SAMPLE_MASK` was active (140 masked shaders) and the flicker remained. Both logs are attached, with ANSI colours removed and the Windows user and PC names replaced: `mandy-thin-rx6800xt-logs.zip`. Neither contains game files. [mandy-thin-rx6800xt-logs.zip](https://github.com/user-attachments/files/35770738/mandy-thin-rx6800xt-logs.zip) ### Output ```text 2026-12-02T22:56:24.275646Z INFO leonida_gpu::host: host wave lanes min=32 max=64 2026-12-02T22:56:24.281594Z INFO leonida_gpu::list::thin: list calls are written down and translated by threads of ours (LEONIDA_THIN=1) threads=6 2026-12-02T22:57:17.026930Z INFO leonida_gpu::host: 1.4 fps, 701.2 ms/frame (...), 632 draws/frame 2026-12-02T22:57:21.873952Z WARN leonida_gpu::host: no host list for a prelude error=L'instance de périphérique GPU a été suspendue. Utilisez GetDeviceRemovedReason pour déterminer l'action appropriée. (0x887A0005) 2026-12-02T22:57:21.874117Z ERROR leonida_gpu::host: no host list for a state prelude; device removed: Le GPU ne répondra à aucune autre commande, probablement parce qu'une autre application a soumis des commandes non valides. (0x887A0007); a diagnostics build with LEONIDA_D3D12_DEBUG=1 names the command Leonida: host GPU failure: no host list for a state prelude; device removed ```
zmasi commented 2026-12-03 08:52:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T08:52:10Z.


Thank you @Quentin1814 for the 14-run bisection and sanitized logs! We audited the thin translation path against thin-on-crash.log and thin-off-ok.log and opened #3309 (73286e1d98, Refs #3264).

What we found (and why #3309 says Refs #3264 rather than claiming a blind fix)

  1. Real HostList resource-lifetime bug fixed in #3309 (descriptor/host.rs KEPT_SEEN):
    • Under default LEONIDA_KEEP_BY_LIST=1, per-thread KEPT_SEEN cached already-retained dynamic-slot resources by (addr_of_HostList, resets). Because List.host: Option<HostList> moves replacement HostList values into the same address (cut, value_written, detach_parts, detach) with resets == 0 (and recycles back lists LIFO in thin.rs), a worker thread could mistake a new HostList for an earlier one and skip keep_once(), letting buffers/textures drop to references == 1 and get freed while the GPU still read them (which causes an immediate GPU page fault / DEVICE_RESET on RDNA 2).
    • However, because you also reproduced the 4–8 thread reset on Belobug 4eb6cfdf (which predates LEONIDA_KEEP_BY_LIST and LEONIDA_ALIAS_LATER), we did not want to overclaim KEPT_SEEN as your sole trigger.
  2. Shared multi-thread suspect present in both main and Belobug 4eb6cfdf (draw.rs heap_buffers):
    • When !done_ahead, the first list to swap buffer_frame claims the frame's heap-buffer pass while concurrent thin worker lists skip it and bind stale heap buffers. In your thin-on-crash.log, 7.88 lists/frame hit that path (0.4 passes/frame) right up to ~2 s before the 22:57:21.873 reset, and its incidence scales directly with worker thread count (>= 4 threads).
  3. Why DRED=faults and when the host device went were missing from thin-on-crash.log:
    • play-d3d12.ps1 already enabled LEONIDA_D3D12_DRED=faults, so you do not need to re-run just to set DRED. In host.rs, when two threads hit device removal simultaneously, the second thread can reach TerminateProcess while the first is still formatting log_removal_context (SAID skips the second print without waiting).

Quick 1-switch checks on your RX 6800 XT (at the default 6 threads)

Since you offered to test switches on your card, these three fast runs will isolate the exact culprit immediately:

  1. Test #3309 (73286e1d98) with default settings (6 threads).
  2. On main, -More @{LEONIDA_LOG='info'; LEONIDA_KEEP_BY_LIST='0'} (isolates KEPT_SEEN / per-list retention).
  3. On main, -More @{LEONIDA_LOG='info'; LEONIDA_ALIAS_LATER='0'} (isolates background tile-mapping ordering).

If all three still reset at world entry with 6 threads, that narrows it directly to the Belobug-shared draw.rs heap_buffers pass race (!done_ahead), and we can put up a targeted guard for you to test right away.

AI-assisted: GPT-6.2 Astra, Claude Opus 5.5, and Gemini 4 Neon (XHigh).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7372854184 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7372854184). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T08:52:10Z. --- Thank you @Quentin1814 for the 14-run bisection and sanitized logs! We audited the thin translation path against `thin-on-crash.log` and `thin-off-ok.log` and opened #3309 (`73286e1d98`, `Refs #3264`). ### What we found (and why #3309 says `Refs #3264` rather than claiming a blind fix) 1. **Real `HostList` resource-lifetime bug fixed in #3309 (`descriptor/host.rs` `KEPT_SEEN`)**: - Under default `LEONIDA_KEEP_BY_LIST=1`, per-thread `KEPT_SEEN` cached already-retained dynamic-slot resources by `(addr_of_HostList, resets)`. Because `List.host: Option<HostList>` moves replacement `HostList` values into the **same address** (`cut`, `value_written`, `detach_parts`, `detach`) with `resets == 0` (and recycles back lists LIFO in `thin.rs`), a worker thread could mistake a new `HostList` for an earlier one and skip `keep_once()`, letting buffers/textures drop to `references == 1` and get freed while the GPU still read them (which causes an immediate GPU page fault / `DEVICE_RESET` on RDNA 2). - However, because you also reproduced the 4–8 thread reset on Belobug `4eb6cfdf` (which predates `LEONIDA_KEEP_BY_LIST` and `LEONIDA_ALIAS_LATER`), we did not want to overclaim `KEPT_SEEN` as your sole trigger. 2. **Shared multi-thread suspect present in both `main` and Belobug `4eb6cfdf` (`draw.rs` `heap_buffers`)**: - When `!done_ahead`, the first list to swap `buffer_frame` claims the frame's heap-buffer pass while concurrent thin worker lists skip it and bind stale heap buffers. In your `thin-on-crash.log`, `7.88` lists/frame hit that path (`0.4` passes/frame) right up to ~2 s before the `22:57:21.873` reset, and its incidence scales directly with worker thread count (`>= 4` threads). 3. **Why `DRED=faults` and `when the host device went` were missing from `thin-on-crash.log`**: - `play-d3d12.ps1` already enabled `LEONIDA_D3D12_DRED=faults`, so you do not need to re-run just to set `DRED`. In `host.rs`, when two threads hit device removal simultaneously, the second thread can reach `TerminateProcess` while the first is still formatting `log_removal_context` (`SAID` skips the second print without waiting). ### Quick 1-switch checks on your RX 6800 XT (at the default 6 threads) Since you offered to test switches on your card, these three fast runs will isolate the exact culprit immediately: 1. **Test #3309 (`73286e1d98`)** with default settings (`6` threads). 2. **On `main`**, `-More @{LEONIDA_LOG='info'; LEONIDA_KEEP_BY_LIST='0'}` (isolates `KEPT_SEEN` / per-list retention). 3. **On `main`**, `-More @{LEONIDA_LOG='info'; LEONIDA_ALIAS_LATER='0'}` (isolates background tile-mapping ordering). If all three still reset at world entry with 6 threads, that narrows it directly to the Belobug-shared `draw.rs` `heap_buffers` pass race (`!done_ahead`), and we can put up a targeted guard for you to test right away. AI-assisted: GPT-6.2 Astra, Claude Opus 5.5, and Gemini 4 Neon (XHigh).
Quentin1814 commented 2026-12-03 09:19:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Quentin1814 on 2026-12-03T09:19:24Z.


Thanks for looking into it so quickly! I ran all three checks on the RX 6800 XT (driver 32.0.21045.29003) at the default settings, with -Log -More @{LEONIDA_LOG='info'} plus the one switch below. All three log LEONIDA_THIN=1 with threads=6, and all three still reset at world entry, like before:

# Build Switch World first drawn (frame line) Device removed Removal context (first lines)
1 #3309 73286e1d9 none 09:13:35 (471 draws/frame) 09:13:39 the host device went while textures picked by index were made ready; submitting thread was between submissions (10 submissions of ours started and not yet seen finished), of 0 lists, for 0.8 ms; relay: fence 18446744073709551615 did not reach 6356
2 main b83ad5433 LEONIDA_KEEP_BY_LIST=0 09:15:10 (98 draws/frame) 09:15:13 submitting thread was preparing a submission (5 submissions of ours started and not yet seen finished), of 35 lists, for 4.2 ms; host GPU device removed after 1 submissions sent ahead (LEONIDA_RELAY=1) of 9 lists
3 main b83ad5433 LEONIDA_ALIAS_LATER=0 09:16:33 (203 draws/frame) 09:16:36 the host device went while textures picked by index were made ready; submitting thread was between submissions (11 submissions of ours started and not yet seen finished), of 0 lists, for 1.3 ms; relay: fence 18446744073709551615 did not reach 5127

The device-removed reason is 0x887A0007 in all three. Unlike my first log, these logs print the removal context, but device-removed data; none every time, with LEONIDA_D3D12_DRED=faults from the launcher. No pipeline was being made at the last frame line before each reset (0 being made).

So by your reasoning this points at the draw.rs heap_buffers pass race. I'm happy to test the targeted guard as soon as it's up, and a run with LEONIDA_D3D12_DEBUG=1 or a different LEONIDA_THIN_THREADS if that helps.

Logs of the three runs, with ANSI colours removed and the Windows user and PC names replaced: mandy-3264-tests-logs.zip.

mandy-3264-tests-logs.zip

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7373493662 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7373493662). Originally posted by [Quentin1814](https://github.com/Quentin1814) on 2026-12-03T09:19:24Z. --- Thanks for looking into it so quickly! I ran all three checks on the RX 6800 XT (driver 32.0.21045.29003) at the default settings, with `-Log -More @{LEONIDA_LOG='info'}` plus the one switch below. All three log `LEONIDA_THIN=1` with `threads=6`, and **all three still reset at world entry**, like before: | # | Build | Switch | World first drawn (frame line) | Device removed | Removal context (first lines) | |---|---|---|---|---|---| | 1 | #3309 `73286e1d9` | none | 09:13:35 (471 draws/frame) | 09:13:39 | `the host device went while textures picked by index were made ready`; `submitting thread was between submissions (10 submissions of ours started and not yet seen finished), of 0 lists, for 0.8 ms`; `relay: fence 18446744073709551615 did not reach 6356` | | 2 | main `b83ad5433` | `LEONIDA_KEEP_BY_LIST=0` | 09:15:10 (98 draws/frame) | 09:15:13 | `submitting thread was preparing a submission (5 submissions of ours started and not yet seen finished), of 35 lists, for 4.2 ms`; `host GPU device removed after 1 submissions sent ahead (LEONIDA_RELAY=1) of 9 lists` | | 3 | main `b83ad5433` | `LEONIDA_ALIAS_LATER=0` | 09:16:33 (203 draws/frame) | 09:16:36 | `the host device went while textures picked by index were made ready`; `submitting thread was between submissions (11 submissions of ours started and not yet seen finished), of 0 lists, for 1.3 ms`; `relay: fence 18446744073709551615 did not reach 5127` | The device-removed reason is `0x887A0007` in all three. Unlike my first log, these logs print the removal context, but `device-removed data; none` every time, with `LEONIDA_D3D12_DRED=faults` from the launcher. No pipeline was being made at the last frame line before each reset (`0 being made`). So by your reasoning this points at the `draw.rs` `heap_buffers` pass race. I'm happy to test the targeted guard as soon as it's up, and a run with `LEONIDA_D3D12_DEBUG=1` or a different `LEONIDA_THIN_THREADS` if that helps. Logs of the three runs, with ANSI colours removed and the Windows user and PC names replaced: `mandy-3264-tests-logs.zip`. [mandy-3264-tests-logs.zip](https://github.com/user-attachments/files/35795076/mandy-3264-tests-logs.zip)
zmasi commented 2026-12-03 11:32:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T11:32:52Z.


Thank you @Quentin1814 for running all three so fast and attaching mandy-3264-tests-logs.zip! Reading test1-pr3309.log, test2-keep_by_list0.log, and test3-alias_later0.log side-by-side actually saved you a wasted build — they rule out heap_buffers !done_ahead as the direct crash trigger and explain why device-removed data; none printed:

What the three new logs proved

  1. heap_buffers !done_ahead (draw.rs:3694) had already stopped firing 3+ seconds before the reset:
    • lists left to make the pass for themselves was non-zero only on the initial loading transition (5.73 / 1.10 / 2.46), then stayed 0.00 (buffers), 0.00 (textures) across the entire final 3.3–4.3 s (~30 frames at ~200 lists/frame) while the submission line was only ~100 ms behind (100.9 ms avg, 129.6 ms max in test3). Every !done_ahead list had already completed on the GPU several seconds before 0x887A0007.
  2. What the host device went while textures picked by index were made ready (draw.rs:4731) means:
    • That message is a GetDeviceRemovedReason() poll inside heap_textures's CPU slot loop (checking benign 1x1 R8G8B8A8_UNORM / 32x32x53 BC7_UNORM views), while Run 2 noticed the exact same asynchronous GPU reset (5–11 submissions in flight, relay: fence u64::MAX did not reach ...) on CreateCommittedResource during a 35-list submission prep first.
  3. Why device-removed data; none printed (breadcrumbs=false markers=false):
    • Your build is a diagnostics build, so no rebuild or 20-minute pipeline precompile is needed! The launcher sets LEONIDA_D3D12_DRED=faults (GPU page-fault reporting only, with auto-breadcrumbs off). Because 0x887A0007 (DXGI_ERROR_DEVICE_RESET) here is not a virtual-memory page fault, faults mode has nothing to print unless auto-breadcrumbs (LEONIDA_D3D12_DRED=1) or the D3D12 debug layer (LEONIDA_D3D12_DEBUG=1) are enabled.
  4. Unisolated LEONIDA_THIN=1-coupled subsystem (LEONIDA_PASSES_AHEAD):
    • LEONIDA_PASSES_AHEAD defaults on only when LEONIDA_THIN=1 (draw.rs:303), spawning leonida-ahead-textures (LEONIDA_AHEAD_SPLIT=1) alongside thin workers running early_textures / flush_for_bake (flushes=4, bakes=8 ran 2–3 s before all three resets). Turning LEONIDA_THIN=0 implicitly turned LEONIDA_PASSES_AHEAD off too.

Two zero-rebuild runs on your existing binary (at the default 6 threads)

Using the binary and pipeline cache you already built:

  1. Isolate ahead-passes vs core multi-worker thin.rs translation:
    -Log -More @{LEONIDA_LOG='info'; LEONIDA_PASSES_AHEAD='0'; LEONIDA_AHEAD_SPLIT='0'}
  2. Capture exact DRED auto-breadcrumbs + D3D12 debug validation on the reset:
    -Log -More @{LEONIDA_LOG='info'; LEONIDA_D3D12_DRED='1'; LEONIDA_D3D12_DEBUG='1'}

Those two runs will immediately tell us whether passes_ahead / ahead_split is the trigger AND name the exact command list / D3D12 op that resets amdxc64.dll.

AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7376850283 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7376850283). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T11:32:52Z. --- Thank you @Quentin1814 for running all three so fast and attaching `mandy-3264-tests-logs.zip`! Reading `test1-pr3309.log`, `test2-keep_by_list0.log`, and `test3-alias_later0.log` side-by-side actually saved you a wasted build — **they rule out `heap_buffers` `!done_ahead` as the direct crash trigger** and explain why `device-removed data; none` printed: ### What the three new logs proved 1. **`heap_buffers` `!done_ahead` (`draw.rs:3694`) had already stopped firing 3+ seconds before the reset**: - `lists left to make the pass for themselves` was non-zero only on the initial loading transition (`5.73` / `1.10` / `2.46`), then stayed **`0.00 (buffers), 0.00 (textures)`** across the entire final 3.3–4.3 s (~30 frames at ~200 lists/frame) while the submission line was only ~100 ms behind (`100.9 ms avg, 129.6 ms max` in `test3`). Every `!done_ahead` list had already completed on the GPU several seconds before `0x887A0007`. 2. **What `the host device went while textures picked by index were made ready` (`draw.rs:4731`) means**: - That message is a `GetDeviceRemovedReason()` poll inside `heap_textures`'s CPU slot loop (checking benign 1x1 `R8G8B8A8_UNORM` / 32x32x53 `BC7_UNORM` views), while Run 2 noticed the exact same asynchronous GPU reset (`5–11` submissions in flight, `relay: fence u64::MAX did not reach ...`) on `CreateCommittedResource` during a 35-list submission prep first. 3. **Why `device-removed data; none` printed (`breadcrumbs=false markers=false`)**: - Your build *is* a `diagnostics` build, so **no rebuild or 20-minute pipeline precompile is needed**! The launcher sets `LEONIDA_D3D12_DRED=faults` (GPU page-fault reporting only, with auto-breadcrumbs off). Because `0x887A0007` (`DXGI_ERROR_DEVICE_RESET`) here is not a virtual-memory page fault, `faults` mode has nothing to print unless auto-breadcrumbs (`LEONIDA_D3D12_DRED=1`) or the D3D12 debug layer (`LEONIDA_D3D12_DEBUG=1`) are enabled. 4. **Unisolated `LEONIDA_THIN=1`-coupled subsystem (`LEONIDA_PASSES_AHEAD`)**: - `LEONIDA_PASSES_AHEAD` defaults on *only* when `LEONIDA_THIN=1` (`draw.rs:303`), spawning `leonida-ahead-textures` (`LEONIDA_AHEAD_SPLIT=1`) alongside thin workers running `early_textures` / `flush_for_bake` (`flushes=4, bakes=8` ran 2–3 s before all three resets). Turning `LEONIDA_THIN=0` implicitly turned `LEONIDA_PASSES_AHEAD` off too. ### Two zero-rebuild runs on your existing binary (at the default 6 threads) Using the binary and pipeline cache you already built: 1. **Isolate ahead-passes vs core multi-worker `thin.rs` translation**: `-Log -More @{LEONIDA_LOG='info'; LEONIDA_PASSES_AHEAD='0'; LEONIDA_AHEAD_SPLIT='0'}` 2. **Capture exact DRED auto-breadcrumbs + D3D12 debug validation on the reset**: `-Log -More @{LEONIDA_LOG='info'; LEONIDA_D3D12_DRED='1'; LEONIDA_D3D12_DEBUG='1'}` Those two runs will immediately tell us whether `passes_ahead` / `ahead_split` is the trigger AND name the exact command list / D3D12 op that resets `amdxc64.dll`. AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
Quentin1814 commented 2026-12-03 12:24:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Quentin1814 on 2026-12-03T12:24:23Z.


Both runs done on main b83ad5433 (the same binary and pipeline cache as before), at the default 6 threads, with -Log -More @{LEONIDA_LOG='info'; ...}. Both still reset at world entry.

# Switches World first drawn (frame line) Device removed Removal context
4 LEONIDA_PASSES_AHEAD=0, LEONIDA_AHEAD_SPLIT=0 12:07:33 (118 draws/frame) 12:07:36 submitting thread was preparing a submission (2 submissions of ours started and not yet seen finished), of 1 lists, for 0.6 ms; relay: the fence reports the device removed
5 LEONIDA_D3D12_DRED=1, LEONIDA_D3D12_DEBUG=1 12:17:21 (126 draws/frame) 12:17:29 submitting thread was preparing a submission (2 submissions of ours started and not yet seen finished), of 31 lists, for 674.8 ms; relay: fence 18446744073709551615 did not reach 6223

Run 4: the settings line shows LEONIDA_PASSES_AHEAD=0 LEONIDA_AHEAD_SPLIT=0, and the ahead-pass lines are gone. lists of ours ahead of a frame and lists left to make the pass appear 0 times, against 43 times each in test3-alias_later0.log. So the ahead passes are not the trigger.

Run 5: DRED was on (crash tracing on (device-removed data) breadcrumbs=true markers=true), but it still gave nothing:

device-removed data; breadcrumbs (done/count, list) []

The debug layer logged no error or corruption message before the reset. Its only messages during play were 2,837 warnings id=1380 (GetResourceAllocationInfo: Alignment cannot be 4KB ...), spread over the whole run (the first at 12:16:29, the last at 12:17:28). At the removal it printed these, in this order:

  • Kernel memory failure. There might be a memory leak. id=834, seven times.
  • The live-object counts: 39,961 resources, 8,643 heaps, 4,077 command lists, 2,041 allocators and 5 queues.
  • The removal reason, id=234 severity=4:
ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_RESET: The hardware took an unreasonable amount of time to execute a command on a different Device Context, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was NOT executing commands when the hang occurred. However, the current video memory and Device Context could not be completely recovered. ...)

The Kernel memory failure lines are read out at the removal, so I can't tell whether they came before or after it. Video memory was not short: 2.3 s before the reset, the log shows 9,859 MB in use of a 15,569 MB budget on the card.

So the reset is a hang (TDR), not a page fault, and nothing on the CPU side names a command. I can run LEONIDA_D3D12_GBV=1 (GPU-based validation), a lower LEONIDA_THIN_THREADS, or any other switch you'd like.

Logs of both runs, with ANSI colours removed and the Windows user and PC names replaced: mandy-3264-tests-4-5-logs.zip.

AI-assisted: log analysis and write-up with Claude Opus 5.5 (High).

mandy-3264-tests-4-5-logs.zip

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7378172929 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7378172929). Originally posted by [Quentin1814](https://github.com/Quentin1814) on 2026-12-03T12:24:23Z. --- Both runs done on `main` `b83ad5433` (the same binary and pipeline cache as before), at the default 6 threads, with `-Log -More @{LEONIDA_LOG='info'; ...}`. **Both still reset at world entry.** | # | Switches | World first drawn (frame line) | Device removed | Removal context | |---|---|---|---|---| | 4 | `LEONIDA_PASSES_AHEAD=0`, `LEONIDA_AHEAD_SPLIT=0` | 12:07:33 (118 draws/frame) | 12:07:36 | `submitting thread was preparing a submission (2 submissions of ours started and not yet seen finished), of 1 lists, for 0.6 ms`; `relay: the fence reports the device removed` | | 5 | `LEONIDA_D3D12_DRED=1`, `LEONIDA_D3D12_DEBUG=1` | 12:17:21 (126 draws/frame) | 12:17:29 | `submitting thread was preparing a submission (2 submissions of ours started and not yet seen finished), of 31 lists, for 674.8 ms`; `relay: fence 18446744073709551615 did not reach 6223` | **Run 4:** the settings line shows `LEONIDA_PASSES_AHEAD=0 LEONIDA_AHEAD_SPLIT=0`, and the ahead-pass lines are gone. `lists of ours ahead of a frame` and `lists left to make the pass` appear 0 times, against 43 times each in `test3-alias_later0.log`. So the ahead passes are not the trigger. **Run 5:** DRED was on (`crash tracing on (device-removed data) breadcrumbs=true markers=true`), but it still gave nothing: ``` device-removed data; breadcrumbs (done/count, list) [] ``` The debug layer logged no error or corruption message before the reset. Its only messages during play were 2,837 warnings `id=1380` (`GetResourceAllocationInfo: Alignment cannot be 4KB ...`), spread over the whole run (the first at 12:16:29, the last at 12:17:28). At the removal it printed these, in this order: - `Kernel memory failure. There might be a memory leak. id=834`, seven times. - The live-object counts: 39,961 resources, 8,643 heaps, 4,077 command lists, 2,041 allocators and 5 queues. - The removal reason, `id=234 severity=4`: ``` ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DEVICE_RESET: The hardware took an unreasonable amount of time to execute a command on a different Device Context, or the hardware crashed/hung. As a result, the TDR (Timeout Detection and Recovery) mechanism has been triggered. The current Device Context was NOT executing commands when the hang occurred. However, the current video memory and Device Context could not be completely recovered. ...) ``` The `Kernel memory failure` lines are read out at the removal, so I can't tell whether they came before or after it. Video memory was not short: 2.3 s before the reset, the log shows 9,859 MB in use of a 15,569 MB budget on the card. So the reset is a hang (TDR), not a page fault, and nothing on the CPU side names a command. I can run `LEONIDA_D3D12_GBV=1` (GPU-based validation), a lower `LEONIDA_THIN_THREADS`, or any other switch you'd like. Logs of both runs, with ANSI colours removed and the Windows user and PC names replaced: `mandy-3264-tests-4-5-logs.zip`. AI-assisted: log analysis and write-up with Claude Opus 5.5 (High). [mandy-3264-tests-4-5-logs.zip](https://github.com/user-attachments/files/35812366/mandy-3264-tests-4-5-logs.zip)
zmasi commented 2026-12-03 14:54:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T14:54:21Z.


Thank you @Quentin1814 — test4-passes_ahead0.log and test5-dred1-debug1.log hit paydirt! Run 4 cleanly eliminates LEONIDA_PASSES_AHEAD / LEONIDA_AHEAD_SPLIT, and Run 5's ID3D12InfoQueue output (id=834 firing seven times before RemoveDevice) exposes a huge LEONIDA_THIN=1 (>= 4 threads) allocator and bury-lag spike compared to your working thin-off-ok.log:

1. What test5-dred1-debug1.log (L18526–L19145) shows vs thin-off-ok.log

  • Seven D3D12: Kernel memory failure. There might be a memory leak. id=834 errors fired before RemoveDevice (L19119 and L19123–L19128 — matching the 6 thin worker threads + 1 submitting thread, triggering D3D12's automatic ReportLiveDeviceObjects dump at L19120–L19144 before RemoveDevice at L19145).
  • Why THIN=1 at 6 threads blew up live command allocators and pending-bury objects in 5 seconds (L16664 -> L18535):
    • In thin-off-ok.log, host lists stayed flat at 1,011 for the entire 8.8-minute session and objects waiting on BURY_LAG stayed at 2,231 (3,616 after 8 min).
    • In test5-dred1-debug1.log, within 5 seconds of world entry:
      1. BACKS hoards live closed allocators (list/thin.rs:168,344-378, list.rs:543-551,643-652): When the submitting thread detaches a thin Recording, detach / detach_parts swaps out the submitted HostList and installs a brand-new fresh_closed() (ID3D12CommandAllocator + ID3D12GraphicsCommandList) into back.host right before Recording::drop parks back idle in unbounded static BACKS (which never drops and is never trimmed by LEONIDA_ALLOCATOR_TRIM).
      2. 6-thread premature materialization × BURY_LAG=64 trap (host.rs:582,5441): With 1–2 worker threads, queued Recordings sit in READY with inner.back == 0 (0 HostLists allocated). With 6 threads during the world-entry burst (~200 lists/frame), all 6 workers race ahead of the submitting thread and materialize distinct HostList + lazy prelude allocators for hundreds of queued recordings while BURY_LAG=64 submissions (~400–600 lists) holds landed lists before recycle() refills IDLE / IDLE_CLOSED.
      3. Result in test5: IDLE_CLOSED ran dry (closed by the line's thread: 109 -> 1,010), minting +773 new ID3D12CommandAllocators in 5 s (2,041 live allocators / 4,077 command-list interfaces at L19137, 0 dropped), 23,880 objects trapped in BURY_LAG (10x thin-off-ok), and process commit hitting 25,384 MB with only 1,865 MB physical RAM free (L18532) on your 32 GB system!
  • What the 5 queues and "a different Device Context" are:
    • Besides Host::queue (DIRECT, which had breadcrumbs [] — idle at the moment of TDR) and 1 internal DXGI/D3D12 queue, Leonida holds 3 persistent COPY queues: LEONIDA_UPLOAD_AHEAD=1 (texture/ahead.rs:200), LEONIDA_RELAY_COPY=1 (host.rs:7047), and LEONIDA_WAIT_RESIDENT (host.rs:364), alongside WDDM / amdkmdag.sys's kernel paging context.

2. Two zero-rebuild checks on your existing binary (at 6 threads)

Before we open the list/thin.rs BACKS + in-flight allocator cap PR, these two zero-rebuild -More runs will immediately confirm which half triggers id=834 / 0x887A0007 on your card:

  1. Slash BURY_LAG and idle allocator hoarding (tests kernel-memory / allocator pressure directly):
    -Log -More @{LEONIDA_LOG='info'; LEONIDA_BURY_LAG='8'; LEONIDA_LIST_POOL='0'; LEONIDA_CLOSED_AHEAD='0'; LEONIDA_ALLOCATOR_TRIM='1'; LEONIDA_ALLOCATOR_TRIM_S='5'}
  2. Disable the 3 extra COPY queues (isolates whether "a different Device Context" is a COPY queue vs WDDM kernel paging):
    -Log -More @{LEONIDA_LOG='info'; LEONIDA_UPLOAD_AHEAD='0'; LEONIDA_RELAY_COPY='0'; LEONIDA_WAIT_RESIDENT='0'}

AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7382231434 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7382231434). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T14:54:21Z. --- Thank you @Quentin1814 — `test4-passes_ahead0.log` and `test5-dred1-debug1.log` hit paydirt! Run 4 cleanly eliminates `LEONIDA_PASSES_AHEAD` / `LEONIDA_AHEAD_SPLIT`, and Run 5's `ID3D12InfoQueue` output (`id=834` firing seven times *before* `RemoveDevice`) exposes a huge `LEONIDA_THIN=1` (`>= 4` threads) allocator and bury-lag spike compared to your working `thin-off-ok.log`: ### 1. What `test5-dred1-debug1.log` (`L18526–L19145`) shows vs `thin-off-ok.log` - **Seven `D3D12: Kernel memory failure. There might be a memory leak. id=834` errors fired *before* `RemoveDevice`** (`L19119` and `L19123–L19128` — matching the 6 thin worker threads + 1 submitting thread, triggering D3D12's automatic `ReportLiveDeviceObjects` dump at `L19120–L19144` before `RemoveDevice` at `L19145`). - **Why `THIN=1` at 6 threads blew up live command allocators and pending-bury objects in 5 seconds (`L16664 -> L18535`)**: - In `thin-off-ok.log`, `host lists` stayed flat at **`1,011`** for the entire 8.8-minute session and objects waiting on `BURY_LAG` stayed at **`2,231`** (`3,616` after 8 min). - In `test5-dred1-debug1.log`, within 5 seconds of world entry: 1. **`BACKS` hoards live closed allocators (`list/thin.rs:168,344-378`, `list.rs:543-551,643-652`)**: When the submitting thread detaches a thin `Recording`, `detach` / `detach_parts` swaps out the submitted `HostList` **and installs a brand-new `fresh_closed()` (`ID3D12CommandAllocator` + `ID3D12GraphicsCommandList`) into `back.host`** right before `Recording::drop` parks `back` idle in unbounded `static BACKS` (which never drops and is never trimmed by `LEONIDA_ALLOCATOR_TRIM`). 2. **6-thread premature materialization × `BURY_LAG=64` trap (`host.rs:582,5441`)**: With 1–2 worker threads, queued `Recording`s sit in `READY` with `inner.back == 0` (`0` `HostList`s allocated). With 6 threads during the world-entry burst (~200 lists/frame), all 6 workers race ahead of the submitting thread and materialize distinct `HostList` + lazy prelude allocators for hundreds of queued recordings while `BURY_LAG=64` submissions (~400–600 lists) holds landed lists before `recycle()` refills `IDLE` / `IDLE_CLOSED`. 3. Result in `test5`: `IDLE_CLOSED` ran dry (`closed by the line's thread: 109 -> 1,010`), minting **`+773` new `ID3D12CommandAllocator`s in 5 s** (`2,041` live allocators / `4,077` command-list interfaces at `L19137`, `0` dropped), **`23,880` objects trapped in `BURY_LAG` (`10x` `thin-off-ok`)**, and process commit hitting **`25,384 MB`** with only **`1,865 MB` physical RAM free** (`L18532`) on your 32 GB system! - **What the `5 queues` and `"a different Device Context"` are**: - Besides `Host::queue` (`DIRECT`, which had `breadcrumbs []` — idle at the moment of TDR) and 1 internal DXGI/D3D12 queue, Leonida holds **3 persistent `COPY` queues**: `LEONIDA_UPLOAD_AHEAD=1` (`texture/ahead.rs:200`), `LEONIDA_RELAY_COPY=1` (`host.rs:7047`), and `LEONIDA_WAIT_RESIDENT` (`host.rs:364`), alongside WDDM / `amdkmdag.sys`'s kernel paging context. ### 2. Two zero-rebuild checks on your existing binary (at 6 threads) Before we open the `list/thin.rs` `BACKS` + in-flight allocator cap PR, these two zero-rebuild `-More` runs will immediately confirm which half triggers `id=834` / `0x887A0007` on your card: 1. **Slash `BURY_LAG` and idle allocator hoarding (tests kernel-memory / allocator pressure directly)**: `-Log -More @{LEONIDA_LOG='info'; LEONIDA_BURY_LAG='8'; LEONIDA_LIST_POOL='0'; LEONIDA_CLOSED_AHEAD='0'; LEONIDA_ALLOCATOR_TRIM='1'; LEONIDA_ALLOCATOR_TRIM_S='5'}` 2. **Disable the 3 extra `COPY` queues (isolates whether `"a different Device Context"` is a `COPY` queue vs WDDM kernel paging)**: `-Log -More @{LEONIDA_LOG='info'; LEONIDA_UPLOAD_AHEAD='0'; LEONIDA_RELAY_COPY='0'; LEONIDA_WAIT_RESIDENT='0'}` AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
Quentin1814 commented 2026-12-03 15:21:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Quentin1814 on 2026-12-03T15:21:02Z.


Both runs done on main b83ad5433, same binary and cache, default 6 threads, -Log -More @{LEONIDA_LOG='info'; ...}. Run 6 did not reset; run 7 did.

# Switches World first drawn (frame line) Result
6 LEONIDA_BURY_LAG=8, LEONIDA_LIST_POOL=0, LEONIDA_CLOSED_AHEAD=0, LEONIDA_ALLOCATOR_TRIM=1, LEONIDA_ALLOCATOR_TRIM_S=5 15:10:03 (116 draws/frame) No device removal. 3 min 40 s in the world, then a CPU access violation at 15:13:44 (below)
7 LEONIDA_UPLOAD_AHEAD=0, LEONIDA_RELAY_COPY=0, LEONIDA_WAIT_RESIDENT=0 15:17:00 (431 draws/frame) Device removed at 15:17:03, 0x887A0007, device-removed data; none

Run 7: the three COPY queues were off. The settings line shows all three switches at 0, and textures uploaded ahead of the lists appears 0 times, against 16 in run 6. It still reset about 3 s after the world first drew. The removal context: submitting thread was preparing a submission (11 submissions of ours started and not yet seen finished), of 19 lists, for 0.4 ms.

Run 6: the first run on this card with THIN=1 and 6 threads to get past world entry.

  • No reset, but very slow: in game, 3.0 fps median, 297 ms median frame, against 18.7 fps with THIN=0. Frame lines went up to 4,000–5,500 draws/frame, so the world was fully drawn.
  • Lists made per frame: by the end, the submitting thread was making 209.3 host lists per frame (38.3 ms), against 3.0 in run 5. That fits LIST_POOL=0, and probably explains the frame rate.
  • The bury-lag count was not low: what waits to be let go rose to 30,615 objects at most and was 18,799 at 15:12:55. That is above run 5's 23,880, and this run did not reset. If the switches themselves are what stopped the reset, the bury-lag count alone may not be the trigger, and it might point more at list or allocator reuse (LIST_POOL, CLOSED_AHEAD, the trim). But see the caveat below.
  • RAM: the THIN=0 run that played 8.8 minutes without a problem had less free RAM than run 5: 618 MB free, 28.7 GB private. So low free RAM alone does not seem to be the trigger either.
  • Edit, a caveat on run 6: at 3 fps everything runs much slower, so the missing reset may come from the changed timing hiding a race, not from the switches themselves. That would fit 1–2 THIN threads not resetting on Belobug. Running each switch alone should tell: if one stops the reset at a normal frame rate, it's that switch; if only LIST_POOL=0 (the slow one) does, the slowdown is the likely reason.

The access violation that ended run 6 (a different failure, CPU side, no device removal):

Leonida: unhandled exception 0xc0000005 at VCRUNTIME140.dll+0x1c45a (read 0x0: nothing mapped there)
  #0  VCRUNTIME140.dll+0x1c45a
  #1  leonida.exe+0x686665
  #2  leonida-image-b99f876b74d4a77f.dll+0x3de6491
  ...

The full register dump and stack are in the log. The title's own crash handler then tried to upload a minidump, and Leonida blocked it (HTTP connection blocked destination=submit.backtrace.io:443). I can't say whether one of the run-6 switches causes this or it is a separate bug that only shows once the world runs long enough with THIN on.

I can run any single one of the five run-6 switches on its own, to find which one stops the reset, or test a PR.

Logs of both runs, with ANSI colours removed and the Windows user and PC names replaced: mandy-3264-tests-6-7-logs.zip.

AI-assisted: log analysis and write-up with Claude Opus 5.5 (High).

mandy-3264-tests-6-7-logs.zip

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7382991468 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7382991468). Originally posted by [Quentin1814](https://github.com/Quentin1814) on 2026-12-03T15:21:02Z. --- Both runs done on `main` `b83ad5433`, same binary and cache, default 6 threads, `-Log -More @{LEONIDA_LOG='info'; ...}`. **Run 6 did not reset; run 7 did.** | # | Switches | World first drawn (frame line) | Result | |---|---|---|---| | 6 | `LEONIDA_BURY_LAG=8`, `LEONIDA_LIST_POOL=0`, `LEONIDA_CLOSED_AHEAD=0`, `LEONIDA_ALLOCATOR_TRIM=1`, `LEONIDA_ALLOCATOR_TRIM_S=5` | 15:10:03 (116 draws/frame) | **No device removal.** 3 min 40 s in the world, then a CPU access violation at 15:13:44 (below) | | 7 | `LEONIDA_UPLOAD_AHEAD=0`, `LEONIDA_RELAY_COPY=0`, `LEONIDA_WAIT_RESIDENT=0` | 15:17:00 (431 draws/frame) | Device removed at 15:17:03, `0x887A0007`, `device-removed data; none` | **Run 7:** the three COPY queues were off. The settings line shows all three switches at `0`, and `textures uploaded ahead of the lists` appears 0 times, against 16 in run 6. It still reset about 3 s after the world first drew. The removal context: `submitting thread was preparing a submission (11 submissions of ours started and not yet seen finished), of 19 lists, for 0.4 ms`. **Run 6:** the first run on this card with `THIN=1` and 6 threads to get past world entry. - **No reset**, but very slow: in game, 3.0 fps median, 297 ms median frame, against 18.7 fps with `THIN=0`. Frame lines went up to 4,000–5,500 draws/frame, so the world was fully drawn. - **Lists made per frame:** by the end, the submitting thread was making 209.3 host lists per frame (38.3 ms), against 3.0 in run 5. That fits `LIST_POOL=0`, and probably explains the frame rate. - **The bury-lag count was not low:** `what waits to be let go` rose to 30,615 objects at most and was 18,799 at 15:12:55. That is above run 5's 23,880, and this run did not reset. If the switches themselves are what stopped the reset, the bury-lag count alone may not be the trigger, and it might point more at list or allocator reuse (`LIST_POOL`, `CLOSED_AHEAD`, the trim). But see the caveat below. - **RAM:** the `THIN=0` run that played 8.8 minutes without a problem had less free RAM than run 5: 618 MB free, 28.7 GB private. So low free RAM alone does not seem to be the trigger either. - **Edit, a caveat on run 6:** at 3 fps everything runs much slower, so the missing reset may come from the changed timing hiding a race, not from the switches themselves. That would fit 1–2 THIN threads not resetting on Belobug. Running each switch alone should tell: if one stops the reset at a normal frame rate, it's that switch; if only `LIST_POOL=0` (the slow one) does, the slowdown is the likely reason. **The access violation that ended run 6** (a different failure, CPU side, no device removal): ``` Leonida: unhandled exception 0xc0000005 at VCRUNTIME140.dll+0x1c45a (read 0x0: nothing mapped there) #0 VCRUNTIME140.dll+0x1c45a #1 leonida.exe+0x686665 #2 leonida-image-b99f876b74d4a77f.dll+0x3de6491 ... ``` The full register dump and stack are in the log. The title's own crash handler then tried to upload a minidump, and Leonida blocked it (`HTTP connection blocked destination=submit.backtrace.io:443`). I can't say whether one of the run-6 switches causes this or it is a separate bug that only shows once the world runs long enough with THIN on. I can run any single one of the five run-6 switches on its own, to find which one stops the reset, or test a PR. Logs of both runs, with ANSI colours removed and the Windows user and PC names replaced: `mandy-3264-tests-6-7-logs.zip`. AI-assisted: log analysis and write-up with Claude Opus 5.5 (High). [mandy-3264-tests-6-7-logs.zip](https://github.com/user-attachments/files/35820504/mandy-3264-tests-6-7-logs.zip)
xMatiassekk commented 2026-12-03 16:10:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by xMatiassekk on 2026-12-03T16:10:31Z.


I can reproduce the same issue on an AMD Radeon RX 6700 XT (RDNA2).

With the default LEONIDA_THIN=1, the game eventually loses the GPU device and exits with device removed errors (0x887A0007 / 0x887A0005). When I set LEONIDA_THIN=0, the game launches and runs reliably.

My issue is therefore very similar to this report, but on an RX 6700 XT instead of an RX 6800 XT. The crash is also associated with very long pipeline and GPU memory waits before the device reset.

Configuration:

  • Windows
  • RX 6700 XT, RDNA2
  • Xbox Series S profile
  • D3D12/Vulkan
  • 720p
  • ray tracing, DLSS and frame generation disabled

The relevant logs contain:
device removed
The GPU device instance has been suspended
host GPU failure
new memory waited for ... 11000 times
new card memory waited for ... 10600 times

Setting LEONIDA_THIN=0 prevents the crash in my tests.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7384392915 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7384392915). Originally posted by [xMatiassekk](https://github.com/xMatiassekk) on 2026-12-03T16:10:31Z. --- I can reproduce the same issue on an AMD Radeon RX 6700 XT (RDNA2). With the default LEONIDA_THIN=1, the game eventually loses the GPU device and exits with device removed errors (0x887A0007 / 0x887A0005). When I set LEONIDA_THIN=0, the game launches and runs reliably. My issue is therefore very similar to this report, but on an RX 6700 XT instead of an RX 6800 XT. The crash is also associated with very long pipeline and GPU memory waits before the device reset. Configuration: - Windows - RX 6700 XT, RDNA2 - Xbox Series S profile - D3D12/Vulkan - 720p - ray tracing, DLSS and frame generation disabled The relevant logs contain: device removed The GPU device instance has been suspended host GPU failure new memory waited for ... 11000 times new card memory waited for ... 10600 times Setting LEONIDA_THIN=0 prevents the crash in my tests.
zmasi commented 2026-12-03 17:28:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-12-03T17:28:21Z.


Thank you @Quentin1814 for Runs 6 & 7, and @xMatiassekk for confirming the exact same RDNA 2 LEONIDA_THIN=1 reset on RX 6700 XT!

We rebuilt b83ad5433 with --profile diag --features diagnostics,mimalloc to decode leonida.exe+0x686665 and audited how each Run-6 switch actually executed in list.rs / host.rs:

1. What leonida.exe+0x686665 is in Run 6

  • leonida.exe+0x686665 = leonida_gpu::port_descriptors::copy + 0x15 (d3d12/crates/leonida-gpu/src/port_descriptors.rs:449) — the return instruction (MARKS.len.load(Acquire) at port_descriptors.rs:465) immediately after call rax into VCRUNTIME140.dll!memcpy via REAL[0].
  • port_descriptors::copy passes rcx (dst), rdx (src), and r8 (len = 0x10) straight through to memcpy untouched before doing its post-copy descriptor-mark check, so rdx = 0x0 arrived directly from the caller.
  • Across all 34,667 lines of test6-bury_lag8-pool0-trim5.log, zero Leonida D3D12 or xmem calls failed (residency at L34548: allocations failed for want of memory 0; commit critical in 0 of 4226 questions), and the crash dump at L34651–34656 shows ~4.1 GiB physical RAM free and ~8.2 GiB commit headroom at the moment of the fault. So the src = NULL dereference at 3m 40s is title-internal (potentially stressed by LEONIDA_LIST_POOL=0 creating/destroying 408,042 D3D12 command allocators & lists and holding gameplay at 3.0 fps / 610–855 ms present latency), not a Leonida wrapper corruption or failed map/allocation. (Aside: the writer=0x7ff94a0dc52b (not the title's) lines in test5/test6 are faults inside wrapped memcpy, which #3306 fixes.)

2. What Runs 6 & 7 narrow down in list.rs / host.rs

  1. Run 7 (UPLOAD_AHEAD=0, RELAY_COPY=0, WAIT_RESIDENT=0) cleanly eliminates Leonida's 3 streaming COPY queues (0x887A0007's "a different Device Context" wording can still reflect DWM/present, the WDDM kernel paging context, or an adapter-wide RDNA 2 engine reset).
  2. Host RAM / VRAM / total BURY_LAG object count are ruled out as standalone triggers: thin-off-ok (644 MB min free RAM, 12,001 MB VRAM) and test6 (38 MB min free RAM at 153 s, 11,901 MB VRAM, up to 30,615 pending-bury objects) both ran without GPU reset, whereas test5 reset in 4 s with 1,612 MB min free RAM and 9,859 MB VRAM right after 7× D3D12: Kernel memory failure (id=834).
  3. Which Run-6 switches actually executed:
    • LEONIDA_CLOSED_AHEAD=0 was a no-op inside Run 6, because IDLE_CLOSED is only populated inside list::recycle() (list.rs:395–402) after if !pools() { return; } (list.rs:389).
    • LEONIDA_ALLOCATOR_TRIM=1 (TRIM_S=5) ran half-active in Run 6: the idle-pool let-go at list.rs:421 was skipped behind pools(), but per-reset allocator_refresh() (host.rs:3126, called from HostList::reset at host.rs:9307 and prelude record at host.rs:9757) is un-gated and replaced 1,941 host-list + 16 prelude allocators across 151 intervals.
    • Note also that when LEONIDA_LIST_POOL=1 is back on, IDLE_CLOSED (list.rs:395–402) grabs up to 96 recycled lists before IDLE's ALLOCATOR_TRIM let-go (list.rs:421) unless LEONIDA_CLOSED_AHEAD=0 is also set.

3. Next two full-~18-fps checks (keeping default LEONIDA_LIST_POOL=1)

Your caveat about LIST_POOL=0's 3 fps timing is spot-on. Keeping LEONIDA_LIST_POOL=1 restores full ~18 fps (eliminating the 209 lists/frame creation stall) and isolates the remaining active switches in two fast runs (@xMatiassekk if you want to try either on RX 6700 XT, that is super helpful too):

  1. Run 8 — Run 6's non-slow switches together at full ~18 fps:
    -Log -More @{LEONIDA_LOG='info'; LEONIDA_BURY_LAG='8'; LEONIDA_CLOSED_AHEAD='0'; LEONIDA_ALLOCATOR_TRIM='1'; LEONIDA_ALLOCATOR_TRIM_S='5'}
    
  2. Run 9 — Clean single-switch LEONIDA_BURY_LAG=8 alone at full ~18 fps (avoids ALLOCATOR_TRIM_S=5 recreating/retiring every live allocator every 5 s on the id=834 path):
    -Log -More @{LEONIDA_LOG='info'; LEONIDA_BURY_LAG='8'}
    
  • Run 8 OK & Run 9 OK → LEONIDA_BURY_LAG=8 alone stops the RDNA 2 reset at full frame rate.
  • Run 8 OK & Run 9 resets → LEONIDA_ALLOCATOR_TRIM=1/5 and/or LEONIDA_CLOSED_AHEAD=0 stops it at full frame rate (one follow-up splits the two).
  • Run 8 resets & Run 9 OK → LEONIDA_BURY_LAG=8 stops it, while ALLOCATOR_TRIM_S=5's 5 s allocator recreation churn was counterproductive at 18 fps.
  • Both Run 8 & Run 9 reset → LEONIDA_LIST_POOL=0 alone prevented the reset in Run 6, narrowing #3264 strictly to post-execution HostList / ID3D12CommandAllocator reuse on amdxc64.dll vs Run 6's lower ~3 fps submission rate/concurrency.

AI-assisted: Gemini 4 Carbon (High) and Claude Opus 5.5 (High).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7386564630 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7386564630). Originally posted by [zmasi](https://github.com/zmasi) on 2026-12-03T17:28:21Z. --- Thank you @Quentin1814 for Runs 6 & 7, and @xMatiassekk for confirming the exact same RDNA 2 `LEONIDA_THIN=1` reset on RX 6700 XT! We rebuilt `b83ad5433` with `--profile diag --features diagnostics,mimalloc` to decode `leonida.exe+0x686665` and audited how each Run-6 switch actually executed in `list.rs` / `host.rs`: ### 1. What `leonida.exe+0x686665` is in Run 6 - **`leonida.exe+0x686665` = `leonida_gpu::port_descriptors::copy + 0x15` (`d3d12/crates/leonida-gpu/src/port_descriptors.rs:449`)** — the return instruction (`MARKS.len.load(Acquire)` at `port_descriptors.rs:465`) immediately after `call rax` into `VCRUNTIME140.dll!memcpy` via `REAL[0]`. - `port_descriptors::copy` passes `rcx` (`dst`), `rdx` (`src`), and `r8` (`len = 0x10`) straight through to `memcpy` untouched before doing its post-copy descriptor-mark check, so `rdx = 0x0` arrived directly from the caller. - Across all 34,667 lines of `test6-bury_lag8-pool0-trim5.log`, zero Leonida D3D12 or `xmem` calls failed (`residency` at `L34548`: `allocations failed for want of memory 0; commit critical in 0 of 4226 questions`), and the crash dump at `L34651–34656` shows ~4.1 GiB physical RAM free and ~8.2 GiB commit headroom at the moment of the fault. So the `src = NULL` dereference at 3m 40s is title-internal (potentially stressed by `LEONIDA_LIST_POOL=0` creating/destroying **408,042** D3D12 command allocators & lists and holding gameplay at `3.0 fps` / `610–855 ms` present latency), not a Leonida wrapper corruption or failed map/allocation. *(Aside: the `writer=0x7ff94a0dc52b (not the title's)` lines in `test5`/`test6` are faults inside wrapped `memcpy`, which #3306 fixes.)* ### 2. What Runs 6 & 7 narrow down in `list.rs` / `host.rs` 1. **Run 7 (`UPLOAD_AHEAD=0`, `RELAY_COPY=0`, `WAIT_RESIDENT=0`)** cleanly eliminates Leonida's 3 streaming `COPY` queues (`0x887A0007`'s `"a different Device Context"` wording can still reflect DWM/present, the WDDM kernel paging context, or an adapter-wide RDNA 2 engine reset). 2. **Host RAM / VRAM / total `BURY_LAG` object count are ruled out** as standalone triggers: `thin-off-ok` (`644 MB` min free RAM, `12,001 MB` VRAM) and `test6` (`38 MB` min free RAM at `153 s`, `11,901 MB` VRAM, up to `30,615` pending-bury objects) both ran without GPU reset, whereas `test5` reset in 4 s with `1,612 MB` min free RAM and `9,859 MB` VRAM right after 7× `D3D12: Kernel memory failure (id=834)`. 3. **Which Run-6 switches actually executed**: - **`LEONIDA_CLOSED_AHEAD=0` was a no-op inside Run 6**, because `IDLE_CLOSED` is only populated inside `list::recycle()` (`list.rs:395–402`) *after* `if !pools() { return; }` (`list.rs:389`). - **`LEONIDA_ALLOCATOR_TRIM=1` (`TRIM_S=5`) ran half-active in Run 6**: the idle-pool let-go at `list.rs:421` was skipped behind `pools()`, **but** per-reset `allocator_refresh()` (`host.rs:3126`, called from `HostList::reset` at `host.rs:9307` and prelude record at `host.rs:9757`) is un-gated and replaced **1,941 host-list + 16 prelude allocators** across 151 intervals. - Note also that when `LEONIDA_LIST_POOL=1` is back on, `IDLE_CLOSED` (`list.rs:395–402`) grabs up to 96 recycled lists *before* `IDLE`'s `ALLOCATOR_TRIM` let-go (`list.rs:421`) unless `LEONIDA_CLOSED_AHEAD=0` is also set. ### 3. Next two full-~18-fps checks (keeping default `LEONIDA_LIST_POOL=1`) Your caveat about `LIST_POOL=0`'s 3 fps timing is spot-on. Keeping `LEONIDA_LIST_POOL=1` restores full ~18 fps (eliminating the 209 lists/frame creation stall) and isolates the remaining active switches in two fast runs (`@xMatiassekk` if you want to try either on RX 6700 XT, that is super helpful too): 1. **Run 8 — Run 6's non-slow switches together at full ~18 fps**: ```powershell -Log -More @{LEONIDA_LOG='info'; LEONIDA_BURY_LAG='8'; LEONIDA_CLOSED_AHEAD='0'; LEONIDA_ALLOCATOR_TRIM='1'; LEONIDA_ALLOCATOR_TRIM_S='5'} ``` 2. **Run 9 — Clean single-switch `LEONIDA_BURY_LAG=8` alone at full ~18 fps** (avoids `ALLOCATOR_TRIM_S=5` recreating/retiring every live allocator every 5 s on the `id=834` path): ```powershell -Log -More @{LEONIDA_LOG='info'; LEONIDA_BURY_LAG='8'} ``` - **Run 8 OK & Run 9 OK** → `LEONIDA_BURY_LAG=8` alone stops the RDNA 2 reset at full frame rate. - **Run 8 OK & Run 9 resets** → `LEONIDA_ALLOCATOR_TRIM=1/5` and/or `LEONIDA_CLOSED_AHEAD=0` stops it at full frame rate (one follow-up splits the two). - **Run 8 resets & Run 9 OK** → `LEONIDA_BURY_LAG=8` stops it, while `ALLOCATOR_TRIM_S=5`'s 5 s allocator recreation churn was counterproductive at 18 fps. - **Both Run 8 & Run 9 reset** → `LEONIDA_LIST_POOL=0` alone prevented the reset in Run 6, narrowing `#3264` strictly to post-execution `HostList` / `ID3D12CommandAllocator` reuse on `amdxc64.dll` vs Run 6's lower ~3 fps submission rate/concurrency. AI-assisted: Gemini 4 Carbon (High) and Claude Opus 5.5 (High).
Quentin1814 commented 2026-12-03 17:40:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ubiquitarianism/leonida. Originally posted by Quentin1814 on 2026-12-03T17:40:33Z.


Thanks @zmasi, here are the results.

Both runs done on main b83ad5433, same binary and cache, default 6 threads, LEONIDA_LIST_POOL left at its default (on), -Log -More @{LEONIDA_LOG='info'; ...}. Both reset at world entry.

# Switches World first drawn (frame line) Device removed Removal context
8 LEONIDA_BURY_LAG=8, LEONIDA_CLOSED_AHEAD=0, LEONIDA_ALLOCATOR_TRIM=1, LEONIDA_ALLOCATOR_TRIM_S=5 17:34:47 (344 draws/frame) 17:34:52 submitting thread was preparing a submission (7 submissions of ours started and not yet seen finished), of 19 lists, for 0.1 ms; relay: the fence reports the device removed
9 LEONIDA_BURY_LAG=8 17:36:36 (122 draws/frame) 17:36:42 submitting thread was preparing a submission (8 submissions of ours started and not yet seen finished), of 1 lists, for 0.2 ms; relay: fence 18446744073709551615 did not reach 5426

Both are 0x887A0007 with device-removed data; none, like the earlier resets.

The switches did take effect. The settings lines show them, and in run 8 the trim ran before the reset: command allocators taken anew since the last line (LEONIDA_ALLOCATOR_TRIM=1) went up to 157 of host lists at their resets and 0 idle host lists let go.

By your table, that is the "both reset" case: of run 6's switches, only LEONIDA_LIST_POOL=0 was left, so it seems to be what kept run 6 from resetting. I can't tell from these runs whether that comes from not reusing lists and allocators, or from run 6's ~3 fps timing. I can run LEONIDA_LIST_POOL=0 alone, or test a PR whenever one is up.

Logs of both runs, with ANSI colours removed and the Windows user and PC names replaced: mandy-3264-tests-8-9-logs.zip.

AI-assisted: log analysis and write-up with Claude Opus 5.5 (High).

mandy-3264-tests-8-9-logs.zip

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7386885680 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/issues/3264#issuecomment-7386885680). Originally posted by [Quentin1814](https://github.com/Quentin1814) on 2026-12-03T17:40:33Z. --- Thanks @zmasi, here are the results. Both runs done on `main` `b83ad5433`, same binary and cache, default 6 threads, `LEONIDA_LIST_POOL` left at its default (on), `-Log -More @{LEONIDA_LOG='info'; ...}`. **Both reset at world entry.** | # | Switches | World first drawn (frame line) | Device removed | Removal context | |---|---|---|---|---| | 8 | `LEONIDA_BURY_LAG=8`, `LEONIDA_CLOSED_AHEAD=0`, `LEONIDA_ALLOCATOR_TRIM=1`, `LEONIDA_ALLOCATOR_TRIM_S=5` | 17:34:47 (344 draws/frame) | 17:34:52 | `submitting thread was preparing a submission (7 submissions of ours started and not yet seen finished), of 19 lists, for 0.1 ms`; `relay: the fence reports the device removed` | | 9 | `LEONIDA_BURY_LAG=8` | 17:36:36 (122 draws/frame) | 17:36:42 | `submitting thread was preparing a submission (8 submissions of ours started and not yet seen finished), of 1 lists, for 0.2 ms`; `relay: fence 18446744073709551615 did not reach 5426` | Both are `0x887A0007` with `device-removed data; none`, like the earlier resets. The switches did take effect. The settings lines show them, and in run 8 the trim ran before the reset: `command allocators taken anew since the last line (LEONIDA_ALLOCATOR_TRIM=1)` went up to `157 of host lists at their resets` and `0 idle host lists let go`. By your table, that is the "both reset" case: of run 6's switches, only `LEONIDA_LIST_POOL=0` was left, so it seems to be what kept run 6 from resetting. I can't tell from these runs whether that comes from not reusing lists and allocators, or from run 6's ~3 fps timing. I can run `LEONIDA_LIST_POOL=0` alone, or test a PR whenever one is up. Logs of both runs, with ANSI colours removed and the Windows user and PC names replaced: `mandy-3264-tests-8-9-logs.zip`. AI-assisted: log analysis and write-up with Claude Opus 5.5 (High). [mandy-3264-tests-8-9-logs.zip](https://github.com/user-attachments/files/35826762/mandy-3264-tests-8-9-logs.zip)
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#3264
No description provided.