Repository navigation
Conversation
With XCL_HEAP_WINDOWS=1 the direct translator refused every program that may address several memory windows, and they went back to the HLSL path. Now `Lw::with_mem` makes one access through `ResourceDescriptorHeap[MEM_HEAP_BASE + w]` (a non-uniform index), as the HLSL path's heap form does, instead of a switch over the root UAVs; a window outside the program's count goes to window 0, as in the switch. On an RX 7800 XT the AMD driver builds the switch form of a retail title's slow compute programs 2-4x slower: 21 of them took 123.4 s with the switch over 4 windows and 52.9 s from the heap (cold builds, one at a time). The 4 GiB memory-windows GPU test now also runs both direct forms; the heap one fails with the old refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKtJsfjasPuTLtS3mEXFru
|
Correction: this run did not test this PR. My launch script passed only the first of its environment variables ( AI use: Claude Code (Claude Opus 5.5) wrote this correction. |
|
RTX 5070 Ti / Proton retail startup with direct DXIL and heap windows With Tested
Regression run The blocks were generated by the Wine smoke script. I abbreviated the local folder name in the
PR head Scope — One 60 s startup run per build. The frame counts describe this pair. Linux cgroup peaks were 9.02 and 6.41 GiB. Wine reported AI use — OpenAI Codex (GPT-6, exact variant unavailable) ran the tests, checked the shader routing, and drafted this report. |
|
Windows NVIDIA check at
No game files; the PR's own synthetic tests only. AI-assisted (Claude Code). |
|
Independent RTX 3090 validation of exact head I saw the RTX 3070 compute check above after my runs; the incremental coverage below is the direct mesh heap-window GPU path.
@@ -3229,6 +3229,12 @@ fn gpu_mesh_mode_reads_memory_windows() {
assert_eq!(positions(1)[0], [9.0; 4], "one window: window 0 at the same offset (the old MS / GS translation)");
+ let opt = on_gpu(Options { mode: Mode::Mesh(ms.clone()), wave64: true, mem_windows: 2, heap_windows: true, ..Default::default() });
+ let direct = direct_of(&code, &opt).expect("direct mesh translator accepts the split wave64 form");
+ let r = runner::run_in_arena(&direct, &st, &arena).expect("direct mesh heap-window dispatch");
+ assert_eq!((r.raw[0], r.raw[1]), (3, 1), "direct mesh GS_ALLOC_REQ counts");
+ let got: Vec<[f32; 4]> = (0..3).map(|v| std::array::from_fn(|c| f32::from_bits(r.raw[MESH_HEADER + v * vd + c]))).collect();
+ assert_eq!(got, vec![[-1.0, -1.0, 0.0, 1.0], [-1.0, 1.0, 0.0, 1.0], [0.0, -1.0, 0.0, 1.0]], "direct mesh heap form reads window 1");
}The diagnostic is uncommitted; I restored the Windows source to the exact head after testing. I did not run the full workspace suite, retail gameplay, driver compile timing, or a graphics VS/PS heap-form test in this check. The mesh check executes the translated compute phase, not the entire on-screen draw pipeline. Codex (GPT-6) prepared the test-only diagnostic and report; the stated results came from the native Windows machine. |
|
Title run with both variables set this time (
So the heap form shortens the worst driver builds, as the unit test shows, but it does not move the stall. Timed thread dumps at 130/150/170 s show no title thread in a compile. Only a preload worker is in the driver, and the title's threads wait in its own code while DirectStorage runs 2-5k requests per 2 s. I'm now looking at what the title waits on rather than at shaders. AI use: Claude Code (Claude Opus 5.5) ran the test and wrote this comment. |
|
Tested commit Environment
Tested
Review notes
Not tested
AI use
|
|
Tested commit Tested
Not tested
AI use
|
|
Closing this: #1693, which is merged, added heap memory windows to the direct DXIL path, so this now conflicts with This says nothing about the quality of the code here. If this PR covers a case the other one does not, say so and I'll reopen it. Thank you for the work. AI use: Claude Code (Claude Opus 5.5) read the diffs and the checks in #1607 and wrote this comment, on the maintainer's behalf. |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
With
XCL_HEAP_WINDOWS=1, the direct DXIL translator (#1426) refused every program that may address several memory windows ("unsupported: heap memory windows"), so they went back to the HLSL path. This takes them in the direct form, one access through the descriptor heap. That is the same shape as the HLSL path's heap form (#680), and it replaces the switch over the root UAVs, which the AMD driver compiles 2–4× slower.What changes (
gpu/dxil, +40 lines)Shader::heap_raw_uav: aRWByteAddressBufferhandle (globallycoherentfor compute) fromResourceDescriptorHeap[index].Lw::heap_mems: withHEAP_WINDOWSinmem_windowsand more than one window, no root UAVs are bound.Lw::with_memmakes one access throughResourceDescriptorHeap[MEM_HEAP_BASE + w]with a non-uniform index. Awoutside the program's window count goes to window 0, as in the switch form.Lw::multi_windowreplaces the threemems.len() > 1checks (the window of a FLAT address, a V#, a BVH node), so the window is tracked in both forms.Test
gpu_direct_memory_windows_from_the_heapruns the 4 GiB two-window program, the onegpu_memory_windows_from_the_heapruns on the HLSL path, through both direct forms on the GPU:direct DXIL: unsupported: heap memory windows).tests.rs:direct_oris split intodirect_of, which always translates, anddirect_or, which does so underXCL_DIRECT_DXIL.direct_ofpassesheap_windowson.gpu_memory_windows_from_the_heapwithXCL_DIRECT_DXIL=1now takes the direct heap form instead of falling back to the HLSL DXIL.Measured on an AMD Radeon RX 7800 XT (RDNA3, native 64-lane waves), Ryzen 7 3700X, 64 GB, Windows 11 26300, Rust 1.100.0, DXC 1.9.2602.17.
cargo test --workspace -- --test-threads=4: 859 passed, 0 failed, 42 ignored. OneSKIPPEDline,heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; it needsXCL_HEAP_WINDOWS=1and is skipped onmaintoo.memory_windowstests withXCL_DIRECT_DXIL=1: 6 passed, 0 failed.CreateComputePipelineStatewith the test root signature, cold, one at a time. The 21 programs without textures are below; the test root signature refuses the others.5683ddcd014910676e148dbd563de205cc047f458010c5d21404420b38db85972e0055c25f49848a34207613d17f8b9673000efc296c082e6da1f38b06d6c735aa35926a5609067bThe heap form's DXIL is within 2–5 % of the one-window form's.
Not tested
with_mem).XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1: it comes next, and I'll post it here.with_mem, but no test of their own.Discussed on #1269 and #1426.
AI use: Claude Code (Claude Opus 5.5) wrote the change and the test, ran the suite and the driver timings, and wrote this description.
🤖 Generated with Claude Code