Repository navigation
Conversation
In split-wave64 mode (two hardware wave32 halves per console wave64), SGPR spill reloads (v_writelane_b32 -> v_readlane_b32 with a constant lane) previously went through xcl_x_rla_uniform and emitted a full cross-half exchange (spin-wait loop, barriers, and atomics) even though both halves already hold identical SGPRs (x64_masks keeps v_writelane_b32's scalar source whole-live). Add a conservative forward must-analysis (upper_lanes::analyze_spills) for split-wave64 Kernel/Compute/Mesh programs that tracks constant-lane v_writelane_b32 slots across 0..64 without intervening VGPR writes, dynamic-lane writes, v_movrel/v_swaprel, LOOP_GUARD exits, or indirect jumps. Shadowed v_readlane_b32 reads take xcl_sh<v>_<l> directly with no cross-half exchange while v_writelane_b32 still updates the VGPR lane. Native wave64 HLSL is unchanged. Measured on RTX 3060 Ti (DXC 1.9.2609.5) across spill-heavy retail wave64 compute shaders: - CS_Slod_BatchCull: rla_u 259->9, DXC 9231->4869 ms, DXIL -25.6%, PSO 9118->6334 ms - CS_Gather_Reference: rla_u 311->17, DXC 14047->7720 ms, DXIL -23.7%, PSO 11848->9305 ms - CS_TransmissionVolumetricsSubmerged: rla_u 506->323, DXC 30955->24472 ms, PSO 30468->27233 ms Assisted-by: Antigravity (Gemini 4 Neon)
Owner
Author
|
Upstream PR xcl-dev#917 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In split-wave64 mode (two hardware wave32 halves per console wave64), SGPR spill reloads (
v_writelane_b32→v_readlane_b32with a constant lane) previously went throughxcl_x_rla_uniformand emitted a full cross-half exchange (bounded spin loop, barriers, and atomics), even though both halves already hold identical SGPRs (x64_maskskeepsv_writelane_b32's scalar source whole-live).This adds a conservative forward must-analysis (
upper_lanes::analyze_spills) for split-wave64Kernel,Compute, andMeshprograms so constant-lane spill reloads read a scalar shadowxcl_sh<v>_<l>directly without exchanging across halves, reducing DXIL size and NVIDIA driver (nvgpucomp64.dll) pipeline compile time. Native wave64 HLSL is unchanged.What is in it
crates/xcl/src/gpu/recomp/upper_lanes.rs: addanalyze_spills(tracks constant-lanev_writelane_b32slots0..63across the CFG; invalidates on any VGPR write, dynamic-lanev_writelane_b32,v_movrel/v_swaprel,LOOP_GUARDexits, or indirect jumps) + unit tests.crates/xcl/src/gpu/recomp/mod.rs: runanalyze_spillsfor split-wave64Kernel/Compute/Meshprograms.crates/xcl/src/gpu/recomp/emit.rs: emit directxcl_sh<v>_<l>reads for shadowedv_readlane_b32inx64()mode without declaring VS/PS-onlyxcl_hw32.crates/xcl/src/gpu/recomp/tests.rs: addgpu_split_wave64_writelane_spill_shadowsGPU test covering lower- and upper-half spill reloads alongside a non-spill cross-half read.Measured on three spill-heavy retail wave64 compute shaders (RTX 3060 Ti, DXC 1.9.2609.5, before → after):
rla_u259 → 9, DXC 9231 → 4869 ms, DXIL 394692 → 293800 B (-25.6%), PSO 9118 → 6334 ms (-30.5%)rla_u311 → 17, DXC 14047 → 7720 ms, DXIL 506376 → 386384 B (-23.7%), PSO 11848 → 9305 ms (-21.5%)rla_u506 → 323, DXC 30955 → 24472 ms, DXIL 1200072 → 1113164 B (-7.2%), PSO 30468 → 27233 ms (-10.6%)Tested
x86_64-pc-windows-msvc), debug + release.cargo test --workspace -- --test-threads=1: 718 passed, 0 failed, 41 ignored (2 SKIPPED GPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)).--test-threads=4on commit1ec4c98, pre-existinghle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelsfailed intermittently (cascading 2PoisonErrors in unrelatedd3d12xtests); allrecomptests pass under both--test-threads=4and--test-threads=1.Regression run
(local folder name redacted to
retail-titlein both blocks; all metrics are exact output of the 60 s runs withXCL_NETWORK=0)main:
PR:
Not tested
split_wave64is false there so emitted HLSL is unchanged).CreateComputePipelineState).AI use
Mirror of xcl-dev#917 (auto-synced, do not edit).