compute: let direct wave64 scalar loads use VCC as scalar data #3267
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3267
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3265"
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?
@Leyukaka on GitHub · 2026-11-28 02:44 UTC · original
Leyukaka:smem-vcc-wave64→main· +159 −16 · 7 files · 1 commits · merged 2026-11-28 04:13 UTCPart of #2935 and #3226. Target branch
main. Extends #3182 to direct wave64 compute.Change. The direct wave64 compute path now gives scalar loads the SGPR bound that wave32 has had since #3182.
src/gfx1013_compute_native.cpp,smem_sgpr_limitand its two callers: destination ranges may end at s107 (VCC_HI), and VCC_LO/VCC_HI may be the SGPR offset.s_mov,v_cndmaskand the VCC branches. The branches OR the two words.src/gfx1013_direct_compute.inl: the direct compute lowering's ownsmem_sgpr_limitcall takes the same bound. Table descriptor loads track descriptor identity rather than payload bits. In wave64 they now refuse when their destination overlaps VCC, with "symbolic scalar memory destination overlaps wave64 VCC".docs/experiments.md: the SMEM note now says wave64 as well.Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
mainf9286e7dplus this commit.native_smem_vcc_wave64_controlsand_hardwarecover, in 64-thread wave64 groups:s_buffer_load_dwordx4into s[104:107] ands_load_dwordx8into s[100:107];v_cndmask_b32in both host halves, under a patterned EXEC.native_direct_containerused to check three wave64 decoder refusals: two VCC offsets and a destination at s107. Those decoder refusals no longer apply, and the s107 destination is accepted. It checks the symbolic-destination refusal instead.main'scompile_dxil, the controls stop at "unsupported scalar memory destination range".native_direct_container.ctest -R "native_|startup_compute|compile_dxil|salu|smem"passes 435 of 436.native_scalar_lds_hardwarefails as onmain.Measured with
compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests, base and change both onmainf9286e7d.s_ff1_i32_b64and the global-load refusal.AI-assisted.
github-bot referenced this pull request2026-11-28 03:11:18 +00:00
@tedin7 on GitHub · 2026-11-28 03:30 UTC · original · reviewed
Review of head
a71822e0. The change looks right to me, but the branch now conflicts withmainandgh pr update-branchrefuses, so it cannot be merged as is.Conflict. #3255 (merged) added the
low.type == Symbol::Type::heap_offsetblock insrc/gfx1013_direct_compute.inlat the same spot as this PR's new wave64 VCC check, right afterconst bool root = ...in the SMEM branch. They do not interact (one testsSymbol::Type::table, the otherheap_offset), so keeping both works. I tested this order:src/gfx1013_compute_native.cppandtests/native_direct_container_check.pymerge on their own.What I checked on the change itself:
smem_sgpr_limitnow takesdirect && !graphicsin the decoder and intransfer. For the non-direct path the bound was already 106 in the decoder, so thetransferchange does not widen it.native_smem_vcc_wave64_check.pycompares every output word, guards included, with a CPU reference: s[104:107] and s[100:107] loads, VCC_LO/VCC_HI as SGPR offsets, and a loaded 64-bit VCC that drivesv_cndmask_b32under a patterned EXEC.Commands run, on this head plus the keep-both merge of
mainabove (applied as a patch):python3 tests/docs_links_check.pyok,python3 tests/bidi_controls_check.pyok,git diff --checkclean,python3 -m py_compileon both touched test files ok.-R '^native_(smem_vcc_wave64_controls|smem_vcc_wave64_hardware|direct_container|heap_offset_add|global_srv_heap_replay_warp|wave64_exec_salu_hardware|wrexec64_hardware|s_not_b64_exec_controls|s_not_b64_exec_hardware|compute_clear)$': dev 10/10 passed, release 10/10 passed.native_smem_vcc_wave64_hardwareran on WARP and did not skip.native_smem_vcc_wave64_controls,_hardwareandnative_direct_containerfail.native_smem_vcc_wave64_controlsand_hardwarefail (unsupported root descriptor load range).Question, not blocking: with this PR a wave64 load may end at s107, and the #3255
heap_offsetpath writes the slot index into all four destination words without the new overlap refusal. In wave64,s_load_dwordx4 s[104:107]from an added heap address would therefore put the index into VCC. That index is a real uniform value, not a symbolic one, so it may be fine. If you want the two paths to match, the new check could also coverlow.type == Symbol::Type::heap_offset.Once the conflict is resolved on the branch, I can rerun the Windows check on the new head.
AI-assisted; commands listed were executed locally.
a71822e0edto0c54f12832@Leyukaka on GitHub · 2026-11-28 03:39 UTC · original
Thanks for the review and for testing the keep-both merge. Rebased onto main
a44e1f95, new head0c54f128.const bool root = ..., before the #3255heap_offsetblock, which is unchanged.low.type == Symbol::Type::heap_offset. That path also writes the slot index intodst..dst+3, and in the wave64 model s106/s107 hold VCC as mask data, so the two paths now match. The condition forSymbol::Type::tableis the one you reviewed. Wave32 is not affected. On main, a wave64 load ending past s105 was already refused in the decoder (unsupported scalar memory destination range), so no load that was accepted before is refused now.tests/native_heap_offset_add_check.pygains a wave64 control,wave64_vcc_dst: 64x1x1 group with bit 20 of.sadword 4 clear,s_load_dwordx4 s[104:107], s[10:11], 0x0(0xF4081A05 0xFA000000) through the added-offset address, expectingsymbolic scalar memory destination overlaps wave64 VCC. Withheap_offsetremoved from the condition, this control fails.A rerun of your Windows check on the new head would be welcome.
AI-assisted.
@R0Y00 on GitHub · 2026-11-28 04:13 UTC · original · approved these changes
The current head
0c54f128covers both symbolic routes. Ordinary and added-offset heap descriptor loads still refuse destinations overlapping VCC in wave64, and the newwave64_vcc_dstcontrol exercises the added-offset path. The numeric loads and register-offset cases passed the two-host-half readback.On
f41806a9plus this head (treefd5c77bc), Debug and Release /O2 each passed 7/7. This included the new controls and hardware readback, heap offset, direct containers, VCC/EXEC NOT and wave64 EXEC. On mainfbef6381plus this head (treeb2c0640a), Release /O2 passed all six focused cases, including the adjacent raw-load and raw-store cache hints:No skips. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, SDK/DXC 10.0.26100.0. The fixtures are source-built.