Linux/Proton: translate --cache --pipelines aborts (std::terminate in dxil-spirv, HansKristian-Work/dxil-spirv#383) #3099
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?
Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-26T08:02:11Z.
What
Under Proton,
victory translate --cache --pipelinesdies partway through withterminate 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 callstd::terminate(), and under Wine that ends the whole process instead of refusing one pipeline.How it shows
71cae0), cross-built releasevictory.exe.title pipelines to start earlyor a progress line.WINEDEBUG=+sehshowsraise (22)(SIGABRT) on a worker thread. Of the PE modules loaded, onlyd3d12core.dllcontains the terminate message.VKD3D_SHADER_DUMP_PATH, exactly one of 1,357 DXIL modules has no.spv. Converting it with dxil-spirv masterb540c8a2reproduces the abort offline:Invalid type ID in cast<T>infixup_load_type_typed, on atextureLoad.f32whose resource has been given component typeU64(64-bit atomics).Impact
Workaround
Skip
--pipelines(translate --cachealone 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.rskey a handle on the first property word only, so an f32image_loadand a 64-bit image atomic through one descriptor share a handle declaredRWTexture2D<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.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
main63bcca4, the three heap-handle caches inemit/lower.rs(handles,entry_handles,join_handles) key a handle on the first property word only. An f32image_loadon 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 anatomicBinOp.i64uses as 64-bit (emit_global_heapsforcesComponentType::U64), and thetextureLoad.f32on that same handle aborts infixup_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-bitimage_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:mainmain+ #2723dxc -dumpbin)RWTexture2D<4xF32>{4098,1033}, atomic{4098,261}dxil.dllvalidatorb540c8a2 --bindlessInvalid type ID in cast<T>,terminate called, exit 134--validateSo #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.
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
ec207194with dxil-spirvb540c8a2. With #2723 merged on63bcca4:translate --cache --pipelinesmakes all 27,135 pipelines with no abort.main, the twoCS_VisHairvariants do.Details: https://github.com/Marvisak/VIctory/pull/2723#issuecomment-7187377830
AI-assisted (Claude Code).
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.
emit/lower.rskey a heap handle on its first property word only, so a floatimage_loadand a 64-bit image atomic through the same descriptor share one handle declaredRWTexture2D<4xF32>.mainthe twoCS_VisHairvariants 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.