Repository navigation
Conversation
…ll size Every heap the title makes gets a PC heap of its full size, and a heap that may hold buffers also gets a block of unified memory as large when its first buffer is placed: buffers go in the block (console code reads them at their addresses), textures in the PC heap. A heap made with ALLOW_ONLY_BUFFERS (both texture kinds denied) never holds a texture, so its PC heap was video memory of the heap's whole size that nothing was placed in, on top of the block. Such a heap now takes its block at CreateHeap and gets a 64 KiB PC heap; GetDesc still answers with the title's size. A buffer that cannot go in the block (and does not fit in the 64 KiB) gets memory of its own of the heap's kind, as a texture past a heap's end already does. When unified memory is full the heap is made as before. XCL_SMALL_BUFFER_HEAPS=0 turns it off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
A buffers-only heap with a 64 KiB PC heap answered GetDesc with the title's exact size, and its PC heap was made with alignment 0 whatever the title asked. A heap made the usual way from a description the PC refuses has its size rounded up to 64 KiB and an alignment above 64 KiB promoted to 4 MiB (dev_create_heap), and d3d12_create_heap's console_heap_descs_refused_by_host_are_normalized_by_xcl checks exactly that: it failed on the RTX 3060 Ti with 0x12345 where 0x20000 was expected. The small heap now does the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DaZV7vMq866ni7pGnJC2Ew
|
Reviewed and tested at Code review findings
Tested locally
AI use
|
|
Ran the buffers-only heap tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. Both new tests pass: only a heap that denies both texture kinds is classified as buffers-only, and a small buffer heap is known by its entry with the 64 KiB PC heap size. The PR is a draft and has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti. These are CPU-side classification tests, not a title memory comparison. Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data. AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
|
RTX 4090, a retail title through world loading: it never makes a buffers-only heap, so this PR has nothing to act on there. This covers the "retail title's world" case in the description's Not tested. Setup
Results
Not tested: other titles, a run past 300 s that reaches the world with this PR (the one 300 s run did not; my #3318 runs with the same setup reached it in 5 of 6, at 169–320 s), AMD, and any memory or frame-time effect: with no heap to act on, there is none to measure on this title. AI use: Claude Code (Claude Opus 5.5) built the tree, wrote the probe, ran the tests and the replays, and wrote this report. The person running these tests asked for it. |
KOLESNiii
left a comment
There was a problem hiding this comment.
Static review of e8f69393 for the stack in the #3041 comparison.
I confirmed the CreatePlacedResource1 bypass reported by saintwolf. For example, CreateHeap1 can return a 64 KiB native heap while reporting the requested 4 MiB. Placing a 64 KiB buffer at offset 64 KiB fits that reported heap, but CreatePlacedResource1 passes the operation straight to the native driver and it fails against the actual heap. A regression test using those two entry points would cover the gap. Heap creation ?? Placement wrapper
Review assisted by Codex (GPT-6, exact variant unavailable). No new build or GPU run for this review.
bmjask
left a comment
There was a problem hiding this comment.
Critical review of current head e8f69393 (source and existing Windows reports; I did not run Windows tests here). Changes needed: The small native heap reports the title's full size, but CreatePlacedResource1 still bypasses placed_in_heap_x; a legal buffer placement beyond 64 KiB can therefore fail against the real 64 KiB heap. Please route all placed-resource entry points through the same UMA/committed fallback and add a CreateHeap1 + CreatePlacedResource1 regression. Also account for the new eager UMA reservation at CreateHeap: unused buffers-only heaps now consume the full block. The existing review describes that lifetime cost. A retail-world run in this thread observed no buffers-only heaps, so the claimed FPS/memory benefit needs a workload that exercises this path.
|
Review (head e8f6939, diff read, not a merge-check; draft, so not built or run):
Fine: the buffers-only check is conservative, failure paths release the heap and fall back to the old path, Release frees the block, the AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Test report (not a merge-check: draft) uma_driver.rs ~756 / ~810). Correction to an earlier version of this comment: the same failure also hit #2991 and, once, #3318 (which doesn't touch heaps), while two full runs of main passed them. So it is intermittent on this machine, not clearly caused by this PR, though it hit this PR in both of its runs. A local run of cargo test -p xcl --lib uma_driver a few times on this head would settle it. The rest of the suite passes, and the findings in my review stand.hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 AI-written and posted by Foniass without a human check of each point. |
Requested by Prime
Every heap the title makes gets a PC heap of its full size, and a heap that may hold buffers also gets a block of unified memory as large when its first buffer is placed: buffers go in the block (console code reads them at their addresses), textures in the PC heap. A heap made with
ALLOW_ONLY_BUFFERS(both texture kinds denied) never holds a texture, so its PC heap was video memory of the heap's whole size that nothing was placed in, on top of the block.Such a heap now takes its block at
CreateHeapand gets a 64 KiB PC heap;GetDescanswers with the title's size rounded up to 64 KiB, and a title alignment above 64 KiB is promoted to 4 MiB, asdev_create_heapdoes for any heap description the PC refuses. A buffer that cannot go in the block (and does not fit in the 64 KiB) gets memory of its own of the heap's kind, as a texture past a heap's end already does. When unified memory is full the heap is made as before.XCL_SMALL_BUFFER_HEAPS=0turns it off.What is in it
crates/xcl/src/hle/d3d12x/real.rs(first commit): buffers-only heaps (ALLOW_ONLY_BUFFERS) get their block atCreateHeapand a 64 KiB PC heap, info lineD3D12.X: buffers-only heap of ...; testsonly_a_heap_that_denies_both_kinds_of_texture_is_buffers_onlyanda_small_buffer_heap_is_known_by_its_entrycrates/xcl/src/hle/d3d12x/real.rs(second commit): the small heap'sGetDescsize and alignment followdev_create_heap's normalisation (the first commit alone failedd3d12_create_heap'sconsole_heap_descs_refused_by_host_are_normalized_by_xclwith 0x12345 where 0x20000 is expected); to be squashed into the first before reviewREADME.md:XCL_SMALL_BUFFER_HEAPSTested
cargo test --workspace --no-fail-fast -- --test-threads=4with the threeuma_drivertests below skipped, on e8f6939: 2606 passed, 1 failed, 49 ignored; failing: hle::d3d12x::list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares (SKIPPED GPU tests: 28 lines: 21no wave64(this card runs wave32), 3 a wave32 per-lane form refused by the translator (gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426), 2no heap windows(opt-inXCL_HEAP_WINDOWS=1), 1no dxc.exe, 1cannot disable the driver cache(needs Windows Developer Mode))cargo test -p xcl --lib -- --test-threads=1 uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window): 3 passed, 0 failed. They are left out of the whole run because on this PC's driver they can end the library test process (exit 0x7c10003, "coherent window could not be restored"), onmaintoocargo test -p xcl --lib -- --test-threads=4, same skips): 2468 passed, 0 failed; 2468 passed, 0 failedE_OUTOFMEMORY(0x8007000E) while the run shared the 8 GB card with the other tests and the desktop; alist_xtest failed the same way once on another branch of this set that changes no D3D12 code (DirectStorage only); it passed in the other runs heremainfa20459: 2605 passed, 0 failed, 49 ignored, 28SKIPPEDlines (own-prs-20261129 run, same command)scripts/smoke.ps1, no input, copied profile and shader cache): blocks belowRegression run
Not tested
buffers-only heapline in its log), so the smoke does not reach this code; the memory saved was not measured on a title that makes such heaps.AI use
Optional temporary Discord for coordinating contributor work, testing and comparing results.
🤖 Generated with Claude Code