Repository navigation
shader: merge multiple loop back edges into one latch and raise pipeline stack - #737
powplusplus wants to merge 1 commit into
Conversation
…ine stack vkd3d-proton's DXIL-to-SPIR-V converter keeps a single back edge per loop header and treats additional back edges as forward edges, recursing indefinitely over the resulting cycle in shaders with wave shuffles. Large traversal shaders also overflow the default 2 MiB thread stack during vkd3d-proton DXIL conversion under Wine, hanging the worker thread instead of returning an error. Add Module::single_latches() before bitcode emission to route multi-latch loop headers through a single synthetic latch block joining their phi values, and raise the pipeline worker stack size to 256 MiB (reserved virtual space, committed on demand) in both victory-gpu and the translate CLI. Fixes all 6 previously hanging ray-tracing shadow shaders on RTX 3080 under Wine/vkd3d-proton (0 timeouts, 6/6 pipelines created).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Tested on AMD under Linux, since the description only has an NVIDIA result. Setup: RX 7900 XT, RADV (Mesa 26.3.1), Wine 11.22 with vkd3d-proton from GE-Proton11-14, diagnostics build. Tree: main Without this PR three compute pipelines never come back here: With it, and no skip list, all three get a host pipeline. Two runs of about ten minutes each, from the start of the game into the first room (one with an empty shader cache, one warm). No hang, no device loss, and the picture of the first room is complete in both. I didn't measure how long the three compiles take, and I haven't tried the two changes separately, so I can't say whether the latch or the bigger stack is what fixes it on this card. |
Summary
Fixes vkd3d-proton hangs and stack overflows during D3D12 pipeline creation on large ray-tracing traversal shaders under Wine/Linux:
Module::single_latches): vkd3d-proton's DXIL-to-SPIR-V converter keeps a single back edge per loop header and treats additional back edges as forward edges, recursing indefinitely over the resulting cycle in shaders with wave shuffles.Module::single_latches()runs beforeModule::write()and routes any loop header with 2+ back edges through a single synthetic latch block that joins their phi values (matching DXC output).PIPELINE_STACK): Large traversal shaders overflow the default 2 MiB thread stack during vkd3d-proton's recursive DXIL conversion; under Wine the overflow hangs the worker thread instead of failing. Bothvictory-gpupipeline workers (pipeline/make.rs) andvictory translateworkers (apps/victory/src/translate.rs) now reserve a 256 MiB stack (pages committed on demand).Verification
cargo test -p victory-shader --lib(172 passed, 0 failed, including newa_header_with_two_back_edges_gets_onetest).victory-shader -- -D warnings) and workspace check clean on8dd30ab.VICTORY_HOST_MAX_WAVE=32): all 6 previously timing-out ray-tracing shadow shaders now validate withdxil.dlland create D3D12 pipelines (6/6 created, 0 timeouts).