main tip: jumps_to_outer_loop_heads_are_structured kills the whole lib test binary on Wine + RDNA3 (exit status 5), bisected to b8b1f49 #1246
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#1246
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?
@SlopTart on GitHub · 2026-11-24 13:41 UTC · original
What
Since
b8b1f49("Recompiler: jumps to outer loop heads and into loops are structured", direct on main), the testgpu::recomp::tests::jumps_to_outer_loop_heads_are_structuredkills the entire lib test process on Wine + RADV/RDNA3 instead of passing or failing. The whole--libsuite dies at that test; everything scheduled after it simply never runs.Bisect (plain main, no PR merges)
9a272d4(grandparent): full lib suite completes, 700 passed / 4 failed (the 4 are my rig's standing Wine-lane set, unrelated).b8b1f49: process aborts. Reproduced 5+ times across three unrelated PR lanes merged onto this main, plus 2/2 with--no-capture, plus 3/3 running the test completely solo:No panic, no assertion, no backtrace - the Wine process exits with status 5. In full-suite logs the death lands right after this shader compiles:
cs 77fbcdd16f57bc1f: 6272 B, format dxil(last of five CS compiles in that test; the four before it also appear:1ee4b7c7a64bfb8c,2d257fd6ea9d5cf5,4fd221ff6e98208e,822ffe8b5dba8c1b).gpu::tilingand every test before it in list order are exonerated: solo tiling module passes 3/3 onb8b1f49, and the solo repro above is minimal.Machine / environment
RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1 (
ignore_shared_fence), Rust crossx86_64-pc-windows-gnu, release profile,XCL_NETWORK=0, DXC pinned viaXCL_DXC_DIR. Counts only, no game data. My Linux rows: #42 / #718.Note
Native Windows/NVIDIA behavior of this commit is not measured by me. But on the Wine + RDNA3 axis this head is a hard stop for the whole test suite, and since CI runs only the description-template check, nothing upstream notices.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@tiagonogueiraa-bit on GitHub · 2026-11-24 13:50 UTC · original
I checked the translation side on the CPU, without a GPU. Conclusion: the HLSL this test emits computes the right result and ends quickly, so the abort is more likely in the host (vkd3d-proton / RADV) than in the structurer.
How: I built
gpu::rdna2+gpu::recompfrom main930e8b4on their own (macOS; DXC, D3D12 and the runner stubbed out). I ran the test's program generator with the same xorshift seed, drawing the four initial SGPRs per round as a GPU run does. For every round I translated both forms. I compiled the body of eachmain()as C++, one lane, withselect/lanebit/io.Load/res.Storeshimmed, and ran it on the round's initial state withs20 = 60and exec all ones. Separately, a small interpreter ran the round's RDNA2 binary directly from the GFX10 encodings.Results for all 120 rounds:
s0–s23,scc,v1–v3in all 120.s20. Those programs have no loop, so they never touchs20and it is not stored (an artifact of my harness, not a test failure).main()bodies (855 of them) starts with thexcl_budgetcheck. The most any round used was 91 of the 65 536 iterations.If the log's compile order holds (two compiles per round, structured first), the 5th CS is round 2's structured form. Its body nests 7 deep, with 2 skip flags and 1
continue. Its result matches the dispatcher and the reference too. So a test that skipped this one program would only hide whatever makes vkd3d-proton / ACO bring the process down on it. An ACO or vkd3d log for that pipeline (e.g.RADV_DEBUG=hangorVKD3D_DEBUG=traceon the solo run) would show which.Written with Claude Code (Claude Opus 5.5). It built the harness and ran the checks above.
@Diskuss on GitHub · 2026-11-24 13:51 UTC · original
Native Windows data point: AMD Radeon RX 9070 XT (RDNA4), Adrenalin driver 32.0.32015.7029; Ryzen 7 5700X3D; 32 GB RAM; Windows 11 Pro build 26300.9974; Rust 1.100.0 x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug build.
Tested origin/main at
930e8b49c1c2ec683d22c724a398b39111cd0e56(b8b1f49is an ancestor).cargo test -p xcl --lib jumps_to_outer_loop_heads_are_structured -- --test-threads=1, run 10 times: 10/10 passed (1 passed, 0 failed each), exit code 0 every time.cargo test -p xcl --lib --no-fail-fast -- --test-threads=4, run once: 707 passed, 0 failed, 21 ignored, exit code 0. No panic, abort or abnormal exit code (no 0xc0000005, no stack overflow).The crash does not reproduce on native Windows with AMD Adrenalin. That points to Wine/RADV (or the Wine-specific stack) rather than the recompiler change itself. I did not test Wine or Linux.
AI use: Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine.
@SlopTart on GitHub · 2026-11-24 14:09 UTC · original
Follow-up from the RDNA3/Wine rig: the traces requested are in, and they name the layer.
RADV_DEBUG=hang (solo run): no GPU hang, no context reset, nothing from the hang detector. The driver side stays clean - the process just dies.
WINEDEBUG=err+all,seh+all: the exit-status-5 is a swallowed segfault:
Symbolized backtrace (DWARF from our own vkd3d-proton v3.1 build; the installed
d3d12core.dllsha256-matches that build,d403458d...):So the fault is inside the embedded dxil-spirv (vkd3d-proton v3.1's DXIL-to-SPIRV translator), in the CFG structurizer's post-dominator recomputation, on the pipeline-creation path. Not RADV, not ACO, not Wine's SEH plumbing, and consistent with the interpreter analysis above: the structured program's semantics are fine, it is the CFG shape that dxil-spirv's
rewrite_invalid_real_loop_breakspath mishandles on a null CFGNode.That fits Diskuss's 10/10 clean native runs too: native Windows uses the real d3d12 runtime, no dxil-spirv involvement.
Caveats stated honestly: our vkd3d-proton is v3.1 with XCL's local patches (shared-fence config work), so one open question is whether a newer vendored dxil-spirv already handles this CFG shape. On this rig the crash is deterministic (3/3 solo), so a vkd3d-proton/dxil-spirv bump is easy to A/B against the same test.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, release profile. Counts only, no game data.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@DavidM1911 on GitHub · 2026-11-24 14:17 UTC · original
Data point from native Windows (not Wine):
jumps_to_outer_loop_heads_are_structuredpasses solo and the full--lib d3d12x/recompfilters are clean onmain930e8b4, RTX 3060 Ti, DXC 1.8.2502.11. So the exit-status-5 death looks specific to the Wine/RADV lane rather than the shader itself — consistent with your bisect pointing atb8b1f49only under Wine.@SlopTart on GitHub · 2026-11-24 14:36 UTC · original
Fix-recipe datapoint: the crash disappears when only the vkd3d-proton build changes.
A/B on the same
b8b1f49checkout, same rig, same DXC, nothing else touched:d3d12core.dllsha256d403458d...): sologpu::recomp::tests::jumps_to_outer_loop_heads_are_structured3/3 exit status 5 (the original repro above).ec207194(whose tip commit is literally "dxil-spirv: Update submodule"; cross-built withbuild-win64.txtand-Db_ndebug=true, same XCL patch, onlyd3d12.dll+d3d12core.dllswapped into the prefix): same solo test 3/3 ok (7.15s / 4.34s / 4.31s).So the null deref in
CFGNode::find_common_post_dominatorfrom our symbolized trace is already fixed by the newer vendored dxil-spirv on vkd3d-proton master, and anyone hitting this under Wine can dodge it by building current vkd3d-proton master with the XCL vtable patch. No driver, Mesa, or xcl change needed to dodge it.If useful I can bisect the dxil-spirv submodule between v3.1's pinned commit and
199cb207to name the exact upstream fix, or verify a future pinned bump on this rig.Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@SlopTart on GitHub · 2026-11-24 15:39 UTC · original
Bisected the crash to an exact upstream dxil-spirv commit, and hit a repro pitfall worth sharing.
Bisect result. Held vkd3d-proton at v3.1 + the XCL patch and swapped only the vendored
subprojects/dxil-spirvbetween the v3.1 pin (8b48f0e0) and master's current pin (7c048638), 104 commits. Per commit: ninja rebuild, DLL swap, solo run ofgpu::recomp::tests::jumps_to_outer_loop_heads_are_structured, cache cleared before every run.2d0df0ce"Add a way to exercise running the resulting SPIR-V through e.g. Mesa." - exit 5, 3/371967a38"Rewrite the structurizer from scratch." (Hans-Kristian Arntzen, 2026-10-13) - pass, 3/3The fix is only 5 commits past the v3.1 pin. That matches my earlier symbolized stack exactly: the fault was
CFGStructurizer::rewrite_invalid_real_loop_breaks->CFGNode::find_common_post_dominatorreadingnull+0x118, and the rewrite replaces that machinery wholesale. Any vendored dxil-spirv at or after71967a38should clear this crash on Wine; a pinned bump is the cleanest remedy for affected builds.The pitfall. vkd3d-proton's pipeline disk cache is
vkd3d-proton.cache, opened relative to the test's cwd (with cargo, that is the crate dir, not the workspace root). One successful compile of the crashing pipeline writes it; every later run then hits the cache and skips dxil-spirv entirely, so an A/B DLL swap looks green no matter which build is installed. The tell is timing: cache-hit runs finished in a flat 4.1-4.3 s, real compiles took 6.1-7.0 s, and crashing runs never write the entry. This produced a convincing fake "the crash vanished" for about two hours on this rig until I started deleting the cache file between trials. Cold-cache re-measurement after the fact: v3.1 pin exit 5 four times (original DLL and fresh rebuilds alike), master pin pass twice.Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1,
XCL_NETWORK=0, release profile. Counts only, no game data. See my Linux rows in #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@crastinator on GitHub · 2026-11-24 14:04 UTC · original · edited 2026-11-24 19:20 UTC
Where it dies: inside vkd3d-proton's DXIL → SPIR-V conversion, in dxil-spirv's CFG structurizer. vkd3d-proton v3.1's own dxil-spirv reproduces it, and the dxil-spirv pinned by #775 does not.
Tested on
main930e8b4dxgi, DXC 1.9.2609.5,VKD3D_CONFIG=ignore_shared_fence. Cross-built forx86_64-pc-windows-msvc(clang-cl / lld-link, xwin SDK), Rust 1.99.1, debug.-Db_ndebug=true(llvm-mingw 20261117):8b48f0e): the test alone fails 3/3, exit status 5, the same as yours.WINEDEBUG=+sehshows an access violation ind3d12core.dll. The DLL keeps its symbols, and the stack is: That is therewrite_invalid_real_loop_breaksloop #775 describes for #611, now reached by the programs this test generates. It also fits @tiagonogueiraa-bit's finding that the HLSL itself is fine, and with Windows passing.53aac418(#775'sbuild-vkd3d-proton.sh): the test alone passes 3/3 (about 7–9 s each).--lib --test-threads=1: 702 passed, 5 failed, 21 ignored. The 5 are the Wine-lane ones with open PRs: #530 ×2, #676, #890 ×2.--lib --test-threads=4, 2/2 runs) this test fails withkernel dispatch: D3D12 device removed (0x80004005). 7 D3D12.X tests running next to it then fail (0x887A0005/PoisonError): 3 insparse, 3 intitle_textures, andvram::d32s8_targets…. With--skip jumps_to_outer_loop_heads_are_structured, one parallel run had 7/7 of them passing. In the other, 3 failed (placed_title_textures_share_vram_and_preserve_pixels,transitions_apply_when_their_list_is_submitted,d32s8_targets…), which looks like the #718 flake. The kernel log has no amdgpu reset or timeout for these runs.Not tested
AI use
Update: the parallel device removal comes from another test. It isn't caused by this test itself.
The partner is
hle::d3d12x::list_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu. Running just those two tests together (--test-threads=2 --exact <both>) fails 3/3: this test getskernel dispatch: D3D12 device removedafter about 0.15 s. Pairing this test with every otherlist_xtest, and withsparse,vram,real,bind,gpu::textureandgpu::uma, passes. Each of the two passes alone.The trigger is the
VirtualFree(mem, 0, MEM_RELEASE)at the end ofwrite_buffer_immediate_…. That frees the memory it opened withOpenExistingHeapFromAddress, while this test's GPU work on the same device (vkd3d-proton hands back the one device per adapter) is still running. Local experiments, 3 runs each:MEM_WRITE_WATCH: still 3/3 failSo it isn't a release that has not happened yet, and it isn't the write watch. Unmapping host memory that was imported (
VK_EXT_external_memory_host, an amdgpu userptr on RADV) breaks work in flight on that device, even after the heap over it is gone. The kernel log shows no amdgpu reset. The device is not lost for good either: in a--test-threads=1run, the D3D12.X tests after it pass.With
--skip write_buffer_immediate_on_open_existing_heap_visible_to_cpu, the full--lib --test-threads=4run (4 runs) no longer shows the device removal or the 7-test cascade. Every run has the 5 known Wine-lane failures, and 2 of the 4 had one more failure I did not capture.XCL's own UMA windows stay mapped for the life of the process, so this looks like a test-suite problem only. I have not checked the retail title.
A test-side fix would be to keep that test's 64 KiB mapped under Wine (
util::under_wine(), as in8fde77a), or for the whole process. I can open that as a test-only PR if that's the direction you want. The underlying behaviour is a Wine / vkd3d-proton / RADV matter.Correction (2026-11-24, later): the parallel device removal above is a resource leak in the test itself, not a release that happened later than it should. #1520 (@wileyGray) found it: the test's four transition barriers held clones of the resource inside
ManuallyDrop, so the imported heap was never released when the test freed its memory. That's why dropping everything I could see did not help. With #1520 the pair passes 3/3 here and the 7-test cascade is gone (details on #1520). So the test-side workaround I offered above isn't needed.@pablogonz12 on GitHub · 2026-11-25 19:57 UTC · original
Same class of abort on RDNA4 (this report is RDNA3), and it is at least nine tests, not one — each abort takes the whole lib test binary down, so the Wine lane cannot run the suite at all. Prepared with AI assistance: DeepSeek V4.1 Flash in OpenCode; the runs below were done by it.
Setup: CachyOS, kernel 7.3.6, Mesa 26.3.1-5 (
RADV GFX1201), RX 9070 XT, GE-Proton11-14 wine (Wine 11.0), scratch prefix, release msvc static build,main2898511(and the same with several open PR heads merged on top — identical).Build and run:
The first abort (exit status 5), as in the report:
With that one passed to
--skip, the next run stops at the next member of the same group, and so on; seven in total, all exit status 5:and after those, a different exit status — 3 instead of 5 — at
jumps_to_outer_loop_heads_are_structured(the test this report bisected tob8b1f49) also aborts with exit status 5, and the twoops_testsones abort even before anydispatch_chaintest runs when they are the ones selected. Everything that does run before the abort passes on this box except the three knowngpu::recompfailures (f32_programs_on_the_gpu,f64_programs_on_the_gpu,gpu_nonfused_mad_and_mac_prevent_fma_contraction, the last one #472).I could not tell whether these share the bisected cause or whether the split/
dispatch_chaingroup is a second, separate abort: skipping one test moves the crash to the next in the same group, which points at something those tests share.f32/f64_programs_on_the_gpubeing red here too may be the same thing, since they compile large programs.Not tested: Windows, RDNA3, other Wine versions (GE-Proton11-14 only); no game run. No workaround is proposed here.
@pablogonz12 on GitHub · 2026-11-25 21:36 UTC · original
More from the same RDNA4 + Wine lane (Wine 11.0 staging under GE-Proton11-14 with vkd3d-proton 3.2.0, Mesa 26.3.1-arch3.5
RADV GFX1201, RX 9070 XT): the abort is not limited to the lib test binary.On
main6d12f58, clean checkout, no PR applied:gpu::dxil::module::split::tests::dispatch_chain --test-threads=1: exit 5, notest resultline (as before).gpu_compute_e2e(integration): 5 passed, 1 failed, 1 skipped (no heap windows). The failure isoffline_split_compute_pipeline_is_reused_by_a_second_process, panicking atcrates/xcl/tests/gpu_compute_e2e.rs:195withprecompiling 1 shaders into C:\users\steamuser\AppData\Local\Temp\xcl-offline-split-pso-....direct_compute_dispatch_split_matches_unsplit_across_wave32_and_wave64,console_split_compute_pso_dispatches_through_d3d12x_hook_and_reuses_scratch) also exit 5 right at the first GPU dispatch; the details are on that PR.Other GPU paths do run on this lane: 64-bit typed
IMAGE_ATOMIC_*operations pass 3/3 with noSKIPPEDon the same prefix and driver (reported on #2488), so this reads as specific to the split/dispatch-chain compute path.Prepared with AI assistance: DeepSeek V4.1 Flash (OpenCode) ran the commands above and wrote this; no code was written.