Linux: dxil-spirv asserts on the DXIL of jumps_to_outer_loop_heads_are_structured (b8b1f49), the suite crashes under vkd3d-proton #1425
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#1425
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?
@Tjabooo on GitHub · 2026-11-24 15:48 UTC · original
On Linux (Wine + vkd3d-proton),
gpu::recomp::tests::jumps_to_outer_loop_heads_are_structured, added withb8b1f49, crashes the test process. So everycargo test -p xcl --librun on RADV / vkd3d-proton stops there. A title shader with the same control flow would end the same way.What fails: dxil-spirv's CFG structurizer, inside vkd3d-proton (
d3d12core.dll), on the DXIL of that test's compute program:Unhandled page fault on read access to 0000000000000118atd3d12core.dll+0x1AB325, so the whole test binary dies;-Db_ndebug=false, dxil-spirv8b48f0e0):So a block that already has a back edge from one loop gets a second, different one: the jump to an outer loop's head from inside an inner loop. Native Windows drivers take this DXIL. dxil-spirv has to restructure it for Vulkan and can't.
Repro (no game data):
main930e8b4, cross-built forx86_64-pc-windows-gnu, run under Wine with vkd3d-proton (the setup in #175 / #257):AMD RX 9070 XT (RDNA4), RADV / Mesa 26.2.6, Arch Linux, Wine 11.21, DXC 2026_09_29. It happens in shader translation, before the GPU is involved, so other GPUs under vkd3d-proton should hit it too. Before
b8b1f49(dd2ae9a) the suite ran through on this machine.Why it matters beyond the test:
Options I can see: emit the outer-loop jump in a form dxil-spirv can structure (for example a flag that breaks the inner loop and then
continues the outer one, as the structured code beforeb8b1f49did), or report it upstream to dxil-spirv with this DXIL as the reproducer. I can do the upstream report and test either fix on RDNA4 / RADV.AI-assisted (Claude Code, Claude Opus 5.5); all results above are from runs on this machine.
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:51 UTC · original
This looks like the root cause of #1246, the same test killing the suite under Wine + RDNA3 with exit status 5. There I checked the translation side on the CPU: for all 120 programs of the test, the structured HLSL gives the same final state as the dispatcher form and as a reference run of the binary. Every loop also carries the budget guard (https://github.com/ivall/xcl/issues/1246#issuecomment-7133410300). So the HLSL is correct, and the failure is dxil-spirv's structurizer on this shape, as your assert shows. A fix on XCL's side would be about the form (a flag that leaves the inner loop and then continues the outer one), not about correctness.
Written with Claude Code (Claude Opus 5.5).
@Tjabooo on GitHub · 2026-11-24 16:05 UTC · original
Reproduced outside Wine and XCL: the standalone
dxil-spirvCLI (Debug build of8b48f0e0) hits the same assertion on this test's DXIL alone (the 5.5 KB dump vkd3d-proton writes before it dies). It is the same assertion as dxil-spirv #267 (fixed in December 2025), so this is a new path to it. Reported upstream: https://github.com/HansKristian-Work/dxil-spirv/issues/375@Tjabooo on GitHub · 2026-11-24 16:30 UTC · original
Resolved upstream: dxil-spirv master no longer asserts on this DXIL (HansKristian-Work/dxil-spirv#375, closed). It is fixed in dxil-spirv, not in XCL, so vkd3d-proton v3.1 only needs a newer dxil-spirv.
Confirmed here: vkd3d-proton v3.1 + #257's patch, with its
subprojects/dxil-spirvmoved to master7c048638(git -C subprojects/dxil-spirv checkout origin/master && git submodule update --init --recursive, then rebuild). RX 9070 XT, RADV / Mesa 26.2.6, Wine 11.21,mainb7aa9f3:jumps_to_outer_loop_heads_are_structured: ok.cargo test -p xcl --lib -- --test-threads=4now runs to the end: 718 passed, 4 failed, 21 ignored, 0SKIPPED. Three of the failures are known (gpu_f64_rootsandgpu_f64_math_random(#530),gpu_nonfused_mad_and_mac_prevent_fma_contraction(#676)). The fourth,gpu_depth_buffer_created_for_unordered_access_is_placed(UNORDERED_ACCESS without the UAV flag,device_x.rs:1113), is new to me and looks like a separate vkd3d-proton difference. I'll look into it separately.For the Linux guide (#257): building vkd3d-proton with dxil-spirv master (or the next vkd3d-proton release that picks it up) avoids this crash. Closing this, since there is nothing to change in XCL.