Skip to content

Recompiler: large compute programs call shared helpers instead of inlining them - #1901

Draft
SamG-Coder wants to merge 1 commit into
xcl-dev:mainfrom
SamG-Coder:recomp/shared-helpers
Draft

SamG-Coder wants to merge 1 commit into
xcl-dev:mainfrom
SamG-Coder:recomp/shared-helpers

Conversation

@SamG-Coder

Copy link
Copy Markdown

Part of #1269. Replaces draft #1867, which combined this with other changes. Large compute programs call one shared copy of the memory-window accessors, the split-wave64 exchange and the typed-format conversions instead of having DXC inline them at every use. On six retail compute programs of 1.3 – 6.7 MB HLSL, pipeline creation is 2.1 – 5.9× faster with the default memory windows and 1.13 – 3.7× faster with XCL_HEAP_WINDOWS=1, and the DXIL 4 – 28 % smaller (tables below).

What is in it

  • Em::finish takes the program's instruction count. From 1 024 instructions (compute and kernel mode), the memory-window accessors and the split-wave64 exchange functions are [noinline], with scalar parameters and out results, which SM 6.6 DXIL keeps as calls. Vector loads and stores go through one scalar _shared function per width.
  • From 256 instructions the typed-format helpers (fmt_value, fmt_pack_shared, st_bytes_shared) are [noinline] in the same way. fmt_comp is split so the conversion takes scalars; fmt_pack and st_bytes keep their signatures as wrappers. The store logic is unchanged.
  • Heap windows (XCL_HEAP_WINDOWS=1) keep their single access: only the switch form's accessors are outlined.
  • The EXEC bit test (lanebit) stays inline. As a [noinline] call it made the driver slower on every program measured (with heap windows, the 3.40 MB program: 5.83 s inline, 7.27 s as a call).
  • Test: gpu_large_compute_shares_wave_and_window_helpers checks that a small program stays inline, that a large one calls the shared accessors, that the outlined DXIL is smaller than the same source inlined, and that both memory windows and a vector load return the right values on the GPU.

Measurements (xcl shaders <pack> --measure-pso <record> --repeat 3: DXC, then CreateComputePipelineState with the driver cache off; main c4d37be against this PR on the same machine, one program at a time; a second pass agrees within 3 %)

Default memory windows (switch form):

HLSL DXIL main → PR DXC main → PR PSO median main → PR speed-up
1.30 MB 369 → 273 KB 2.49 → 1.56 s 4.11 → 1.45 s 2.8×
1.92 MB 460 → 338 KB 8.99 → 5.55 s 8.94 → 2.26 s 4.0×
2.73 MB 747 → 539 KB 6.09 → 4.27 s 11.84 → 3.48 s 3.4×
3.40 MB 850 → 690 KB 5.89 → 5.53 s 29.34 → 5.01 s 5.9×
4.21 MB 1 050 → 878 KB 8.07 → 8.28 s 42.41 → 8.66 s 4.9×
6.72 MB 1 642 → 1 457 KB 25.28 → 18.95 s 39.53 → 18.71 s 2.1×

XCL_HEAP_WINDOWS=1:

HLSL DXIL main → PR DXC main → PR PSO median main → PR speed-up
1.30 MB 319 → 250 KB 2.30 → 1.59 s 4.43 → 1.59 s 2.8×
1.92 MB 353 → 330 KB 7.47 → 5.82 s 3.48 → 2.37 s 1.5×
2.73 MB 640 → 498 KB 5.91 → 4.41 s 14.56 → 3.90 s 3.7×
3.40 MB 663 → 617 KB 5.62 → 4.31 s 6.64 → 5.87 s 1.13×
4.21 MB 832 → 796 KB 6.74 → 6.11 s 9.29 → 7.00 s 1.3×
6.72 MB 1 362 → 1 093 KB 20.33 → 18.28 s 42.76 → 13.47 s 3.2×

DXC is slower on one of the twelve (4.21 MB, default windows: +3 %).

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce RTX 5080, driver 616.64 (32.0.16.1664), AMD Ryzen 7 9800X3D, Windows 11 (10.0.26300), Rust 1.95.0, release
  • cargo test --workspace -- --test-threads=4: 960 passed, 0 failed, 43 ignored (SKIPPED GPU tests: 12 tests, 22 cases: the wave64 cases of gpu::recomp::lower / lower_dxil and gpu_wave32_program_in_wave64_hardware, gpu_geometry_wave32_prefix_count_over_a_mask for no wave64 on this GPU; heap_window_out_of_memory_falls_back_to_the_switch_form for no heap windows). Release build, after cargo build --workspace --release.

Regression run

main:

PR:

Not tested

  • No scripts/smoke.ps1 regression run yet (main or PR); required before this leaves draft.
  • Only an NVIDIA GPU with 32-lane waves (split wave64). No AMD or native wave64 runs, and no Linux / vkd3d-proton runs.
  • Pipeline times are for six programs from one pack, measured one at a time; no title run with the change.

AI use

  • Claude Code (Claude Opus 5.5): split this change out of the author's work, ported it onto current main, found and removed the lanebit slowdown by measuring each part on its own, ran the tests and measurements, and wrote this description.

…ining them

DXC inlines every helper before it optimises, so a large compute program
gets a copy of the memory-window switch, the split-wave64 exchange and
the typed-format conversions at every use, and the driver compiles all
of them. From 1 024 instructions (256 for the format helpers) these stay
[noinline] with scalar parameters, which SM 6.6 DXIL keeps as calls.
Heap windows keep their single access. The EXEC bit test stays inline:
as a call it made the driver slower.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HKEY-Funk-Machine

Copy link
Copy Markdown

@SamG-Coder the device suspension I reported on #1867 (#1867 (comment)) is still there on #1901 at 5064119, on an RX 9070 (RDNA4). It looks tied to the outlined switch-form window accessors: with XCL_HEAP_WINDOWS=1, where this PR leaves the accessors inline, the same program builds, and its DXIL is identical to the base's.

62b584e061c05fc5 c4d37be (base) 5064119 (this PR)
switch windows (default, 4) 197 280 B DXIL, built in 6.2 s Unknown pointer operation encountered during ParseAddress, then 0x887A0005 (device suspended)
XCL_HEAP_WINDOWS=1 158 700 B, built in 3.8 s 158 700 B, built in 3.8 s

Tested

  • 5064119 and its base c4d37be, release. One local-only change in measure_pso: no Windows Developer Mode here, so ShaderCacheControl(DISABLE) fails (0x887A002D). I made that a warning and ran each measurement under an xcl.exe copied to a new name, which gives the AMD driver a cold cache.
  • xcl shaders <pack>/shaders.rpf --measure-pso 62b584e061c05fc5 --repeat 1, one process each.
  • AMD Radeon RX 9070 (RDNA4, native wave64, so no split-wave64 exchange), driver 32.0.32015.7029, Ryzen 9 7945HX3D, 32 GB, Windows 11 Pro 26300, DXC 1.9.2602.17.

Not tested

AI use: Claude Code (Claude Opus 5.5) ran the measurements and wrote this comment.

@WebIdentity1

Copy link
Copy Markdown

Synthetic isolation for the outlined switch-window accessors on an RTX 3090, exact #1901 head 5064119216a6443dead457f6a3e16cdf58bd29a8 and parent c4d37bec1bb4286eb373aea963404a23f13401fa.

I padded the existing gpu_memory_windows_above_4_gib program with 1,024 S_NOPs so this PR takes its large-compute outline path. The test already checks window-1 scalar/buffer/global reads, window-0/1 writes, and a window-1 global atomic. The overlay also accepts either switch syntax and asserts that the PR's switch form emits [noinline] void xcl_mInterlockedAdd(...); its heap form must not. This is a small public fixture an AMD tester can run to see whether a simple outlined atomic/accessor program triggers the reported ParseAddress failure or whether that needs the larger program's structure.

Tested — native Windows 10 19045, RTX 3090 driver 591.74, Ryzen 7 7800X3D, Rust 1.98.1 MSVC, DXC 1.8.2502.11; XCL_ADAPTER=3090, HLSL path, default split-wave64 selection. Each snapshot was 303 source files and matched its SHA-256 manifest before/after. Cargo logs show a fresh Compiling xcl for each snapshot.

  • cargo test --locked -p xcl --lib gpu_memory_windows_above_4_gib -- --test-threads=1 --show-output: parent 1/0/0; PR 1/0/0. On the corrected PR overlay, outlined atomic: true, GPU result 1/0/0.
  • cargo test --locked -p xcl --lib gpu_memory_windows_from_the_heap -- --test-threads=1 --show-output: parent 1/0/0; PR 1/0/0. On the corrected PR overlay, outlined atomic: false, GPU result 1/0/0.
  • The PR's gpu_large_compute_shares_wave_and_window_helpers: 1/0/0 on the RTX 3090.

The added test lines on #1901's tests.rs are:

-    let p = prog(&refs);
+    let mut p = encode("S_NOP", "ENC_SOPP", &[], None).unwrap().repeat(1024);
+    p.extend(prog(&refs));
     let one = translate(&p, &Options::default()).unwrap();
@@
-    assert_eq!(t.hlsl.contains("switch (xcl_w)"), !heap, "heap windows: no switch over windows");
+    assert_eq!(t.hlsl.contains("switch (xcl_w)") || t.hlsl.contains("switch (window)"), !heap, "heap windows: no switch over windows");
+    let outlined_atomic = t.hlsl.contains("[noinline] void xcl_mInterlockedAdd(");
+    assert_eq!(outlined_atomic, !heap, "large switch-form program should outline the atomic accessor");
+    println!("outlined atomic: {outlined_atomic}");

Not tested: AMD, the failing retail shader, full suite, retail smoke, cold compilation time or memory. These passes show this small outlined program works on the 3090; they do not explain or dismiss the RX 9070 device suspension. I corrected and reran an initial diagnostic that looked for the wrong (uint) helper return type; only the void assertion above proves the outlined path.

AI use: Codex desktop (GPT-6) prepared the synthetic test overlay, ran the paired Windows checks and drafted this report from retained logs.

@Melow-code Melow-code left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The 2-6x PSO creation speedup is significant. The RDNA4 device suspend on outlined switch-form accessors is the blocker — the driver may not handle cross-function LDS access correctly with noinline. Worth checking if the suspend reproduces with only the LDS helpers outlined, leaving the typed-format ones inlined.

@CharlyRien

Copy link
Copy Markdown

Run time on an RTX 3090 (32-lane waves, split wave64): the programs build faster but run 1.7 – 2.7× slower, because the split-wave64 exchange helpers are now calls. With those inline again the run time is back to the base's.

The description measures DXC and pipeline creation. This adds the GPU time of the dispatches themselves, same trees.

Setup

  • Trees: main c4d37be (base) and c4d37be + this PR's commit 5064119. Each carries only a local test harness (not for upstream): it builds the memory windows as the runtime does (VirtualAlloc, OpenExistingHeapFromAddress, placed buffers; views from the descriptor heap with XCL_HEAP_WINDOWS=1, root UAVs otherwise), runs one translated program with given inputs and times each Dispatch with timestamp queries.
  • Because c4d37be declares every compute memory window globallycoherent, and that alone costs seconds per dispatch on the imported host heap (see Recompiler: emit globallycoherent on compute memory windows only when needed #1850 and GPU heaps in host memory: residency, CPU readback and wait-release data from a PS5 relinker #1640), the harness removes the qualifier from the HLSL of both trees. Otherwise the code shape cannot be seen in the timings.
  • Program A: 1 333 instructions, one captured world-load dispatch of a retail title replayed with its real inputs (32x32x2 groups of 4x4x4, loops, 50 ballot and 75 read-lane exchange sites). Program B: 4 110 instructions, synthetic inputs (constant buffer filled, textures zero, 1 024 groups), so its timings are synthetic.
  • GPU time: median of 7 dispatches, two separate runs, nothing else on the GPU. Pipeline time: one CreateComputePipelineState of a copy that differs by a never-taken store, so the driver cache misses (ShaderCacheControl(DISABLE) is refused without Developer Mode).
  • RTX 3090 24 GB, driver 616.56, Ryzen 9 5950X, Windows 11 22631, DXC 1.9.2602.17, release.

Results

program windows GPU ms, base (run 1 / run 2) GPU ms, PR same output pipeline s, base → PR DXIL KB, base → PR
A (real inputs) heap 11.10 / 11.13 25.59 / 23.39 yes 1.66 → 0.86 108 → 71
A (real inputs) switch 12.01 / 11.30 32.31 / 28.33 yes 2.76 → 1.07 138 → 86
B (synthetic) heap 0.732 / 0.731 1.270 / 1.269 yes (weak: one word written) 6.1 → 3.4 309 → 175
B (synthetic) switch 0.735 / 0.734 1.393 / 1.396 yes (weak) 11.3 → 2.6 403 → 194

Which helper costs the time (program A, [noinline] removed from one group at a time in the PR's HLSL)

heap windows switch windows
PR as it is 25.6 / 23.4 32.3 / 28.3
split-wave64 exchange helpers inline again 11.7 / 10.6 26.3 / 22.4
window accessors inline again (already inline) 26.9 / 25.1
both inline 12.4 / 12.0
  • Heap form: the description says heap windows keep their single access, which is true of the accessors, but the exchange helpers (xcl_x_ballot_shared, xcl_x_meet, …) go out of line from 1 024 instructions in both forms, and that is the whole slowdown there.
  • Switch form: both groups cost about the same, and only putting both back inline restores the base time.
  • Within the exchange group on the heap form: only xcl_x_ballot_shared inline gives 13.9 / 13.5 ms; only xcl_x_meet left out of line 15.6 / 13.6 ms.

So on 32-lane GPUs the trade here is about half the pipeline-creation time once, against about twice the GPU time of every dispatch of a program that loops. A threshold on the number of exchange sites inside loops, or keeping the exchange inline and outlining only the accessors and the format helpers, would keep most of the build gain; I have not measured those variants.

One more thing for the cache: the typed-format code at the top of every program is rewritten for all sizes, so the HLSL of every compute program of the pack changes, including the quarter of them under 256 instructions. A translated-shader cache is rebuilt entirely.

Not tested

  • AMD or any native wave64 GPU (no split form there, so the exchange helpers do not exist).
  • Real inputs for any program other than A; the typed-format helpers' run-time effect (neither program uses them).
  • Run time with globallycoherent kept: not measured for the PR (program A takes about 7.4 s per dispatch on the base that way, which hides everything else).
  • Pipeline time with the driver cache really off.
  • Recompiler: large compute programs share repeated code with DXC and the driver #1867's DXIL for program A is byte-identical to this PR's in both forms, and it timed the same.

AI use: Claude Code (Claude Fable 5.2 coordinating, Claude Opus 5.5 for the port of the harness and the measurements) ran this and drafted the report.

@oni-swr

oni-swr commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

RDNA3 data point for #1901 at 5064119216a6443dead457f6a3e16cdf58bd29a8 vs parent c4d37bec1bb4286eb373aea963404a23f13401fa on an RX 7800 XT: the same device suspension (0x887A0005) reproduces on RDNA3 — including on this PR's own GPU unit test and under XCL_HEAP_WINDOWS=1 whenever any [noinline] internal DXIL function remains.

Unlike RDNA4's Unknown pointer operation encountered during ParseAddress, the RDNA3 driver prints unsupported to stdout/stderr right before CreateComputePipelineState returns 0x887A0005.

Results

PR unit test (gpu_large_compute_shares_wave_and_window_helpers, added in 5064119, not present on c4d37be):

  • cargo test --release -p xcl --lib gpu_large_compute_shares_wave_and_window_helpers -- --test-threads=1 --nocapture (XCL_ADAPTER="7800 XT"): FAILED — prints unsupported, then panics at CreateComputePipelineState: The GPU device instance has been suspended... (0x887A0005).

Three retail compute records (xcl shaders <record>.bin --measure-pso <hash> --split 0 --windows 4 --repeat 3, one process per measurement, 5 s wait after each device suspension):

record windows c4d37be (base) 5064119 (this PR) PR internal DXIL funcs (dxc -dumpbin)
9136eb6afa6d8a2e (postfx_aces:CS_BakeACES...) switch (4) 169 052 B DXIL, 1.56 s DXC, 1.424 s median (1.373–1.477 s) 135 408 B DXIL, unsupported → 0x887A0005 3 (xcl_mLoad, xcl_mLoad4_shared, xcl_loadx4_shared)
9136eb6afa6d8a2e XCL_HEAP_WINDOWS=1 134 988 B DXIL, 1.30 s DXC, 0.983 s median (0.980–0.992 s) 134 988 B DXIL, 1.83 s DXC, 1.043 s median (0.937–1.203 s) 0 (@main only)
d10c0a5491f60cad (indirect_light_probes:CS_IrradianceCache...) switch (4) 396 216 B DXIL, 5.74 s DXC, 6.576 s median (6.356–6.770 s) 278 284 B DXIL, unsupported → 0x887A0005 11 (xcl_m*, xcl_loadx4_shared, fmt_value, st_bytes_shared, fmt_pack_shared)
d10c0a5491f60cad XCL_HEAP_WINDOWS=1 325 268 B DXIL, 5.08 s DXC, 5.190 s median (5.036–5.249 s) 284 652 B DXIL, unsupported → 0x887A0005 3 (fmt_value, st_bytes_shared, fmt_pack_shared)
de83041b451429d1 (sr_tracing:CS_ResolveGBuffer_Opaque) switch (4) 526 584 B DXIL, 6.55 s DXC, 18.548 s median (17.323–21.435 s) 418 216 B DXIL, unsupported → 0x887A0005 4 (xcl_mLoad, xcl_mLoad4_shared, xcl_loadx4_shared, fmt_value)
de83041b451429d1 XCL_HEAP_WINDOWS=1 424 892 B DXIL, 6.28 s DXC, 10.588 s median (10.136–10.712 s) 385 092 B DXIL, unsupported → 0x887A0005 1 (fmt_value)

DXIL validation & isolation finding

  • All six PR DXIL containers pass IDxcValidator (dxil.dll 1.8.2502.11, hr=0x0) and disassemble cleanly with dxc -dumpbin.
  • de83041b451429d1 with XCL_HEAP_WINDOWS=1 isolates the failure beyond switch-form memory windows and out pointer parameters: dxc -dumpbin shows its only non-entry function is define internal fastcc i32 @"\01?fmt_value@@YAIIII@Z"(i32 %v, i32 %w, i32 %ty) — a pure scalar arithmetic helper with no i32* out parameters and no resource accesses, invoked via call fastcc i32 — and it still triggers unsupported → 0x887A0005.
  • The only PR variant that built (9136eb6afa6d8a2e with XCL_HEAP_WINDOWS=1) had zero internal functions in DXIL (same size as c4d37be). On the switch-window variants, the outlined vector/atomic accessors (xcl_mLoad4_shared, xcl_loadx4_shared, xcl_mLoad3_shared, xcl_mInterlockedAdd) also emit i32* noalias nocapture dereferenceable(4) out parameters.

Tested

  • Commits: c4d37bec1bb4286eb373aea963404a23f13401fa (base) and 5064119216a6443dead457f6a3e16cdf58bd29a8 (PR Recompiler: large compute programs call shared helpers instead of inlining them #1901 head), release builds (cargo build --release --bin xcl -j 4 and cargo test --release -p xcl --lib).
  • Local-only cache workaround: patched ShaderCacheControl(DISABLE) failure in measure_pso to a warning on both trees and ran each measurement from a freshly copied and renamed xcl.exe to ensure a cold AMD driver cache (ShaderCacheControl(DISABLE) actually succeeded without warning on this machine, and all 3 repeats per run measured cold).
  • Hardware & software: AMD Radeon RX 7800 XT (RDNA3, native wave64, --split 0), driver 32.0.31035.1003 (2026-07-24), AMD Ryzen 7 5700X3D, 64 GB RAM, Windows 11 Pro 26200 (10.0.26200), Rust 1.100.0 (0ef1bc386), DXC dxcompiler.dll 1.8.2502.11 / dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0).

Not tested

  • Full cargo test --workspace, scripts/smoke.ps1 / retail title runs, --split 1 (split-wave64), other AMD driver versions, or NVIDIA / Intel / Linux.

AI use: Antigravity (Gemini 4 Neon) built both trees, ran the measurements and wrote this comment.

@Rednaxeh

Copy link
Copy Markdown
Contributor

RDNA3 run of this PR, since the numbers in the description are NVIDIA's: on an RX 7800 XT the device is removed within the first 2–3 s, twice, with this commit; main alone runs 300 s.

Setup: AMD Radeon RX 7800 XT 16 GB (driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17, release, retail title, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_TRACE=1, warm DXIL cache for main, empty for this PR's translations (its DXIL is new).

tree result
main 689f2db, same command, 300 s runs to its end: 1 364 frames, 0 device removals, 0 PSOs refused
this PR's head 5064119 on its base c4d37be black window from the start; the first CreateGraphicsPipelineState answers 0x887a0005 at 3.4 s (the device already gone), D3D12 device removed: 0x887a0020 logged at 30.7 s
5064119 cherry-picked on main 20cf130 (2daacb6 locally), XCL_DRED=1 D3D12 device removed: 0x887a0020 at 2.045 s, DRED page fault at GPU VA 0x0; allocations there: []; recently freed: [], then the title's own C++ exception (0xe06d7363) and exit. 30 driver compiles before it, the largest a 582 060 B compute program "finished" in 44 ms.

So the driver takes the outlined DXIL (no PSO is refused) and the GPU faults at address 0 on the first work that runs it; I cannot tell from here which program. 0x887a0020 is DXGI_ERROR_DRIVER_INTERNAL_ERROR. The maintainer's merge run is on RDNA4 with a near driver, so this is worth a look before that. Logs of both runs kept; I can post them, and rerun with a change.

Not tested: the suite on this tree; XCL_HEAP_WINDOWS=1; other AMD drivers.

AI use: Claude Code (Claude Fable 5.1) built the trees, read the logs and wrote this; the runs were mine.

gustavsi added a commit to gustavsi/xcl that referenced this pull request Nov 25, 2026
…ders)

Integrates upstream PR xcl-dev#1901 (5064119) so large compute shaders call shared [noinline] helpers instead of inlining them, reducing DXIL size and compile time while preserving xcl-dev#1414's zero-for-missing-channel rule in fmt_comp.
@DavidM1911

Copy link
Copy Markdown
Contributor

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

Thanks!

@milesah3ad

Copy link
Copy Markdown

Run time on Blackwell (RTX 5080, 32-lane waves, split wave64): on these synthetic programs the GPU time stays within 5 % of the base or drops, even with exchanges inside a loop. Driver builds are 6–28× faster in the switch form, and every output matches the base bit for bit. This adds a second NVIDIA generation next to @CharlyRien's RTX 3090 numbers. It doesn't reproduce his slowdown, so the cost may depend on the GPU generation or on his program's shape (50 ballots and 75 lane reads in loops, real inputs), which these programs don't have.

Setup: RTX 5080 16 GB, driver 621.24, Ryzen 7 9800X3D, Windows 11 Pro 26300, rustc 1.100.0, DXC 1.9.2609.5, release. Trees: this head 5064119 and its parent c4d37be, each with the same local example (not for upstream). The example generates split-wave64 compute programs (128 threads, 4 memory windows) from @QemmHD's #156 generator, with every memory access at the thread's own address so one group's output is deterministic. Shapes:

  • base: a divergent if every 4th round, which is an EXEC ballot
  • wave: a v_readlane every round
  • atomic: a returning atomic every round
  • loop: a uniform 4-trip loop around a load
  • loopx: the same loop with a v_readlane and a ballot (v_cmp + s_and_saveexec_b64 + restore) inside it, every trip

For each program, in this order:

  • DXC
  • a cold CreateComputePipelineState in a fresh process (ABI root signature, new seed; the two trees' DXIL differs, so no driver-cache hits)
  • one 1-group dispatch, whose output words are hashed and compared between trees
  • the median of 30 timed 64-group dispatches (runner::dispatch_timed, in video memory, so globallycoherent costs nothing here)

Trees interleaved per program. All programs pass the 1,024-instruction threshold: the PR's HLSL has 42 [noinline] functions in the switch form and 7 in the heap form; the parent's has none.

program (instr.) windows DXIL KB base → PR driver s base → PR GPU ms base → PR same output
base, 250 (3,129) switch 141 → 48 4.37 → 0.45 0.293 → 0.290 yes
loop, 250 (3,346) switch 150 → 57 4.74 → 0.57 0.322 → 0.323 yes
loopx, 250 (3,594) switch 178 → 79 4.43 → 0.70 0.343 → 0.349 yes
wave, 250 (3,879) switch 229 → 53 5.80 → 0.50 0.265 → 0.197 yes
atomic, 250 (3,879) switch 196 → 82 7.55 → 0.77 0.189 → 0.191 yes
base, 1000 (12,509) switch 564 → 182 47.4 → 4.0 1.161 → 1.168 yes
loop, 1000 (13,384) switch 610 → 204 65.6 → 6.2 1.250 → 1.311 yes
loopx, 1000 (14,384) switch 736 → 226 163.3 → 5.9 1.358 → 1.375 yes
wave, 1000 (15,509) switch 954 → 200 90.7 → 5.5 1.061 → 0.781 yes
atomic, 1000 (15,509) switch 809 → 317 120.6 → 13.4 0.748 → 0.757 yes
base, 250 heap 83 → 68 0.45 → 0.28 0.446 → 0.380 yes
loop, 250 heap 98 → 84 0.51 → 0.36 0.449 → 0.401 yes
loopx, 250 heap 117 → 81 1.83 → 0.80 0.480 → 0.424 yes
wave, 250 heap 174 → 74 1.85 → 0.36 0.262 → 0.198 yes
atomic, 250 heap 114 → 99 0.59 → 0.40 0.183 → 0.185 yes
base, 1000 heap 328 → 267 2.96 → 1.80 1.785 → 1.509 yes
loop, 1000 heap 354 → 293 3.91 → 2.80 1.787 → 1.608 yes
loopx, 1000 heap 473 → 316 10.2 → 5.1 1.933 → 1.674 yes
wave, 1000 heap 716 → 289 17.6 → 2.7 1.050 → 0.755 yes
atomic, 1000 heap 462 → 392 4.49 → 3.14 0.727 → 0.732 yes
  • GPU time: within ±5 % everywhere, except where the PR is faster: −10 to −28 % on wave and on base / loop / loopx with heap windows. The largest base-to-PR increase is loop 1000 switch at +4.9 %.
  • Driver time: 6–28× faster with switch windows (163 s → 5.9 s for loopx 1000) and 1.4–6.4× with heap windows.
  • PR head, cargo test -p xcl --lib -- gpu::recomp --test-threads=4: 262 passed, 0 failed, 18 ignored (SKIPPED: wave64-only cases, and the direct path's refused f16/cvt forms, as on main). gpu_large_compute_shares_wave_and_window_helpers passes on its own.

So on this GPU the trade that @CharlyRien measured on Ampere, half the build time against double the run time, isn't visible for these shapes. Whether his program A behaves the same on Blackwell is the open question. A run of that captured dispatch on an RTX 40 or 50 would settle whether a threshold on exchange sites in loops is needed per generation or everywhere.

Not tested: retail programs, real inputs (these use zero-filled memory and own-slot accesses, so their memory traffic is lighter than a real program's), the coherent window or globallycoherent on host memory, AMD (where #1901 has device-removal reports), the title, release-to-release repeats beyond one interleaved run per program.

AI use: Claude Code (Claude Opus 5.5) wrote the probe, ran it on the machine above and wrote this report. I checked the numbers against the logs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants