Repository navigation
Conversation
…iles go back A pool heap is released only when all its tiles are free, and a title frees its tiles in runs spread over all its heaps. With heaps of 64 MiB (1,024 tiles) a retail title's world load unmapped 1.5 GB of its 4.6 GB of tiles and 3 of 78 heaps went back: 1.7 GB of video memory stayed in live heaps as free tiles. With heaps of 64 tiles 1.25 GB goes back and 0.2 GB stays. retire_free_pools marks the pools that go with a flag each: a world load frees hundreds of pools' worth of tiles at once. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
RTX 4060 Laptop GPU (8 GiB), NVIDIA 590.48.1, Wine 11.0 / vkd3d-proton 3.2.0, This is isolated GPU pool-reclamation evidence, not a retail world-load or peak-host-RAM measurement; on Wine, smaller heaps may increase Vulkan allocation count/driver overhead. A matched guarded world-load comparison should sample pool bytes vs mapped bytes, driver allocation count, scope RAM and GPU usage. I did not launch XCL retail here because the existing console-facing in-place D3D12 vtable/root-signature assertions under stock vkd3d-proton precede this PR (#175), so this fixture cannot certify gameplay or the 16 GiB RAM floor. Additional local-integration result (2026-11-26), not an exact-PR retail test: after installing diagnostic vkd3d-proton 3.2.0 A separately fresh-built 1080p title trial still hit our unchanged 6000 MiB global GPU safety ceiling: stopped at 40.98 s, 6158 MiB GPU, 5389 MiB available system RAM, 4539 MiB scope memory / 4343.4 MiB anonymous, exit 137 from the guard. An 18-second window screenshot was black; no gameplay/input/FPS claim. Earlier same-integration 64 MiB-pool run at the same requested render resolution stopped at 38.86 s / 6039 MiB, but differing host state/cache history and absent pool-at-stop accounting mean these runs do not establish a performance or memory-saving comparison. Lowering title output from 4K to 1080p also did not by itself clear the ceiling. The focused reclamation result remains positive; this integration result only says that this change alone did not make our workload fit. Sparse logging reported 61,095 mapped 64 KiB tiles at submission 16 and 57,495 at 128; these are intermediate live-page counts, not GPU allocations at the stop. This older integration lacks newer lazy-level texture residency, so please do not interpret it as coverage of current main or the full memory-fix stack. Local evidence: |
|
NVIDIA and AMD full-suite run, to go with pickles976's run of the new test on an RTX 4060 under Wine above. Tested exact head Tested
Not tested
AI use
|
|
Independent NVIDIA (8 GB VRAM) test report on exact head Tested
Regression run main: PR: Not tested
AI use
|
…cl-dev#2630) (cherry picked from commit 2dc544098979ef1c83fb7b6ff48d58683d6d2cde)
|
Tested on an RTX 3060 12 GB, retail world load, merged onto Setup: RTX 3060 12 GB, NVIDIA 581.80, i9-14900KF, 32 GB RAM, Windows 11 26200, release build. Head Sparse pools from the 2 s
Not tested: the exact head or AI use: Claude Code (Claude Opus 5.5) merged the branch locally, ran the runs on this machine and wrote this report. |
A pool heap of the sparse windows goes back only when every tile of it is free, and a title frees its tiles in runs spread over all its heaps. With heaps of 64 MiB a retail title's world load leaves 1.5 – 2.0 GB of video memory in live heaps as free tiles (and Windows charges that to the process's commit as well). This makes the heaps 4 MiB, so the heaps of the freed runs go back. Part of #1773 (its point 3); the measurements that led here are in my comment there.
What is in it
hle/d3d12x/sparse.rs:POOL_TILESis 64 (it was 1024).retire_free_poolsmarks the pools that go with a flag each. It searched a list of them once per free tile, which was fine for a handful of 64 MiB pools and is not for the hundreds of small ones a world load frees at once.pools_of_freed_runs_go_back: 192 MiB of tiles taken in order, of every 64 MiB the first 4 MiB kept and the rest freed. WithPOOL_TILESat 1024 it fails with3072 tiles of video memory stay in pools for 192 tiles in use (192 MiB for 12 MiB).Tested
cargo build --workspace+cargo test --workspace --no-fail-fast -- --test-threads=4, run twice on this head: 1,436 passed, 0 failed, 47 ignored; and 1,435 passed, 1 failed, 47 ignored, the failure beinghle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memoryat its list'sClosewith0x80004005. That is the failure D3D12.X: a direct list at a released compute list's heap vtable address gets the compute list's methods #2588 describes onmain(now and then in parallel runs); the test does not use the sparse pools and passed alone, 3 of 3.SKIPPEDlines in each run: 21 wave64 forms (no wave64 on this adapter), 3 per-lane f16 / f32 forms refused, 2 of the title under the debug layer and 1 upload test (no D3D12 debug layer here), 1no heap windows, 1 that cannot turn the driver cache off (no Developer Mode).POOL_TILESis put back to 1024.The retail title of #505, Series S profile,
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_TEXTURE_LEVEL_PAGES=1, one run of 600 s each. Both builds (the second from this change before one comment was reworded) also carry #684 (without itmainends inxg::copy_fromat the world's set-up) and a local counter that is not in this PR (free tiles by pool, time ofCreateHeapand of the mappingUpdateTileMappingscalls):mainb49be18+ #684CreateHeapUpdateTileMappingscalls that map tiles, their timesparse windows: 16 submits: time spent, tiles mappedsparse windows: 8192 submits: time spentSo the pools follow what is mapped: 1,452 MB less in pool heaps and 1,060 MB less local video memory once the world loads, for 0.5 s more in
CreateHeapand 0.6 s more in tile mapping over the run. Both runs wait for pipelines after the world's set-up (no present there in either), so this compares the menus, the loading screens and the load itself. Process commit is not in the table: the two runs compiled different amounts in the driver at the same times (19 against 1 compute pipelines of 10 s or more), which moves it by more than the heaps do.The same change on
nvidia-devc044dc6d+ #684 (XCL_UMA_SHADOW=1, one run each, the runs before and after it in one night on the same caches):sparse windows: 16 submits: tiles mapped, time spentsparse windows: 8192 submits: time spent0x887a0006), dedicated video memory of all processes at 15.4 of 16 GBOne run each, so the last row shows no cause. Added 2026-11-26 after seven more runs of the 4 MiB build on the same caches (1200 s each): six ran their time, and one lost the device the same way at 241 s (
0x887a0006, DRED with the same operations around the stop) with local video memory at 12,986 MB. So that removal comes with 64 MiB and with 4 MiB heaps, and does not need a full card; the last row is no evidence for this change.Regression run
main:
this PR:
Two more pairs of the same 60 s run: frames shown 1141 and 1123 on
main, 1114 and 1242 here; peak commit 13,706 and 13,676 MB onmain, 13,656 and 13,684 MB here.Not tested
nvidia-dev57 – 87 % of the free tiles lay in wholly free aligned blocks of 64, 28 – 62 % in blocks of 256, and blocks of 16 added little (the comment linked above).AI use
Claude Code with Claude Fable 5.2 wrote the change and the test, ran the runs and wrote this text.
🤖 Generated with Claude Code