Linux: dxil-spirv asserts on the DXIL of jumps_to_outer_loop_heads_are_structured (b8b1f49), the suite crashes under vkd3d-proton #1415

Closed
opened 2026-11-24 15:48:53 +00:00 by Tjabooo · 3 comments
Tjabooo commented 2026-11-24 15:48:53 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by Tjabooo on 2026-11-24T15:48:53Z.


On Linux (Wine + vkd3d-proton), gpu::recomp::tests::jumps_to_outer_loop_heads_are_structured, added with b8b1f49, crashes the test process. So every cargo test -p xcl --lib run 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:

  • vkd3d-proton v3.1 release build (asserts compiled out, as in #257's build): Unhandled page fault on read access to 0000000000000118 at d3d12core.dll+0x1AB325, so the whole test binary dies;
  • the same source as a debug build with assertions (-Db_ndebug=false, dxil-spirv 8b48f0e0):
    Assertion failed: !succ->pred_back_edge || succ->pred_back_edge == &entry, file ../subprojects/dxil-spirv/cfg_structurizer.cpp, line 3452
    

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): main 930e8b4, cross-built for x86_64-pc-windows-gnu, run under Wine with vkd3d-proton (the setup in #175 / #257):

cargo test -p xcl --lib --target x86_64-pc-windows-gnu -- jumps_to_outer_loop_heads_are_structured --test-threads=1

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:

  • For Linux and Steam Deck players, any console program whose translation produces this shape crashes the title at pipeline creation under vkd3d-proton.
  • For #1269: the direct DXIL backend has to get through the same structurizer on Linux, as @itsd-effex pointed out there. This test is a small, game-free case for it.

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 before b8b1f49 did), 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.

<!-- greyfinch-sync:ivall/xcl:issue:6585744058 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/1425). Originally posted by [Tjabooo](https://github.com/Tjabooo) on 2026-11-24T15:48:53Z. --- On Linux (Wine + vkd3d-proton), `gpu::recomp::tests::jumps_to_outer_loop_heads_are_structured`, added with b8b1f49, crashes the test process. So every `cargo test -p xcl --lib` run 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: - vkd3d-proton v3.1 release build (asserts compiled out, as in #257's build): `Unhandled page fault on read access to 0000000000000118` at `d3d12core.dll+0x1AB325`, so the whole test binary dies; - the same source as a debug build with assertions (`-Db_ndebug=false`, dxil-spirv `8b48f0e0`): ``` Assertion failed: !succ->pred_back_edge || succ->pred_back_edge == &entry, file ../subprojects/dxil-spirv/cfg_structurizer.cpp, line 3452 ``` 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): `main` `930e8b4`, cross-built for `x86_64-pc-windows-gnu`, run under Wine with vkd3d-proton (the setup in #175 / #257): ``` cargo test -p xcl --lib --target x86_64-pc-windows-gnu -- jumps_to_outer_loop_heads_are_structured --test-threads=1 ``` 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:** - For Linux and Steam Deck players, any console program whose translation produces this shape crashes the title at pipeline creation under vkd3d-proton. - For #1269: the direct DXIL backend has to get through the same structurizer on Linux, as @itsd-effex pointed out there. This test is a small, game-free case for it. 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 `continue`s the outer one, as the structured code before b8b1f49 did), 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 commented 2026-11-24 16:07:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by tiagonogueiraa-bit on 2026-11-24T15:51:06Z.


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).

<!-- greyfinch-sync:ivall/xcl:comment:7136719593 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/1425#issuecomment-7136719593). Originally posted by [tiagonogueiraa-bit](https://github.com/tiagonogueiraa-bit) on 2026-11-24T15:51:06Z. --- 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 commented 2026-11-24 16:07:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Tjabooo on 2026-11-24T16:05:48Z.


Reproduced outside Wine and XCL: the standalone dxil-spirv CLI (Debug build of 8b48f0e0) 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

<!-- greyfinch-sync:ivall/xcl:comment:7137110864 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/1425#issuecomment-7137110864). Originally posted by [Tjabooo](https://github.com/Tjabooo) on 2026-11-24T16:05:48Z. --- Reproduced outside Wine and XCL: the standalone `dxil-spirv` CLI (Debug build of `8b48f0e0`) 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 commented 2026-11-24 17:06:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Tjabooo on 2026-11-24T16:30:02Z.


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-spirv moved to master 7c048638 (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, main b7aa9f3:

  • jumps_to_outer_loop_heads_are_structured: ok.
  • cargo test -p xcl --lib -- --test-threads=4 now runs to the end: 718 passed, 4 failed, 21 ignored, 0 SKIPPED. Three of the failures are known (gpu_f64_roots and gpu_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.

<!-- greyfinch-sync:ivall/xcl:comment:7137761678 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/1425#issuecomment-7137761678). Originally posted by [Tjabooo](https://github.com/Tjabooo) on 2026-11-24T16:30:02Z. --- 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-spirv` moved to master `7c048638` (`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, `main` `b7aa9f3`: - `jumps_to_outer_loop_heads_are_structured`: **ok**. - `cargo test -p xcl --lib -- --test-threads=4` now runs to the end: 718 passed, 4 failed, 21 ignored, 0 `SKIPPED`. Three of the failures are known (`gpu_f64_roots` and `gpu_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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#1415
No description provided.