Shaders: NVIctory's split-wave64 lowering as a last-resort fallback on 32-lane hosts #259
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/259"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by taskywasky on 2026-11-27T20:15:28Z.
What
On a host whose waves have 32 lanes (NVIDIA), 22 console wave64 compute programs of GTA VI 1.0.2.1 still stop with
no wave32 lowering for this wave64 program. They read and write LDS inside one lane-branch region, whichlds_meetingscannot order. Their dispatches are dropped.This adds NVIctory's split-wave64 lowering (its commits
c41faed..61db46f,emit/split.rs) as a last-resort fallback. It runs only after every existing form (local waves,widen, threading,split_lds/lds_meetings) still leaves a program needing 64-lane waves. It never reaches a program those forms translate.VICTORY_WAVE_SPLIT=0turns it off, and the switch is part of the shader cache key.VICTORY_WAVE_WHY=1prints each decision (WAVE64-SPLITlines).independent_lds,singleton_lds,thread_zero; one-wave groups only, as in NVIctory). Also NVIctory's retry when a region is refused: forwards_cbranch_execzskips fall through (s_nop), and in one-wave groups the region's scc/vcc/exec branches and loop exits are taken wave-wide (structure_wide), for up to 24 rounds.lds_meetingsnow also admits regions that both read and write, when the fallback has proved them).Upsides
dxil.dlland create pipelines on an RTX 3060 (bulktranslate --list --validate --pipelines,VICTORY_HOST_WAVE=32).GpuParticleEmitCS_Emit*_Dynamic_*programs (particles emitted from moving models and edges, skinned and attached-mesh variants), all 9vfx_proj_decal_trailprograms (projected decal trails, liquid trails, heap defrag), the two hair shadow masks (shadowmask:CS_GenerateShadowMasks*_SampleHairScreenSpace) and two waterCS_TransmissionVolumetricsprograms.main.cargo test -p victory-shaderpasses 295 tests, including NVIctory's LDS-proof tests ported to this lowering (split_tests.rs).Current issues and limits
v_readlaneandv_readfirstlaneuse this host half's 32 lanes only (NVIctory's documented shortcut). That is exact when one half is idle or the value is uniform, and wrong when a single value is needed across all 64 lanes.s_barriers are relied on instead.vfx_triangleClip:CS_CollectTriangles{,_Meshlets}, which has no room for the exchange in 32 KiB of LDS.main: pink and black surfaces in some scenes show up both with and without this change. They are being looked at separately.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by starnotes-xj on 2026-11-28T07:24:21Z.
Tested on an 8 GB 32-lane host — reporting what it does and does not reach there, since it turned out not to be needed for the face-relocation program this time.
Card: RTX 4060 Laptop 8 GB, GTA VI 1.0.2.1, latest
main(55 commits,8fc2254),VICTORY_HOST_WAVE=32.I merged this together with #560 into a build that also carries #490 (the launchers stop leaving
CS_DefragHeap_ComputeRelocationsout ofVICTORY_LEAVE_OUT) and #669. The motivation was02384a60fda6f2d0(vfx_triangleClip:CS_DefragHeap_ComputeRelocations), which is refused withno wave32 lowering for this wave64 programand whose dispatches being dropped is why characters had no faces.Attribution, with this PR's fallback switched off and the translator run on that program alone:
So with #560 merged, that program is taken by the existing forms and your fallback is never reached for it — no problem with the ordering as written, just noting that the two PRs overlap on this program and #560 alone covers it.
What is left in a whole run afterwards is
6b82bc7d22016cb5(the meshlet collector, groups of 1024, LDS past the host's 32 KiB) and nothing else, which matches #101's note.No behaviour change was visible otherwise: same scenes, same frame times within run-to-run noise (about 18 fps on this card, 2560x1440 output, Series S, DLSS Quality).
Also:
VICTORY_WAVE_WHY=1was useful for this — theWAVE64-SPLIT round Nlines make it obvious when the fallback is not entered at all.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:23:08Z.
Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.
Pull request closed