Recompiler: split direct compute programs that use guest LDS #2299
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!2299
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2299"
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?
@joeypercia on GitHub · 2026-11-25 13:00 UTC · original
joeypercia:c5-lds-split→main· +1941 −83 · 18 files · 8 commits · openStacked on #2097; only the top commit belongs here (
4de5261). Part of #2088 (campaign task C5, LDS part).The direct-DXIL compute splitter (#2080, #2097) keeps every program that uses guest LDS whole. Its mutable-global check refuses
xcl_lds, and its scan refuses LDS loads, stores and atomics, and guests_barrier. This lets those programs split.What is in it
crates/xcl/src/gpu/dxil/module/split.rs,Shader::split_compute/make_piece:transfer_shared. In the split form, the LDS includes the exchange words at its top. The LDS is its own(global, words, slot)region after the carried values, so it can move into #2126's fixed-slot layout if both land.xcl_xc/xcl_xsas separate translator globals are still told apart fromxcl_lds.xcl_ldscan cross a cut as its index, like the exchange slots.Module::dispatch_plan, which now takesuniform:docs/wave64-on-wave32.md: the sentence saying LDS programs stay whole now describes the above.split.rs:uniform: None) cuts where the group does not pass together, and the restricted plan never does.dispatch_chain_lds_cuts_before_a_guest_wave_returnscovers wave 0 returning before later guest barriers. Unrestricted plans put one of those barriers in a piece that wave 0 still has to pass, and the restricted plan keeps everything from the return on in the last piece. Its split form also matches the CPU reference on the GPU.dispatch_chain_lds_poll_loop_keeps_several_waves_whole, CPU only, polls with an atomic and with a plain load. The plain-load case fails without the load rule.Tested
RTX 4070 Ti 12 GB (NVIDIA 621.40, 32-lane waves) and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2,
XCL_ADAPTER=Radeon). Windows 11 Pro 26200, Rust 1.100.0, DXC 1.8.2502.11, debug.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on4de5261:pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translatoranddevice_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa, also fail on the base8b2fa0e. #2245 fixed them onmainafter this stack's base.fuzz_tests::fuzz_validate_and_gpu_1andrecomp::tests::gpu_image_get_resinfo_past_last_level. All four also fail on8b2fa0eon the Radeon.With the uniform rule switched off locally, the four tests with several waves fail on their plan assertions. They were not run on the GPU that way.
Census of the title's compute programs (
xcl shaders <pack> --direct --sample 0 --max-bytes 0 --windows 260,XCL_DIRECT_DXIL=1, with a local logging patch):atomicBinOp(add) whose result is used. UAV atomics are another C5 item.Cold
CreateComputePipelineStateon the 4070 Ti. Each run is a fresh process under a new exe name (the driver cache is per exe name; Developer Mode is off). Pieces build in parallel, on the root signatures the runtime uses. 3 runs each:CS_Primary_PrefilterAndIntegrateIrradianceSHCS_RaytraceShadows_Shared95cc13288a27a96e(CS_ScreenProbes_ActivateRays), the title's largest compute program, is not helped by this. 280,877 of its 291,811 instructions are in one strongly connected component (15,553 blocks), which a dispatch chain cannot cut. It also has a UAV atomic add. It stays whole.GPU time, the new fixtures, 8192 groups, median of 20 timestamped dispatches on the 4070 Ti:
The cost is the LDS copy: each cut writes and reads back the whole 32 KB
xcl_ldsblock of every group, about 1.3–1.4 ms per cut at 8192 groups. #2158 (open) sizesxcl_ldsfrom LDS_SIZE, and this copy follows the array's size. For the two programs above, that is an 8 KB and a 4 KB block.Regression run
scripts/smoke.ps1, the same retail title for 60 s, one after the other on the machine under Tested, release builds from clean trees.main1a0bbe3:this PR,
4de5261:PR vs
main: 1387 / 1468 frames (94 %), peak commit 15996 / 16696 MB (96 %). Device removals 0 and crashes 0 in both. An earlier pair on5e60822, before the load rule, gave 1491 / 1548 frames.Not tested
AI use
@luckyteagirl on GitHub · 2026-11-25 13:16 UTC · original
Independent focused test of exact PR head
5e608220fdb9c9d4d7c2fb19fabbf5ab7d68682don a dedicated Radeon RX 6800M (RDNA2, driver30.0.13002.13003), Windows 11 build 26200, Ryzen 9 5980HX, Rust 1.99.0 MSVC, and DXC/DXIL 1.9.2609.5. Clean detached worktree and isolated Cargo target.XCL_ADAPTER=6800M XCL_REQUIRE_GPU=1 XCL_DIRECT_DXIL=1 cargo test --locked -p xcl --lib -j 2 dispatch_chain_lds -- --test-threads=1 --show-output: 7 passed, 0 failed, 0 ignored, with noSKIPPEDline. The runner selects the adapter throughXCL_ADAPTER; all six whole-versus-split GPU comparisons completed, including wave32, split wave64 with one through four guest waves, and the early-return case. The seventh test is the CPU-only LDS atomic-loop planning check. The five fixture logs report 3 or 4 pieces and matching output plus 16 guard words.This adds a dedicated RX 6800M run to the author's RTX 4070 Ti and RDNA2 iGPU evidence. The synthetic wave64 cases explicitly use the split representation; they do not test native-wave64 chains. I did not run the full workspace suite, title smoke, title-program output comparison, or GPU timing on this head.
AI use: OpenAI Codex (GPT-6; exact variant not exposed in this session) ran the native Windows test, checked the fixture paths and clean exact head, and drafted this report. No game data was used.
@nnonno91 on GitHub · 2026-11-25 14:04 UTC · original
Independent check of the updated head
4de52614fa58e20fb2b62896bd9a65212dcf9ec0on Radeon integrated graphics and RTX 5090.Tested
cargo test --locked -p xcl --lib dispatch_chain_lds -- --nocapture --test-threads=1in separate processes withXCL_ADAPTER=AMD RadeonorXCL_ADAPTER=NVIDIA GeForce RTX 5090(XCL_REQUIRE_GPU=wave64on Radeon). Each gave 7 passed, 0 failed, 0 ignored and no skips.Not tested
Retail smoke, GPU or compile timings, and the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the tests, checked the logs and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 17:31 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.Thanks!
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.