Shaders: retry wave64 programs without the stall guard when they stay… #142
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/gamingwithhomie--larp!142
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-142"
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?
@Callimann8 on GitHub · 2026-12-05 19:37 UTC · original
Callimann8:fix/wave64-refused-after-stall-guard→main· +55 −1 · 2 files · 2 commits · merged 2026-12-05 20:42 UTCTitle
Shaders: NVIDIA refuses 3 compute pipelines since v1.0.10 (wave64 left at 64 lanes by the stall guard)
Body
Requested by Carlos · project thread
What is wrong
Since
9a42871(the water mosaic fix for #24, in v1.0.10 and later), every run on an NVIDIA card logs:and then one dispatch a frame is dropped (
dispatch: dropped, no host pipeline).eae3498e6553afa8isCS_CalcRasterClassificationListCounts; the other two are its variants. In game the lighting looks off. The same three refusals show up in #123 (vkd3d-proton withVKD3D_FORCE_WAVE32=1, so 32-lane waves too).With the D3D12 debug layer (
LARP_D3D12_DEBUG=1) the reason is:Why
9a42871added a stall guard toir::without_skips: it keeps ans_cbranch_execzskip when the region it skips holds a loop an empty wave would not leave. For these three programs the guard keeps skips that their 32-lane forms have to leave out. Every formemit_formstries then still needs 64 lanes, so the program is emitted withWaveSize(64), and a 32-lane host refuses the pipeline. Before9a42871(for example the stock1c2a608build) the same programs came out as 32-lane forms and ran.The change
emit_forms: when a console wave64 compute program on a host of 32-lane waves is still at 64 lanes after every other form, it tries the forms once more with the stall guard left out (ir::without_stall_guard, a thread-local switch read bywithout_skips). It keeps that result only if it came down to 32 lanes, else it returns the 64-lane result as before.host_uses_wave32()).Testing
On Windows 11, RTX 4070 (WaveLaneCountMax 32), current
main(f209756) plus this commit:larp translate <the three containers> --pipelines --validatewithLARP_HOST_MAX_WAVE=32: 3 validated, 3 pipelines (before: 3 validated, 0 pipelines, "Falscher Parameter").1c2a608build emits for them (LARP_EMIT_DUMP, MD5 compared).host pipeline: refusedline and no dropped dispatch; the lighting that looked off with v1.0.10+ looks right again.@Kassadd on GitHub · 2026-12-05 20:00 UTC · original
Ran it on CachyOS + Proton, RTX 4080 SUPER, vkd3d-proton 3.2.0. In short: it works, and the cost is visible.
What it fixes, confirmed.
host pipeline: refusedgoes from 3 to 0 for the whole run, and the lighting problem is gone — shadows are cast again (the player, bollards, the canopy, the poles), and the sky stops being blown out white. That last part I did not expect:CS_CalcRasterClassificationListCountsfailing was washing out the whole exterior, not only removing shadows.The cost. With the stall guard left out there are now shadow artefacts on some geometry: dark patches with no caster behind them, and very hard edges. Which is roughly what removing the guard would predict — the 32-lane form runs where the guard would have kept a wave from executing.
Two notes that may help:
0 indirect executionsin the frame line still reads 0 even with the shadows back, so whatever that counter tracks is not the shadow pass. It is not a useful signal here.@Callimann8 on GitHub · 2026-12-05 20:22 UTC · original
Thanks for testing this on Proton, and for the note about the sky. That was the "washed out" look I first reported too.
I looked into whether the artefacts come from leaving the guard out, and I don't think they do:
reads_lanes && any_cycle), never throughdecided_cycle. I checked this with a debug print on the stall test. The skip it keeps is the one at 0xfb8 in eae3498e6553afa8, in front of the thread-0 prefix sum over the group's waves (B15-B20). Both loops in it are bounded by scalar counters compared against constants (s_cmp_eq_u32 s4, Nands_cmp_gt_u32 s5, N), so a wave with no lane walks them a fixed number of times and leaves. Its LDS writes and the final stores are all under EXEC, so an empty wave writes nothing.9a42871) emits for them, MD5-compared. So these passes now run exactly as they did in v1.0.9 and earlier.I pushed a follow-up commit (
5cb4487) that makes this explicit. The retry now leaves out only the cautious test, and a skip in front of a loop that provably never ends for an empty wave is kept even in the retry. The output for the three programs doesn't change (same hashes), but nothing else can slip through that path now.So my guess is that the dark patches and hard edges come from somewhere else in the shadow path that was hidden while these three never ran. Two checks would tell us:
@HeyOkay on GitHub · 2026-12-05 20:42 UTC · original
Additional Windows / RTX 5070 Ti result for the three affected compute programs.
This is an isolated output-workaround test on the existing v1.0.11 NVIDIA binary, not a build or validation of the current PR head.
Environment: Windows, RTX 5070 Ti 16 GB, i5-14600K; Series S; configured 2560x1440, DLSS Quality, sharpening 0.5, FG 2x, 30 base-FPS cap. The existing final 3840x2160 swapchain limitation remains separate.
Method:
Observed result:
The existing face-related replacement files were untouched; a separate post-fix close-up face regression check has not yet been recorded. I have not established whether the hard-edged shadow artifacts reported on Proton are absent in every scene on this Windows setup.
This supports the three restored Wave32 outputs as an explanation for the visible regressions on this machine, without claiming that the current/general retry implementation has been tested here. No game containers, translated shader binaries, or private logs are attached.
@Proudnoob4 on GitHub · 2026-12-05 21:27 UTC · original
Confirmed on RTX 4080 / Windows 10 19045, Series X, 2560x1440 DLSS Quality, frame generation off. Our baseline e80ff0f logged each of the three named 0x80070057 pipeline refusals once, plus one dropped-dispatch warning. With only
101e63band5cb4487applied to that baseline, a first boot and a warmed boot both reached gameplay with zero host-pipeline refusals and zero dropped-dispatch warnings. Caps were 30 for the first boot and 60 for the warm boot. Both runs ended at our harness deadline. The input replay diverged, so this is a pipeline/startup confirmation, not a matched visual or FPS comparison.