fix(victory-shader): keep wave64-on-wave32 TGSM within 32 KiB on 32-lane hosts #295
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!295
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-295"
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?
@mauroalvare on GitHub · 2026-11-26 01:43 UTC · original
mauroalvare:fix/victory-wave64-lds-limit→main· +150 −3 · 3 files · 4 commits · openVice-Tay
On a 32-lane host, Vice-Tay now reuses one group-shared dword for the thread-numbering prologue when the shader declares the full 32 KiB. The prologue finishes using it before the emulated shader's LDS accesses. If cross-half exchange needs more group-shared memory than D3D12 supports, lowering reports the limit explicitly.
The NVIDIA test exercised a split wave that reads across halves at the limit. A second regression covers a shader whose exchange storage exceeds the limit.
Earlier Neptune description
Change
In VIctory's RDNA2-to-DXIL translator (
third_party/victory/crates/victory-shader/src/emit/lower.rs), the non-paired wave64-on-wave32 compute lowering (used on 32-lane hosts such as NVIDIA GPUs) could push thread-group shared memory (TGSM) past D3D12's hard 32 KiB (8,192 dwords) limit:halves(wave_base's LDS counter) unconditionally appended 1 dword (s.lds_dwords += 1), turning a 32 KiB console shader into 32,772 bytes (8,193dwords), rejected bydxil.dlland D3D12CreateComputePipelineState. The paired form already reuses slot 0 whens.lds_dwords == 8192becausewave_base()emits a post-countergroup_syncwheneverslot < cs.lds_bytes() / 4; the non-paired path now does the same.exchangeunconditionally added2 * group.div_ceil(64)dwords even whens.lds_dwordswas already at or near 8,192 (and even whengroup <= 32orLOCAL_WAVES, whereexchange_halvesnever touches LDS). Becauseemit_formsstill returnedOk((_, Some(32)))with invalid >32 KiB DXIL,emit_anynever fell back to the paired form (which needs zero exchange dwords and fits in 32 KiB). Checkings.lds_dwords + exchange_dwords <= 8192keepswave = 64whenexchangedoes not fit, lettingemit_anyfall back to the valid paired form.Linked issue: Refs #213
Verification
Base SHA:
c4c93bdc413191a9dc909998d2d53080a3f0c880(LooperSalty/AnyXboxX:main)Hardware: Windows 11, Ryzen 7 9700X, NVIDIA GeForce RTX 5070 Ti (driver
621.40),dxil.dll10.0.26100.0, Rust1.98.1(MSVC).Before the fix (both new tests failing on base
c4c93bd):After the fix (from
third_party/victory):Oracle and test data
Both new regression tests in
third_party/victory/crates/victory-shader/src/emit/wave64_tests.rssynthesize minimal GFX10 wave64 compute shaders with 32 KiB (32,768 bytes) of LDS:wave64_full_32kib_lds_without_exchange_fits_on_32_lane_host: 64 threads writing3*t + 1toLDS[4*t](includingLDS[0]) and reading mirror lane63 - tacross halves; validated withdxil.dlland checked dword-for-dword on RTX 5070 Ti.wave64_full_32kib_lds_with_exchange_falls_back_to_paired_on_32_lane_host: 128 threads writing5*t + 7toLDS[4*t], readingt ^ 32, and computings_bcnt1_i32_b64+v_mbcnt_lo/hi; verifies fallback to paired form,dxil.dllvalidation, and all 512 output dwords on RTX 5070 Ti.No game, console, or SDK files were used.
Checklist
E_NOTIMPL), never a fake success.AI assistance: investigated, implemented, tested on RTX 5070 Ti, and drafted with Antigravity (Gemini).
174f85c99ato9134d56626fix(victory-shader): keep wave64-on-wave32 TGSM within 32 KiB on 32-lane hoststo test(victory-shader): cover the full LDS budget on 32-lane hoststest(victory-shader): cover the full LDS budget on 32-lane hoststo fix(victory-shader): keep wave64-on-wave32 TGSM within 32 KiB on 32-lane hosts9134d56626toa45726872bView 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.