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). |
…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)
An instrumentation plan written against a stale tree measures the wrong thing, so the spec's assumptions were diffed against the 154 commits the sync merged. Nothing collides, and the two files D6 extends (log.rs, report.rs) are untouched, as are all of our own files and all seven switch names the spec proposes. Upstream added no telemetry of its own. Four things moved and are now recorded in the document: - XCL_WAVE64_SPIN already exists in gpu/recomp/emit.rs and defaults to the expensive spin rendezvous. The ~4x counter-paired case is therefore already a one-run A/B experiment rather than something to build, and it joins the loop-cap probe as a first measurement. - Split-dispatch scratch is being actively bounded upstream (XCL_SPLIT_SCRATCH_MB, hle/d3d12x/real/dispatch_chain.rs, three commits). H1 is restated: the question is whether scratch still dominates after that bounding, not whether anyone knows about it. - Two of the nine wave64 pull requests landed (xcl-dev#2305, xcl-dev#2203), so the exchange baseline moved and section 5.6's counts must be taken on this tree rather than against the figures in docs/wave64-on-wave32.md. - present.rs gained a compositor and a present ring, so part 5 (headless) is larger than its ~250-line estimate and needs re-estimating before it starts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RbZXznytQeB5KoWdhtdy5
… block xcl-dev#2420 fixed this test after xcl-dev#2203 (whole-wave branches in split wave64) put the exchange of the `s_cbranch_execz` condition into the entry block, by counting only the barriers past the entry block's branch. A program that is no longer the split form (no barrier anywhere) passes that check too, so also require at least one group barrier in the entry block, as xcl-dev#2379 did, and drop the doc comment's "the only barrier left is the one at the start", which has not held since xcl-dev#2203. With `Lw::local_masks` forced off (xcl-dev#2074's fix switched off) the test still fails, on 2 barriers past the branch. Assisted-by: Claude Code (Claude Opus 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