d3d12: device removed seconds after world entry on RX 6800 XT with the default LEONIDA_THIN=1; THIN=0 runs fine #3264
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Reference
No Branch/Tag specified
main
github-pr/3295
beta
docs/changelog-3483-3500
github-pr/3294
github-pr/2975
github-pr/2815
feat/gate-driver-start
feat/skip-pipelines-release
perf/lazy-compare
perf/mwaitx-wait
test/prio-ceiling-main
fix/ab-cpu-stdout
fix/gate-old-crashes
diag/ab-cpu
test/main-0312
github-pr/3291
diag/indirect-clamp-census
feat/barrier-enhanced
perf/texture-frame-ceiling
perf/dstorage-threads
fix/console-queue-dma-tables
fix/port-descriptors-record-parts
fix/frame-waits-fence
fix/console-sampler-words
fix/graphics-userdata-spill
fix/xg-reserved-layout-rotation
fix/barrier-console-flags
fix/switches-wait-test-child
test/list-value-waits
test/lot-gxdk-0412
fix/bvh-compacted-size
docs/i18n-quickstarts
feat/native-pipeline-slots
fix/clippy-leonida-gpu
fix/list-value-producers
fix/descriptor-page-straddle
fix/xmem-low-window
fix/ffx-jitter-never-zero
fix/run-stdout-closed
github-pr/2892
github-pr/2896
feat/warm-save-every
github-pr/2980
github-pr/2994
github-pr/3005
github-pr/3010
github-pr/3136
github-pr/3303
github-pr/3220
github-pr/3143
github-pr/3330
github-pr/3226
github-pr/3187
carry/3395
github-pr/2946
github-pr/2947
github-pr/2945
github-pr/2983
github-pr/3001
github-pr/3372
github-pr/3128
github-pr/3296
github-pr/2588
github-pr/3119
github-pr/3378
fix/crash-diagnostics
feat/dlss-mip-bias
fix/retired-out-of-order
fix/dxr-postbuild-barrier
fix/amd-relay-default
fix/removed-report-wait
feat/heap-twin
feat/vram-margin
github-pr/2472
github-pr/3123
github-pr/3088
assets/annonce-v1
github-pr/2794
github-pr/3300
github-pr/3304
github-pr/3308
github-pr/3367
github-pr/3369
fix/launcher-dlss-diagnostics
github-pr/3269
github-pr/2957
github-pr/3205
fix/crash-zero-guard
github-pr/3185
github-pr/3099
github-pr/3104
github-pr/3348
github-pr/3379
github-pr/3377
perf/darner-title-priority-ceiling
github-pr/3376
gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github-pr/3373
github-pr/3368
github-pr/3198
gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github-pr/3346
github-pr/3375
github-pr/2958
github-pr/3151
github-pr/3307
github-pr/3278
github-pr/3374
fix/runtime-test-conservative-fixtures
github-pr/3366
ci/shard-semantic-linux
github-pr/3354
docs/fg-limit-fps-switch
github-pr/3365
fix/read-file-hard-link
github-pr/3364
fix/book-slot-heap-never-read
github-pr/3361
github-pr/3263
github-pr/3360
github-pr/3353
github-pr/3331
fix/alias-later-queued-submissions
github-pr/3352
github-pr/3228
github-pr/3349
claude/gallant-sagan-aamatr
github-pr/3200
github-pr/3132
github-pr/3323
github-pr/3332
github-pr/3340
github-pr/3311
github-pr/3334
github-pr/3297
github-pr/3256
github-pr/2567
github-pr/2851
d3d12/agility-sdk-621
github-pr/3164
github-pr/3114
github-pr/3050
github-pr/3113
github-pr/3326
github-pr/3144
github-pr/2642
github-pr/3072
github-pr/2789
github-pr/2643
github-pr/3009
github-pr/3035
github-pr/3031
github-pr/2686
github-pr/2834
github-pr/3321
github-pr/3325
github-pr/3290
github-pr/3324
github-pr/3130
claude/fervent-curie-m19lnr
github-pr/3309
github-pr/3305
github-pr/3306
github-pr/3302
github-pr/3301
github-pr/3345
github-pr/3211
github-pr/3027
github-pr/3286
github-pr/3235
github-pr/3265
github-pr/3275
codex/skip-no-hit-ray-passes
github-pr/2823
github-pr/2911
github-pr/3262
github-pr/3125
github-pr/3206
github-pr/3250
github-pr/3238
github-pr/3188
github-pr/2952
github-pr/3217
github-pr/3168
t3/preserve-fsr-sdk-restart-path
t3/propagate-host-failure-hresult
github-pr/3209
t3/launcher-custom-parameters
github-pr/3207
github-pr/3183
github-pr/3160
github-pr/3201
ci/less-to-run
github-pr/2930
github-pr/2797
github-pr/2999
perf/native-compute-shader-forms
github-pr/3191
github-pr/3011
github-pr/3019
github-pr/2996
gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
claude/blissful-franklin-ukp7ag
github-pr/3141
github-pr/3156
github-pr/3150
github-pr/3153
github-pr/3163
github-pr/3142
github-pr/3139
github-pr/2841
github-pr/3069
github-pr/3098
github-pr/3107
github-pr/3071
github-pr/2774
github-pr/2889
github-pr/3075
github-pr/2661
github-pr/3064
github-pr/3054
github-pr/3049
github-pr/2855
github-pr/2943
github-pr/3016
github-pr/2887
github-pr/3006
github-pr/3003
github-pr/2993
notes/card-time-and-plant-flicker
github-pr/2989
feat/vulkan-rs
github-pr/2985
github-pr/2951
github-pr/2982
github-pr/752
github-pr/792
github-pr/2877
github-pr/2654
github-pr/2893
github-pr/2948
github-pr/2944
github-pr/2919
github-pr/2915
archive/ci/less-to-run/20261202T1121Z
github-pr/2800
github-pr/2822
github-pr/2833
github-pr/2840
github-pr/2831
github-pr/2832
github-pr/2801
github-pr/2890
github-pr/2891
github-pr/2664
github-pr/2807
rt-call-trace
github-pr/2755
perf/ahead-split
github-pr/2587
github-pr/2698
github-pr/2609
github-pr/3219
docs/readme-runtime-proposal
github-pr/2017
github-pr/1741
github-pr/1667
codex/coord-claim-check-20261124-7e48
v1.1.0
v1.0.1
Notifications
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy#3264
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:This gives Series X, 2560x1440 output, the title's dynamic resolution from 1080 lines, and
LEONIDA_THIN=1withLEONIDA_THIN_THREADS=6.LEONIDA_ADAPTERwas not set in either run. The display is on the 6800 XT; a Ryzen 9600X iGPU is also present.thin-on-crash.log)THIN=1, 6 threadsthin-off-ok.log)-More @{LEONIDA_LOG='info'; LEONIDA_THIN='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 withLEONIDA_THIN=0.The same bug in the VIctory lineage. The same failure happened on the Belobug VIctory fork (
VICTORY_THIN, commit4eb6cfdf), on this card, on 2026-11-28. I bisected it there over 14 runs:THIN=1with 8 or 4 list threads gave DEVICE_RESET (0x887A0007) at world entry, every time (9 runs).JOIN_PARTS,UPLOAD_AHEAD,UNDER_WIDE,LAND_ECHO,ASYNC_SUBMIT, thePORT_*patches andLIST_VIEWS=0were not the cause.D3D12_DEBUG=1it 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)
LEONIDA_WC_NO_BACK=1. Before your 2026-11-29 face fix, this card showed only eyes and teeth unlessWC_NO_BACK=0was set. Copy-back is now about 11 ms a frame, against 22–25 ms withWC_NO_BACK=0ondd87aa4.7b907de,dd87aa4): plants flicker in and out.LEONIDA_SAMPLE_MASKwas 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
Thank you @Quentin1814 for the 14-run bisection and sanitized logs! We audited the thin translation path against
thin-on-crash.logandthin-off-ok.logand opened #3309 (73286e1d98,Refs #3264).What we found (and why #3309 says
Refs #3264rather than claiming a blind fix)HostListresource-lifetime bug fixed in #3309 (descriptor/host.rsKEPT_SEEN):LEONIDA_KEEP_BY_LIST=1, per-threadKEPT_SEENcached already-retained dynamic-slot resources by(addr_of_HostList, resets). BecauseList.host: Option<HostList>moves replacementHostListvalues into the same address (cut,value_written,detach_parts,detach) withresets == 0(and recycles back lists LIFO inthin.rs), a worker thread could mistake a newHostListfor an earlier one and skipkeep_once(), letting buffers/textures drop toreferences == 1and get freed while the GPU still read them (which causes an immediate GPU page fault /DEVICE_RESETon RDNA 2).4eb6cfdf(which predatesLEONIDA_KEEP_BY_LISTandLEONIDA_ALIAS_LATER), we did not want to overclaimKEPT_SEENas your sole trigger.mainand Belobug4eb6cfdf(draw.rsheap_buffers):!done_ahead, the first list to swapbuffer_frameclaims the frame's heap-buffer pass while concurrent thin worker lists skip it and bind stale heap buffers. In yourthin-on-crash.log,7.88lists/frame hit that path (0.4passes/frame) right up to ~2 s before the22:57:21.873reset, and its incidence scales directly with worker thread count (>= 4threads).DRED=faultsandwhen the host device wentwere missing fromthin-on-crash.log:play-d3d12.ps1already enabledLEONIDA_D3D12_DRED=faults, so you do not need to re-run just to setDRED. Inhost.rs, when two threads hit device removal simultaneously, the second thread can reachTerminateProcesswhile the first is still formattinglog_removal_context(SAIDskips 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:
73286e1d98) with default settings (6threads).main,-More @{LEONIDA_LOG='info'; LEONIDA_KEEP_BY_LIST='0'}(isolatesKEPT_SEEN/ per-list retention).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.rsheap_bufferspass 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).
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 logLEONIDA_THIN=1withthreads=6, and all three still reset at world entry, like before:73286e1d9the 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 6356b83ad5433LEONIDA_KEEP_BY_LIST=0submitting 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 listsb83ad5433LEONIDA_ALIAS_LATER=0the 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 5127The device-removed reason is
0x887A0007in all three. Unlike my first log, these logs print the removal context, butdevice-removed data; noneevery time, withLEONIDA_D3D12_DRED=faultsfrom 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.rsheap_bufferspass race. I'm happy to test the targeted guard as soon as it's up, and a run withLEONIDA_D3D12_DEBUG=1or a differentLEONIDA_THIN_THREADSif 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
Thank you @Quentin1814 for running all three so fast and attaching
mandy-3264-tests-logs.zip! Readingtest1-pr3309.log,test2-keep_by_list0.log, andtest3-alias_later0.logside-by-side actually saved you a wasted build — they rule outheap_buffers!done_aheadas the direct crash trigger and explain whydevice-removed data; noneprinted:What the three new logs proved
heap_buffers!done_ahead(draw.rs:3694) had already stopped firing 3+ seconds before the reset:lists left to make the pass for themselveswas non-zero only on the initial loading transition (5.73/1.10/2.46), then stayed0.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 maxintest3). Every!done_aheadlist had already completed on the GPU several seconds before0x887A0007.the host device went while textures picked by index were made ready(draw.rs:4731) means:GetDeviceRemovedReason()poll insideheap_textures's CPU slot loop (checking benign 1x1R8G8B8A8_UNORM/ 32x32x53BC7_UNORMviews), while Run 2 noticed the exact same asynchronous GPU reset (5–11submissions in flight,relay: fence u64::MAX did not reach ...) onCreateCommittedResourceduring a 35-list submission prep first.device-removed data; noneprinted (breadcrumbs=false markers=false):diagnosticsbuild, so no rebuild or 20-minute pipeline precompile is needed! The launcher setsLEONIDA_D3D12_DRED=faults(GPU page-fault reporting only, with auto-breadcrumbs off). Because0x887A0007(DXGI_ERROR_DEVICE_RESET) here is not a virtual-memory page fault,faultsmode has nothing to print unless auto-breadcrumbs (LEONIDA_D3D12_DRED=1) or the D3D12 debug layer (LEONIDA_D3D12_DEBUG=1) are enabled.LEONIDA_THIN=1-coupled subsystem (LEONIDA_PASSES_AHEAD):LEONIDA_PASSES_AHEADdefaults on only whenLEONIDA_THIN=1(draw.rs:303), spawningleonida-ahead-textures(LEONIDA_AHEAD_SPLIT=1) alongside thin workers runningearly_textures/flush_for_bake(flushes=4, bakes=8ran 2–3 s before all three resets). TurningLEONIDA_THIN=0implicitly turnedLEONIDA_PASSES_AHEADoff too.Two zero-rebuild runs on your existing binary (at the default 6 threads)
Using the binary and pipeline cache you already built:
thin.rstranslation:-Log -More @{LEONIDA_LOG='info'; LEONIDA_PASSES_AHEAD='0'; LEONIDA_AHEAD_SPLIT='0'}-Log -More @{LEONIDA_LOG='info'; LEONIDA_D3D12_DRED='1'; LEONIDA_D3D12_DEBUG='1'}Those two runs will immediately tell us whether
passes_ahead/ahead_splitis the trigger AND name the exact command list / D3D12 op that resetsamdxc64.dll.AI-assisted: Gemini 4 Neon (XHigh) and Gemini 4 Carbon (High).
Both runs done on
mainb83ad5433(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.LEONIDA_PASSES_AHEAD=0,LEONIDA_AHEAD_SPLIT=0submitting 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 removedLEONIDA_D3D12_DRED=1,LEONIDA_D3D12_DEBUG=1submitting 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 6223Run 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 frameandlists left to make the passappear 0 times, against 43 times each intest3-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: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.id=234 severity=4:The
Kernel memory failurelines 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 lowerLEONIDA_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
Thank you @Quentin1814 —
test4-passes_ahead0.logandtest5-dred1-debug1.loghit paydirt! Run 4 cleanly eliminatesLEONIDA_PASSES_AHEAD/LEONIDA_AHEAD_SPLIT, and Run 5'sID3D12InfoQueueoutput (id=834firing seven times beforeRemoveDevice) exposes a hugeLEONIDA_THIN=1(>= 4threads) allocator and bury-lag spike compared to your workingthin-off-ok.log:1. What
test5-dred1-debug1.log(L18526–L19145) shows vsthin-off-ok.logD3D12: Kernel memory failure. There might be a memory leak. id=834errors fired beforeRemoveDevice(L19119andL19123–L19128— matching the 6 thin worker threads + 1 submitting thread, triggering D3D12's automaticReportLiveDeviceObjectsdump atL19120–L19144beforeRemoveDeviceatL19145).THIN=1at 6 threads blew up live command allocators and pending-bury objects in 5 seconds (L16664 -> L18535):thin-off-ok.log,host listsstayed flat at1,011for the entire 8.8-minute session and objects waiting onBURY_LAGstayed at2,231(3,616after 8 min).test5-dred1-debug1.log, within 5 seconds of world entry:BACKShoards live closed allocators (list/thin.rs:168,344-378,list.rs:543-551,643-652): When the submitting thread detaches a thinRecording,detach/detach_partsswaps out the submittedHostListand installs a brand-newfresh_closed()(ID3D12CommandAllocator+ID3D12GraphicsCommandList) intoback.hostright beforeRecording::dropparksbackidle in unboundedstatic BACKS(which never drops and is never trimmed byLEONIDA_ALLOCATOR_TRIM).BURY_LAG=64trap (host.rs:582,5441): With 1–2 worker threads, queuedRecordings sit inREADYwithinner.back == 0(0HostLists allocated). With 6 threads during the world-entry burst (~200 lists/frame), all 6 workers race ahead of the submitting thread and materialize distinctHostList+ lazy prelude allocators for hundreds of queued recordings whileBURY_LAG=64submissions (~400–600 lists) holds landed lists beforerecycle()refillsIDLE/IDLE_CLOSED.test5:IDLE_CLOSEDran dry (closed by the line's thread: 109 -> 1,010), minting+773newID3D12CommandAllocators in 5 s (2,041live allocators /4,077command-list interfaces atL19137,0dropped),23,880objects trapped inBURY_LAG(10xthin-off-ok), and process commit hitting25,384 MBwith only1,865 MBphysical RAM free (L18532) on your 32 GB system!5 queuesand"a different Device Context"are:Host::queue(DIRECT, which hadbreadcrumbs []— idle at the moment of TDR) and 1 internal DXGI/D3D12 queue, Leonida holds 3 persistentCOPYqueues:LEONIDA_UPLOAD_AHEAD=1(texture/ahead.rs:200),LEONIDA_RELAY_COPY=1(host.rs:7047), andLEONIDA_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.rsBACKS+ in-flight allocator cap PR, these two zero-rebuild-Moreruns will immediately confirm which half triggersid=834/0x887A0007on your card:BURY_LAGand 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'}COPYqueues (isolates whether"a different Device Context"is aCOPYqueue 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).
Both runs done on
mainb83ad5433, same binary and cache, default 6 threads,-Log -More @{LEONIDA_LOG='info'; ...}. Run 6 did not reset; run 7 did.LEONIDA_BURY_LAG=8,LEONIDA_LIST_POOL=0,LEONIDA_CLOSED_AHEAD=0,LEONIDA_ALLOCATOR_TRIM=1,LEONIDA_ALLOCATOR_TRIM_S=5LEONIDA_UPLOAD_AHEAD=0,LEONIDA_RELAY_COPY=0,LEONIDA_WAIT_RESIDENT=00x887A0007,device-removed data; noneRun 7: the three COPY queues were off. The settings line shows all three switches at
0, andtextures uploaded ahead of the listsappears 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=1and 6 threads to get past world entry.THIN=0. Frame lines went up to 4,000–5,500 draws/frame, so the world was fully drawn.LIST_POOL=0, and probably explains the frame rate.what waits to be let gorose 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.THIN=0run 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.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):
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
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:
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.
Thank you @Quentin1814 for Runs 6 & 7, and @xMatiassekk for confirming the exact same RDNA 2
LEONIDA_THIN=1reset on RX 6700 XT!We rebuilt
b83ad5433with--profile diag --features diagnostics,mimallocto decodeleonida.exe+0x686665and audited how each Run-6 switch actually executed inlist.rs/host.rs:1. What
leonida.exe+0x686665is in Run 6leonida.exe+0x686665=leonida_gpu::port_descriptors::copy + 0x15(d3d12/crates/leonida-gpu/src/port_descriptors.rs:449) — the return instruction (MARKS.len.load(Acquire)atport_descriptors.rs:465) immediately aftercall raxintoVCRUNTIME140.dll!memcpyviaREAL[0].port_descriptors::copypassesrcx(dst),rdx(src), andr8(len = 0x10) straight through tomemcpyuntouched before doing its post-copy descriptor-mark check, sordx = 0x0arrived directly from the caller.test6-bury_lag8-pool0-trim5.log, zero Leonida D3D12 orxmemcalls failed (residencyatL34548:allocations failed for want of memory 0; commit critical in 0 of 4226 questions), and the crash dump atL34651–34656shows ~4.1 GiB physical RAM free and ~8.2 GiB commit headroom at the moment of the fault. So thesrc = NULLdereference at 3m 40s is title-internal (potentially stressed byLEONIDA_LIST_POOL=0creating/destroying 408,042 D3D12 command allocators & lists and holding gameplay at3.0 fps/610–855 mspresent latency), not a Leonida wrapper corruption or failed map/allocation. (Aside: thewriter=0x7ff94a0dc52b (not the title's)lines intest5/test6are faults inside wrappedmemcpy, which #3306 fixes.)2. What Runs 6 & 7 narrow down in
list.rs/host.rsUPLOAD_AHEAD=0,RELAY_COPY=0,WAIT_RESIDENT=0) cleanly eliminates Leonida's 3 streamingCOPYqueues (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).BURY_LAGobject count are ruled out as standalone triggers:thin-off-ok(644 MBmin free RAM,12,001 MBVRAM) andtest6(38 MBmin free RAM at153 s,11,901 MBVRAM, up to30,615pending-bury objects) both ran without GPU reset, whereastest5reset in 4 s with1,612 MBmin free RAM and9,859 MBVRAM right after 7×D3D12: Kernel memory failure (id=834).LEONIDA_CLOSED_AHEAD=0was a no-op inside Run 6, becauseIDLE_CLOSEDis only populated insidelist::recycle()(list.rs:395–402) afterif !pools() { return; }(list.rs:389).LEONIDA_ALLOCATOR_TRIM=1(TRIM_S=5) ran half-active in Run 6: the idle-pool let-go atlist.rs:421was skipped behindpools(), but per-resetallocator_refresh()(host.rs:3126, called fromHostList::resetathost.rs:9307and prelude record athost.rs:9757) is un-gated and replaced 1,941 host-list + 16 prelude allocators across 151 intervals.LEONIDA_LIST_POOL=1is back on,IDLE_CLOSED(list.rs:395–402) grabs up to 96 recycled lists beforeIDLE'sALLOCATOR_TRIMlet-go (list.rs:421) unlessLEONIDA_CLOSED_AHEAD=0is 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. KeepingLEONIDA_LIST_POOL=1restores full ~18 fps (eliminating the 209 lists/frame creation stall) and isolates the remaining active switches in two fast runs (@xMatiassekkif you want to try either on RX 6700 XT, that is super helpful too):LEONIDA_BURY_LAG=8alone at full ~18 fps (avoidsALLOCATOR_TRIM_S=5recreating/retiring every live allocator every 5 s on theid=834path):LEONIDA_BURY_LAG=8alone stops the RDNA 2 reset at full frame rate.LEONIDA_ALLOCATOR_TRIM=1/5and/orLEONIDA_CLOSED_AHEAD=0stops it at full frame rate (one follow-up splits the two).LEONIDA_BURY_LAG=8stops it, whileALLOCATOR_TRIM_S=5's 5 s allocator recreation churn was counterproductive at 18 fps.LEONIDA_LIST_POOL=0alone prevented the reset in Run 6, narrowing#3264strictly to post-executionHostList/ID3D12CommandAllocatorreuse onamdxc64.dllvs Run 6's lower ~3 fps submission rate/concurrency.AI-assisted: Gemini 4 Carbon (High) and Claude Opus 5.5 (High).
Thanks @zmasi, here are the results.
Both runs done on
mainb83ad5433, same binary and cache, default 6 threads,LEONIDA_LIST_POOLleft at its default (on),-Log -More @{LEONIDA_LOG='info'; ...}. Both reset at world entry.LEONIDA_BURY_LAG=8,LEONIDA_CLOSED_AHEAD=0,LEONIDA_ALLOCATOR_TRIM=1,LEONIDA_ALLOCATOR_TRIM_S=5submitting 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 removedLEONIDA_BURY_LAG=8submitting 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 5426Both are
0x887A0007withdevice-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 to157 of host lists at their resetsand0 idle host lists let go.By your table, that is the "both reset" case: of run 6's switches, only
LEONIDA_LIST_POOL=0was 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 runLEONIDA_LIST_POOL=0alone, 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
I'm still here after the move:
quentinophere,Quentin1814on GitHub.My build is unchanged. It is
b83f35c06here, which wasb83ad5433on GitHub; same content, only the hash changed with the history rewrite.LEONIDA_THIN=0still runs fine on the RX 6800 XT.The log zips above still link to GitHub. If those links stop working, I can attach them again here.
I can still run
LEONIDA_LIST_POOL=0alone, any other switch, or a PR, whenever @zmasi or anyone else picks this up.AI-assisted: write-up with Claude Opus 5.5 (High).
An update on this one, from in-game gate runs (
scripts/game-gate.ps1,-PlayArgs '-SeriesS', defaultLEONIDA_THIN=1at 6 threads unless said otherwise), RX 6800 XT:68427be7edevice_lost(0x887A0007) about 4.6 s after the world first draws983c7f678(now merged)device_lostabout 4.3 s after the world first draws68427be7eLEONIDA_RELAY=068427be7eLEONIDA_THIN=0So #3439 does not fix this one on RDNA 2, and
LEONIDA_RELAY=0is the first single switch that getsTHIN=1past world entry here, at 10 fps rather than run 6's 3 fps with five switches. But it is a single run, and relay 0 halves the frame rate (10 fps against 20 fps withTHIN=0), so like run 6 it may only pass because it is slow. Details and the 30-minute relay A/B are on #3403.Logs:
mandy-gate-main-rx6800xt.zip,mandy-gate-pr3439-rx6800xt.zip(on #3439) andmandy-3403-thin1-relay0-rx6800xt.zip(attached here).AI-assisted: log analysis and write-up with Claude Opus 5.5 (High).
An update on this one: #3031 (pooled command allocators) keeps the device on this card with the default
LEONIDA_THIN=1. With the PR's default, a 300 s gate run passed at 25.1 fps mean. The same executable withLEONIDA_ALLOCATOR_RING=0lost the device at world entry, as main does. PROVISIONAL (n=1 per arm). Details and logs: the DONE on #3031.If it is merged, I will run main again with the defaults and close this issue if it holds.
AI-assisted: log analysis and write-up with Claude Opus 5.5 (High).