Reuse group barriers across Wave32 LDS reads #152
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!152
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-152"
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?
@gomeaw on GitHub · 2026-11-26 08:01 UTC · original
gomeaw:fix/reuse-wave32-lds-read-barriers→main· +120 −9 · 4 files · 1 commits · openAddresses the split-LDS barrier lead in #143.
The Wave32 lowering emitted a full group barrier before every LDS read, including consecutive reads and reads directly after an explicit full group barrier. Once all lanes have synchronized, a run of read-only LDS instructions can share that ordering. A write or atomic still has its own barrier. The proof starts again at block boundaries and after other instructions, apart from wait-count and no-op instructions. Fence-only diagnostics retain the original per-access fences.
Windows CI measured seven barriers on the original emitter and four with this patch in a synthetic two-half shader. The native Wave64 form kept its one explicit barrier. The SDK validator accepted the Wave32 shader at default settings, at
VICTORY_SHADER_OPT=127, and with group waits disabled for diagnostics. The Windows shader suite passed 287 tests.The fixture reads across the two halves before and after an overwrite and checks all 64 threads when a Wave32 device is available. Hosted CI validates the emitted shader, and a physical RTX run is needed for those output and frame-time measurements.
The translator version changes so the A/B uses the newly emitted DXIL.
The NVIDIA A/B builds isolate this shader change. The combined Windows run passed 301 shader tests and the optimized diagnostics build.
@Proudnoob4 on GitHub · 2026-11-26 08:08 UTC · original
Awesome turnaround picking up the
split_ldsread-run lead!Sharing a physical RTX 4080 16 GB (Windows 10, i5-13600K, Series S,
render_scale=0.6667, RT skipped) data point from our own equivalentsplit_ldsRaR + post-s_barrierbarrier coalescing test (bundled with fast floatVICTORY_NV_FLOAT=7and 64-byte multi-textureD3D12_TEXTURE_BARRIERinspection):n=96settled 5s intervals,making=0): median27.20 fps(36.7 ms),p90 27.80,max 28.60,0stutters>55 ms, GPUP0 2805 MHz / 99.8 W / 99% util / 7% VRAM util.split_ldsRaR/post-s_barriercoalescing +NV_FLOAT=7+-30global UAV barriers/frame (Pass 9, warm cache,n=71settled 5s intervals,making=0): median27.00 fps(37.1 ms),p90 27.70,max 28.30,0stutters>55 ms, GPUP0 2790 MHz / 99.4 W / 99% util / 7% VRAM util.pass9_t540.png) and all 63 local shader/GPU tests passed.Diagnostic takeaway for RTX 4080
Even combining
split_ldsread-run barrier coalescing, fewer float ALU ops, and 30 fewer global UAV barriers/frame left RTX 4080 frame time flat at~37 mswhile drawing only~99 W(~31%of TDP) at99%reported GPU util and7%VRAM util. That strongly suggests our bottleneck in this scene is not shader ALU orsplit_ldsbarriers, but rather command-list / barrier / prelude / card-step serialization.I'm running an
av#106VICTORY_GPU_TIMING=1+VICTORY_D3D12_DRED=1diagnostics pass next on the warm cache to get the exact per-list GPU breakdown (title'svspreludesvsstepsvscomparesvsothers) and will report what actually owns those37 ms.@Aniseto on GitHub · 2026-11-26 17:37 UTC · original
Ran the Wave32 LDS barrier fixture at
bb61bb7on an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (pinned by
rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.The test printed
wave32 LDS barriers: 4; wave64 LDS barriers: 1andall 64 lanes observed the old and new LDS values: the wave32 dispatch ran on the real adapter and checked all 64 threads, which is the physical RTX run the description asks for. The wave64 count is from translation only; this card has no native 64-lane waves. The thread has no prior report from this adapter.Not tested: frame-time measurements, a retail title, native wave64 hardware, AMD and Intel GPUs, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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.