Linux (vkd3d-proton): dxil-spirv's CFG structurizer takes 20+ GB on two ~284 KB translated compute programs, so system memory runs out or the title's watchdog fires during world loading #611
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#611
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?
@xstraok on GitHub · 2026-11-24 02:30 UTC · original
A retail game (Series X profile, 1.0.2.1) on Linux (Wine + vkd3d-proton, RADV) stops presenting ~150 s into world loading. Then either system memory runs out (32 GB machine) or the title's watchdog fires (
0xc0000005 in game_scarlett_master.exe+0x23cf683 (write at address 0x0), as in #505 / #534).What happens.
XCL_THREAD_DUMP_ATshows one title thread ind3d12_device_CreateComputePipelineState. Below it the stack isvkd3d_shader_compile_dxil → dxil_spv_converter_run → CFGStructurizer::run → structurize → find_selection_merges → CFGNode::get_outer_selection_dominator → CFGNode::dominates_all_reachable_exits, the last frame recursing (symbols from the vkd3d-proton build).free_in_thread: "Don't bother freeing"), so the structurizer's working set only grows.Reproduced outside the game. I ran the native
dxil-spirvCLI (vkd3d-proton's submodule,8b48f0e0) over the 126 DXIL blobs in XCL's cache (dxil/*.dxil,dxil/translated/*_Compute_*):e55c11d728be9ebb.dxil(=translated/2e0055c25f49848a_Compute_0_4_0, 284 048 B) andcf9c9f793b127fa3.dxil(284 400 B).switches (dxc -dumpbin, 40 k lines).Possibly related: #560 (the AMD jump at the first wave of world compute pipelines), #533 (bounded compute pipeline waits), #172 (structured form instead of the
switch (pc)dispatcher, which would change the CFG these programs give dxil-spirv). I have not checked whether these two programs are pc-chain programs.Not known: whether #172 or a smaller HLSL shape avoids it. Also unknown: the slower growth earlier in loading (~150 MB/s, from ~80 s, anonymous 16 MB-multiple mappings at
0x13_…–0x20_…). It may also be compile memory that Wine's heap keeps, but that is not measured.Tested: RX 9060 XT (RDNA4, Mesa 26.2.6 RADV), Ryzen 5 7600, 32 GB RAM, Arch Linux, Proton Experimental Wine + vkd3d-proton 3.1 (#257). XCL
maina6f5f7a+ #257 + #458 + #496 + #484 + #610 (#575's clamp), release. 2 runs, both stalled the same way: one stopped by a RAM guard at 171 s, one hit the watchdog at 181 s.AI-assisted: Claude Code (Claude Opus 5.5) found the stack, built the dxil-spirv CLI, ran the scan and wrote this text. I made the runs.
github-bot referenced this issue2026-11-26 04:32:08 +00:00
@ddm-j on GitHub · 2026-11-24 05:18 UTC · original
dxil-spirv #371 (merged upstream 2026-11-23) fixes most of this: ≥10× faster on this title's largest compute shaders, and in game ~7-10× more pipelines get built per run. #257's kit still builds vkd3d-proton v3.1, which pins the old dxil-spirv.
dxil-spirv #371 ("rewrite the recursive algorithms to be as iterative as possible", fixing dxil-spirv #366: since the structurizer rewrite, large compute shaders need ~2x the stack) is not in vkd3d-proton v3.1 (dxil-spirv
8b48f0e, the pin you tested) nor in vkd3d-proton master yet (34f0ff8).Tested
mainf4ce27c+ #257 + #684, releasex86_64-pc-windows-gnu.8b48f0eand at53aac41(#371's merge), options close to vkd3d-proton on NVIDIA (--bindless --ssbo-uav --ssbo-srv --typed-uav-read-without-format --enable-shader-demote --subgroup-size 32 32), on the 20 largest compute DXIL files in XCL's cache (1.3-25 MB):53aac41, 8 MB stack: all 20 convert; 17 in 1-13 s, two in ~180 s, one in ~430 s; peak RSS 0.3-7 GB.53aac41, 1 MB stack (ulimit -s 1024, a Windows thread's size): 19 of 20; the one ~13 MB shader still segfaults.8b48f0e(sampled, stopped once the answer was clear): the smallest of the 20 over 900 s (timed out) vs 1.2 s; a ~5 MB one 108 s vs 11 s.30b0eb9withsubprojects/dxil-spirvat53aac41+ #257's patch builds clean. Three 300 s runs back to back with #690's preload: 340 / 417 / 483 pipeline sets recorded as used, against 45-49 with v3.1. At the stop, title threads now wait mostly on the driver's own compile (winevulkan), no longer in dxil-spirv's structurizer. The watchdog stop itself does not move yet (~100 s here).Suggestion for #257: build vkd3d-proton with dxil-spirv at or after
53aac41until a vkd3d-proton release carries it. Since one large shader still overflows a 1 MB stack, vkd3d pipeline creation is also safer on XCL's own workers with a big stack than on a title thread (theresolve_waitpath builds on the title's thread).Not tested
53aac41changes anything besides speed and stack use.AI use
@xstraok on GitHub · 2026-11-24 05:28 UTC · original
Confirmed on RADV. RX 9060 XT 16 GB (RDNA4, Mesa 26.2.6), Proton Experimental, vkd3d-proton v3.1 with
subprojects/dxil-spirvmoved to53aac418+ #257's patch, XCLf4ce27c+ #257 + #496 + #610 + #172 (+ #708 in the last runs): the 20+ GB structurizer runs and the hangs are gone in every run since (9 runs). The stop is now the same as yours. Thread dumps at the stop (real::build_compute→translated_compute_pso→dxc::compile, thend3d12core/winevulkan) show a title render thread compiling new ~870–910 KB-DXIL compute shaders one at a time on first bind, ~11 s each (DXC, then 3.1–3.4 s in the driver). A second render thread waits inpso_async::resolve_wait, the main thread waits on both, and the title's watchdog fires ~30 s later. A rerun takes the cached ones in ~10 ms and stops on the next new ones, so it is compile time, not a hang.+1 on bumping dxil-spirv in #257's kit. Closing this one since the upstream fix covers it; the first-bind compile stall is a separate problem.
(Drafted with Claude Code, Claude Opus 5.5; numbers from my runs.)
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175