Repository navigation
D3D12.X: reclaim empty 64 MiB VRAM pool heaps, alias GPU mirror pages, and sync 2048x128 glyph atlases - #1985
Conversation
|
On On the RTX 5060 Laptop GPU (8 GiB), an asset-free D3D12 probe allocated three 64 MiB heaps. With one warm spare, DXGI local usage went from 208 to 144 MiB after reclaim, then back to 208 MiB when the slot was reused. Ten focused checks passed with zero failures, ignores or hardware skips, including that local probe. Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, vkd3d-proton 3.1.0 ( In matched offline Series X startup checks (parent OpenAI Codex (GPT-6.2-Sol) assisted with diagnosis, implementation, tests and reporting. |
Hardware test report — commit
|
|
Technical review findings: Blocking
Major
|
…, and sync 2048x128 glyph atlases
|
Regression run for this PR: head main this PR: No device removals or crashes; 102 % of main's frames, 95 % of its peak commit. Not tested: the whole suite; world loading; whether the title reaches all of the changed code in these 60 s (default settings: Written with Claude Code (Claude Opus 5.5) from runs on this machine. |
363a451 to
5a515f0
Compare
|
Thanks for the detailed catches, Updated
Compiled cleanly in release ( |
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
|
Independent NVIDIA check of 5a515f0 against the requested 3da2abb baseline. Windows 11 build 26300, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug build. Built with The PR's empty-pool bookkeeping test passed. The shared-VRAM GPU test passed on both revisions. Its 512 unreleased 1 MiB texture placements over a 16 MiB working set had zero additional page growth after fill. Coverage was the stock synthetic tests with default driver validation. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the tests and drafted this report. |
|
Follow-up on 5a515f0. A separate synthetic GPU fixture on the RTX 3080 Ti (621.35, Windows 11 build 26300) created one pool with a live RGBA8 texture and two empty 64 MiB heaps. With one warm spare configured, One exact test passed with zero failures or skips. The fixture seeded already-empty heaps and exercised native D3D12 retirement on one queue. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this report. |
|
Regression run of Against the limits in CONTRIBUTING.md: 100 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
xcl-dev#1182 keys owned pages by their physical page, but the count of tiles to take (from the xcl-dev#1985/xcl-dev#1663 batch code) still looked pages up by address: a page already shared through its physical page was counted as missing, and a new one not, so fresh_iter ran dry and the title aborted at vram.rs:789 in the first XCLM run (49 s, menus). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @Toons29 for running and sharing the exact-head 60 s |
Brings main to full parity with upstream/main (cdb0891), including: - World rendering & gameplay: xcl-dev#1991, xcl-dev#1988, xcl-dev#1984, xcl-dev#2028, xcl-dev#2078 - Memory / VRAM / PSO: xcl-dev#1985, xcl-dev#2157, xcl-dev#2178, xcl-dev#2195, xcl-dev#2176, xcl-dev#1996, xcl-dev#1914 - Direct DXIL & shaders: xcl-dev#2120, xcl-dev#2174, xcl-dev#2194, xcl-dev#2207, xcl-dev#1951, xcl-dev#1973, xcl-dev#2156, xcl-dev#2064 - Preserves local Linux/Wine customizations: docs/linux.md, scripts/linux/*, in-process Wine XAsync (xgameruntime/api.rs), loader watchdog bypass, and Wine MEM_WRITE_WATCH bypass on coherent UMA windows (gpu/uma.rs). Assisted-by: Antigravity (Gemini 4)
Pass per-device heap properties when the batched allocator grows. Keep xcl-dev#1747 batching and xcl-dev#1985 heap slot reuse and fence-delayed retirement for both heap types. Verify the selected backing with a two-tile GPU copy/readback. Assisted-by: OpenAI Codex (GPT-6)
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
Reclaims idle 64 MiB VRAM tile-pool heaps (keeping a configurable warm spare count via
XCL_VRAM_KEEP_SPARE_POOLS, default1), defers reclaimed heap destruction safely behind GPU fence completion (retire_fence), canonicalizes GPU mirror virtual addresses (canonical_va) only when uncommitted/aliasing a mapped GPU view (physical_page_at+VirtualQueryMEM_COMMITguard), and widensis_small_cpu_filled_targetup to2048on an axis (<= 1Mpixels) so2048x128CPU-filled glyph atlases stay in sync.Part of #1833.
What is in it
crates/xcl/src/hle/d3d12x/vram.rs:Arenas::sweep_dropped: zero-alloc fast-path + order-preservingdrain(arenas_sweep_dropped_preserves_newest_fitting_order).TilePool::reclaim_empty_heaps, per-devicelast_reclaim, andretire_fence(queue.Signal+fence.GetCompletedValue()verification) so reclaimed pool/arenaID3D12Heapobjects are never dropped while in-flight GPU work references them (compatible with#1983'snote_internal_wait).canonical_va: checkskernelx::physical_page_at(va)+VirtualQueryMEM_COMMITbefore aliasing a GPU mirror view (canonical_va_aliases_unmapped_gpu_view_but_preserves_committed_override).crates/xcl/src/hle/kernelx.rs&crates/xcl/src/hle/d3d12x/title_textures.rs:kernelx::mirrors::gpu_views_of+ symmetrictitle_textures::retire_overlappingretirement in both directions (gpu_va -> cpu_vaandcpu_va -> paired gpu_va).is_small_cpu_filled_targetup to2048x128(<= 1Mpixels,small_cpu_filled_target_accepts_wide_glyph_atlas_and_rejects_large_or_depth).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly onto3da2abb(5a515f0).cargo build --release,0errors) on5a515f0; GitHub ActionsBuild and testis running on this pushed head (5a515f0).scripts/smoke.ps1regression pair on AMD Radeon RX 9070 (@Toons29): passed (0 device removals, 0 crashes).Regression run
60 s
scripts/smoke.ps1pair on exact head5a515f0vsmain(AMD Radeon RX 9070, driver 32.0.32029.2010, Windows 11 26300, release,XCL_NETWORK=0on a retail title), contributed by@Toons29:main:
this PR:
Not tested
cargo testsuite and 60 sscripts/smoke.ps1pair on5a515f0, fullcargo test --workspacesuite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use