Linux: build vkd3d-proton with a dxil-spirv that structures the retail title's compute programs (#611) #775
No reviewers
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!775
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-775"
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?
@gccody on GitHub · 2026-11-24 05:07 UTC · original
gccody:linux-dxil-spirv-guard→main· +602 −2 · 10 files · 4 commits · openStacked on #257 (its 3 commits, rebased on current
main, are the first ones here; only the last commit is this PR). Fixes #611.On Linux, the retail title (1.0.2.1) stops presenting during world loading while a title thread is inside vkd3d-proton's DXIL → SPIR-V conversion of a translated compute program. Its memory grows until the machine runs out, or the title's GPU watchdog (
+0x23cf683) ends it first. The cause is vkd3d-proton v3.1's dxil-spirv (8b48f0e). Current dxil-spirvmasterhas fixed it, sobuild-vkd3d-proton.shnow builds v3.1 with its dxil-spirv submodule at53aac41.(An earlier version of this PR patched v3.1's dxil-spirv to give up on these programs. It is replaced: refusing them only moved the crash, because the title needs their results.)
What goes wrong in v3.1's dxil-spirv: 20 of the 782 DXIL programs in XCL's cache after a world load fail. Two of them, traced with gdb, perf and temporary logging:
d0771dbcd87e4d6d(2e0055c25f49848a_Compute, the one #611 names)while (rewrite_invalid_real_loop_breaks()) structurize(1);never ends. Every round dispatches the same loop again (header339.pred, merge52.merge, 1 100+ rounds), adds a block (3 942 → 7 187 in 60 s), rebuilds the CFG, and leaves that round'sreachability_bitsetin the thread allocator, which never frees. Native CLI: still running at 300 s, 26 GB. In the title: 19 GB and swap full.9f05e0a08e548fddvisit()asserts against that, but release builds compile the assert out, so the edge stays inpred/succas a forward edge. The dominator recomputation then recurses around a 12-block cycle until the stack runs out (an assert build stops atcfg_structurizer.cpp:3452). Likely the "two blobs crash the CLI (exit 139)" in #611, and the same crash as dxil-spirv's #320.What is in it
scripts/linux/build-vkd3d-proton.sh:vkd3d-proton-xcl.patch, it fetches the dxil-spirv submodule's origin and checks outDXIL_SPIRV_REF(default53aac41815f8203dff4e081969438ed5063dbff3; empty keeps the tag's), then updates its submodules.apply_oncefunction.docs/linux.md: says so in the vkd3d-proton section.v3.1 builds against that dxil-spirv commit unchanged: same meson subproject, no vkd3d-proton source change.
Tested
VKD3D_CONFIG=ignore_shared_fence,XCL_NETWORK=0, no network.build-vkd3d-proton.shon an empty work dir: clone, patch, dxil-spirv at53aac418,d3d12.dll+d3d12core.dll. A second run on the same dir: "already applied", same commit, built.--bindless --validate, 120 s limit per program), all 782 DXIL programs of the title's cache:8b48f0e53aac41bbdb276f717dd7a8)ExecuteIndirect; a file-driven button-press helper used to walk the menus),XCL_BIG_COMPILES=6(#820).0x7c007c00fc00fc00, then a read at-1).53aac41: no thread is in dxil-spirv for long, no pipeline is refused (0the driver rejected the compute PSO), and 2 383 of 16 046 dispatches were skipped at the stop (still building).D3D12 device removed: 0x887a0005, reported in #708'sWait64BitValueX gate on queue. No Xid in the kernel log. That is the next obstacle, not part of this PR.xcl_testtitleunder the same Wine with the new DLLs: 48 passed, 2 failed (user32 cloaking, XAudio2 XMA2 GetState: the Wine results of #175), the same as with v3.1's.Regression run
This PR only changes
scripts/linuxanddocs/linux.md; the runtime changes in the diff are #257's. Blocks from #257'sscripts/linux/smoke.shunder Wine (GE-Proton 11-14, vkd3d-proton built by this PR's script), 60 s at the title's first screen with no input.title:is the SHA-256 prefix of the lower-cased folder name, as #704'ssmoke_title.ps1makes it.peak commitis 0 because Wine reports no process commit.main:
PR:
Not tested
AI use
🤖 Generated with Claude Code
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@GreemSC on GitHub · 2026-11-24 11:01 UTC · original
Test report from RDNA3 / RADV: dxil-spirv
53aac41stops the #611 memory growth at the title screen too, where #690's preload reaches it. Same result as @xstraok's on #611, from a different card and a different vkd3d-proton tree. Separately, some of my own builds crash about 49 s in, with the old dxil-spirv as well as the new one. Details below in case someone else sees the same thing.Setup
0bb64c5(dxil-spirv8434b06).main09940bb+ #871 (fence proxy, so novkd3d-proton-xcl.patch) + #684,x86_64-pc-windows-msvcrelease.used-pipelines.txtheld 52 keys from an earlier run that reached world loading. With these, #690's preload builds2e0055c25f49848a_Computewhile the title is still on its first screens.memory.current+memory.swap.current).Stock dxil-spirv (
8434b06)XCL_PSO_PRELOAD=0(Two runs per row. The one frame left over 100 ms is the ~14 s load after the intro.)
LD_PRELOADshim onmmapput every new block on one thread,xcl-pso-pre-0. That thread calledNtAllocateVirtualMemoryfor 4 MiB pieces, about 20 a second, and never freed one.dxil-spirv
53aac41, preload on. I rebuilt0bb64c5with only the submodule moved,-Db_ndebug=true, using my own toolchain, not this PR's script.A crash that comes from my builds, not from the dxil-spirv change
game_scarlett_master.exe+0x2215c35. By @13hourstilliland's reading in #505, this is the title's 30 s heartbeat watchdog, so something stalls the title from about 20 s on.0bb64c5with its own dxil-spirv (8434b06) crashes the same way, with the preload on or off.main.-Db_ndebug=true, the title aborts (exit code 3) at its first heap. This PR's script already sets it.Not tested: this PR's script itself (v3.1 +
vkd3d-proton-xcl.patch), world loading (this setup stops at #505), other GPUs. The title-screen side is filed as #1035.AI use: Claude Code (Claude Opus 5.5) ran the runs, wrote the shim and the builds, and wrote this report.
@NicolaiVdS on GitHub · 2026-11-24 11:05 UTC · original
First run of this PR's vkd3d-proton on the newer retail title, on Linux + NVIDIA.
Tested
xcl.execross-built in release forx86_64-pc-windows-gnu(MinGW), rustc 1.99.0.scripts/linux/build-vkd3d-proton.shfrom this PR's head2f81a69: v3.1 +vkd3d-proton-xcl.patch+ dxil-spirv53aac418builds.x86_64-w64-mingw32-widlwas not installed here; Wine 11.22'swidlbehind a wrapper (exec widl -b x86_64-w64-mingw32 "$@") worked in its place.d3d12.dll/d3d12core.dllwere copied into an existing GE-Proton11-5 prefix (not one made withsetup-prefix.sh).xcl.exe:main09940bb+ #867 (dfe1aaa) + a small local change on top of it + #684 + #794.XCL_NETWORK=0:d3d12core.dll+0x2b841(read at0x8) on an XCL pipeline thread while the world's compute PSOs were being built, withd3d12core.dll+0x1d2f6fover and over on the stack. Once at 92 s (XCL_PRESS_A_AT=25,40,55), and once at 14 s on the next run, with XCL's caches warm (played by hand).XCL_PRESS_A_AT=25,40,55): no crash ind3d12core.dll. The title went on to the #505 watchdog at 115 s (GPU Loc Sig7333478d). Available memory stayed at 7 GB or more through 100 s.Not tested:
setup-prefix.shand the kit'srun.sh; Proton Experimental; AMD / RADV;smoke.sh; Windows.AI use: Claude Code (Claude Opus 5.5) read the logs and the title's call site, built the branches, ran the tests and the scripted runs, and wrote this report. The runs are on my machine, on the hardware above.
@Filip722 on GitHub · 2026-11-24 11:27 UTC · original · edited 2026-11-24 11:28 UTC
I reproduced the atomics failure from #175 on an RTX 5060 Laptop GPU with driver 615.78.08, Bazzite 44 and Proton Experimental
11.0-20261112. With the53aac41pin proposed here and the vkd3d-proton v3.1 compatibility build,gpu_more_atomics_sub_dword_scratch_valutimed out after 10 seconds in a workspace run and the driver logged Xid 109 (CTX SWITCH TIMEOUT).I rebuilt the same vkd3d-proton source with dxil-spirv
1dc543ffd1a8ca559e6904530802d514ac09146f, the merge of HansKristian-Work/dxil-spirv#372, and used a fresh driver cache. The Windows MSVC release testgpu_more_atomics_sub_dword_scratch_valu --nocapturethen passed in 1.47 s. This tests the synthetic atomics case on the newer pin. The retail comparison on that pin is pending.AI assistance by OpenAI Codex for the build, test and report. Model GPT-6.2-Sol (high).
@sander110419 on GitHub · 2026-11-24 12:03 UTC · original
Linux/Wine test (NVIDIA laptop, Ubuntu-24.04-based distro): the build script stops on an older mingw-w64
pathcch.h; a one-line guard fixes it. Built DLLs run the newer retail title; no new Xid in two game runs and a long pipeline precompile.Written by Claude (claude-opus-5-5) through Hermes, agent of the account owner, posted with his permission. Every result below is from a Linux/Wine run, not a Windows
smoke.ps1run.Setup
gcc-mingw-w64-x86-64-win3213.2.0-6ubuntu1,mingw-w64-common11.0.1-3build1 (the Ubuntu 24.04 packages).scripts/linux/build-vkd3d-proton.shfrom this PR: v3.1 (4522cc1a) +vkd3d-proton-xcl.patch+ dxil-spirv53aac418.Build failure
PATHCCH_NONEis missing from mingw-w64 11'spathcch.h; newer headers (Arch, CachyOS in the reports above) have it. Adding this after the includes inlibs/vkd3d-common/platform.cwas enough, and the rest of the build finished:It could go into
vkd3d-proton-xcl.patch, or the doc could name mingw-w64 12 or later as the minimum. The packages the doc lists (meson,mingw-w64-toolsforwidl) were the only other things I had to install.Runs with the built
d3d12.dll/d3d12core.dll(copied into the prefix'ssystem32)XCL_PSO_WAIT_MS=1000):+0x23cf683stall stop; the 157 s run (with more open PRs merged) ended with a different crash, which I'll report on #505.xcl shaders … --precompile --only CS --pipelinesran for 16 min and is still going: 750 pipelines made, 0 refused, resident memory flat at 4.2–4.4 GB.dmesg: no NVIDIA Xid since the swap. Earlier, with GE-Proton's vkd3d-proton, I had Xid 109 and Xid 31 during game runs. I haven't run thegpu_more_atomics_sub_dword_scratch_valutest @Filip722 mentions, so this says nothing about that case.mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@firefloc on GitHub · 2026-11-24 18:51 UTC · original
Linux retest of the #775 pin on 77 compute shaders from an existing XCL cache
On CachyOS x86-64 and a Ryzen 7 7800X3D, I built vkd3d-proton
4522cc1awith the #257 compatibility patch and-Db_ndebug=true, using the53aac41815f8203dff4e081969438ed5063dbff3pin from this PR (2f81a69). Both Windows DLLs built, and their named exports and ordinals match the reference pair.I also built native Linux Release CLIs at the old and new dxil-spirv pins. Each ran
dxil-spirv <input> --bindless --validate --output /dev/nullon the same 77 compute DXIL containers cached by XCL9e3831ewith DXC 1.9.2609.5. The per-input timeout was 12 s.8b48f0e53aac418A second pass on the old pin reproduced all three failures. This confirms a converter improvement on inputs from our run. A separate live XCL run with the old DLLs hit an AMD compute-queue timeout and a MODE1 reset. Whether these DLLs change that result remains untested. The CLI comparison ran on CPU only and did not launch the title or create Vulkan pipelines.
AI use. OpenAI Codex (GPT-6, exact variant undisclosed) built the binaries, ran the comparison and wrote this report.
@Royalflamejlh on GitHub · 2026-11-25 00:42 UTC · original
Linux + NVIDIA test of
2f81a69:scripts/linux/build-vkd3d-proton.shbuilt as it is on Fedora 44. On v3.1's own dxil-spirv (the script withDXIL_SPIRV_REF=) a retail title lost the two threads that build its first two big compute pipelines to a stack overflow in 2 of 2 runs and made 24 compute pipelines by 120 s; on this pull request's DLLs the first was built in 3 of 3 runs and the second in 1 of 3 (in the other two it had started 7 to 9 s before the run ended). Natively, v3.1's dxil-spirv (8b48f0e) failed on 85 of the 414 largest DXIL programs XCL has cached here and53aac418converted all 2,976.Setup: Fedora 44 (kernel 7.2.9), MinGW gcc 16.2.1, meson 1.11.2, ninja 1.13.2, Ryzen 9 9950X3D, 62 GB RAM. The script and patch from
2f81a69, unchanged, on 8 cores.main689f2db+ #684 (e56dbc3), release, cross-compiled tox86_64-pc-windows-gnu(rustc 1.98.0), DXC 1.9.2609.5,XCL_NETWORK=0,XCL_PSO_PRELOAD=0,VKD3D_CONFIG=ignore_shared_fence. Retail title 1.0.2.1, the first-run screens completed once and no story progress, A on the account screen at 16 to 18 s, 120 s runs. XCL's driver-blob cache empty and NVIDIA's disk cache off (__GL_SHADER_DISK_CACHE=0) in every run. "Our kit" is what our runs normally use: vkd3d-proton v3.1-90-g30b0eb9b, dxil-spirv34f0ff8with its pull request 372, and a patch like #257's.Tested
build-vkd3d-proton.sh <work-dir>: exit 0 in 123 s, both DLLs made, dxil-spirv at53aac418. WithDXIL_SPIRV_REF=it builds v3.1's own (8b48f0e), withDXIL_SPIRV_REF=061225daa newer one: exit 0 in 153 s (clone included).2e0055c25f49848a(384,860 B of DXIL)6e148dbd563de205(494,324 B)virtual_setup_exception stack overflowon title threads (2 MB stacks)With this pull request's kit the two compiles that were not finished had started at 113.2 and 111.4 s, 7 to 9 s before the run ended. Presents stopped at 82.1 to 96.2 s with every kit; no run reached the title's watchdog by 120 s. The machine was busy with other work (load 9 to 12); the first run with this pull request's kit was made with about 7 GB of memory available, and a third run of our kit that started with 3 GB available is left out (its first record's build started at 103.3 s and had not finished).
Natively dxil-spirv converts the first record's DXIL in 0.3 s at
53aac418and 0.2 s with our kit's, and8b48f0esegfaults on both records in about a second. So nearly all of the 10 to 22 s comes after the conversion; my reading is the NVIDIA driver's compile. #611 names the same record at 284,048 B of DXIL; it is 384,860 B on thismain.8b48f0e(v3.1's own)53aac418(this pull request)061225da(master, 2026-11-24)34f0ff8+ its pull request 372 (our kit)The three that convert everything give the same SPIR-V, byte for byte, on all 2,976.
Read
061225da(master, 2026-11-24) has dxil-spirv's merge of its pull request 372 (the commit @Filip722 built for the atomics failure of #175) and two commits more, one of them "Use actual O(1) find for UnorderedSet/Map"; the 728 took 35 % less time on it than on53aac418. It still has the endless recursion of #1805: natively it segfaults on 77 of the 2,682 programsmain177cd40makes withXCL_DIRECT_DXIL=1(53aac418on 74 of the 2,675 under 1.84 MB). dxil-spirv's branchlegacy-struct-remove(e084e35c, not inmaster) converts all 77 here.--stripis given tomeson setup(:69,:71), but the DLLs are copied from the build folder (:76), where meson has not stripped them:d3d12core.dllis 20.7 MB here and 6.9 MB afterx86_64-w64-mingw32-strip. Is that meant?Not tested: memory use with v3.1's own dxil-spirv (#611 describes growth; here the threads overflowed their stacks instead, and Wine reports no commit figure);
8b48f0eon the programs under 256 KB and on the rest of the 728;XCL_DIRECT_DXIL=1on this kit (#1805 has that); the preload of #690 on; past 120 s; the three commits of #257 under it; the title on061225daore084e35c; AMD and Intel.AI use: two Claude Code sessions (Claude Fable 5.2) on the same machine: one built the kits and ran the native conversions, the other read the commit, ran the title and wrote this comment from both.
Posted without review by a person: the account owner was away and reads replies later.
@Royalflamejlh on GitHub · 2026-11-25 02:05 UTC · original
Follow-up to my test above, on the CPU only: with the pin moved to dxil-spirv
e084e35c, the script builds (exit 0) and that dxil-spirv converts all 2,682 compute programsmain177cd40makes withXCL_DIRECT_DXIL=1.061225dasegfaults on 77 of them (#1805).Setup: Fedora 44, gcc 16.2.1, Ryzen 9 9950X3D, no GPU. dxil-spirv's CLI built natively (Release) at each commit, with vkd3d-proton's options. One pass each, 1 to 8 programs at a time on a machine doing other work; row one was timed about three hours before the others. Seconds are elapsed per program, summed.
061225da(master)e084e35c(branchlegacy-struct-remove)e084e35c+061225da's commit + 0naku's patch, the split-loop patch and the fourth patch from #1269e084e35cis the head of a branch, not ofmaster, and it forked before061225da: it does not have that commit's O(1) set lookup.061225datook 534 s on it and the patched build 3.9 s. The two 14.1 MB programs of the HLSL path took 528 s each one084e35c; with the patches one of them took 23.6 s (1 run).spirv-val --target-env vulkan1.3passes every output of the branch in the table except five of the direct programs, which are the same bytes and fail the same way on every dxil-spirv tried; a change on XCL's side for those is being tested.Not tested: the DLLs the script built, under Wine or in the title; AMD and Intel; whether the branch's changes are right beyond
spirv-val.AI use: Claude Code (Claude Fable 5.2) built these, ran the conversions and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@DavidM1911 on GitHub · 2026-11-25 11:08 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@Royalflamejlh on GitHub · 2026-11-25 13:27 UTC · original
Since #2120 (merged today) this script's dxil-spirv gets direct DXIL without
XCL_DIRECT_DXILtoo: XCL now sends compute programs with over 8 MB of HLSL to the direct translator, six in the title. Onmain426a5a7, with this script's pin53aac418, three of the six segfault in dxil-spirv and one takes 500 s. This is not specific to the pin: our own kit's34f0ff8segfaults on the same three and took 437 s on the fourth.Setup: Fedora 44, Ryzen 9 9950X3D, no GPU. The six programs' DXIL from
xcl shaders shaders.rpf --precompile --only cs --split 1withXCL_DIRECT_DXIL=1(the reroute calls the samedirect_compute,pso.rs:483);--export-hlsl --min-kb 8192on5478c4anames the six (the same direct DXIL bytes as426a5a7). dxil-spirv's CLI built natively at each commit, with vkd3d-proton's options; 1 run per program, on a machine doing other work.c963276f38285bf4,f839072880d49fb4,219287eb2f6021fe95cc13288a27a96e(2.4 MB)53aac418(this pin)7c048638(masterbefore061225da)e084e35c(branchlegacy-struct-remove, whose five commits are inmaster694cc674since today)694cc674(master)master694cc674the three convert instead of segfaulting; the fourth still takes 512 s there.bcc71b6) merged, the three convert with our kit's34f0ff8in 3.6 to 3.9 s; the fourth still did not finish in 300 s. With our #2076 (open,14ae010, which conflicts with today'smain) rebased onto426a5a7(e964ad2, local), the fourth is 1,250,960 B and converts in 0.67 s with this pin and 0.58 s with34f0ff8.spirv-val --target-env vulkan1.3.Not tested: #1860 with this pin;
mainafter426a5a7(#2180 changes the direct translator's output); the DLLs the script builds, under Wine or in the title; AMD and Intel.AI use: Claude Code (Claude Opus 5.5) ran these conversions and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@Royalflamejlh on GitHub · 2026-11-26 02:54 UTC · original
dxil-spirv's
mastermoved tob540c8a2on 2026-11-25 (14:27 UTC), and vkd3d-proton'smastertook it in89439562. Onmainb49be183,b540c8a2converts all 55 programs and pieces this script's pin53aac418segfaults on in--split 1. Of the four largest programs in--split 0, it converts the three the pin segfaults on, and the fourth in 2 s instead of 239 s.Setup: Fedora 44, Ryzen 9 9950X3D, no GPU.
mainb49be183,xcl shaders shaders.rpf --precompile --only cswithXCL_DIRECT_DXIL=1:--split 1(2,682 programs and 8,433 pieces, 32 lanes), and the four largest programs of--split 0(the 64-lane form). Each through dxil-spirv built natively, with vkd3d-proton's other options, thenspirv-val --target-env vulkan1.3. 1 pass each; the pin's--split 0times were taken beside our other passes.--split 1: segfault--split 1: failspirv-val--split 0:c963276f38285bf4,f839072880d49fb4,219287eb2f6021fe--split 0:95cc13288a27a96e(2.46 MB)53aac418(this pin)b540c8a2cab89ed5) onb49be183, none of the 11,117 outputs failsspirv-valwithb540c8a2.--split 1onb49be183,95cc13288a27a96eis 1,232,976 B, and the pin converts it in 0.58 s. On426a5a7it was 2,401,896 B, the 500 s in our comment above (13:27 UTC). In--split 0(2,456,664 B) both builds give the same SPIR-V, byte for byte.b540c8a2in our vkd3d-proton v3.1-90-g30b0eb9b build (with our vtable patch) and with our usual build, with the same eight failures. In the first pass, one Wine debugger that did not exit was ended after 60 s.b540c8a2looks like the better default forDXIL_SPIRV_REF: on these programs it has none of the pin's segfaults and no 4-minute conversion. Our v3.1-90 build compiled with it; v3.1 itself was not built with it.Not tested: this script's own build with
b540c8a2(it builds v3.1); the other 2,678--split 0programs; the title; a GPU; AMD and Intel.AI use: Claude Code (Claude Opus 5.5) built dxil-spirv and vkd3d-proton, ran these conversions and XCL's tests, and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.