Repository navigation
Shaders, GPU: one back edge per loop header, and a large stack for pipeline threads - #1885
powplusplus wants to merge 2 commits into
Conversation
catminou4
left a comment
There was a problem hiding this comment.
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.
|
Automated triage for the maintainers. This pull request no longer merges cleanly into Generated by Claude Code |
Offline measurement on a retail dumpResult: no count change against I merged head 5aa10e5 onto 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). |
|
@powplusplus a coordination question from #2309, which carries one commit of yours ( |
|
Tested on Linux/Proton, and it fixes the stack overflow and the resulting Setup: RX 9070 XT (RADV), Linux Mint 22.3, GE-Proton11-14. Release build cross-compiled with
The 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.
Not tested yet: a game run with this, and Windows. |
|
I rebased this onto current Checked on the rebased branch:
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. |
vkd3d-proton's DXIL conversion keeps one back edge per loop header, as DXC's code has. With several, the others stay in the header's forward predecessors and form a cycle, and in programs with wave shuffles its dominator search then recursed without end: the thread overflowed its stack and, under Wine, hung. The ray-tracing shadow passes do this once they translate. The back edges of a header with several now go through one new block that joins their phi values.
vkd3d-proton converts DXIL on the thread that creates the pipeline, recursively over its control flow. The ray-tracing shadow passes overflowed the default 2 MiB, and under Wine the overflow hung the thread instead of failing. The pipeline workers and the translate command's workers now get 256 MiB, reserved only.
5aa10e5 to
2e6b2c2
Compare
vkd3d-proton's DXIL conversion (dxil-spirv) keeps one back edge per loop header, as DXC's code has. With several, it takes the others for forward edges and recurses without end over the cycle that makes (in programs with wave shuffles). Under Wine the stack overflow then hangs the thread, and with it the process (seen here as a deadlock on the heap lock). Before writing, Module::single_latches sends the back edges of a header with several through one new block that joins their phi values. Ported from Marvisak/VIctory#1885 (d48ec767, by powplusplus); see also Marvisak/VIctory#2754. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ck4nRpEBizbYrjNarbDQc4
vkd3d-proton converts DXIL on the thread that creates the pipeline, recursively over its control flow. The largest ray-tracing passes overflow the default 2 MiB, and under Wine the overflow hangs the thread instead of failing. The pipeline workers now get 256 MiB, reserved only. Ported from Marvisak/VIctory#1885 (5aa10e54, by powplusplus), without its change to the offline translate command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ck4nRpEBizbYrjNarbDQc4
vkd3d-proton's DXIL conversion (dxil-spirv) keeps one back edge per loop header, as DXC's code has. With several, it takes the others for forward edges and recurses without end over the cycle that makes (in programs with wave shuffles). Under Wine the stack overflow then hangs the thread, and with it the process (seen here as a deadlock on the heap lock). Before writing, Module::single_latches sends the back edges of a header with several through one new block that joins their phi values. Ported from Marvisak/VIctory#1885 (d48ec767, by powplusplus); see also Marvisak/VIctory#2754. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ck4nRpEBizbYrjNarbDQc4
vkd3d-proton converts DXIL on the thread that creates the pipeline, recursively over its control flow. The largest ray-tracing passes overflow the default 2 MiB, and under Wine the overflow hangs the thread instead of failing. The pipeline workers now get 256 MiB, reserved only. Ported from Marvisak/VIctory#1885 (5aa10e54, by powplusplus), without its change to the offline translate command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ck4nRpEBizbYrjNarbDQc4
Two 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).