shader: merge multiple loop back edges into one latch and raise pipeline stack #737
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!737
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-737"
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?
@powplusplus on GitHub · 2026-11-25 06:06 UTC · original
powplusplus:shader/one-back-edge→main· +144 −20 · 5 files · 1 commits · openSummary
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).@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 06:07 UTC · original · edited 2026-11-25 06:12 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
acd5702ℹ️ About Codex in GitHub
Your 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.
@UwUCammie on GitHub · 2026-11-25 11:59 UTC · original
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
9376fd6merged into myokex/victory-amd, plus #857, myokex/victory-amd#6 and this PR picked on top.Without this PR three compute pipelines never come back here:
559d9f0184e15fe3,a1b20bc47e3c9597,e8c962358d862e3f. Each keeps a worker busy until the run ends, so I have been skipping them withVICTORY_SKIP_PIPELINES.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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.