Skip to content

Recompiler: split wave64 compute groups of several waves across dispatches - #2097

Open
Kalmarv wants to merge 7 commits into
xcl-dev:mainfrom
Kalmarv:direct-multiwave-split
Open

Kalmarv wants to merge 7 commits into
xcl-dev:mainfrom
Kalmarv:direct-multiwave-split

Conversation

@Kalmarv

@Kalmarv Kalmarv commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1269. Stacked on #2080: only the last two commits are new here, bcde3f0 (the change) and 8b2fa0e (a test by @WebIdentity1).

#2080 splits wave64 programs only when the group is one 64×1×1 wave. In a 120 s title run, the longest cold compute builds are seven cascade-shadow programs with 8×16 and 16×16 groups (2 and 4 wave64s): 70–125k DXIL instructions each, 7–16 s per build, 87.5 s for all seven. They have no guest LDS, barriers or atomics. They are declined only because the wave64-on-wave32 emulation exchanges values between the two halves of each wave through translator-made group-shared counters and slots, and that state has to survive a dispatch boundary. With this change they split like the single-wave case and build in 1.7–2.5 s each.

What is in it

  • crates/xcl/src/gpu/dxil/module/split.rs:
    • Each wave32 half's continuation is indexed by the group's flat logical thread ID, recreated in every piece, so a different hardware wave order in the next dispatch is harmless.
    • A signal and its bounded wait on the partner half always stay in the same piece, because a wait cannot finish if its peer's signal moved to a later dispatch.
    • At each cut, every thread of the group meets at the piece exit and copies the per-half arrival counters and both banks of exchange slots to scratch. This includes threads whose guest path skipped the piece. The next piece restores them before branching. Each console wave keeps its own exchange count, since waves reach a cut at different counts.
    • Programs that use guest LDS, and partial guest waves, stay on the whole pipeline.
  • docs/wave64-on-wave32.md: describes the above.
  • A GPU test, dispatch_chain_four_wave64s_preserves_partner_epochs. It runs four wave64s in a 16×16 group, where only the odd guest waves do every exchange, across repeated cuts. It compares every output word with the whole shader and a CPU reference. A single common exchange count for all waves would fail it.

Tested

  • Ryzen 9 9950X, RTX 5070 Ti (NVIDIA 610.74), Windows 11 build 26200, release, DXC 1.9.2609.

  • Cold pipeline build, the seven cascade-shadow programs as the title emits them (byte-identical to the title's cache), fresh process, caches off; split pieces on 16 threads:

    Program Group Whole Split Pieces Faster
    1e436c8d3fe48b98 8×16 15.06 s 2.33 s 10 6.5×
    7ce8e57c276da3cc 8×16 15.63 s 2.50 s 11 6.2×
    6d1e4583f8129771 16×16 12.16 s 2.01 s 9 6.1×
    7c08ec6429245b8e 16×16 12.72 s 2.46 s 8 5.2×
    da1583f6d86ffae1 16×16 12.65 s 2.09 s 8 6.1×
    6f3a2502a8d6b129 8×16 6.97 s 1.67 s 6 4.2×
    dfdf55272f300cb9 16×16 12.32 s 2.20 s 9 5.6×

    All seven: 87.5 s whole against 15.3 s split, built one program after another. All 61 pieces pass the DXC 1.9 validator.

  • Output on the GPU, 6f3a2502a8d6b129 with a seeded input that reaches its shading store (8×16 group, four hardware waves): the whole and split forms each write 2048 words, 0 different, and both match the expected 256 texels. All six pieces ran (768 invocations against 128). A CPU trace of the signed pieces with their continuation tags shows all 128 lanes doing their work in pieces 1, 2, 4 and 6, and passing through 3 and 5 on the default continuation; the GPU's per-piece times agree (19–20 µs for 3 and 5, 34–418 µs for the others).

  • The new 16×16 test: all 512 output words match the whole shader and the CPU reference.

  • dispatch_chain_exited_waves_preserve_other_waves_3d, a fixture by @WebIdentity1 (comment), test only. In a 16×16 group on a 2×2×2 grid, guest wave 0 returns at once, wave 2 returns after six exchanges, and waves 1 and 3 take different exchange counts. The whole shader and its 5-piece split both match the CPU calculation on all 2048 output words plus 16 guard words. On ed1b606 (now 8b2fa0e) all five dispatch_chain GPU tests pass with no skips.

  • Intel Arc A770, measured by @JJAutoCompare (comment) on 9498862: the four-wave test passes, 512 of 512 words for the whole shader and the split chain.

  • AMD RDNA4 (native wave64), measured by @bielfreedom (comment), RX 9070 XT, on eafe39f: no change there, as expected. Of the title's 2,689 compute programs the same 462 split, with the same piece counts as Recompiler: split large direct compute pipelines at CFG edges #2080, because wave64 groups compile as native WaveSize(64) and chains are built only for 32-lane hardware waves. The dispatch_chain and split::tests tests pass, 6 of 6, with no skips; they build the split-wave64 form explicitly, so it ran on AMD hardware too.

  • The branch was rebased onto main f5c5bdf with Recompiler: split large direct compute pipelines at CFG edges #2080; the only conflict was in README.md. bcde3f0 and 8b2fa0e are c92e6df and ed1b606 rebased (they were c4178b3 and eafe39f before the rebase onto main 9633138).

  • cargo test --release --offline --workspace -- --test-threads=4 on 9498862, before the rebase onto Recompiler: split large direct compute pipelines at CFG edges #2080's current head: 1157 passed, 0 failed, 46 ignored, with 24 skip notices across 14 tests (no native wave64, unsupported per-lane forms, no heap windows). The new 16×16 test ran.

  • AMD Radeon RX 9070, regression pair by @Toons29 (comment), Ryzen 7 7800X3D, on c8a6e3f (this branch before the latest rebase), 60 s of a title on the default route: main 568e7db 1566 frames and this PR 1631, peak commit 14592 / 14565 MB, no crash or device removal in either.

  • cargo test --workspace -- --test-threads=4 (debug) on 8b2fa0e, rebased onto main 9633138: 1248 passed, 2 failed, 46 ignored. The two failures, device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa and pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator, fail on main 9633138 too; Tests: two expectations that no longer match the code #2245 fixed both on main since. 25 SKIPPED notices: no native wave64 on this card, three per-lane FP16 forms the per-lane lowering refuses, and no heap windows.

Regression run

The branch was rebased onto main 9633138 with #2080's current head 6c34370, with no conflicts of its own.

scripts/smoke.ps1 -Seconds 120, the same retail title, one after the other on the machine under Tested, release builds from clean trees.

main 9633138 (this PR's base):

xcl-smoke v1
commit: 963313835813f475037b3a9f5fcc3cb591696928
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1323 (PresentX 1323)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 29175 MB

this PR, 8b2fa0e:

xcl-smoke v1
commit: 8b2fa0e28c2773dd8b28cd6b5a95eee5517e9732
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 120
exit: 0x0
frames shown: 1309 (PresentX 1309)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 30321 MB

PR vs main: 1309 / 1323 frames (99 %), peak commit 30321 / 29175 MB (104 %); device removals 0 and crashes 0 on the PR run, 0 and 0 on main.

Both runs use XCL_DIRECT_DXIL=1 and start with the same private XCL pipeline cache, holding only the pipeline list; the driver's own cache was left alone. The PR run logged compute split: 55 programs split, 328 pieces built, 157 chained dispatches issued at 120 s (3 by 50 s, 12 by 60 s, all 157 by 70 s), and no piece ... refused warning. Before the rebase, eafe39f logged 57 programs, 305 pieces, 251 chains in the same setup; how far the title gets before it stops varies between runs. Both runs present no frames in their last 6 s, for a reason this change doesn't touch.

Not tested

  • AMD, native wave64 on hardware, Linux.
  • Output of the other six cascade-shadow programs on the GPU, and output on captured title inputs.
  • GPU time under controlled clocks. On the input above, at unlocked clocks, the split took 894 µs against 711 µs whole (9 runs, indicative only).

AI use

OpenAI Codex (GPT-6) wrote the change and the test. Claude Code (Claude Opus 5.5) helpers ran the driver timings and GPU checks, and Claude Code wrote this description and opened the PR.

🤖 Generated with Claude Code

@WebIdentity1

WebIdentity1 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Native Ampere check of 9498862415d1bbbd219f3d0fcf92936f297087a4: the three existing chain tests and a new whole-guest-wave early-exit case pass. No runtime defect found in these cases. The attached test exercises participation in the new group-wide checkpoint barriers after guest waves return.

Tested

  • Windows 10 Home 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74 / 32.0.15.9174, Rust/Cargo 1.98.1 MSVC, DXC/DXIL 1.8.2502.11, debug. Actual selected adapter printed NVIDIA GeForce RTX 3090.
  • XCL_ADAPTER=3090, XCL_DIRECT_COMPACT=0; XCL_REQUIRE_GPU, XCL_DIRECT_DXIL, XCL_SPLIT_WAVE64 unset.
  • cargo test --locked -p xcl --lib -- gpu::dxil::module::split::tests::dispatch_chain --test-threads=1 --nocapture: 4 passed / 0 failed / 0 ignored, zero SKIPPED notices, exit 0. Recompiled in 37.94s; harness 1.02s. These are harness timings, not pipeline-performance measurements.
  • New fixture: 16×16 group (four guest wave64s), grid (2,2,2). Guest wave 0 returns immediately, wave 2 returns after six exchanges, wave 1 takes only even-numbered exchanges, wave 3 takes all 12. Per-group/lane inputs differ. The whole shader and five-piece split chain both match the CPU calculation on all 2048 output words plus 16 tail guards. The plan requests 4096 scratch dwords/group, or 128 KiB for this grid; this is the plan's storage requirement, not measured peak GPU memory.
  • Existing author fixtures also pass: 96 words for native-wave 32 loops, 192 for single split-wave64 loops/exchange, 512 for four-wave partner epochs. All compare whole/split output with CPU expectations.
  • Only the attached test differs from the author head. All 324 source hashes matched before/after and the local snapshot.

Not tested: real title inputs or retail smoke, full workspace suite, native wave64, AMD/Intel, production D3D12.X chain allocation/lifetimes or ExecuteIndirect, arbitrary per-lane exits within a guest wave, cold driver compilation or GPU throughput. This tests the synthetic module/runner path on Ampere, not game compatibility. The original #2080 forward-edge test remains a result of its older exact snapshot.

AI use: Codex (GPT-6) inspected the change, wrote the new fixture, ran native verification and prepared this report.

Portable test-only patch on 9498862
diff --git a/crates/xcl/src/gpu/dxil/module/split.rs b/crates/xcl/src/gpu/dxil/module/split.rs
index 605b8c6..55440f3 100644
--- a/crates/xcl/src/gpu/dxil/module/split.rs
+++ b/crates/xcl/src/gpu/dxil/module/split.rs
@@ -757,6 +757,91 @@ mod tests {
         assert_eq!(runner::dispatch_split(&chain, groups, &input).unwrap(), reference);
     }
 
+    /// Guest waves that returned still participate in the checkpoint rendezvous
+    /// while other waves keep advancing their partner counters and slot banks.
+    #[test]
+    fn dispatch_chain_exited_waves_preserve_other_waves_3d() {
+        if !runner::wave32_supported().unwrap_or(false) {
+            runner::skip_test("no wave32 GPU");
+            return;
+        }
+        println!("CHAIN_EXIT_GPU={}", runner::adapter().unwrap());
+        let geometry = [16, 16, 1];
+        let cs = CsInterface { threads: geometry, ..Default::default() };
+        let options = KernelOptions { wave64: true, split: true, mem_windows: 1, sampler_base: 0 };
+        let mut lw = Lw::new(&[], &Default::default(), options, &Entry::Compute(cs));
+        let (tid, _) = lw.setup_lanes_compute(geometry, false);
+        let half = lw.lshrc(tid, 5);
+        let wave = lw.lshrc(tid, 6);
+        let [x, y, z] = [0, 1, 2].map(|axis| lw.s.group_id(axis));
+        let z = lw.shlc(z, 1);
+        let row = lw.add(z, y);
+        let row = lw.shlc(row, 1);
+        let group = lw.add(row, x);
+        let base = lw.shlc(group, 8);
+        let index = lw.add(base, tid);
+        let addr = lw.shlc(index, 2);
+        let mem = lw.mems[0];
+        let initial = lw.s.raw_load(mem, addr, 1)[0];
+        let acc = lw.tmp_var();
+        lw.wr(acc, initial);
+        let not_second_wave = lw.cmpc(Pred::Ne, wave, 1);
+        for round in 1..=12 {
+            if round == 1 || round == 7 {
+                let exit = lw.block(Some(1));
+                let live = lw.block(Some(1));
+                let stops = lw.cmpc(Pred::Eq, wave, if round == 1 { 0 } else { 2 });
+                lw.cond_br(stops, exit, live);
+                lw.s.m.set_block(exit);
+                let old = lw.rd(acc);
+                let value = if round == 1 { lw.addc(old, 100_000) } else { old };
+                lw.s.raw_store(mem, addr, &[value]);
+                lw.s.m.ret();
+                lw.s.m.set_block(live);
+            }
+            let mut exchange = |lw: &mut Lw| {
+                let payload = lw.addc(half, round);
+                let peer = lw.exchange(payload);
+                let old = lw.rd(acc);
+                let value = lw.add(old, peer);
+                lw.wr(acc, value);
+                Ok(())
+            };
+            if round % 2 == 1 { lw.guarded(not_second_wave, &mut exchange).unwrap(); }
+            else { exchange(&mut lw).unwrap(); }
+            let next = lw.block(Some(1));
+            lw.br(next);
+            lw.s.m.set_block(next);
+        }
+        let value = lw.rd(acc);
+        lw.s.raw_store(mem, addr, &[value]);
+        lw.s.m.ret();
+        lw.s.m.optimize();
+        let chain = lw.s.split_compute(geometry, Some(tid), 160).expect("split with exited guest waves");
+        assert!(chain.pieces.len() >= 3);
+        let whole = lw.s.finish_optimized(geometry, Some(32)).unwrap();
+        crate::gpu::dxil::validate::validate(&whole).expect("valid whole shader");
+        let input: Vec<_> = (0..2064u32).map(|i| if i < 2048 { i + 17 } else { 0xdeadbeef }).collect();
+        let expected: Vec<_> = input.iter().enumerate().map(|(i, &v)| {
+            if i >= 2048 { return v; }
+            let tid = i as u32 % 256;
+            let peer = (tid / 32) ^ 1;
+            match tid / 64 {
+                0 => v + 100_000,
+                1 => v + 6 * peer + 42,
+                2 => v + 6 * peer + 21,
+                _ => v + 12 * peer + 78,
+            }
+        }).collect();
+        println!("CHAIN_EXIT_STAGE whole pieces={} scratch_dwords_per_group={}", chain.pieces.len(), chain.dwords_per_group);
+        let reference = runner::dispatch(&whole, [2, 2, 2], &[], &input).unwrap();
+        assert_eq!(reference, expected, "whole program CPU oracle");
+        println!("CHAIN_EXIT_STAGE split");
+        let result = runner::dispatch_split(&chain, [2, 2, 2], &input).unwrap();
+        assert_eq!(result, expected, "split program CPU oracle");
+        println!("CHAIN_EXIT checked_words=2048 guards=16 pieces={} scratch_dwords_per_group={}", chain.pieces.len(), chain.dwords_per_group);
+    }
+
     #[test]
     fn dispatch_chain_wave32_live_loops() { compare(32); }
 

@JJAutoCompare

Copy link
Copy Markdown

Intel Arc A770 verification for XCL PR #2097

Tested

$env:CARGO_TARGET_DIR = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target'
$env:CARGO_BUILD_JOBS = '2'
$env:CARGO_INCREMENTAL = '0'
$env:CARGO_PROFILE_DEV_DEBUG = '0'
$env:CARGO_PROFILE_TEST_DEBUG = '0'
$env:TEMP = 'L:/XclTooling/pr2097/run-20261125T040217981Z/temp'
$env:TMP = $env:TEMP
$env:XCL_ADAPTER = 'A770'
$env:XCL_DXC_DIR = Join-Path $env:LOCALAPPDATA 'XclTooling/dxc-1.9.2609/bin/x64'
cargo test --locked -p xcl --lib --no-run

The GPU command ran in a fresh powershell.exe -NoProfile -ExecutionPolicy RemoteSigned process. Within the wrapper, System.Diagnostics.Process ran the following executable and arguments, captured stdout and stderr separately, and passed the child exit status to the wrapper.

$exe = 'L:/XclTooling/pr1512-tiling-edges-fddfa267/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
    & $exe gpu::dxil::module::split::tests::dispatch_chain_four_wave64s_preserves_partner_epochs --exact --nocapture --test-threads=1
}
  • 1 passed, 0 failed, 0 ignored, 0 explicit skips, 1126 filtered out. The harness reported 0.78 s. The child and GPU wrapper both exited 0. The wrapper logged GPU lock release and completed at 2026-11-25T05:04:09.3691366+01:00. The exclusive Cargo target slot is released. Separate stdout, stderr, and exit status files are beside this report.
  • Two 16 × 16 × 1 groups ran four logical wave64s per group, each split into two 32-lane hardware waves. The fixture requires wave32 support and emits wave size 32 for the whole shader and every piece of the direct-DXIL chain. It asserts at least three pieces. All 512 output words from the whole GPU dispatch matched the CPU reference, and all 512 from the split chain matched the whole GPU dispatch.
  • For output index i (zero-based), the CPU reference starts at i + 1. With tid = i % 256, it adds ((tid / 32) ^ 1) + round for each exchange from rounds 1 through 12. Odd guest waves take all 12 rounds. Even guest waves take the six even rounds. This checks that the partner exchange and live accumulator survive the dispatch cuts when different guest waves reach them with different exchange counts.

Not tested

Other fixtures, workspace suite, retail-title smoke, real-title shader output, cold pipeline timing, other adapters and drivers, native wave64, and the HLSL backend.

AI use

T3 Code / Codex (gpt-6.2-sol) verified the PR and worktree, ran the stock fixture, and wrote this report.

Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 25, 2026
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@Kalmarv
Kalmarv force-pushed the direct-multiwave-split branch from 9498862 to ed1b606 Compare November 25, 2026 04:07
@Kalmarv

Kalmarv commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@WebIdentity1 thanks, your early-exit fixture is in the PR as ed1b606, test-only, with you as co-author. I also rebased the PR onto #2080's current head, 17a984b, so this PR's own changes are now the last two commits.

On an RTX 5070 Ti (NVIDIA 610.74, DXC 1.9.2609) all five dispatch_chain GPU tests pass with no skips. In your fixture, the whole shader and its 5-piece split both match the CPU calculation on 2048 words plus 16 guard words.

The description check will fail until I add a regression run made on this head. That run is queued.

AI use: Codex helpers adapted the fixture and ran the tests, and Claude Code (Claude Opus 5.5) wrote this comment.

Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 25, 2026
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@Kalmarv
Kalmarv force-pushed the direct-multiwave-split branch from ed1b606 to eafe39f Compare November 25, 2026 05:01
@JoaoPauluu

Copy link
Copy Markdown

Same as on #2080, plus this PR's two tests. A run with vkd3d-proton as the host D3D12. 5 of the new dispatch-chain GPU tests crash the test process inside vkd3d-proton.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from Linux: docs/linux.md, scripts/linux and Wine start-up checks for vkd3d-proton and DXVK (#154, #241) #257, DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. eafe39f as it is (merge base with main f5c5bdf), no uncommitted changes. The lib test binary runs under Wine, one test per process, twice: at ed1b606 and at eafe39f, with the same result.
    • dispatch_chain_exited_waves_preserve_other_waves_3d: crashes (see below)
    • dispatch_chain_four_wave64s_preserves_partner_epochs: crashes (see below)
    • dispatch_chain_divergent_forward_edges_3d: crashes (see below)
    • dispatch_chain_wave32_live_loops: crashes (see below)
    • dispatch_chain_wave64_live_loops_and_exchange: crashes (see below)
    • dispatch_chain_native_wave64_builds_whole: ok, SKIPPED (no wave64)
  • Each failing test kills the process before it reports anything (exit 5): an access violation, page fault on read access to 0x0000000000000110, at 0x6ffffca2b118. That address is inside vkd3d-proton's d3d12core.dll, which is loaded at 0x6ffffc880000. I traced it for dispatch_chain_wave32_live_loops; the others end with the same exit code. So the host's D3D12 crashes on something the dispatch chain does. I have not found which call.

Not tested

  • the split programs on the retail title, the whole suite on this head, native Windows, AMD.

AI use

  • Claude Code (Claude Opus 5.5) built the commit, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

IvyNotFound added a commit to IvyNotFound/xcl that referenced this pull request Nov 25, 2026
# Conflicts:
#	crates/xcl/src/gpu/dxil/module/split.rs
IvyNotFound added a commit to IvyNotFound/xcl that referenced this pull request Nov 25, 2026
…#2080/xcl-dev#2097's chain tests and xclm's compact tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IvyNotFound added a commit to IvyNotFound/xcl that referenced this pull request Nov 25, 2026
In the second XCLM run no graphics pipeline was built after world load (74 s): the workers
were all on huge compute pipelines and the split pieces of xcl-dev#2080/xcl-dev#2097/xcl-dev#2107, which went to
the lane taken first. Every draw went on with its stand-in (7936 of 19940 skipped) and the
screen stayed black. A quarter of the workers (at least 2, XCL_PSO_GFX_WORKERS) now take
graphics builds only, and compute pieces go to the front of the compute lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bielfreedom

Copy link
Copy Markdown

AMD RDNA4 check of #2097 (eafe39f): no effect on the native-wave64 path, as expected, and the tests pass.

Setup

  • GPU: RX 9070 XT 16 GB (RDNA4, native wave64), AMD driver 32.0.32029.2010.
  • System: Windows 11, release.

Results

  • Census:
    • Run: XCL_DIRECT_DXIL=1, default split target, all 2,689 retail compute programs, with a local logging patch that records each program's dispatch_chain piece count.
    • 462 split programs, with piece counts identical to Recompiler: split large direct compute pipelines at CFG edges #2080's for every program. No program changes.
    • That fits the description: on this adapter, wave64 groups compile as native WaveSize(64), and chains are only built for hardware wave 32. So the cascade-shadow programs keep their whole pipeline here, as before.
  • Tests:
    • cargo test --release -p xcl --lib -- dispatch_chain split::tests --test-threads=1 with XCL_REQUIRE_GPU=1 and XCL_ADAPTER=9070: 6 passed, 0 failed, no SKIPPED notices.
    • That includes dispatch_chain_four_wave64s_preserves_partner_epochs and dispatch_chain_exited_waves_preserve_other_waves_3d.
    • These tests build the split-wave64 form explicitly, so they ran the emulated form on AMD hardware too.

Read / inference: this PR is a gain for 32-lane GPUs only. On AMD those programs still build whole. A native-wave64 chain would be a separate change, as discussed on #2080.

AI use: Claude Code (Claude Opus 5.5) ran the census and tests and wrote this. Counts only, no game data.

@O5-7 O5-7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent test report for PR #2097 on head commit eafe39f1a5329b08204cc423238456bedddd8557 (eafe39f).

Setup

  • GPU: NVIDIA GeForce RTX 5080 16 GB (wave32-only, driver 32.0.15.9579)
  • CPU / RAM: AMD Ryzen 7 9700X, 32 GB RAM
  • OS / Toolchain: Windows 11 Pro 10.0.26100, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.8.2502.11 (Windows SDK 10.0.26100.0)

Test results (debug)

  • cargo test -p xcl dispatch_chain -- --nocapture: 6 passed, 0 failed, 0 ignored (dispatch_chain_native_wave64_builds_whole reported SKIPPED ...: no wave64 on this wave32-only GPU)
  • XCL_DIRECT_DXIL=1 cargo test -p xcl dispatch_chain -- --nocapture: 6 passed, 0 failed, 0 ignored (dispatch_chain_native_wave64_builds_whole reported SKIPPED ...: no wave64 on this wave32-only GPU)
  • cargo test --workspace -- --test-threads=4: 1160 passed, 0 failed, 46 ignored

Regression run (clean detached HEAD eafe39f)

xcl-smoke v1
commit: eafe39f1a5329b08204cc423238456bedddd8557
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1685 (PresentX 1685)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14105 MB

(Same clean-machine main cbc296a 60 s baseline: 1686 frames (PresentX 1686), 60 60 60, 0 removals, 0 crashes, 14083 MB.)

AI use

  • Antigravity (Gemini 4 Neon) ran the builds, test suites, and smoke run, and formatted this report.

Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 25, 2026
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@Kalmarv
Kalmarv force-pushed the direct-multiwave-split branch from eafe39f to 3c818a2 Compare November 25, 2026 10:45
Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 25, 2026
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@Kalmarv
Kalmarv force-pushed the direct-multiwave-split branch from 3c818a2 to b31aa81 Compare November 25, 2026 10:50
Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 25, 2026
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@Kalmarv
Kalmarv force-pushed the direct-multiwave-split branch from b31aa81 to bbca73c Compare November 25, 2026 11:00
Kalmarv added a commit to Kalmarv/xcl that referenced this pull request Nov 25, 2026
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@Kalmarv
Kalmarv force-pushed the direct-multiwave-split branch from bbca73c to c8a6e3f Compare November 25, 2026 11:10
@Toons29

Toons29 commented Nov 25, 2026

Copy link
Copy Markdown

Regression run of c8a6e3fb on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 568e7db7, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 568e7db7729c8fa6c8f0f4b32d798faaf11462bb
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14592 MB
xcl-smoke v1
commit: c8a6e3fbb2c2e476f7aac61fd4e7179474889f7e
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14565 MB

Against the limits in CONTRIBUTING.md: 104 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
Kalmarv and others added 7 commits November 25, 2026 06:46
Keep control-flow cycles in one pipeline, pass edge-live values through per-dispatch scratch and compile the pieces on the PSO workers. Direct dispatch records the chain with UAV ordering. Indirect dispatch builds the whole form on demand.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The synthetic split fixture declared u2 twice with different coherence flags. Bind its existing memory window and validate the whole fixture before checking the cut.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adjacent lanes previously accessed ef008c0f's continuation data 1,612 bytes apart. Store the tag and each live dword in a separate lane-contiguous plane; transport both halves of i64 values through their own planes.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adopt WebIdentity1's fixture from xcl-dev#2080. Lanes return early, skip ahead
over a piece, or run different numbers of loop iterations. Check the
whole and split outputs against the CPU model and guard words on a
2 x 3 x 2 dispatch grid for native wave32 and split wave64.

Source: xcl-dev#2080 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
Compile and validate a partitionable CFG through the native-wave64 admission gate. On a wave64 adapter, run the whole pipeline and check its lane count and output. Identify the existing compare(64) case as two hardware waves.

Assisted-by: OpenAI Codex (GPT-6)
Use the workgroup's flat logical thread ID for the continuation of each
wave32 half. Keep each counter signal with its peer wait, and transfer
the per-half arrival counters and double-buffered exchange slots at a
group-wide rendezvous between pieces. Wave allocation starts afresh in
each piece. Leave guest LDS and partial guest waves on the whole path.

Exercise four wave64s with different exchange epochs across repeated
cuts and compare every output word to the whole shader and a CPU oracle.

Assisted-by: OpenAI Codex (GPT-6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adopt WebIdentity1's four-wave fixture. Two guest waves return at
different points while the other waves keep exchanging. Compare the
whole shader and the dispatch chain to the CPU oracle across a 3D grid.

Source: xcl-dev#2097 (comment)
Assisted-by: OpenAI Codex (GPT-6)
Co-authored-by: WebIdentity1 <212448219+WebIdentity1@users.noreply.github.com>
@thehollowedone

Copy link
Copy Markdown

Independent Windows/NVIDIA run on clean 8b2fa0e, with a separate integration against main 1a0bbe3. Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC and DXC/DXIL 1.8.2502.11, debug.

Tested
cargo build --offline --locked --workspace --jobs 6 passed on both builds. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture gave 1248 passed, 2 failed, 46 ignored on the exact head and 1257 passed, 0 failed, 46 ignored on the main integration. The exact-head cache-marker and UAV-format assertion values match the two failures isolated on the same pinned base for #2080. Both counts include 26 runtime skip notices.

cargo test --offline --locked -p xcl --lib <filter> -- --test-threads=1 --nocapture passed separately for dispatch_chain_four_wave64s_preserves_partner_epochs and dispatch_chain_exited_waves_preserve_other_waves_3d on the exact head, with zero skips. The first matched all 512 expected outputs. The 3D early-exit fixture matched all 2,048 outputs and preserved 16 guard words, with four pieces and 4,352 scratch dwords per group. Both cases also passed in both workspace runs.

Not tested
Wine, native wave64, retail world load, or driver compilation timing.

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this report.

@Kalmarv

Kalmarv commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Status: #2080, #2107 and #2126 are merged. This PR now conflicts with main afc5ee8 in split.rs, and the conflict needs real integration rather than a mechanical rebase:

The rework comes next, with a new suite and smoke pair. Until then, the current head 8b2fa0e is only tested against the old base. @joeypercia, #2299 sits on this PR and will meet the same make_piece change.

AI use: Claude Code (Claude Opus 5.5) wrote this status note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants