Recompiler: XCL_DECLARED_LDS=1 sizes direct compute LDS from the header (~11 ms less GPU per frame) #2937
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!2937
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2937"
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?
@Kalmarv on GitHub · 2026-11-27 01:16 UTC · original
Kalmarv:declared-lds→main· +122 −29 · 12 files · 1 commits · draftThe direct DXIL translator gives every compute program that uses LDS the whole 8,192-dword groupshared block D3D12 allows, with the split form's exchange words at its top. That caps how many groups run at once on a GPU whose LDS per SM is shared by resident groups. With
XCL_DECLARED_LDS=1it declares what the program's header asks for: the static workgroup LDS from COMPUTE_PGM_RSRC2, plus the split form's exchange words and counters (or the arrival counter of a native 2-D/3-D group) placed after it. A header with no size, or one too large to leave room for those, keeps the 8,192-dword layout. LDS addresses are clamped to the declared top. Off by default.What is in it
CsInterface::lds_dwordsfrom COMPUTE_PGM_RSRC2 (recomp/mod.rs).setup_storagesizesxcl_ldsfrom it and places the exchange words and counters after the guest LDS;lds_indexclamps to the declared top (dxil/lanes.rs,dxil/kernel.rs,dxil/lower_mem.rs); the callers ofsetup_storagein the tests follow the new signature.recomp/pso.rs).compute_lds_reservation_matches_descriptor_and_lane_storage(declared size and lane storage per mode,dxil/core_tests.rs) anddeclared_lds_disk_cache_separates_both_direct_routes(cache keys,recomp/pso.rs).Tested
XCL_DXC_DIR.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4onc4f2a7f3: results follow (queued).Regression run
8b957becvsc4f2a7f3) is queued; blocks follow. The switch is off by default, so the pair is a regression check of the default path.Not tested
AI use
@ettehn on GitHub · 2026-11-27 01:25 UTC · original
Independent Windows GPU readback on
c4f2a7f: RTX 5070 Ti Laptop (12 GB), NVIDIA 621.24, native D3D12. I usedconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back, with one local fixture change:rsrc2 |= 1 << 15to declare the 128 LDS dwords the synthetic program writes before reading its partner lane. Runtime code was unchanged.With
XCL_DIRECT_DXIL=1and fresh XCL caches per run, all four combinations ofXCL_PER_LANE=0/1andXCL_DECLARED_LDS=0/1completed the dispatch and passed readback. SDKdxc -dumpbinshows@xcl_ldsat 8,192 dwords with the switch off and 141 with it on (128 guest + 13 helper) on both lowering routes. This covers real PSO creation and execution for the split-wave LDS case. No retail timings or smoke results from this machine for this test.OpenAI Codex (6.2sol) assisted with verification.
@andrewDoing on GitHub · 2026-11-27 02:01 UTC · original
Independent synthetic readback on PR head
c4f2a7f313db2c85ffd5becadafebc58dee85799plus a test-only fixture, on an RTX 5070. The guest shader declared 128 dwords of LDS and used 16×8×1 workgroups over 2×3 groups. The test compared each thread's own and mirrored lane coordinates through LDS for 768 threads per run.Four fresh-process tests passed without reported skips or failures: native wave32 and split guest wave64, each with the new allocation behavior off and on. Disassembly showed 8,192 dwords allocated with the behavior off in both modes; with it on, wave32 allocated 129 dwords including the arrival counter, and split wave64 allocated 141 including exchange/counters. All 6,144 expected output words matched across the four runs.
The fixture and header change were test-only; GTA VI execution, retail timing and performance were not tested. AI use: OpenAI Codex with GPT-6.2 Astra wrote and ran the fixture; Codex coordinated and prepared this report.
@SzczepanGrela on GitHub · 2026-11-27 02:03 UTC · original
RX 9070 / RADV native-wave64 verification of
c4f2a7f313db2c85ffd5becadafebc58dee85799againstmain8b957bec6f82495aec940944c6bf47faa02db590.Tested
8293130ebe370b1+with local assertions disabled, DXC/DXIL 1.9.2602.17.XCL_ADAPTER='AMD Radeon RX 9070' XCL_REQUIRE_GPU=wave64 XCL_NETWORK=0 XCL_DXC_THREADS=1 XCL_DIRECT_COMPACT=0, private enabled caches. Production files match each pinned revision; only identical local tests were appended.The two new upstream tests passed on the head at
--test-threads=1and4: 2 passed, 0 failed, 0 ignored per top-level run. Each also ran its ten successful child harnesses. The cache test covers its synthetic marker-based cache-key separation.Additional local probes, run through Wine:
Separate processes for
XCL_DECLARED_LDS=0/1, both revisions, three repetitions per configuration:gpu_compute_mode_dispatch_abiprogram: write own coordinates to LDS, synchronize, read the reversed partner, then export both. Prefix and suffix canaries surround the output.For these 2-D GPU cases, the head with the switch on declares 129 / 257 / 385 dwords for 128 / 256 / 384 guest dwords, including the native arrival counter. Unspecified and oversized cases retain 8,192 dwords. HLSL retains 8,192. The layout-only probe also verified the split exchange/counter reservations and fallback cases.
All GPU payloads and guards matched independently computed values: 360 dispatches, including 180 native wave64, 552,960 payload words and 28,800 guard words. Containers have the expected WaveSize and thread-group metadata. Captures repeat byte-for-byte across the three repetitions. Default-off containers match main byte-for-byte in both probes; HLSL and fallback controls remain unchanged with the switch on.
The head reports 2 passed / 0 failed in every configuration. Main with the switch off also passes both probes; with it on, the GPU probe passes and the layout probe fails as expected on 72 size assertions per process, since main retains the old allocation.
Not tested
Retail/smoke, frame-time or occupancy gains, runtime PSO-hook integration, real driver-blob cache reuse, the full suite, or forced-split GPU execution. Split-form coverage here is translation/validation only.
AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the diff, prepared local test-only probes, ran the comparisons, independently checked layout arithmetic and raw GPU output, and drafted this report. Publication authorized by the account owner.
@LocranKing on GitHub · 2026-11-27 10:00 UTC · original
Tested PR #2937 (
c4f2a7f3) againstmain(8b957bec) on Windows 11 (26300), Ryzen 5 5500 (6C/12T), RTX 3060 Ti 8 GiB (driver621.40),rustc 1.100.0, DXC1.9.2602.17.Unit Test (
cargo test --locked -p xcl)gpu::recomp::pso::shader_cache_tests::declared_lds_disk_cache_separates_both_direct_routes: passed (1 passed, 0 failedin lib and all invoked subprocess modes).Paired 180 s Retail Smoke (
9cc6a39e, Series Slockhart,XCL_HEAP_WINDOWS=1,XCL_DIRECT_DXIL=all,XCL_DIRECT_SPLIT_INSTRUCTIONS=0,XCL_PSO_WAIT_MS=50)Note:
XCL_DECLARED_LDS=1changes the direct-DXIL translator key as designed, so PR #2937 ran from a pre-warmedXCL_DECLARED_LDS=1DXIL snapshot and entered the world at231.3 s(109.4 sguest entry,58.1 sin-world) vsmain's188.4 s(67.2 sentry,58.9 sin-world).~58 sworld)2swindows)main(8b957bec)124014(28windows)29,411 MB14,281 / 2,241 MB9,178draws,34,068dispatches (88skipped)0 / 0(exit: 0x0)c4f2a7f3,XCL_DECLARED_LDS=1)117322(28windows)30,010 MB14,522 / 2,851 MB12,394draws,65,536dispatches (2,578skipped)0 / 0(exit: 0x0)Both runs stayed clean (
0crashes,0device removals,exit: 0x0). In the matched28two-second world windows, PR #2937 logged more presents (22vs14) and roughly 2x dispatches (65,536vs34,068).Not tested: Per-dispatch GPU timestamp breakdown (
XCL_LOOK_STATS), or longer steady-state runs past PSO build-out on 8 GiB VRAM.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.