wave64: never emit a barrier a group cannot reach, and cover the whole group in the wave-wide decision #81
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!81
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-81"
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?
@Pavl3000 on GitHub · 2026-11-26 02:27 UTC · original
Pavl3000:pr/wave64-wide→main· +233 −19 · 2 files · 4 commits · draftFour changes to the wave-wide form (
widen) for console wave64 compute programs on a 32-lane host. Measured on an RTX 3080 Ti (D3D12min=32 max=32), tree0a43566; the context and the numbers are in #37.What it does
exchange_halvesputs two group barriers in the current block, andwave_wideonly checked that the branch block is all-lane.group_syncnow recordsneed(block)for a block that is not, which is the needwidenalready reacts to, andwidentreats an emission that leaves needs as stuck and refuses the program when nothing is left to widen. Such a barrier is a guaranteed0x887A0006.loop_exits_around): a barrier inside a loop whose two halves leave on different iterations waits for threads that are not there.exchange_pair:slot + 2 * (thread >> 6)) and the barrier at the end ofexchange_halveshas them all in place, sowave_wideORs every pair ofthreads.div_ceil(64)instead of only its own half's. No new primitive;2nLDS loads per thread at a widened branch.widenno longer refuses a group holding several console waves.all_lanesno longer says a block is left out by some lanes when the structure has no entry for it:all.get(b).copied().unwrap_or(true).falsethere put spurious needs in front of the widening, which then looked for branches around a block no lane region holds and gave up (WAVE64-WIDE stopped with 1 branches wave-wide: a branch around it cannot be).Measured
At pipeline creation on the title's nine refused programs (verified by making the pipelines, not by reading logs):
9 refused → 1. Now created:
CS_Visibility,CS_Tiling_Generate_Opaque,CS_TransmissionVolumetrics_Tiled,_LocalLights,_Submerged,_VolumePortalsOnly,CS_DefragHeap_ComputeRelocations(128-thread group),CS_CollectTriangles_Meshlets(1024-thread group). Still refused:CS_AlphTransmissionPrefilterMip(2da4beb386509b77, 256).With
VICTORY_WAVE_WHY=1the barriers each emits and how many stand in a block not every lane runs: 3/0, 51/0, 613/0, 767/0, 255/0, 326/30, 2854/78. The five that ran in a game run, including both world passes, had none.What is still wrong
The card is still lost (
0x887A0006) after about 74 s of frames in the open world. So legality and a group-wide decision are necessary but not sufficient: what is left isv_mbcntand lane masks read as data inside divergent regions, and the 32 KiB shared-memory budget of the 1024-thread group — the two items #37 names beyond these.How it can be tested cheaply
A branch of mine also lets
translate --warm <file of hashes>take--pipelines, which makes the pipeline for each named hash and drops it: nine programs in about two seconds instead of a sweep of all 26 000 (that sweep cost 2.7 CPU-hours and produced nothing). I left it out of this PR to keep it to the translator; it can be a second one if wanted.all_lanes answered false when the exchange's all-lane map had no entry for the block, which said 'not every lane runs it' about blocks the analysis never saw. That put spurious needs in front of widen, which then looked for branches around a block no lane region holds and gave up ('WAVE64-WIDE stopped with 1 branches wave-wide: a branch around it cannot be'). After the change, eight of the title's nine refused programs create their compute pipeline on a 32-lane host: CS_Visibility, CS_Tiling_Generate_Opaque, four transmission-volumetrics passes, and the three groups of several console waves (128, 256 and 1024 threads) that were refused before. The ninth, CS_AlphTransmissionPrefilterMip (256), is still refused. Not yet safe to run: 4 922 barriers were recorded in the eight and 124 of them still stand in blocks not every lane runs, so at least one of the eight would hang the group. Which one is the next step, two seconds per program with VICTORY_WAVE_WHY=1.@Bladureau on GitHub · 2026-11-26 14:47 UTC · original
Tested on an RTX 4060 Laptop GPU 8 GB (driver 617.14, D3D12
min=32 max=32), Windows 11, title 1.0.2.1: avatarmanz/maina9400a6+ #209 + this PR,VICTORY_WAVE_WIDE=1,VICTORY_SHADER_KEY=source, every shader translated beforehand with the same settings, Series S.The device hung during the world load, 3.6 minutes in; the process exited with 0x887A0005. DRED (
light): in the first list that did not finish, 8 of 17 commands completed. The first uncompleted one is an indirect dispatch of2561af9577c47289(ptfx_CS_lightAtlas_Sprite), followed in the same barrier interval by dispatches ofcabb87599722e59a(itsNonLocalLightsvariant).Offline, the forms these two programs take:
2561af9577c47289cabb87599722e59aVICTORY_WAVE_WIDE=14e964d2f953f1c29VICTORY_WAVE_WIDE=14e964d2f953f1c29VICTORY_WAVE_WIDE4e964d2f953f1c29Without
VICTORY_WAVE_WIDE, the same build ran 6.8 minutes with no device removal. So on this GPU the wave-wide form ofptfx_CS_lightAtlas_Spritestill hangs with this PR, although the PR widens two more of its branches. That is the programemit/mod.rsnames as the reasonVICTORY_WAVE_WIDEis off by default. I did not run #209 withVICTORY_WAVE_WIDE=1but without this PR in game.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.