Repository navigation
Recompiler: defer large per-lane compute shaders to compact direct DXIL - #2796
Saksukella wants to merge 1 commit into
Conversation
|
Independent Windows/NVIDIA check on
A single-block fixture independently confirmed the instruction gate: Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop GPU (12 GB, driver 621.24), Rust 1.97.1 MSVC debug, DXC 1.8.2502.11, 4 passed, 0 failed, 0 ignored, no reported skips. The threshold fixtures were translated only. This run did not measure NVIDIA driver compile commit, run the full workspace suite, or launch a retail title. OpenAI Codex assisted with the probe and verification. The exact model identifier was unavailable in this session. |
|
Update for head Update for head NVIDIA run for the Not tested line, with the RX 9070 XT from the same PC. Tested: pass, head
Not tested: a title run or the AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
Follow-up in \efb6e48e: during live \XCL_PER_LANE=1\ testing we found \lower_dxil::compute_with()\ in \pso.rs\ returned before \gpu::dxil::kernel::translate_compute(), bypassing \compact::large()\ and still emitting \2,673,860 B\ DXIL for \cs 56c0cd3b82a00c6e. Deferring \compact::large(&cfg)\ out of \lower_dxil::compute_with()\ (and falling back when per-lane DXIL exceeds \512 KiB\ and compact/split is smaller) now routes \cs 56c0cd3b82a00c6e\ through compact form at runtime (\160,534 B, \16.7x\ smaller), cutting 180s RX 9070 XT peak commit from \63,298 MB\ to \34,190 MB\ (-29.1 GB). Re-verified with \7/7\ CPU \compact\ tests and fresh 60s RX 9070 XT smoke (\1661\ frames, \60 61 60, \ |
|
Test report on a retail compute shader that crosses the new threshold but does not take the compact form. Linux/RADV, tested at head Setup: RX 7900 XT 20 GB (gfx1100), Mesa 26.2.6 RADV, vkd3d-proton
So the lower threshold now asks For context, not about this PR: the same record through the default HLSL → DXC path (1,403,484 B DXIL) never finishes on RADV. ACO's register spiller grows past 12 GB within ~50 s, and a debug Mesa 26.2.6 build hits the spiller assert of https://gitlab.freedesktop.org/mesa/mesa/-/issues/15722. So the large-shader commit spikes the PR describes for AMD's Windows driver have a Linux counterpart on the HLSL path, which compact form does not reach. Not tested: head AI use: Claude Code (Claude Opus 5.5) built the probe, ran the measurements and wrote this report. Numbers checked against the run logs before posting. |
# Conflicts: # crates/xcl/src/gpu/recomp/pso.rs
efb6e48 to
960f4fc
Compare
|
Rebased cleanly onto This PR now contains only the remaining |
|
Ran the compact-DXIL and per-lane routing tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. All 12 pass, including the new Not tested: the large branch-heavy program behind AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
|
AMD Windows data for #2796: on an RX 9070 XT, the new thresholds change one retail compute program out of 2,689. That program builds about 1.6× slower in AMD's driver and with 4× the peak memory. On First, the branch. It now carries 256 commits against Setup
Which programs change, all 2,689 compute programs (translation only)
Driver,
So on AMD this program was better off split. This looks like what #2810 describes for automatic compact lowering: the compact whole replaces a split plan that was available. One option is to leave the threshold alone for programs that already split. Not tested: NVIDIA, GPU output, and a title run. AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the measurements and wrote this report; I posted it. |
|
Thanks for the thorough RX 9070 XT measurement! Two quick clarifications on the current PR head (
Your |
|
Correction to my comment above. This PR's base is
So on This PR's own commit ( AI use: Claude Code (Claude Opus 5.5) built the binaries, ran the measurements and wrote this correction; I posted it. |
|
Tested - retail title on native Windows AMD RDNA2, PR head Tool: OpenCode with DeepSeek V4.1 Flash 1017
The deferral fires on this title: the PR logs 7 Peak commit and presents are unchanged, so the 36+ GiB per-lane spike does not reproduce here: Not tested: the standard non-per-lane path (this change only runs under AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests, read the logs and wrote this comment; the figures and the deferral/compact lines were checked against the run logs. |
What is in it
7a8056fa,compact::large()block/instruction thresholds) was cherry-picked ontoamd-devin53995420; this PR is rebased cleanly ontoamd-dev(c32c91a3) with the remaining per-lane compact routing fix (960f4fc2):crates/xcl/src/gpu/dxil/mod.rs,crates/xcl/src/gpu/recomp/lower_dxil.rs,crates/xcl/src/gpu/recomp/pso.rs:XCL_PER_LANE=1,lower_dxil::compute_with()previously ran beforegpu::dxil::kernel::translate_compute()and returned immediately onOk(k), bypassingcompact::large()/compact::plan()andsplit_compute(). As a result, branch-heavy unrolled compute shaders (for example,cs 56c0cd3b82a00c6e) still emitted2,673,860 Bmonolithic DXIL (588,191IR lines,32,279basic blocks,36,143PHIs) and triggered>36 GiBdriver-compiler commit spikes underXCL_PER_LANE=1.compact::large(&cfg)) out oflower_dxil::compute_with()so they lower through compact/split direct DXIL (160,534 B,31,585IR lines,975blocks,108PHIs —16.7xsmaller), and fall back inpso.rs::direct_compute()totranslate_compute_rodata()when per-lane DXIL exceeds512 KiBand the compact/split alternative is smaller or split.crates/xcl/src/gpu/dxil/compact_tests.rs:per_lane_compute_defers_branch_heavy_program_to_compact_pathconfirming large branch-heavy compute programs defer fromlower_dxil::compute_with.amd-dev.Tested
32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows;rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).cargo test -p xcl --lib gpu::dxil::compact -- --skip gpu_: 8 passed, 0 failed (1.52s), includingper_lane_compute_defers_branch_heavy_program_to_compact_path.XCL_DIRECT_DXIL=1,XCL_PER_LANE=1,XCL_RT_GATE=hold, no DXIL size cap):cs 56c0cd3b82a00c6elowered via compact form (direct DXIL compact form: 20965 blocks of 672 kinds), shrinking on-disk DXIL from2,673,860 Bto160,534 B(16.7xsmaller) with0driver refusals and no compile stall, dropping peak process commit from63,298 MBto34,190 MB(-29.1 GB/-46%, and27.7–31.8 GBonamd-devc32c91a3), with0device removals and0crashes.Regression run
Not tested
AI use
XCL_PER_LANE=1compact-bypass commit spike on branch-heavy compute shaders, implementing thelower_dxil::compute_with()/pso.rs::direct_compute()deferral and unit test, rebasing cleanly ontoamd-devc32c91a3, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.