gpu: add wave64 emulation through group-shared memory #1107
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1114"
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 archielcqp-a11y on 2026-11-24T01:13:04Z.
Change
src/wave64_emulate.hlsligives a 64-thread group the results of 64-laneWaveReadLaneAt,WaveReadLaneFirst,WaveActiveSumandWaveActiveBallotwithout wave intrinsics: each lane writes a group-shared slot, the group waits on a barrier, lanes read the slots they need, and a second barrier frees them. The result does not depend on the native wave width (WARP 8, NVIDIA 32), and does not use WARP 1.0.22's forced-wave64WaveReadLaneAt. Refs #145.Limits: exactly 64 threads per group, uniform control flow,
uintvalues. Prefix, min/max, bitwise and quad operations are not provided.wave_shuffleandbvh_wave64still measure the adapters' own wave operations and are unchanged.Verification
Commit
9149048on upstreamc77687b, Windows 10 build 19045, debug layer enabled. Rebased from31f9ebb, resolving thetests/offscreen_check.cppconflict with the new--descriptor-heap-pagingoperations (both kept); onc77687bwave64_emulate_hardware/_warpand the fourdescriptor_heap_pagingtests pass.ctest --preset dev --no-tests=error -R '^wave64_emulate_' -V(also run in the release preset and the app-local WARP build):wave_shuffle_warpon the same adapter: 64 of 64 affine reads misroutedOn the original base
d2ac415the full suite indev,w10andreleasehad no new failures; on31f9ebbsee the stacked run below.Also tested on upstream
31f9ebbwith all five rebased changes stacked (620 tests, Agility SDK 1.620.2 + WARP 1.0.22 build, bottom-up ASLR off):gpu_alias_registry_hardware/_warp,cpu_shim_shadow_warp,cpu_shim_chain_warpand bothwave64_emulatetests pass. The remaining failures also fail on plain31f9ebb:bvh_wave64_warp,wave_shuffle_warp(#145),cpu_archive_texture_gpu_warp,cpu_native_load_config_callback,pe_package_import_closure.Evidence and follow-up
New fixture
tests/wave64_emulate.hlsl/tests/wave64_emulate.cpp, original source under MIT. It checks the affine, rotation and mirror reads ofwave_shuffle, a first-lane read, a sum and a ballot on all 64 threads against a CPU reference (448 values per run). The negative control is a build whose affine read asks for the next lane; the test requires it to be reported on every thread. Results and limits are indocs/experiments.mdunder "Wave64 emulation with group-shared memory".The technique follows the one described in realdody/americas-recomp#130; no code was taken from it (that repository is GPL-2.0).
Follow-up: prefix, min/max, bitwise and quad operations, and use from the shader translator once it lowers cross-lane operations for 64-lane programs.
Checklist
This change was AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by Toons29 on 2026-11-24T01:37:44Z.
Tested
9149048bon an AMD Radeon RX 9070 (RDNA 4,1002:7550), driver32.0.32029.2010, Windows 11 build 26300,devpreset, debug layer unavailable: passThis adapter can run 64-wide waves, so the forced-width-64 case runs here instead of skipping:
wave64_emulate_hardware(RX 9070)affine_wrong=0affine_wrong=0wave64_emulate_warp(in-box WARP10.0.26100.9818)native_lane_range=4..4Both passed, with no other skips. The hardware run doesn't print which native width it used.
wave_shuffle_hardwareandbvh_wave64_hardwarealso pass on this head; their_warpversions skip on in-box WARP.