Shaders: NVIctory's split-wave64 lowering as a last-resort fallback on 32-lane hosts #259
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/trustno1-coder--VIctory-NVIDIA!259
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@taskywasky on GitHub · 2026-11-27 20:15 UTC · original
taskywasky:wave64-split→main· +1198 −17 · 4 files · 1 commits · openWhat
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.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.