compute: copy descriptor words through VCC as a scalar temporary, wave64 SMEM loads and lane spills #3329
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3329"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T09:49:41Z.
Part of #3224 (claimed there). Target branch
main.Some direct compute programs park descriptor words in VCC and move them back, for example
s_mov_b64 vcc, s[18:19]while s[18:19] hold the upper words of a buffer descriptor. The move into s106/s107 refused at once with "descriptor used as mask", although VCC is only a scalar temporary there.Change 1 (
src/gfx1013_direct_compute.inl, first commit):s_mov_b32and aligneds_mov_b64copy each word into or out of s106/s107 with its symbol, as for other SGPRs.transfer()insrc/gfx1013_compute_native.cppalready copies both symbols, and VOPC and carry writes already make VCC numeric again (s106 only in wave32).v_cndmask;main);s_cbranch_vccz/vccnz, on s106 in wave32 and on both words in wave64.Change 2 (
src/gfx1013_direct_compute.inl,src/gfx1013_compute_native.cpp, second commit):s_load_dwordx4/x8) may end at s106/s107; the "symbolic scalar memory destination overlaps wave64 VCC" refusal is removed and the load writes the descriptor symbols there (shown for table loads; a heap-offset load into s[104:107] now reaches the heap contract check).v_writelane_b32andv_readlane_b32spill and reload s106/s107 like other SGPRs (bound raised from s105 to s107 in both files); a symbolic reload into anything above s107 is still refused.Tests for change 1. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, Release, on
main32dc3d7cplus the first commit.native_vcc_descriptor_copy_controls:s_cbranch_vccz, byv_cndmask_b32with VCC, or bys_mov_b64 exec, vccis refused.main'scompile_dxilthe round trip is refused at the park with "descriptor used as mask", so the test fails there.native_vcc_descriptor_copy_hardwarepasses on the RTX 5080: 320 output and guard words for each of the four round trips.native_vcc_descriptor_copy_warpreports a capability skip (77).ctest -R "native_|startup_compute|compile_dxil|salu": 528 of 529 pass, plus one transient failure.native_scalar_lds_hardwarefails as onmain.cpu_native_exe_terminationfailed once during the parallel run and passes when run alone.compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests(counts only):main3f780716, and 251 with this commit (the commits from3f780716to32dc3d7conly touchtools/probe_root_devices.pyand its tests);v_dot4_i32_i8withop_sel_hi:[1,0,1]. That stays refused: as I wrote on #3224, its semantics for an inline constant are not established.Tests for change 2. Same setup, on
main8ecd30feplus both commits.native_vcc_descriptor_copy_{smem_store,smem_mask,smem_range,spill_image,spill_mask}: a wave64 x4 load into s[104:107] stored through directly; the same load followed bys_cbranch_vccnz(refused); an x8 load into s[104:111] (refused as a range); an x8 image descriptor in s[100:107] spilled to a VGPR withv_writelane_b32(s100..s105,vcc_lo,vcc_hi), cleared, reloaded and used byimage_store; the same spill followed bys_cbranch_vccnz(refused).native_direct_containerandnative_heap_offset_addnow expect the accepted load or the heap contract instead of the overlap refusal.ctest -R "^(native_vcc_descriptor_copy_.*|native_direct_container|native_heap_offset_add|native_lane_access.*)$": 10 pass,native_vcc_descriptor_copy_warpskips (77).ctest -R "native_|compile_dxil|salu"after a full build: all pass exceptnative_fixed_mesh57_waterfall_fine_hardwareandnative_scalar_lds_hardware, which fail onmaintoo.v_writelane_b32source bound back to<= 105ingfx1013_direct_compute.inlmakesspill_imageandspill_maskfail; restoring the SMEM overlap refusal makessmem_store,smem_mask,native_direct_containerandnative_heap_offset_addfail.compile_dxil --jobs 4 gfx1013-direct-cs@0 --requests), four programs stopped at the SMEM overlap and then at thevcc_lo/vcc_hispill; they now pass both. Three then stop atdirect descriptor address outside bound table(#3221) and one atunbound numeric SGPR s61, so none compiles with this alone.Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T20:21:27Z.
Rebased on
main8ecd30feand added a second commit for the wave64 SMEM refusal claimed on #3224: table and heap-offset descriptor loads may end at s106/s107, andv_writelane_b32/v_readlane_b32carry those words like other SGPRs. The body now covers both commits, with tests, mutations and the census result (the four programs get past both VCC refusals; none compiles with this alone).Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-28T22:03:25Z.
Review: COMMENTED
Reviewed head
95414551.Code read (
gfx1013_direct_compute.inl,gfx1013_compute_native.cpp):s_mov_b32/s_mov_b64now copy each word per identity into or out of s106/s107 in compute; every VCC consumer found in the diff (operand reader, carry-in andv_cndmask, scalar bypass matches, DPP with preserved destination,s_cbranch_vccz/vccnz, lane read/write) first requires the VCC words to be numeric and refuses otherwise. EXEC and M0 stay refused. The wave64 SMEM overlap refusal is removed only for table and heap-offset loads, with the new SMEM range and mask refusal tests behind it. No issue found.Verification (Win2025, dev and release, this head):
x2w_pipe.py win2025 3329 --regex 'native_vcc_descriptor_copy|native_direct_container|native_heap_offset_add': 10/10 passed on dev and 10/10 on release, includingnative_vcc_descriptor_copy_warpand_hardware.AI-assisted; commands listed were executed locally.