Shaders, GPU: one back edge per loop header, and a large stack for pipeline threads #1885
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1885
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1885"
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 00:04 UTC · original
powplusplus:shader/one-back-edge→main· +147 −20 · 5 files · 2 commits · openTwo hangs in vkd3d-proton's pipeline creation, both in its DXIL conversion (dxil-spirv), which runs on the thread that creates the pipeline.
Module::single_latches, before writing, sends the back edges of a header with several through one new block that joins their phi values.Found with a native dxil-spirv build under gdb on the DXIL vkd3d-proton dumped.
Results
No program changes whether it emits or validates (
translate --validateover shaders.rpf, identical to70564ae). On main the programs that hit this do not translate yet; with #1883 they do, and then, on an RTX 3080 under Proton, each pipeline created on its own with a 120 s limit:The second run stopped after 35 of the 45 (the machine ran short of memory, nothing to do with the run). Those 35 include 30 of the 35 that hung. Not run yet with this: the four
CS_RaytraceVBuffer_*ShaderBinning*passes andCS_RaytraceShadows_Shared, which hung before, and the fiveCS_Subdivision_*programs.Testing
cargo test -p victory-shader -p victory-gpuunder Proton (RTX 3080 and WARP): as on main (victory-shader 204 passed, victory-gpu 74 passed; the same 5 and 4 fail on main there).@Marvisak on GitHub · 2026-11-25 08:18 UTC · original · edited 2026-11-25 16:00 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-shader/src/emit/bitcode.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (needs work) was for an older state ofmain.Generated by Claude Code
@sinan-cmyk on GitHub · 2026-11-25 11:52 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head
5aa10e54ontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@desplmfao on GitHub · 2026-11-25 15:43 UTC · original
@powplusplus a coordination question from #2309, which carries one commit of yours (
364c1bc, one back edge per loop header) together with a follow-up for loops with several back edges per block. The triage asked that it not land twice. Would you rather it land here in #1885 (then #2309 drops it and keeps only its own commit on top), or in #2309 (with your credit kept in the commit)? Either is fine with me; I'll follow whatever you prefer.@Foxiquek on GitHub · 2026-11-26 04:24 UTC · original
Tested on Linux/Proton, and it fixes the stack overflow and the resulting
warmhang.Setup: RX 9070 XT (RADV), Linux Mint 22.3, GE-Proton11-14. Release build cross-compiled with
cargo xwin. Both commits were cherry-picked onto the copy of VIctory in LooperSalty/AnyXboxX (third_party/victory, Neptune 2026-11-25c base), not onto this repo'smain.5aa10e5conflicted there, so its two stack changes were applied by hand, and that tree'svictory warmworkers gotPIPELINE_STACKtoo.victory warm shaders.rpf, same environment, before and after:has overflowed its stackstd::thread::scopewaits forevera1b20bc47e3c9597,e8c962358d862e3f,559d9f0184e15fe3The three hashes are the ones that overflowed. They're the same three programs as #2754. A 64 MiB worker stack alone (no emitter change) still overflowed on all three, which fits the unbounded recursion described there. The emitter commit is what fixes it.
cargo test -p victory-shader --release: 185 passed, 0 failed, 2 ignored.Not tested yet: a game run with this, and Windows.
@Foxiquek on GitHub · 2026-11-26 05:25 UTC · original
I rebased this onto current
main(63bcca4), in case it helps it land: Foxiquek/VIctory@rebase/pr1885-one-back-edge (compare). The conflict was inemit/bitcode.rs.mainadded a freesuccessors(term)helper, sosingle_latchesand the new test use it instead of the secondsuccessorsmethod. Nothing else changed, and authorship is kept.Checked on the rebased branch:
cargo xwin build --release -p victorybuilds.clippyreports nothing in the PR's lines, andrustfmtshows no new differences frommain.victory-shadertests, run under GE-Proton11-14 on an RX 9070 XT: 301 passed, 2 failed, 3 ignored.maingets 300 passed with the same 2 failing (hosts_that_do_not_fuse_are_named,stub_pipeline_is_created). Both are Wine-host tests: no real WARP, and vkd3d accepts an unsigned stub.a_header_with_two_back_edges_gets_oneandwritten_bytes_unchangedpass.Not tested on Windows, or in game on this rebase. The in-game result in my comment above was the same two commits on AnyXboxX's tree.
5aa10e5459to2e6b2c2b51@catminou4 on GitHub · 2026-11-25 00:32 UTC · original · reviewed
Mixed PR: shader/formats parts are macOS-tested in the batch; GPU/HLE parts are Windows-only statics.
One back edge per loop header + large-stack…: apps+gpu+shader mixed — shader part in batch.
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.