Repository navigation
D3D12.X: back kept-in-step title textures by shared VRAM pages (#248) - #288
Conversation
|
@iliassgm tested on the retail streaming repro, as asked. AMD Radeon RX 7800 XT 16 GB (driver 32.0.32015.7029), 31.6 GB RAM, Windows 11, release builds. Regression run ( Streaming run – this PR's head + #244 (without #244 the title crashes at 67 s on the lazy-page race), menus walked with
No device removal, no crash. Stopped by the kill-switch at 129 s (33.7 GB commit, free RAM at 2.5 GB). The same setup with other builds, for comparison:
So the 0x887a0007 from #248 is gone with this PR and after ~80 s video memory grows ~0.06 GB/s ( Not tested: a run without the kill-switch; the picture during world loading (it is a dark loading fade there); NVIDIA. AI-assisted (Claude Code, Claude Opus 5.5). |
876557c to
ad79932
Compare
|
Retail run of
No device removal, and no new warning kinds compared with xcl-smoke, 60 sClaude Code (Claude Opus 5.5) ran the tests and wrote this report. No game files attached. |
|
Huge thanks @gw1337x and @grahamster2 for running both retail streaming tests (RX 7800 XT and RTX 3080 10 GB) — seeing VRAM drop from 19.8 GiB / OOM on Note that I pushed an updated head commit |
|
The main this PR, Streaming numbers for
No crash, device removal or Claude Code (Claude Opus 5.5) ran the tests and wrote this report. No game files attached. |
|
@iliassgm rerun on Regression run ( (main's block for comparison is in my earlier comment: Streaming run, this head + #244,
No device removal, no crash, no Not tested: more than one run per head; the picture during world loading; NVIDIA. AI-assisted (Claude Code, Claude Opus 5.5). |
|
A small one I hit while testing, in case it helps: on this PR ( |
…r GPU tests allocate at the same time) placed_title_textures_share_vram_and_preserve_pixels (PR #288) asserted the process's local video memory grew under 384 MB; under --test-threads=4 on an RX 9070 other GPU tests in the process made it +672 MB, alone it passes. The page count, which the change controls, stays asserted exactly.
|
Merged (2b4bb43), from the draft - of the three #248 PRs it kept video memory lowest in grahamster2's NVIDIA runs. Checked on an RX 9070 (RDNA4) on main 2b4bb43 together with #306, #288 and #294: |
… is committed, not a failure placed_title_textures_share_vram_and_preserve_pixels (PR #288) asserted every shape went to shared video-memory pages. GitHub's runner adapter refuses the 256x256x6 cube with 9 mips as a reserved resource (arrays with packed mips are a lower tiled tier's limit); the texture is then committed, which is correct - the test failed and its panic poisoned the lock two other tests share. Arrays and cubes now note the fallback; their pixels are checked either way.
…e with mips GitHub's runner adapter reports tiled resources tier 2 but refuses a reserved 256x256x6 cube with 9 mips, and further steps of placed_title_textures_share_vram_and_preserve_pixels (PR #288) then expected shared pages it never got. The test now probes that one resource and is SKIPPED, like the other GPU tests the runner cannot run; on a GPU it runs whole.
Fixes #248
What is in it
vram.rs: addvram::place_pagesso non-GPU-owned textures placed viaCreatePlacedResourceXuse reserved (D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE) resources backed by the existing shared 64 KiBvram::Pagespool (falling back to committed resources when reserved creation is unsupported, e.g. 1D textures orXCL_VRAM_ARENAS).vram.rs: map every 64 KiB page boundaryPstrictly inside[va, va + console_bytes)(owned_pages, proven non-aliasing for disjoint ranges even at 4 KiB alignment) onto sharedpages, share remaining/sub-64 KiB tiles inextra_pageskeyed by(va, tile_index)so repeated placements at the same address never leak, wrap poolCreateHeapintitle_textures::own_work, and keyPAGESper device withqueue.GetDeviceinbefore_execute.vram.rs(unmap_superseded/remap_if_unmapped): when a placed texture is superseded by a placement with a different range ((ova, oend) != (va, end)) or a GPU-owned render target, unmap its tiles (D3D12_TILE_RANGE_FLAG_NULL) and return any unsharedextra_pages/ tail pages straight tocoolingso 4 KiB-packed< 64 KiBstreaming churn stays bounded without requiringRelease. Exact same-range aliases remain mapped and share every tile. If the newer overlapping placement is later released,remap_if_unmappedre-binds the uncovered texture cleanly.title_textures.rs&device_x.rs: wait for pendingUpdateTileMappingsviavram::before_execute(&queue)beforetexture::upload_batch(andprobe_gpu_content). Keep active (non-shadowed) entries in anO(log N)address-ordered index sorefresh_onceskips shadowed placements while still tracking transitions/states on shadowed entries and promoting uncovered older textures back to active onforget(fixing row 6 from @Kalmarv's comparison while keeping fast uploads and rows 1–5).owned_pagesdisjointness, shadowing/unmapping, and multi-layer reactivation (vram.rs,title_textures.rs), plus a hardware D3D12 GPU test covering 512 unreleased 1 MiB textures over a 16 MiB window (+16 MiBpages,+0 Bafter fill), exact same-range aliasing + release reactivation (rows 4 & 6), partial-overlap isolation + unmap/remap on release (row 5 & 6b), immediateextra_pagesreclamation for superseded 4 KiB-packed< 64 KiBtextures, and bit-exact GPU readback across RGBA8/BC7 mip chains (including packed mips), a 6-slice cubemap, and a 3D volume.Tested
32.0.16.2124), Intel Core i5-10400F, Windows 11;rustc 1.100.0 (0ef1bc386 2026-11-09), debug + release (cargo build --release -p xclclean).cargo test --workspace -- --test-threads=4: 654 passed, 0 failed, 40 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware— RTX 3060 is wave32;uploads_start_from_each_subresources_stateskips locally because Windows Graphics Tools / D3D12 debug layer is not installed).placed_title_textures_share_vram_and_preserve_pixels): 512 unreleased 1 MiB textures over 16 MiB stay at+16 MiBpages (+0 Bafter fill),+0 Blocal VRAM growth after fill (solo run),+16active kept; rows 4/5/6 + different-range unmap/remap + 4 KiB< 64 KiBextra_pagesreclamation all pass bit-exact; negative control withXCL_VRAM_ARENAS=1fails as expected.Regression run
Draft PR awaiting a
scripts/smoke.ps1run on a retail title (I do not have a retail game folder on this machine). If @gw1337x or another retail tester can runscripts/smoke.ps1onmainand this head commit (ad799324d6e6) withXCL_ACTIVITY=1, I will paste both blocks here and mark ready for review.main:
pending (no retail title locally)
PR:
pending (no retail title locally)
Not tested
scripts/smoke.ps1(no retail game files locally).AI use