Linux/Proton: translate --cache --pipelines aborts (std::terminate in dxil-spirv, HansKristian-Work/dxil-spirv#383) #3099

Open
opened 2026-11-26 08:02:11 +00:00 by arogan178 · 3 comments
arogan178 commented 2026-11-26 08:02:11 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-26T08:02:11Z.


What

Under Proton, victory translate --cache --pipelines dies partway through with terminate called without an active exception (exit 3). The cause is a converter bug in vkd3d-proton, tracked upstream as HansKristian-Work/dxil-spirv#383. One title shader makes dxil-spirv call std::terminate(), and under Wine that ends the whole process instead of refusing one pipeline.

How it shows

  • Series X 1.0.2.1, RX 9070 XT, Mesa RADV, CachyOS, Proton Experimental bleeding-edge 11.0-20261125 (vkd3d-proton 71cae0), cross-built release victory.exe.
  • The shader step finishes (25,756 translated, 229 refused, 1.3 GB). The pipeline step aborts around pipeline 1,200 of 27,145 on every attempt, sooner with more workers. The last line before it is title pipelines to start early or a progress line.
  • WINEDEBUG=+seh shows raise (22) (SIGABRT) on a worker thread. Of the PE modules loaded, only d3d12core.dll contains the terminate message.
  • With VKD3D_SHADER_DUMP_PATH, exactly one of 1,357 DXIL modules has no .spv. Converting it with dxil-spirv master b540c8a2 reproduces the abort offline: Invalid type ID in cast<T> in fixup_load_type_typed, on a textureLoad.f32 whose resource has been given component type U64 (64-bit atomics).

Impact

  • No pipeline prebuild on Linux. A run makes pipelines on worker threads instead, so the first minutes in the world are black or have missing draws while about 300 pipelines a frame queue up.
  • If a run reaches the same pipeline, it would end the same way. My prologue runs did not reach it.

Workaround

Skip --pipelines (translate --cache alone works) and let the run make the pipelines it needs.

Fix

The cause is in our emitter, not dxil-spirv (see the comments below). The heap-handle caches in emit/lower.rs key a handle on the first property word only, so an f32 image_load and a 64-bit image atomic through one descriptor share a handle declared RWTexture2D<4xF32>. That is invalid DXIL: a 64-bit image atomic needs an R32G32_UINT resource. #2723 keys the caches by both property words; with it, all 27,135 pipelines build under stock Proton. dxil-spirv#383 was closed upstream as invalid input.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6622186846 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3101). Originally posted by [arogan178](https://github.com/arogan178) on 2026-11-26T08:02:11Z. --- ## What Under Proton, `victory translate --cache --pipelines` dies partway through with `terminate called without an active exception` (exit 3). The cause is a converter bug in vkd3d-proton, tracked upstream as HansKristian-Work/dxil-spirv#383. One title shader makes dxil-spirv call `std::terminate()`, and under Wine that ends the whole process instead of refusing one pipeline. ## How it shows - Series X 1.0.2.1, RX 9070 XT, Mesa RADV, CachyOS, Proton Experimental bleeding-edge 11.0-20261125 (vkd3d-proton `71cae0`), cross-built release `victory.exe`. - The shader step finishes (25,756 translated, 229 refused, 1.3 GB). The pipeline step aborts around pipeline 1,200 of 27,145 on every attempt, sooner with more workers. The last line before it is `title pipelines to start early` or a progress line. - `WINEDEBUG=+seh` shows `raise (22)` (SIGABRT) on a worker thread. Of the PE modules loaded, only `d3d12core.dll` contains the terminate message. - With `VKD3D_SHADER_DUMP_PATH`, exactly one of 1,357 DXIL modules has no `.spv`. Converting it with dxil-spirv master `b540c8a2` reproduces the abort offline: `Invalid type ID in cast<T>` in `fixup_load_type_typed`, on a `textureLoad.f32` whose resource has been given component type `U64` (64-bit atomics). ## Impact - No pipeline prebuild on Linux. A run makes pipelines on worker threads instead, so the first minutes in the world are black or have missing draws while about 300 pipelines a frame queue up. - If a run reaches the same pipeline, it would end the same way. My prologue runs did not reach it. ## Workaround Skip `--pipelines` (`translate --cache` alone works) and let the run make the pipelines it needs. ## Fix The cause is in our emitter, not dxil-spirv (see the comments below). The heap-handle caches in `emit/lower.rs` key a handle on the first property word only, so an f32 `image_load` and a 64-bit image atomic through one descriptor share a handle declared `RWTexture2D<4xF32>`. That is invalid DXIL: a 64-bit image atomic needs an R32G32_UINT resource. #2723 keys the caches by both property words; with it, all 27,135 pipelines build under stock Proton. dxil-spirv#383 was closed upstream as invalid input.
BastienRodz commented 2026-11-26 09:06:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-26T08:16:07Z.


This one looks like our emitter, and open PR #2723 already removes it.

On main 63bcca4, the three heap-handle caches in emit/lower.rs (handles, entry_handles, join_handles) key a handle on the first property word only. An f32 image_load on a UAV (kind|0x1000, 0x409) and an image atomic (kind|0x1000, 0x105) through the same descriptor therefore share one handle, annotated {4098, 1033} (RWTexture2D<4xF32>). dxil-spirv then marks the handle an atomicBinOp.i64 uses as 64-bit (emit_global_heaps forces ComponentType::U64), and the textureLoad.f32 on that same handle aborts in fixup_load_type_typed. The { i32 4098, i32 1033 } on the atomic's UAV that dxil-spirv#383 shows is that output; without the shared handle, the atomic would be annotated {4098, 261}.

Synthetic repro: a compute program with an R32G32 UAV texture read by image_load (dmask 0xF) and by a 64-bit image_atomic_umax. It was tested at a fixed address, load first and atomic first, at an address offset by a root constant, and with the descriptor chosen by an if/else and used after the join:

main main + #2723
image handles (dxc -dumpbin) 1, RWTexture2D<4xF32> 2: load {4098,1033}, atomic {4098,261}
DXC 1.9 dxil.dll validator accepts all 4 accepts all 4
dxil-spirv b540c8a2 --bindless all 4: Invalid type ID in cast<T>, terminate called, exit 134 all 4 convert and pass its --validate

So #2723 should stop the prebuild abort with no dxil-spirv change. dxil-spirv#383's guard is still worth having, so a bad module fails one pipeline instead of the process. #2723's own test covers a 32-bit atomic in one block; the cases above add the 64-bit atomic, a dynamic address and a join. Not checked against the title's module itself.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7186389574 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3101#issuecomment-7186389574). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-26T08:16:07Z. --- This one looks like our emitter, and open PR #2723 already removes it. On `main` `63bcca4`, the three heap-handle caches in `emit/lower.rs` (`handles`, `entry_handles`, `join_handles`) key a handle on the first property word only. An f32 `image_load` on a UAV (`kind|0x1000, 0x409`) and an image atomic (`kind|0x1000, 0x105`) through the same descriptor therefore share one handle, annotated `{4098, 1033}` (`RWTexture2D<4xF32>`). dxil-spirv then marks the handle an `atomicBinOp.i64` uses as 64-bit (`emit_global_heaps` forces `ComponentType::U64`), and the `textureLoad.f32` on that same handle aborts in `fixup_load_type_typed`. The `{ i32 4098, i32 1033 }` on the atomic's UAV that dxil-spirv#383 shows is that output; without the shared handle, the atomic would be annotated `{4098, 261}`. Synthetic repro: a compute program with an R32G32 UAV texture read by `image_load` (dmask 0xF) and by a 64-bit `image_atomic_umax`. It was tested at a fixed address, load first and atomic first, at an address offset by a root constant, and with the descriptor chosen by an if/else and used after the join: | | `main` | `main` + #2723 | |---|---|---| | image handles (`dxc -dumpbin`) | 1, `RWTexture2D<4xF32>` | 2: load `{4098,1033}`, atomic `{4098,261}` | | DXC 1.9 `dxil.dll` validator | accepts all 4 | accepts all 4 | | dxil-spirv `b540c8a2 --bindless` | all 4: `Invalid type ID in cast<T>`, `terminate called`, exit 134 | all 4 convert and pass its `--validate` | So #2723 should stop the prebuild abort with no dxil-spirv change. dxil-spirv#383's guard is still worth having, so a bad module fails one pipeline instead of the process. #2723's own test covers a 32-bit atomic in one block; the cases above add the 64-bit atomic, a dynamic address and a join. Not checked against the title's module itself.
ClosetPie107 commented 2026-11-26 09:06:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by ClosetPie107 on 2026-11-26T09:04:32Z.


Confirmed on the retail title: #2723 fixes this. RX 9070 (RDNA4), CachyOS, Mesa 26.3.1, Proton Experimental 11.0-20261112, vkd3d-proton master ec207194 with dxil-spirv b540c8a2. With #2723 merged on 63bcca4:

  • translate --cache --pipelines makes all 27,135 pipelines with no abort.
  • No emitted module aborts the dxil-spirv CLI. On main, the two CS_VisHair variants do.
  • A world run reached the prologue and lasted 25 minutes without a crash.

Details: https://github.com/Marvisak/VIctory/pull/2723#issuecomment-7187377830

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7187381206 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3101#issuecomment-7187381206). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T09:04:32Z. --- Confirmed on the retail title: #2723 fixes this. RX 9070 (RDNA4), CachyOS, Mesa 26.3.1, Proton Experimental 11.0-20261112, vkd3d-proton master `ec207194` with dxil-spirv `b540c8a2`. With #2723 merged on `63bcca4`: - `translate --cache --pipelines` makes all 27,135 pipelines with no abort. - No emitted module aborts the dxil-spirv CLI. On `main`, the two `CS_VisHair` variants do. - A world run reached the prologue and lasted 25 minutes without a crash. Details: https://github.com/Marvisak/VIctory/pull/2723#issuecomment-7187377830 AI-assisted (Claude Code).
arogan178 commented 2026-11-26 22:29:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-26T22:29:47Z.


Update: the fault is ours, so I've corrected the Fix section above.

  • BastienRodz traced it to VIctory's shader emitter. The handle caches in emit/lower.rs key a heap handle on its first property word only, so a float image_load and a 64-bit image atomic through the same descriptor share one handle declared RWTexture2D<4xF32>.
  • dxil-spirv's maintainer closed dxil-spirv#383 as invalid input: in D3D, a 64-bit image atomic needs an R32G32_UINT resource, so the F32 declaration is the bug. That matches the trace above.
  • #2723 keys the caches by both property words. ClosetPie107 confirmed it on the retail title under stock Proton: all 27,135 pipelines build with no abort, no emitted module aborts dxil-spirv (on main the two CS_VisHair variants do), and a 25-minute world run had no crash.

So this is fixed by #2723 once it lands, with no change needed in dxil-spirv or vkd3d-proton.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7204729506 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3101#issuecomment-7204729506). Originally posted by [arogan178](https://github.com/arogan178) on 2026-11-26T22:29:47Z. --- Update: the fault is ours, so I've corrected the Fix section above. - BastienRodz traced it to VIctory's shader emitter. The handle caches in `emit/lower.rs` key a heap handle on its first property word only, so a float `image_load` and a 64-bit image atomic through the same descriptor share one handle declared `RWTexture2D<4xF32>`. - dxil-spirv's maintainer closed dxil-spirv#383 as invalid input: in D3D, a 64-bit image atomic needs an R32G32_UINT resource, so the F32 declaration is the bug. That matches the trace above. - #2723 keys the caches by both property words. ClosetPie107 confirmed it on the retail title under stock Proton: all 27,135 pipelines build with no abort, no emitted module aborts dxil-spirv (on `main` the two `CS_VisHair` variants do), and a 25-minute world run had no crash. So this is fixed by #2723 once it lands, with no change needed in dxil-spirv or vkd3d-proton.
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
Marvisak/VIctory#3099
No description provided.