Direct DXIL: memory windows through the descriptor heap (XCL_HEAP_WINDOWS) #1693
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!1693
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1693/head"
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?
@bmjask on GitHub · 2026-11-24 19:20 UTC · original
bmjask:dxil/heap-windows→main· +233 −54 · 8 files · 1 commits · merged 2026-11-24 19:43 UTCFollow-up to #1426.
The direct RDNA2→DXIL translator used to refuse programs that take their memory windows from the descriptor heap (
XCL_HEAP_WINDOWS=1,recomp::HEAP_WINDOWSin the window count) and sent them to the HLSL path. With this PR it translates them.What is in it
gpu/dxil/lower_window.rs(new file): windowwis aRWByteAddressBufferfromResourceDescriptorHeap[NonUniformResourceIndex(MEM_HEAP_BASE + w)](createHandleFromHeap+annotateHandle,globallycoherentin compute mode, like the root windows). It sits behind onew < windowscheck instead of a switch over the root UAVs u2... Awoutside the windows reads 0 and drops its stores and atomics, as the HLSLxcl_m*heap accessors do. All memory accesses (loads, stores, atomics including 64-bit and CAS loops, format and typed buffer loads, SMEM, BVH) go throughwith_mem, so they all use it. 64-bit atomics on heap handles setAtomicInt64Heap.window_read/window_write(#1426 still usedhi & 3). The window comes from the 64-bit effective address (carry / borrow, V# stride bits masked) minus the UMA base (IO_UMA_BASE_HI). A read withhi == 0goes to window 0; any other address outside the windows matches none. This applies to the root-UAV form too, so out-of-UMA pointers no longer alias a live window there either.kernel.rs: the refusal is removed;mem_windows()builds the root or heap windows.TRANSLATOR_VERSIONgoes 4 → 5, so cached direct translations are rebuilt.lower_mem.rs/lower_image.rs(window(..)→window_at/buffer_window/flat_window(.., write)), oneheap_memfield inLw, andShader::heap_raw_buffer_uav.direct_orpassesHEAP_WINDOWSwhenOptions::heap_windowsis set.gpu_memory_windows_from_the_heap,gpu_heap_windows_reject_out_of_uma_aliasingandgpu_memory_windows_reject_out_of_uma_aliasingnow run through the direct path underXCL_DIRECT_DXILand are checked on the GPU. The 64-bit atomics test also validates the heap form.Tested
cargo test -p xcl --lib gpu::dxil: 80 passed, 0 failed, 1 ignored.cargo test -p xcl --lib gpu::recompwithXCL_DIRECT_DXIL=1and=all, each withXCL_HEAP_WINDOWS=0and=1: 194 passed, 0 failed, 18 ignored in all four. The GPU window tests (gpu_memory_windows_*,gpu_heap_windows_reject_out_of_uma_aliasing, mesh, BVH64) ran on the GPU through the direct path, validator-clean.cargo test --workspace -- --test-threads=4: 858 passed, 0 failed, 42 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware– no wave64 path on this adapter;heap_window_out_of_memory_falls_back_to_the_switch_form– no heap windows by default).memory_windows_above_4_gib5608 → 5328 B (−5 %).XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1(PR head, A pressed at 10/15/20/25/30/40 s, 60 s): 1454 frames shown (presents per 2 s at the end 43 46 40), 0 device removals, 0 crashes, peak commit 19441 MB. Fallback counts and PSO times were not collected.Regression run
Both runs were back to back on a quiet machine, with
XCL_PRESS_A_AT=10,15,20,25,30,40(A pressed at those seconds).main:
PR:
Not tested
XCL_DIRECT_DXIL_STATS=1) and PSO build times in the title run.AI use
🤖 Generated with Claude Code
@raylitebull on GitHub · 2026-11-24 19:44 UTC · original
Tested on Windows 11 with an AMD Radeon RX 9070 XT (16191 MiB VRAM, RDNA4, native wave64) on a local merge branch based on
c160d86.Setup & tested configuration
c160d86+#1693(b5d6322, merged cleanly with zero conflicts) +#1679(ee85bc2) +#751,#1288,#1005,#1053,#1195,#1529,#1584,#1661(release build).XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_NETWORK=0,XCL_SKIP_BINK=1,XCL_MUTE_TTS=1(300 s run on a newer retail title).Observed results
0x0after full300.00 s(0crashes,0device removals,0OOMs).1,914(PresentX 1914;651translated PSOs,19,207unique shaders).25,644 MBpeak commit (11,926 MBworking set,13,065 MBprocess VRAM /14,515 MBadapter VRAM,8,791 MBtarget pages).75,653DirectStorage requests (4,201 MBstreamed,2,041failed); captured 4K loading frames showed clean output with no visual corruption.#1693(b5d6322) and#1679(ee85bc2) have a small 2-line overlap incrates/xcl/src/gpu/dxil/kernel.rs(keeping both|| geo.is_some()and themem_windows(...)call resolves cleanly).Not tested
dxil_cachelogged1,288hits /0misses /0compilations on pre-warmed caches).#1693without#1679/bundle PRs,cargo test --workspace, NVIDIA/Intel GPUs, and 3D in-world frames past the 300 s loading carousel.@thiagocalile on GitHub · 2026-11-24 20:27 UTC · original
Tested commit
b5d63226df1fe6044e50054310109f96790b6a3fon an AMD Radeon RX 6600 (RDNA2, native 64-lane waves): all targeted tests passed.Tested
32.0.21045.29003;XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11, debug build.XCL_ADAPTER=radeon cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 80 passed, 0 failed, 1 ignored (25.1s).XCL_ADAPTER=radeon XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e -- --nocapture: 4 passed, 0 failed, 0 ignored (34.86s).XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 855 passed, 3 failed, 42 ignored (37.83s).mainon this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascadestransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory; tracked by #1028).SKIPPED(not counted as coverage):heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows(plus D3D12 debug-layer tests skip becaused3d12SDKLayers.dllis not installed).Not tested
scripts/smoke.ps1— no game executable here), D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine.AI use
@DavidM1911 on GitHub · 2026-11-24 22:02 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
@bmjask on GitHub · 2026-11-24 22:06 UTC · original
Thanks @raylitebull (RX 9070 XT, 300 s, plus the
kernel.rsmerge note with #1679) and @thiagocalile (RX 6600:gpu::dxil80/0/1,gpu_compute_e2ewith heap windows 4/0/0; the 3 workspace failures are the ones tracked in #1028).AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
github-bot referenced this pull request2026-11-26 06:18:31 +00:00