Recompiler: nest the compact dispatch of big programs by default #2025
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2025
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2025"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Pipodi on GitHub · 2026-11-25 01:08 UTC · original
Pipodi:nest-default→main· +2561 −55 · 9 files · 9 commits · openStacked on #2018 (
908c454, on #16922046259, #144880fac65and #13165328b15); only the top commit (eee2b86) belongs here.With
XCL_COMPACT_NESTunset, the compact form now usesautofrom #2018: groups of 32 cases for a program of 512 cases or more, the flat switch below.XCL_COMPACT_NEST=0keeps the flat form, and a power of two nests every program. An invalid value warns and keepsauto, the wayXCL_COMPACT_CSkeeps its default. Part of #1269.Why: the flat switch over ActivateRays' 2,516 cases took 168 s and 8.1 GB in a cold NVIDIA driver build, against 36 s and 1.5 GB nested (RTX 4090, measurements). Testers measured the same programs with a fixed group size:
What is in it
crates/xcl/src/gpu/recomp/compact.rs:nest_ofreads the value (unset or invalid:Auto),nest_from_envkeeps it once; testan_unset_nest_is_auto.crates/xcl/src/gpu/recomp/pso.rs: comment only. Unset now names compact cache entries_c_na, asautodoes. The translator sources change, so the cache's identity changes anyway.crates/xcl/src/gpu/recomp/tests_compact.rs: a doc line. WithXCL_SAMPLE_BIG_CSset,gpu_compact_sample_big_csnow runs the default (nested) form of a big sample.README.md: what the default does, andXCL_COMPACT_NEST.Tested
rustc 1.100.0.eee2b86(onmainafc5ee8through the stack), debug:cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4gave 1300 passed, 0 failed, 46 ignored, in 23 result blocks. Its patch is the same as atf698c22(and at06489eaexcept the README context, kept asmainhas it before this PR's bullet); only the base moved.lower_dxilper-lane f16/f32 cases (refused by the per-lane form, as onmain); 3 cases that need the D3D12 debug layer / SDK layers, which this machine does not have;heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).an_unset_nest_is_autofails.Regression run
The retail title, 60 s,
XCL_PRESS_AT=16:A(the title takes A at its title screen 16 s in and loads for the rest of the run), no other variables (the default shader cache, warm from earlier runs). Both runs on this machine, with nothing else running.main06c9f55:This PR, head
eee2b86:The PR's run got 108.0 % of
main's frames and 102.1 % of its peak commit.Not tested
ActivateRays, so the smoke pair checks only that the rest still works. In a 300 s run of #1692 with groups of 32, the title built ActivateRays nested in 36 s; with the flat form it had not finished the build by the end of the run.autoitself (as opposed to a fixed group size) on AMD, RADV and Intel; programs under 698 cases in the driver. @philip-roy-jones is measuring the threshold on an RX 580 (claim).AI use
5040ea1and908c454, wrote this description. A second Opus 5.5 agent reviewed the diff. A Claude Sonnet 5.5 subagent ran the smoke pair on this head.🤖 Generated with Claude Code
@nnonno91 on GitHub · 2026-11-25 01:13 UTC · original
Tested
Independent GPU and translated-cache check on
06489ea27c0f657263a948f244ca80373bd0f8fa. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62, native wave64), and GeForce RTX 5090 (32.0.16.1742, split wave64). Rust 1.100.0 x64 MSVC, DXC/DXIL 1.8.2502.11, unoptimized dev/test profiles with debug info off.cargo build --workspace --lockedpassed.cargo test --locked -p xcl --lib gpu::recomp::compact::tests -- --test-threads=1 --nocapturepassed 7 tests on AMD, and the same command with the filtershader_cache_testspassed 16. Zero failed, ignored, or skipped.cargo test --locked -p xcl --test compact_default_gpu_probe -- --exact default_compact_mode_and_cache_on_gpu --test-threads=1 --nocapturepassed in all five settings on each adapter (1 passed, 0 failed, 0 ignored, 0 skipped per process). The temporary probe used synthetic 511- and 512-case FSPX compute shaders throughconsole_hlsl,console_to_dxil_in, and D3D12 dispatch.XCL_COMPACT_CS=1forced these fixtures onto the compact backend. All 64 output words for each shader matched the CPU sum in every setting on both GPUs.XCL_COMPACT_NESTauto, or invalid_c_na0_c32_c_n32On each adapter, the unset run populated a fresh cache. Explicit
autoand an invalid string both reused those entries in separate cached-only processes, with one hit and zero compiler calls per shader. The invalid string emitted the fallback warning. The flat and fixed modes created their own translated-cache entries without replacing the automatic ones. HLSL and DXIL matched byte for byte between the default and the corresponding explicit control at each boundary.Not tested
Real titles, automatic selection of the compact backend, controlled compile timings, gameplay performance, RADV, or the full workspace test suite.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) prepared and ran the temporary probe, checked the output, and drafted this report.
@raylitebull on GitHub · 2026-11-25 02:06 UTC · original
Independent AMD RDNA2 + NVIDIA RTX 5090 checks on \
@ettehn on GitHub · 2026-11-25 03:10 UTC · original
Independent cold-compile timings on RTX 5070 Ti Laptop
Tested
06489ea27c0f657263a948f244ca80373bd0f8fain release on Windows 11 26200.9974, RTX 5070 Ti Laptop (driver 621.24), Ryzen 9 8945HX, DXC 1.8.2502.11 and Rust 1.97.1. Usedxcl shaders <pack> --measure-pso <record> --repeat 1 --windows 4, withXCL_COMPACT_CS=1,XCL_HEAP_WINDOWS=1andXCL_PSO_DISK_CACHE=0. Each run used a fresh process and the tool disabled the implicit driver caches. Reversed the order for the flat, 32 and 64 repeats. All 21 PSO builds succeeded.Seconds for DXC plus D3D12 PSO creation, excluding archive lookup and HLSL emission:
56c0cd3b82a00c6e958400d2caf0724495cc13288a27a96eFor ActivateRays, flat → 32 reduced DXC from 20.29–20.95 s to 7.78–7.81 s and driver creation from 21.75–21.83 s to 19.42–19.47 s. For ActivateProbes, 32 improved the combined time even though driver creation alone rose from 6.48–6.56 s to 7.40–7.42 s. Groups of 64 were slightly faster overall on this adapter and emitted 6–7% larger DXIL than groups of 32. This is one adapter and one driver version.
The compact unit-test filter and
gpu_compact_nested_dispatchpassed (8 total, zero failed, ignored or skipped). The retail PSOs were created but never dispatched. Retail output parity and title behavior remain untested in this run.AI use: OpenAI Codex (GPT-6.2 Sol) assisted with benchmark setup and verification.
@ettehn on GitHub · 2026-11-25 03:26 UTC · original
Follow-up experiment: group nested cases by similar register writes
On the same
06489eaWindows / RTX 5070 Ti Laptop setup as above, I kept groups of 32 and prototyped a stable sort of compact cases by the set of directly assigned SGPRs/VGPRs. The block-to-case table was remapped; block order and branch targets were kept. This was a local experiment using emitted assignments as a heuristic.95cc13288a27a96e),-O1, two independent cache-off runs per arm in original/reordered/reordered/original order. Driver PSO time 19.17–19.45 → 15.44–15.48 s, DXC 7.71–7.73 → 7.18–7.22 s. DXIL 919,948 → 827,732 B; the SDK DXC disassembly has 79,432 → 58,442 phi incoming operands.56c0cd3b82a00c6e), one build per arm at each level. At-O3, driver time 7.54 → 5.78 s, but DXC 5.00 → 18.53 s. At-O1, DXC still grew 4.79 → 18.36 s. This is an end-to-end compile regression for this record.958400d2caf07244), one build per arm per level. At-O3, DXC + driver 19.53 → 20.41 s. At-O1, 19.35 → 20.21 s.The existing synthetic GPU test
gpu_compact_nested_dispatchpassed with the reordered cases (1 passed, no skip). Retail PSOs were only built. This is evidence for investigating a targeted optimization for the largest switches; I would keep the current default grouping while the reason for the DXC regression and retail output parity are unresolved.AI use: OpenAI Codex (GPT-6.2 Sol) assisted with prototyping and verification.
@DavidM1911 on GitHub · 2026-11-25 04:12 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main(crates/xcl/src/gpu/recomp/pso.rs) — needs a rebase before it can be tested.@Diskuss on GitHub · 2026-11-25 08:25 UTC · original
Tested on AMD Radeon RX 9070 XT (RDNA4) at
f698c22623c5ef846da3d0449679921c39a1d7a9(bare head, not merged with main; it is 3 commits behind main568e7db). Covers the whole compact stack (#1448, #1692, #2018) per the #1269 request.Windows 11 Pro 26300.9974, Ryzen 7 5700X3D, 32 GB, driver 32.0.32015.7029, Rust 1.100.0 msvc, DXC 1.9.2602.17, debug build, D3D12 debug layer installed.
Tested
cargo test --workspace --no-fail-fast -- --test-threads=4: 1189 passed, 2 failed, 46 ignored. No DXGI_ERROR_DEVICE_REMOVED.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1and_3(panic at fuzz_tests.rs:1171, e.g. seed 722res[30] = 0x1, CPU 0x7fffffff). These are the same two failures as on main568e7db(1152 passed / 2 failed / 46 ignored, known AMD issue #2115); nothing new fails. Passed count is +37 vs main from the stack's added tests; ignored is unchanged.f16_programs_on_the_gpux4 (f16 arithmetic and f16 packed, wave32 and wave64, per-lane form): refused, unsupported V_MUL_F16 / V_PK_MUL_F16 VOP3 modifiers (#1426 semantics)f32_programs_on_the_gpux2 (f32 conversions, wave32 and wave64): refused, unsupported V_CVT_F16_F32shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode required, 0x887A002D)heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsNot tested: no smoke: our only title (The Matrix Awakens) stops before shader compile on main at CreateCommandSignature E_INVALIDARG (#1887), so a smoke on this stack alone would only show that crash. Release build not tested.
Report written by Claude Code (Claude Sonnet 5.5) from a real run on this machine.
@itsSio on GitHub · 2026-11-25 08:41 UTC · original
Tested
Independent Windows GPU check at clean PR head
f698c22623c5ef846da3d0449679921c39a1d7a9(no local merge or patches), following the #1269 request. Both machines rancargo build --workspace --locked(exit 0) andcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocapture(exit 0). Unoptimized MSVC dev/test profiles, debug info off, default XCL shader options, noXCL_SAMPLE_*variables.SKIPPEDevents32.0.16.108832.0.16.1088Both NVIDIA runs logged 21 native-wave64 skips (including
gpu_compact_native_wave64_form), three per-lane cases refused (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32), no heap windows (heap_window_out_of_memory_falls_back_to_the_switch_form), and no driver-cache disable support (pso_measurement_compiles_an_exact_synthetic_record,0x887A002D). The RTX 2080 SUPER also lacked the D3D12 debug layer fortest_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state. Runtime skips are reported separately from Rust's ignored count.On the 9800X3D's Radeon RDNA2 iGPU (driver
32.0.21043.5001),XCL_ADAPTER=radeon cargo test -p xcl --lib --locked gpu::recomp::tests_compact -- --test-threads=1 --nocapturegave 25 passed / 0 failed / 0 ignored, no runtime skips, including native-wave64 compact and nested-vs-flat dispatch coverage.Not tested: Full workspace on AMD, retail smoke, game shader samples, or compile-time performance. No speedup is inferred from suite duration.
AI use
Ran via Samaritan:
@moombathepilot on GitHub · 2026-11-25 09:02 UTC · original
Tested — RX 7800 XT on Windows
Clean PR head
f698c22623c5ef846da3d0449679921c39a1d7a9. Ryzen 7 5700X3D, RX 7800 XT (driver32.0.32029.2010), Windows 11, Rust 1.100.0 MSVC, DXC 1.9.2602.17.cargo build --locked --workspacepassed.cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: 1,190 passed, 1 failed, 46 ignored across 21 result blocks.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1failed on seed 722 (res[30] = 0x1, CPU0x7fffffff). The same mismatch reproduced on parent5040ea1ef4807af4732dcbfaed1789226c39c4e0(#2018), consistent with #2115. The first run also hitconsole_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk(DXIL not compiled yet). That test passed on the full rerun and in isolation on the parent.V_MUL_F16,V_PK_MUL_F16), two per-lane f32 conversion cases (V_CVT_F16_F32),pso_measurement_compiles_an_exact_synthetic_record(driver-cache disable unavailable,0x887A002D),test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_state(D3D12 debug layer unavailable), andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows). The PLS junction subcase also loggedmklink /Junavailable.Retail startup smoke
Release build,
scripts/smoke.ps1 -Seconds 60with a fresh XCL data root and DXIL cache, networking off, no injected input.Not tested
World loading, retail shader compile-time performance, or a paired startup comparison.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) ran the builds, tests and smoke, compared the failing tests against the parent, and drafted this report.
@upipibi on GitHub · 2026-11-25 08:40 UTC · original · edited 2026-11-25 09:05 UTC
NVIDIA test report for
f698c22(base6e1e2be), as asked in #1269; it covers the stack from #1316 through #2018. RTX 3070 8 GB (Ampere, 32-lane waves), driver 616.56, Windows 11, debug, the PR head as it is.cargo test --workspace --no-fail-fast -- --test-threads=4: 1190 passed, 1 failed, 46 ignored.test_title_runs_and_game_folder_is_untouched, because my build step ran onlycargo build --workspace --tests, soxcl_testtitle.exeandtestgame_mw.dll, built from the repository'stests/testtitle, were missing (the panic says "build first: cargo build --workspace"). So the end-to-end test did not run here. With a full build (cargo build --workspace && cargo build --workspace --tests),cargo test -p xcl --test e2egives 3 passed, 0 failed atf698c22, and 3 passed, 0 failed onmain568e7db. So nothing failed on this head here.no wave64(the wave64 parity andlower_dxilGPU cases). The others areper-lane form: refused,no heap windows,cannot disable the driver cache, and Developer Mode off (0x887A002D).xcl-smokeblock: I have no title.AI-assisted (Claude Code). Synthetic tests only.
@Rednaxeh on GitHub · 2026-11-25 10:38 UTC · original
RX 7800 XT (RDNA3, wave64), in the title: the compact nested form builds
ActivateRayson the AMD driver in 57 s wheremaincannot build it at all. The title still does not render its world within 900 s on this card: it keeps asking for new 1 MB compute programs that the driver builds at 30–40 s each.Covers the in-title part that @moombathepilot's report on this card leaves out (world loading, compile times). Head
f698c22merged locally ontomain568e7db(clean merge,7573f49), release. Ryzen 7 7800X3D, 32 GB RAM, driver 32.0.32029.2010, Windows 11 26300, Rust 1.100.0, DXC 1.9.2602.17. The newer retail title of #505, offline, defaults (HLSL path),XCL_PSO_TRACE=1 XCL_ACTIVITY=1, A at the start screen.ActivateRaysandActivateProbes(the two programscompact_wantedtakes here)95cc13288a27a96e(ActivateRays, 88 863 instructions, 752 KB of compact HLSL): 1 068 976 B of DXIL, built by the driver in 57.5 s on the title's thread (start 101.2 s, done 158.7 s), commit 31–33 GB around it (one spike to 39.9 GB). Onmainthe same record is 13.8 MB of HLSL-path DXIL that the driver refuses with E_OUTOFMEMORY after 15–33 s and ~15 GB (#1310, #1918), and 3.35 MB of plain direct DXIL (XCL_DIRECT_DXIL=1) that the driver had not finished after 215 s while the process climbed to 54 GB of commit (#2057, my report there).56c0cd3b82a00c6e(ActivateProbes, 76 699 instructions, 2.39 MB of compact HLSL): 467 648 B, 9.4 s. (mainHLSL path: 17–22 MB, refused.)Three runs: 300 s cold, 300 s warm, 900 s warm
gated (waited 54–197 s)), 155 compiles over 256 KB in all (111 MB); at 600 s a title thread waits inresolve_waitfor one of them atSetPipelineState. Commit 32–35 GB, spikes to 49.8 GB at 782 s.real.rsexpects ~600 of the ~1 MB ray-tracing resolve programs.So on RDNA3 this stack removes the one program that
maincould never build, and the remaining cost is the AMD driver's 30–40 s per 1 MB program times the number of programs the title asks for, one slot at a time. A world picture would need several more warm runs, more huge-compile slots (XCL_HUGE_PSO_CONCURRENCY, 3 GB of commit headroom each on a 32 GB machine), or a way to fill the blob cache ahead that works on AMD (xcl shaders --pipelinesdoes not: AMD keys its driver cache by application).Not tested
XCL_COMPACT_NEST=0, the direct backend with this stack, NVIDIA.AI use: Claude Code (Claude Fable 5.1) read the logs and wrote this; the runs were mine.
@ClosetPie107 on GitHub · 2026-11-25 10:53 UTC · original
Linux / AMD RDNA4 (RADV) test report on exact head
f698c22(clean detached worktree), coveringXCL_COMPACT_NESTunset (auto) on RADV from Not tested.Environment
experimental-11.0-20261112), vkd3d-proton v3.1 (#257+dxil-spirv53aac418), DXVKv3.1.1-209, DXC1.9.2609.5,x86_64-pc-windows-gnucross-compileUnit & GPU tests (debug test binary,
XCL_ADAPTER=9070 XCL_REQUIRE_GPU=wave64,--test-threads=1 --nocapture, capped atMemoryMax=14G,MemorySwapMax=0)gpu::recomp::compact: 9 passed, 0 failed, 0 ignored, 0 skipped (0.36 s).gpu::recomp::tests_compact:gpu_compact_against_the_pc_block_fallbackhit the 14 GiB cgroup OOM cap on RADV/dxil-spirv(killed cleanly; previously triggered an uncapped OOM).gpu::recomp::tests_compact --skip gpu_compact_against_the_pc_block_fallback: 24 passed, 0 failed, 0 ignored, 0 skipped (8.00 s).Cold RADV PSO builds with
XCL_COMPACT_NESTunset (auto) (releasexcl.exe shaders <dir> --precompile --only cs --pipelines,MESA_SHADER_CACHE_DISABLE=true,VKD3D_SHADER_CACHE_PATH=0, freshXCL_DXIL_CACHE,MemoryMax=14G,MemorySwapMax=0):ActivateProbes(9083c094, 88,863 insts, 752 KB HLSL): 21.2 s compile (22.0 s wall), 4.23 GiB peak (pipelines made on the GPU 1, refused 0,driver cache 0) — down from 252 s flat on#1316.ActivateProbesTarget(534f271f, 88,445 insts, 692 KB HLSL): 15.4 s compile (15.5 s wall), 2.90 GiB peak (pipelines made on the GPU 1, refused 0,driver cache 0) — down from 176 s flat on#1316.Not tested: full workspace suite, retail title run,
ActivateRays, programs under 512 cases.AI use: T3 Code / Antigravity (Gemini 4 Neon) built and ran these tests on this machine and drafted this report.
@DavidM1911 on GitHub · 2026-11-26 00:49 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.