Repository navigation
recomp: enable whole-wave branches and dead-SCC elision in split wave64 - #2203
Conversation
|
Heads-up from #1912, which changes the same call. AI use: Claude Code (Claude Opus 5.5) ran the merge check and wrote this note. |
|
Independent RTX 5080 16 GB check on Windows 11 Pro 25H2 (26200.9974), driver 617.14, Rust 1.98.1 and DXC/DXIL 1.9.2609.5. Both new tests passed on clean On direct parent Offline follow-up on the same RTX 5080 and revisions. The uncapped seeded sweep reproduced 26/205 → 39/205 per-lane compute programs and 35 → 2 whole-wave branch refusals. A separate 16 KiB-capped probe validated all 39 PR outputs, retained all 26 parent successes and created a D3D12 compute pipeline for each of the 13 newly emitted Wave64 programs on the RTX 5080. On seven separately matched compute programs previously investigated in the NVIDIA fork, the PR cleared the branch refusal in six. The per-lane path still emitted 0/7 due to SDWA half conversion, LDS or buffer atomics, and one unchanged |
|
AMD running the split wave64 form ("AMD split-wave64 drivers" is listed as untested), paired against On the RX 9070 XT,
Not tested: native wave64 with this PR (I only ran the forced split form here), Intel, a title. |
…test Both `self.tails[self.cur] = self.lw.cur()` sync lines in `DxilIr::ballot` and `DxilIr::read_lane` landed on `main` via xcl-dev#2203. Rebase xcl-dev#1928 onto `main` to keep only the standalone `[128, 1, 1]` split-wave64 (`Partner::Spin`) regression test covering: - whole-wave ballot (`s_bcnt1_i32_b64`) in a uniform branch arm feeding a join PHI, - cross-half `v_readlane_b32` (lane 37) in a uniform branch arm feeding a join PHI, - `v_readfirstlane_b32` (ballot + read_lane) in a uniform loop feeding back-edge PHIs. Each case compiles and validates through `lower_dxil::compute_split` and, when a GPU is available, checks dispatch parity against `run_compute_waves`. Part of xcl-dev#1889 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Test report on Setup: unmodified Fact (n = 2 with What the logs show: the growth is process-private memory in many 8-32 MB regions (about 50 per second); image, mapped files, the heaps and the sparse windows do not change, and video memory stays at 6.5 GB local. In the 30 s before the jump only graphics pipelines compile (1.8-3.3 s each), as in the control runs. The one difference in compile activity is the compute program Not identified: which allocation exactly (driver or process); the other four programs I checked (50625695d2e6cbe7, 206ed63b96be21a1, a9f2cd53943d5dc4, 4097cf4856634349) are still refused for IMAGE_SAMPLE_LZ / IMAGE_LOAD. Not tested: the commit before #2203 with per-lane in the game, runs in the world, AMD, a per-lane precompiled cache. One thing that could be tried is a size cap on the per-lane form (fall back to the split form above some DXIL size); I have not tried it. Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5). |
What is in it
wave_branches) in theXCL_PER_LANE=1split-wave64 compute form when the console wave's partner half is present or spin-synced (Partner::Present | Partner::SpinviaIr::can_wave_branch()).self.tails[self.cur] = self.lw.cur()after split-wave64ballotandread_laneexchanges inDxilIrso successor PHI incoming blocks track the post-exchange join block underPartner::Spin(same 2-line fix as Tests: add split_wave64_spin_exchange_updates_block_tails regression test #1928, needed here for multi-wave threadgroups to pass DXIL validation).compute_scc_liveness) overSummary::blocksand routes mask-op SCC writes (saveexec, bitwise mask ops, 64-bit mask compares,S_WQM) throughmask_nonzero_sccso dead SCC writes skip emitting whole-wave ballots (and split-wave64 exchange barriers).lower_dxil.rs:split_wave64_wave_branches_on_the_gpu(all 8wave_branch_caseson both[64, 1, 1]/Partner::Presentand[128, 1, 1]/Partner::Spin, validated withdxil.dlland checked for 128-thread GPU parity againstdxil::kernel::translate_compute) andsplit_wave64_dead_scc_skips_exchange_barrier(verifying barrier elimination and GPU output).Impact on a 2,000-program sample (
--direct --lanes --split 1 --sample 2000 --max-bytes 0, 205 compute programs):26 / 205to39 / 205(+50%), matching native wave64 (--split 0:39 / 205)."a branch on whether any lane of a"drop from35to2(the remaining 2 have partial threadgroup sizes wherethreads % 64 != 0, matching native wave64).dxil.dll 1.9validation in debug builds (0validator errors,0panics).50625695d2e6cbe7,206ed63b96be21a1,a9f2cd53943d5dc4), the whole-wave branch refusal is cleared (remaining refusals are downstreamIMAGE_SAMPLE_LZ/IMAGE_LOAD).Tested
rustc 1.100.0, DXC /dxil.dll1.9.2602.17, debug & release builds.cargo test --workspace -- --test-threads=4: 1156 passed, 0 failed, 46 ignored (SKIPPED GPU tests: 20 native wave64 tests on 32-lane NVIDIA GPU, 3 pre-existing f16/f32-to-f16 per-lane refusals, 1 driver-cache test without Windows Developer Mode, 1 heap-window test).cargo test -p xcl --lib gpu::recomp::lower: 55 passed, 0 failed (including both new split-wave64 GPU/validator tests).cargo test -p xcl --lib gpu::recomp::lane_masks: 13 passed, 0 failed.xcl shaders <pack> --direct --lanes --split 1 --sample 2000 --max-bytes 16384(debug build, validating every per-lane output viadxil.dll): 39/39 per-lane split-wave64 compute shaders validated with 0 errors.xcl shaders <pack> --direct --lanes --split 1 --sample 2000 --max-bytes 0vs--split 0(release build): 39/205 vs 39/205 compute programs, 0 validator errors, 0 panics.Regression run
Baseline (
main568e7db):PR (
283068c, run withXCL_PER_LANE=1):Not tested
AI use
Ir::can_wave_branch,compute_scc_liveness, thelower_dxil.rstail updates and unit/GPU tests, and running the validation