D3D12.X: sparse tiles outside the GPU heaps can live in system memory #2987
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2987"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by treybertram06 on 2026-11-27T07:35:07Z.
Target:
main. This was opened againstnvidia-dev; #3203 merged that intomain, and this is rebased ontomaind52ff48c. Part of #2688. Related: gefydev's planned budget-triggered L0 sparse pools (#2688), and #1702 (texture pages in system memory).With
XCL_COHERENT_HEAPS=sparsethe title's GPU heaps live in the sparse windows instead of the coherent window. These heaps are committed memory with aPAGE_GRAPHICS_*protection, about 4.5 GB in a retail title. Shaders read and write them every frame. In the coherent window (system RAM, read over PCIe), one retail compute program took 1,364 ms per frame on an RTX 3080; with the heaps in video memory it falls under 33 ms (XCL_GPU_TIMES). An RTX 4080 report on #2688 found the same factor. But with the heaps in video memory, the sparse windows hold about 7.5 GB of tiles. On a 10 GB card the device runs out of budget: 19 GB in use against 8.9 GB, removed at 659 s.XCL_SPARSE_SYSMEM=1(off by default) keeps the GPU heaps' tiles in video memory and puts every other sparse-window tile in system memory:sparse::alloc_as) before its commit maps its tiles;MEMORY_POOL_L0, write-back), which the GPU reads over PCIe.gefydev's plan moves new pools past the budget. This one decides by what a range holds, so the heaps the shaders depend on are never the ones moved.
What is in it
D3D12.X: sparse tiles outside the GPU heaps can live in system memory(hle/d3d12x/sparse.rs,hle/kernelx.rs):note_hot/is_hot/alloc_asmark the hot ranges;SysPools, pool index tagged withSYS) with their own free and cooling lists. Since the rebase onto #2898, these lists are aFreePoolsof their own, kept by the heap's number withoutSYS, because the free table is indexed by heap number;pool_heapresolves either kind;take_tile_for);forget_hot, fromsparse::freeand kernelx'sMEM_RELEASE);pool_bytesno longer counts quarantined system-memory tiles as video memory (throny's merge-check).the_title_gpu_heaps_are_hot_and_nothing_around_them,a_lazy_tile_outside_the_gpu_heaps_gets_system_memory,a_parked_system_memory_tile_gives_way_to_a_gpu_heap. The last two fail without their fixes. Since the rebase, the last one also checks that the replaced tile cools among the system-memory pools and not in the video-memory free table; that check fails when the index is not masked. Undercfg(test)the switch follows a thread-local a test sets, not the environment.Tested
xcl.exe(#2590). Debug tests, release title runs.cargo test --workspace --no-fail-fast -- --test-threads=4, withXCL_DXC_DIRset to DXC 1.9, at this PR's head15b74314: 2879 passed, 1 failed, 51 ignored.gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16, also fails onmaind52ff48cwithout this change (2876 passed, 1 failed, 51 ignored there).SKIPPED: 22no wave64, 2no heap windows. The same onmain.cargo test -p xcl --lib system_memory: 2 passed, 0 failed, no skips.6c5904f9(before the review fixes and the rebase ontomain; not rerun since),XCL_COHERENT_HEAPS=sparse XCL_SPARSE_SYSMEM=1 XCL_TEXTURE_LEVEL_PAGES=1 XCL_PREPARE_WORKERS=6, scripted presses. Over the 400 s after the menus: 0.72 presents/s, video memory 15.1 GB local / 5.0 GB non-local (budget 9.2 GB), commit 41.5 GB, no device removal.XCL_GPU_TIMESwith the heaps in the coherent window: the top programcs 10eaefe801508781took 1,364 ms per frame. With them in video memory, the top program is under 70 ms.Regression run
Base, a commit of
main:d52ff48c.smoke.ps1now setsXCL_PREPARE=0, somain's launch preparation gate no longer holds the run, and the base is currentmainagain. The switch is off in both runs. A 60 s warm-up run ofmaincame first.This PR's head:
Not tested
XCL_COHERENT_HEAPS=sparseisn't onamd-dev. A 16 GB RDNA3 card stays under its budget anyway (oni-swr on #2688).0x887a0006, at 48 s and 202 s); the cause is not known. Runs without these switches also lose it on this title (#2688).0x8007000E) at 805 s.AI use
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T07:56:46Z.
Independent RTX 3080 Ti check of
6c5904f9: withXCL_SPARSE_SYSMEM=1, the eager path places a cold control tile in the system-memory pool, but a lazy cold tile receives a default video-memory pool tile at its first CPU write. The lazy materialization path callstake_tile()directly, bypassing the cold/hot choice inensure_mapped. This undercuts the VRAM saving whenXCL_SPARSE_LAZY=1is used.I extended the existing synthetic lazy first-write test to first verify L0 support with an eager control tile and then assert the lazy tile's pool class. On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, I set
XCL_SPARSE_SYSMEM=1andXCL_REQUIRE_GPU=1and rancargo test --offline --locked -j 4 -p xcl --lib a_lazy_tile_gets_memory_at_its_first_bytes_and_keeps_them -- --nocapture --test-threads=1. It failed on the PR head (0 passed, 1 failed, 0 ignored, no GPU skip; lazy pool class was video). Sharing the selection intake_tile_for(t)made the same test pass (1 passed, 0 failed, 0 ignored, no GPU skip), including its existing 64-KiB GPU readback. This is a local candidate, not a committed change or a full title validation.Candidate fix and focused regression diff
The broader policy still needs the lazy path's
at_hand/low-memory decision to consider ready system-pool tiles, plus reservation-lifetime handling when an address changes between hot and cold. Those cases were not exercised by this focused test. No game files were used. AI use: Codex (GPT-6.2 Sol) ran the red/green GPU test and wrote the local candidate; Codex (GPT-6.2 Astra) reviewed the sparse allocation paths.Imported from ivall/xcl. Originally posted by 3L1A5-1 on 2026-11-27T08:05:24Z.
8 GB VRAM / 16 GB RAM data point with
XCL_SPARSE_SYSMEM=1alone (no hot heaps, which an 8 GB card can't hold): local video memory is cut from ~4.1 GB to ~1.1 GB over budget, and it stays under budget until title ~180 s. The cost is system memory, roughly one-for-one, and on 16 GB the run still ends on host memory. One run with the switch. The comparison is against single runs of the same stack without it, and the local over-budget peak was stable at +3.7 to +4.5 GB across 8 runs of this base with and without the other PRs.Tested
nvidia-deve0821b12+ #2817 (a2c10b4a) + #2921 (8b57c36e) + #2898 (8cf249e5) + this PR (6c5904f9). This PR and #2898 conflict insparse.rs(FreePools), which I resolved locally, so a rebase will be needed if #2898 lands first. Baseline: the same stack without this PR (ona5e2d851).XCL_SPARSE_SYSMEM=1(noXCL_COHERENT_HEAPS=sparse).Results
XCL_SPARSE_SYSMEM=1no system-memory pool heapwarnings. The end time difference is within the 340–440 s spread I see between single runs of this stack, so I'm not reading a gain or loss from it.Not tested: repeats,
XCL_COHERENT_HEAPS=sparse(no room in 8 GB), 32 GB RAM, AMD.AI use: build, run and log analysis by Claude Code agents (Claude Sonnet 5.5), report written and checked against the run logs by Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by SzczepanGrela on 2026-11-27T08:06:51Z.
RX 9070 / Wine: an eager sparse-window system-memory readback works in a focused native GPU fixture at
6c5904f9426ffdfd4772399c92bfa84ddf29f6e2. Both copies and a wave64 compute shader preserve the expected contents through the mixed pool mapping.Tested
RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1, Ryzen 7 7700, CachyOS 7.3.0-5, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton
8293130ebe370b1+with local asserts-disabled build, DXC/DXIL 1.9.2602.17, Rust 1.97.1 Windows-GNU release. Explicit adapter, network off, private enabled caches. Owned tests were appended to source copies; production functions and original assertions were unchanged.Compared the exact head with its actual parent
a5e2d851a503fc0e04609f773ea53f2d2c4e3269; the targetnvidia-devhad advanced toe0821b12.cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run, then the resulting PE under Wine:hle::d3d12x::sparse::tests::the_title_gpu_heaps_are_hot_and_nothing_around_them --exact --nocapture --test-threads=1and=4: 1 passed, 0 failed each.hle::d3d12x::sparse::workflow_sysmem_native::workflow_cold_system_tiles_and_hot_video_tiles_read_back --exact --nocapture --test-threads=1: three fresh full processes per source/switch combination, plus one pilot each.XCL_SPARSE_SYSMEM=0and=1were tested in separate processes. Each harness passed; zero ignored or skipped tests.The fixture maps eagerly through
ensure_mapped, withXCL_SPARSE_LAZYunset. It uses a 16-tile reserved buffer, with 6 tiles marked hot and 10 cold. It calls productionnew_state,ensure_mapped,flush_pendingandupload_dirty, registering hot ranges directly throughnote_hoton head.These are actual pool tags and native
ID3D12Heap::GetDescresults. All cold tiles in the enabled head used the system-pool path; no fallback to DEFAULT was counted as coverage.Every window word was checked after CPU upload, after partial native GPU writes with untouched regions retained, and after an owned wave64 shader loaded, transformed and stored every word through the same window. A separate width buffer verified lane count 64 and its 15 untouched guards.
Independent Python verification checked all 10,223,872 readback words, including 39 MiB of window payload, across 64 native readbacks and 16 wave64 dispatches. Data, guards and shader containers match across sources, switches and fresh repeats. No device removal occurred.
Not tested
Lazy first-write materialization, including the bypass already reported here, the full kernelx
VirtualAlloc/alloc_ascaller, hot-range free/reuse lifecycle, title workload, smoke, full suite, native Windows, physical residency, budget reduction or performance. Heap properties and GPU data correctness do not establish those measurements. Main83b00818was not integrated or built: the three-way file application conflicts insparse.rsandkernelx.rs; no manual repairs were made.AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the public change, wrote and ran the fixture and independent verifier, and drafted this report. Publication authorized by the account owner.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T08:16:39Z.
New, separate finding on #2987 head
6c5904f9, following my earlier lazy-placement report: a cold tile can be decommitted intoparked, then immediately recommitted at the same address after that address becomes a title GPU heap.ensure_mappedtakes the parked tuple before checkingis_hot, so the new hot heap inherits system-memory backing. This is distinct from the lazy first-write path.I added a synthetic one-tile GPU regression that commits cold, flushes the mapping, verifies the SYS pool bit, decommits, calls
note_hotfor the same address, and recommits. On Windows 11 build 26300, RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Rust 1.99.1 MSVC, withXCL_SPARSE_SYSMEM=1andXCL_REQUIRE_GPU=1,cargo test --offline --locked -j 4 -p xcl --lib a_parked_cold_tile_does_not_back_a_new_hot_heap -- --nocapture --test-threads=1failed on the PR head (0 passed, 1 failed, 0 ignored, no GPU skip; pool index retained the SYS bit). The candidate below passed the same test (1 passed, 0 failed, 0 ignored, no GPU skip).The candidate acquires a video-memory replacement before touching the parked mapping, then unmaps and quarantines the old tile behind the existing queue fences. It leaves pinned tiles on their existing backing so placed-buffer aliases remain intact. It is a focused local candidate, not a full proof of safe retirement under every queue schedule; the author should review and extend the pinned/blocked-queue tests before merging.
Candidate correction and regression diff
Separate test-coverage note: with
XCL_SPARSE_SYSMEM=1, the broaderparkedfilter still has two existing failures because those tests expect released tiles in the video-memorys.coolingqueue. The candidate does not change them. With the feature unset, that filter completed 6 passed, 0 failed, with the new SYS-only case reporting a skip; those six passes are not six SYS-mode coverage cases.No game files or title executable were used. AI use: Codex (GPT-6.2 Sol) wrote and ran the red/green test and candidate; Codex (GPT-6.2 Astra) checked the mapping and fence sequence.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T08:29:55Z.
Independent desktop NVIDIA verification of PR #2987 at head
6c5904f9426ffdfd4772399c92bfa84ddf29f6e2(1commit; exact parent & merge-base:a5e2d851a503fc0e04609f773ea53f2d2c4e3269onnvidia-dev).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
6c5904f9)cargo test --release -p xcl --lib -- hle::d3d12x::sparse::tests::the_title_gpu_heaps_are_hot_and_nothing_around_them --exact --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1727 filtered out× 3 (0.00s× 3,0skipped)cargo test --release -p xcl --lib -- hle::d3d12x::sparse:: --test-threads=1 --nocapture(3 consecutive runs)67 passed; 0 failed; 1 ignored; 1660 filtered out× 3 (5.20s,4.74s,4.98s,0skipped;1#[ignore]:early_commit_timing)cargo test --release -p xcl --lib -- hle::kernelx:: --test-threads=1 --nocapture(3 consecutive runs)61 passed; 0 failed; 1 ignored; 1666 filtered out× 3 (1.25s,1.25s,1.26s,0skipped;1#[ignore]:scatter_timing)cargo build --release -p xcl2m 16s, exit0,0new warnings insparse.rs/kernelx.rs; pre-existingrbq_valuewarning unchanged froma5e2d851)Paired quiet 60 s retail smokes (
title: 29640639,XCL_PREPARE=0 XCL_NETWORK=0)Exact parent & merge-base (
a5e2d851a503fc0e04609f773ea53f2d2c4e3269,XCL_PREPARE=0 XCL_NETWORK=0):PR #2987 default (
6c5904f9426ffdfd4772399c92bfa84ddf29f6e2,XCL_SPARSE_SYSMEMunset,XCL_PREPARE=0 XCL_NETWORK=0):PR #2987 opt-in (
6c5904f9426ffdfd4772399c92bfa84ddf29f6e2,XCL_SPARSE_SYSMEM=1,XCL_PREPARE=0 XCL_NETWORK=0):Runtime memory & sparse-pool telemetry (
xcl.logsteady-state ~48–58 s)a5e2d851(default)6115 MB4741 MB896 MB(838 MBmapped)14755 MB0.17–0.18 msXCL_SPARSE_SYSMEMunset)6116 MB4782 MB896 MB(838 MBmapped)14740 MB0.18–0.19 msXCL_SPARSE_SYSMEM=1)5218 MB(-898 MB/-14.7%)5597 MB(+815 MB)0 MB(0 MBmapped)14637 MB0.15–0.16 msUnder
XCL_SPARSE_SYSMEM=1, the runtime log confirmed activation (sparse windows: XCL_SPARSE_SYSMEM=1 - tiles outside the title's GPU heaps in system memory) and system-memory pool heap growth (64 -> 128 -> 256 -> 512 MBlogged at power-of-two checkpoints), keeping VRAM sparse pools at0 MBand reducing RTX 4060 local VRAM usage by898 MBwith0device removals and0crashes.Limits of coverage
note_hot/is_hotrange boundary predicate (the_title_gpu_heaps_are_hot_and_nothing_around_them3/3),hle::d3d12x::sparse::(67/0/1× 3),hle::kernelx::(61/0/1× 3), default-off non-regression, and liveXCL_SPARSE_SYSMEM=1L0 pool routing (-898 MBlocal VRAM) on RTX 4060 (8 GB).XCL_SPARSE_SYSMEM=1alone (withoutXCL_COHERENT_HEAPS=sparse); did not run a combinedXCL_COHERENT_HEAPS=sparse+XCL_SPARSE_SYSMEM=1multi-minute post-menu world-load stress test.XCL_PREPARE=0(XCL_NETWORK=0), bypassing startupprepare_for_launch, and the 2#[ignore]timing tests (early_commit_timing,scatter_timing) were not executed.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T12:04:11Z.
The Windows no-GPU CI run for head
6c5904f9exits with D3D12 device removal0x887a0020on Microsoft Basic Render Driver. Its last allocation is a 3 GiB GPU-view alias. In this test module,a_gpu_view_tile_is_filled_from_its_cpu_view_and_follows_its_writesis the path that requests exactly 3 GiB whensoftware(&test_device())returns false; its software path requests 53 tiles. The abort suppresses the test name, so this is a source/log correlation, not a definitive harness attribution.software()currently returns false when factory creation, adapter lookup, orGetDesc1fails. For this test's allocation decision, an unknown adapter should use the bounded software case. The candidate below does that while preserving the large case when a known hardware adapter reports no software flag. Microsoft documents the Basic Render Driver's software flag.On Windows 11 build 26300, RTX 3080 Ti / driver 621.35, the new
unknown_adapter_uses_the_small_gpu_view_caseregression failed 0/1/0 before the policy change and passed 1/0/0 afterward. WithXCL_TEST_WARP=1,cargo test --offline --locked -p xcl --lib a_gpu_view_tile_is_filled_from_its_cpu_view_and_follows_its_writes -- --nocapture --test-threads=1passed 1/0/0, no skip, and logged a 0x350000-byte GPU view. That WARP test also passed on the unchanged PR head here; I could not reproduce the runner's failed adapter classification locally. The full suite and CI on this candidate are untested. Rerunning the same CI job after the author integrates the small guard would decide whether it resolves this crash.Candidate test-only diff
AI use: Codex (GPT-6.2 Sol) traced the CI and source, wrote the candidate, and ran the focused tests.
Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-27T12:20:49Z.
Tested PR #2987 (
6c5904f9) on Windows 11 with a Series S (lockhart) profile, including a paired A/B 240 s open-world comparison withXCL_SPARSE_SYSMEM=1vs unset and the unit test.Environment
GPU_UPLOADsupported, driver32.0.16.2140)nvidia-devDXIL cache (XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PREPARE_GRAPHICS=0,XCL_DRED=1),XCL_COHERENT_HEAPS=sparsefor both PR runsUnit test
cargo test --locked -p xcl --lib -- the_title_gpu_heaps_are_hot --nocaptureon6c5904f9:hle::d3d12x::sparse::tests::the_title_gpu_heaps_are_hot_and_nothing_around_them— ok (1 passed, 0 failed)Paired A/B 240 s World Runs (
XCL_COHERENT_HEAPS=sparse, RTX 3060 Ti 8 GB)PresentX)180 s, default heaps)a5e2d8510x00 / 01861151.36 s25770 MB8974 MB4677 MB3880 MB2560 MB(2393 MBmapped)240 s, default heaps)a5e2d8510xc0000005(188.46 s)2 / 0126.29 s25909 MB9351 MB4768 MB3864 MB2624 MB(2423 MBmapped)#2987unset (240 s)6c5904f9,XCL_COHERENT_HEAPS=sparse0x00 / 01999(0 1 3last 3/2s)138.55 s31745 MB13121 MB2019 MB4380 MB5568 MB(5344 MBmapped)#2987+XCL_SPARSE_SYSMEM=1(240 s)6c5904f9,XCL_COHERENT_HEAPS=sparse,XCL_SPARSE_SYSMEM=10x00 / 01896(1 2 2last 3/2s)120.65 s31726 MB10560 MB4915 MB4518 MB2944 MB(2892 MBmapped)Summary
240 sruns underXCL_COHERENT_HEAPS=sparsereached the world cleanly and exited0x0with0device removals and0crashes on this 8 GB card.XCL_SPARSE_SYSMEM=1loggedsparse windows: XCL_SPARSE_SYSMEM=1 - tiles outside the title's GPU heaps in system memoryand reduced peak local VRAM by2,561 MB(13,121 MB->10,560 MB), shifting~2.6 GBof sparse pool allocations (5,568 MB->2,944 MBlocal; non-local2,019 MB->4,915 MB) into system memory while keeping the hot GPU heaps in local VRAM.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T13:36:46Z.
Follow-up on PR head
6c5904f9. I revised my earlier candidate after reviewing a failed system-memory heap allocation. This diff supersedes the one previously in this comment.BTreeMapfor logarithmic lookup and removal instead of a growing linear scan.Tested: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1 MSVC. The revised synthetic tests force the feature on their own thread and include GPU readback, L0 capability checks, failed-allocation preservation, batched replacement, pinned backing, and release cleanup.
cargo test -p xcl --lib hle::d3d12x::sparse::tests -- --test-threads=4: 74 passed, 0 failed, 1 ignored. With an isolated Cargo target,cargo test --workspace -- --test-threads=4: 1,705 passed, 2 failed, 28 ignored; 25 GPU skip notices (21 no wave64, 3 unsupported per-lane instruction cases, 1 opt-in heap-window test). Both failures are integer overflows intexture_upload::tests::{pieces_hold_the_texels_of_their_levels,gpu_parts_of_a_texture_go_up_and_the_rest_stays}; each also failed alone at the same line on untouched PR head6c5904f9.git diff --checkpassed.Not tested: A clean-commit paired title smoke, AMD/Intel, and a live placed-buffer alias. The diff is uncommitted and is a candidate for the author to review; it is not merge-ready evidence. The separate lazy first-write finding still needs its allocator-path fix.
Revised candidate fix and focused regressions (uncommitted diff)
AI use: Codex (GPT-6.2 Sol) revised the candidate and ran the tests; Codex (GPT-6.2 Astra) independently reviewed the replacement invariant.
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T14:39:34Z.
4 GB data point: GTX 1650 (driver 621.24), 16 GB RAM, Ryzen 5 1600, Windows 11 26300, head
6c5904f9unmodified, release.cargo test --release -p xcl --lib the_title_gpu_heaps_are_hot: 1 passed.cargo test --release -p xcl --lib hle::d3d12x::sparse -- --test-threads=1: 67 passed, 0 failed, 1 ignored. WithXCL_SPARSE_SYSMEM=1set: 64 passed, 3 failed, 1 ignored. The three assert onState::cooling; from readingState::cool, a system-pool tile cools inSysPoolsinstead.XCL_COHERENT_HEAPS=sparse:1024 XCL_SPARSE_SYSMEM=1plus my usual memory and pipeline switches: device removed (0x887a0005) at 806 s, before a 3D frame. Just before: 6.85 GB local (budget 3.3 GB), 4.4 GB non-local, 2.9 GB of sparse pools in video memory, 3.0 GB of target pages.0x8007000Eand fell back to video memory, with 10.8 GB of system commit still free.Not tested: the same run with the switch unset.
AI use: Claude Code (Claude Sonnet 5.5) built, ran and wrote this for @gefydev.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T15:10:22Z.
Test of this PR's exact diff (
6c5904f9) on the newestnvidia-devd1be8103, RTX 4080 16 GB (driver 621.40, 2 GiB shader-heap profile), i9-12900K, Windows 11 26300, 64 GB + 32 GB page file. The tree also had #684 and #2951 (so launches are quick) and a local press-timing patch; nothing else. Same build base, same save, 600 s each,XCL_COHERENT_HEAPS=sparse XCL_TEXTURE_LEVEL_PAGES=1 XCL_CS_PSO_WAIT_MS=200 XCL_TWO_PASS_MB=3072:XCL_SPARSE_SYSMEM=1So on this card the switch moves about 2.9 GB out of video memory as intended, with no cost in commit and no stability problem in 10 minutes. It does not raise the present rate here (1.5-1.6 either way, one run each, so the difference is noise), and the process is still 3.6 GB over the budget;
XCL_TEXTURE_SYSMEMfrom your prototype was what brought it under on my earlier runs.Not tested: the picture (the world is black on this machine on every build, see #505), a run longer than 10 minutes, AMD, default heap placement.
Numbers are from the logs of these two runs. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this.
Imported from ivall/xcl. Originally posted by gefydev on 2026-11-27T15:12:51Z.
Follow-up, not a test of this PR alone: the same head plus
b6fd1f27, texture pool pages in system memory past the budget, and the upload queue created with the device (local build). Local at the failing point 4.4 GB instead of 6.85 GB, no system-memory pool failures, but a0xc0000005insidenvwgf2umx.dllat 845 s at world entry; still no 3D frame. Local + non-local about 11 GB. One run each.AI use: Claude Code (Claude Sonnet 5.5) built, ran and wrote this for @gefydev.
Imported from ivall/xcl. Originally posted by treybertram06 on 2026-11-27T16:17:20Z.
@thehollowedone thanks, all three are right. Fixed in
f8e75bca(squashed into the one commit, rebased onnvidia-devd1be8103):materializetakes its tile through the same choice asensure_mapped(take_tile_for). A system-memory tile doesn't wait when video memory is short.SYS, a video-memory tile is mapped over it at once. The old tile goes toquarantine_tilesbehind the fences of that flush. A tile a placed buffer has pinned keeps its backing. If no video memory is found, it keeps the old tile, as before.forget_hot(a)is called onsparse::free, on thealloc_ascommit failure path, and on kernelx'sMEM_RELEASEof a sparse reservation. I kept theVec: there are a few dozen GPU heaps per run.XCL_SPARSE_SYSMEMin tests (gefydev's 3coolingfailures): undercfg(test),sysmem_tiles()follows a thread-local that a test sets, never the environment. The existing tests now pass with the variable set.New tests (each fails on
6c5904f9's logic and passes now, RTX 3080 / 621.40, no skips):a_lazy_tile_outside_the_gpu_heaps_gets_system_memorya_parked_system_memory_tile_gives_way_to_a_gpu_heap, which checks the old tile is quarantined and reads the new bytes back through the windowthe_title_gpu_heaps_are_hot_and_nothing_around_them, extended withforget_hotThe no-GPU CI failure (
0x887a0020) also happens on other recentnvidia-devPRs (#3036, #3037). I left the test helper alone here, since it's outside this PR.@gefydev the
0x8007000Efrom system-memory heap creation at 805 s on the 4 GB card looks like a separate limit. I don't have a 4 GB card to check it, so I've added it under Not tested.Thanks to @3L1A5-1, @LocranKing and @throny for the runs. throny's numbers match mine: this switch moves memory out of video memory, and the frame-rate gain on a 10 GB card comes with the texture-level part, which I'll open next as a PR stacked on this one.
AI use: Claude Code (Claude Opus 5.5) wrote the fixes and tests, ran them, and wrote this reply.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-27T19:22:25Z.
I retested the stale hot-range lifecycle from my prototype report on head
f8e75bca1ea903b1cf0e9d4f9387b73f359e5051using the exact-head source plus a test-only fixture and its test-mode switch.Three fresh-process controls passed with zero skips: normal
sparse::free, an injected 64 KiB commit failure, and the title-facingVirtualFree(MEM_RELEASE)path. In each, the next cold reservation reused the same address andis_hotwas false, so the placement policy selected L0. The original prototype retained the hot classification in the normal-release and injected-failure controls.This verifies reservation bookkeeping and policy selection. It does not allocate a GPU backing heap or measure physical residency, a retail workload, or performance.
AI use: OpenAI Codex with GPT-6.2 Astra ran the controls; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-27T20:13:04Z.
AMD run for the Not tested line.
Tested: pass, head
f8e75bcapplied on its basenvidia-devd1be810, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X.cargo test -p xcl --lib -- hle::d3d12x::sparse hle::kernelx --test-threads=4 --nocapture:nvidia-devalone: 127 passed). New and ok:the_title_gpu_heaps_are_hot_and_nothing_around_them,a_lazy_tile_outside_the_gpu_heaps_gets_system_memory,a_parked_system_memory_tile_gives_way_to_a_gpu_heap.The sparse tests make their device on the first adapter (
D3D12CreateDevice(None, ..)), the RX 9070 XT here. The same tests also pass inside #3039 (report there).Not tested:
XCL_COHERENT_HEAPS=sparsein a title, a long session, Intel.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T21:40:30Z.
merge-check
base: d1be8103644791b7a65f068954324e93d4b1b565 (
nvidia-dev)head: f8e75bca1ea903b1cf0e9d4f9387b73f359e5051
merge: clean trial merge into the current
nvidia-devtip; two intended files, +239/-10. I read the merged diff and traced the new L0 tile path through allocation, fallback, mapping, quarantine, cooling, and pool retirement.build:
cargo build --locked --workspace-> ok.tests:
cargo test --locked --workspace --no-fail-fast -- --test-threads=4-> 1,827 passed, 8 failed, 48 ignored, 27 GPUSKIPPEDnotices. All three new #2987 tests passed. The eight failures are a subset of the nine seen on the untouched exact base: both texture-upload tests, the console-MS test, the async-compute PSO test, split-compute in two targets, and two-pass driver-cache in two targets. The base's mesh-cache failure did not recur here; no new suite failure appeared.review: A refused L0 heap request repeats for every cold tile before fallback.
take_sys_tiletries a new 64 MiB L0 heap after its free list is exhausted; onCreateHeapfailure it falls back to a video-memory tile, then the next cold tile repeats the same request. In a test-only forced-failure fixture, mapping four cold tiles made four failed L0 attempts while the video pool supplied all four. The focused regression failed on the unchanged merged head (0/1; observed 4, expected 1). The local candidate below reuses any available L0 tile first, then delays another failed heap request for one second while falling back; it passed the regression (1/0), retried after the delay, and the final sparse test group passed (70/0, 1 ignored). The author has reported a real L0 allocation refusal on a 4 GB card. The candidate is uncommitted and has not had a full-suite or title run.review: System-memory heap capacity remains at its process high-water mark.
SYS_POOLS.heapsretains every 64 MiB L0 heap after its tiles cool;retire_free_poolsand its later-submit scheduling only consider the video-memory pool. Tile reuse works, but a fully unused L0 heap cannot be returned. This is a source-derived lifetime finding, not a measurement of wasted commit in the author's title run. Keep stable, optional L0 heap slots owned byState; retire only heaps whose tiles have completed mapping/queue quarantine and cooling, while pinned aliases keep their heap alive. Include L0 cooling and retired heaps in the later-submit sweep so the last heap can leave after its last tile cools. A gated GPU regression should verify retention before fence completion, live alias readback, then release after all fences, cooling, and a later submit. The separate texture L0 pool in #3039 has an earlier verified reclaim regression, but its patch does not cover this sparse pool.performance: the switch is off by default. With it on, repeated failed 64 MiB allocation calls and warnings add CPU time in the cold-tile path; L0 heaps that never retire keep host capacity after a streaming peak. I did not measure title frame time or process commit for this check.
verdict: not yet: bound failed L0 allocation retries and retire fully idle L0 sparse pools with the existing GPU-lifetime rules. The attached retry candidate resolves the first finding locally; the second needs its own focused regression and implementation.
hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (NVIDIA 621.35), rustc 1.99.1 MSVC, SDK DXC 1.8.2502.11. Codex (GPT-6.2 Sol) ran the trial merge, build, full suite, forced-failure regression and candidate sparse tests, reviewed the merged code, and wrote this check; Codex (GPT-6.2 Astra) independently traced the pool and fence lifetimes.
Not tested here: a new retail-title run, AMD, Intel, a full suite on the local candidate, or a production L0-heap retirement change.
Local retry candidate and isolated forced-failure regression
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T00:06:08Z.
merge-check claim
head:
f8e75bca1eImported from ivall/xcl. Originally posted by throny on 2026-11-28T00:30:21Z.
merge-check
base:
d1be8103(nvidia-dev)head:
f8e75bca1emerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1827 passed, 8 failed, 48 ignored (27 SKIPPED lines). The 8 failures are the base's own on this GPU, the same six names with and without the PR (#2771 and #2788 fix three of them). Base alone: 1824 passed, 8 failed, 48 ignored.
review: opt-in (XCL_SPARSE_SYSMEM=1); without it the behaviour is the base's: every new branch first checks the switch. The only default change is that GPU heaps are noted in a small table, once per heap. Open for the opt-in path, from the earlier check and still on this head: the system-memory pool heaps are never retired, and take_sys_tile retries CreateHeap for every cold tile after a refusal, without backoff; also the activity counter undercounts mapped bytes. For whoever merges: #3039 contains this PR's sparse.rs hunks (merge one, rebase the other), and #2898 changes reuse_tile's free-list type that this PR's pool passes, so the two break each other's build until one is rebased (system-memory tiles must not go into #2898's per-heap table). World-run note: this PR has been part of the local build this card used for 16 world runs yesterday (
d1be8103plus a stack of open PRs, 5 to 30 minutes each, switches of this PR left at their defaults); nothing in those runs pointed at it.performance: no default cost beyond one OnceLock read per tile (reasoned).
verdict: safe to merge (default path; the opt-in follow-ups above stay open)
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite unless said).
Imported from ivall/xcl. Originally posted by razormontana on 2026-11-28T00:49:47Z.
Independent native validation of #2987
f8e75bca1ea903b1cf0e9d4f9387b73f359e5051as included in the clean #3039 child7cce7d3d4625ac8f90f146f1f89f25a613e32e76. The child only changes the placed-texture module. Windows 11 Pro build 22631, Core i7-10700K, RTX 3070 8 GB with NVIDIA 617.42, Rust 1.100.0 x64 MSVC.Tested
A native
cargo test --offline --locked -j 1 -p xcl --lib --no-run --message-format=json-render-diagnosticsbuild passed. The test binary ranthe_title_gpu_heaps_are_hot_and_nothing_around_themon CPU anda_lazy_tile_outside_the_gpu_heaps_gets_system_memoryanda_parked_system_memory_tile_gives_way_to_a_gpu_heapon the RTX 3070, each by exact name with--exact --nocapture --test-threads=1. The sparse GPU fixtures verified system-memory backing, ordinary remapping to a hot heap, and byte-exact readback.3 passed, 0 failed, 0 ignored, 0 explicit skips.
Not tested
A detached #2987-only build, load-time VRAM savings, or sustained retail use.
AI use
Codex GPT-6.2 ran the focused validation, checked the results, and prepared this report.
Imported from ivall/xcl. Originally posted by akimfomin on 2026-11-28T01:59:48Z.
AnyPS5 #27991 tests keeping sparse read-only address uploads current across backing changes. An XCL-specific check could move one tile from local to system backing while leaving a neighboring tile on the original heap, then compare both bytes and bytes re-uploaded. It separates always re-reading everything from refreshing only the mapping that actually changed. Existing capacity and pressure results are independent of this control.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T02:27:02Z.
I checked the implemented system-to-local transition on RTX 5070 / NVIDIA 616.92 at head
f8e75bca1ea903b1cf0e9d4f9387b73f359e5051. This is the reverse of the local-to-system direction requested above; it is a complementary control, not a substitute for that scenario.A test-only native fixture initialized two adjacent 64 KiB tiles, promoted and rewrote only the first from parked system backing to local VRAM, and read both back. All 65,536 bytes of the promoted tile matched the new value; the neighbor retained its original pool mapping and all 65,536 original bytes. Instrumented upload selection recorded one 65,536-byte dirty upload and no clears for that submit. A subsequent clean submit recorded zero upload bytes and both tiles remained correct. The focused test passed with no skips.
The fixture supplies the dirty-page list directly. It checks upload selection and GPU contents for this transition, not Windows dirty-page discovery, the reverse transition, or retail bandwidth/performance.
AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T03:25:47Z.
Conflict in Sparse.rs needs to be fixed.
-Prime
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T07:33:27Z.
Ran the sparse-tile placement tests at
f8e75bcaon an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, 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.
All 69 tests pass with one ignored, including
a_lazy_tile_outside_the_gpu_heaps_gets_system_memoryanda_parked_system_memory_tile_gives_way_to_a_gpu_heap. They are CPU-side placement tests undercfg(test); no system-memory tile was actually allocated on this adapter. The thread has a report on an RTX 5070 (driver 616.92) for the reverse transition; this adds a desktop RTX 5070 Ti with driver 32.0.16.2124.Not tested: real system-memory tile placement in a title, a paired smoke run, the full workspace suite and its 11 known failures, 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.
Imported from ivall/xcl. Originally posted by treybertram06 on 2026-11-30T07:13:08Z.
Rebased onto
maind52ff48c(new head15b74314); thesparse.rsconflict is fixed.FreePoolsfrom #2898, by the heap's number withoutSYS. throny's merge-check warned that aSYSindex would resize the per-heap table, and this avoids that.a_parked_system_memory_tile_gives_way_to_a_gpu_heapnow checks that the replaced tile cools among the system-memory pools. That check fails without the masking.pool_bytesno longer counts quarantined system-memory tiles as video memory (also from throny's merge-check).AI use: Claude Code (Claude Opus 5.5) did the rebase, the fixes and the runs.
Imported from ivall/xcl. Originally posted by throny on 2026-11-30T16:20:08Z.
merge-check
, wanted ": another test took the address while the window was remade). Rerun ofbase:
9dfbe3ea66head:
15b74314fdmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2886 passed, 3 failed, 51 ignored; failing: gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 (fails on main alone too, #3533), hle::d3d12x::uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom and ::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment ("segment 0 (64 MB CUSTOM): Map gave
cargo test -p xcl --lib -- uma_driver: main9dfbe3ea3x with --test-threads=1 and 1x with 4: 8 passed, 0 failed each time; merge of this head 3x with 1 and 1x with 4: 8 passed, 0 failed each time. The same two tests failed the same way in our suite run of #2041 (an acphal-only change) on 2026-11-29, so they are the parallel-run flake of #3187, not this PR (which does not touch uma_driver). (25 SKIPPED lines). Base alone at9dfbe3ea: gpu_direct_image_get_resinfo_d16 fails there too (#3533).review: no new finding. Compared with our earlier check (
f8e75bca): rebased onto main and onto #2898's per-heap FreePools; the system-memory pools now keep their own FreePools indexed by the heap number without SYS (SYS is masked before add_heap and in cool()), so a SYS tile never reaches the video-memory free table (which would size its table by 1<<31); the replaced-tile test now checks that. pool_bytes no longer counts quarantined SYS tiles as video memory (our earlier point). The swap path now uses initial_state() and quarantine_tiles_for with the queue completion snapshot, as main does. Lock order is one way (sparse state, then SYS_POOLS; take_sys_tile drains the quarantine before taking SYS_POOLS and drops it before falling back to take_tile). Mirrors (new_mirror) keep video memory. Still open from the earlier check, opt-in path only: system-memory pool heaps are never retired, take_sys_tile retries CreateHeap for every tile after a refusal without backoff, and the activity counter undercounts mapped bytes. Default path: every new branch first checks XCL_SPARSE_SYSMEM; the only default change is that kernelx notes each GPU heap in the small HOT table (and forgets it on release).performance: no default cost beyond one OnceLock read per tile taken (reasoned); the PR's own smoke runs (RTX 3080, switch off) show 1583 frames vs main's 1578.
verdict: safe to merge (default path; the opt-in follow-ups above stay open)
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-12-01T08:08:50Z.
Independent RTX 3080 Ti regression check of PR #2987 at head
15b74314, based ond52ff48c.The new regression fails on the unmodified PR head: after the test disables video-memory pool allocations, the hot tile remains
LAZYand so does the adjacent cold tile, even though a separate probe confirmed that the L0 system-memory pool is available. The candidate tracks allocation failure separately for each backing class and uses the same class decision for allocation and retry bookkeeping. The regression also uploads the cold tile's data and verifies it through GPU readback.Tested: Windows 11 build 26300, NVIDIA GeForce RTX 3080 Ti (12,288 MiB; driver 621.40), rustc 1.99.1 MSVC. On the unmodified head, the focused regression reported 0 passed, 1 failed, 0 ignored. With the candidate applied,
cargo test --offline --locked -p xcl --lib hle::d3d12x::sparse --quiet -- --test-threads=1reported 144 passed, 0 failed, 1 ignored, 0 skipped.A separate
cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4run on the unmodified PR head reported 2,875 passed, 5 failed, 51 ignored, and 24 GPU skips. On exact based52ff48c,cargo test --offline --locked -p xcl --lib gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16 --quiet -- --exact --test-threads=1andcargo test --offline --locked -p xcl --test e2e --quiet -- --test-threads=4reproduced the same D16 and four e2e failures. I have not rerun the full workspace suite or paired smoke on this candidate; this is not a merge-check.Candidate runtime fix and regression
AI use: OpenAI Codex (GPT-6.2 Sol) wrote the regression and candidate and ran the GPU tests; OpenAI Codex (GPT-6.2 Astra) reviewed the allocation-class design and identified the class-selection and unsupported-adapter corrections.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:17:29Z.
Triage (#1607) – head
15b7431#3039 contains all of this PR's added lines because it is stacked on it: its first commit is this PR's
15b74314, and only its top commit (XCL_TEXTURE_SYSMEM) is its own. That is not a duplicate. #1702 (texture pages in system memory) and the amd-dev #3112 (XCL_SPARSE_VRAM_CAP_MB) work on the same budget problem, but they choose what to move differently.I found no problem in the diff. Every freed tile goes through
cool, soSYStiles never reach the video-memoryFreePools, andpool_heapresolves both kinds. One gap the description already lists: the system-memory pool heaps are never released.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by gut0to on 2026-12-01T14:12:29Z.
Code review location:
crates/xcl/src/hle/d3d12x/sparse.rs; line 3594Each 64 MiB heap added to
SYS_POOLS.heapsremains there for the process lifetime; unlike the video pools, the system-memory pools have no all-free retirement path. A workload that temporarily grows this pool can therefore retain its peak L0 allocation after all tiles are cooled and freed. Could empty system heaps be retired once their tiles are unmapped and the sparse-queue fence has passed, with a test thatsys_pool_bytes()decreases? AI-assisted static review: I used an AI assistant to inspect the allocation and release paths.Imported from ivall/xcl. Originally posted by gut0to on 2026-12-01T14:12:29Z.
Review: COMMENTED
AI-assisted static review: I used an AI assistant to trace the system-pool allocation and free paths.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T18:34:40Z.
In-world result, RTX 4080 16 GB (621.40), current
main6bfb5c51+ this head15b74314(plus our local input-timing patch), same build, 900 s each,XCL_RESIDENCY_PRIORITY=1, default two-pass reserve, no draws skipped:XCL_SPARSE_SYSMEMSo it takes about 3.5 GB off video memory (nearly down to the budget) at no measurable cost in presents/s. One earlier run with it (393) lost the device at 130 s; the three since ran 900 s clean, so I can't tie that loss to the switch. No other device removal or crash.
AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T18:38:30Z.
Code review location:
crates/xcl/src/hle/d3d12x/sparse.rs; line 3594Confirmed from the diff:
SYS_POOLS.heapsonly grows (sys_pool_bytes()isheaps.len() * POOL_TILES * TILE, and nothing removes a heap), while the video pools have their retired path. Our world runs show the size it reaches: withXCL_SPARSE_SYSMEM=1the process's non-local (system) video memory went from 3.9 GB at the start to 8.7 GB at the end of a 900 s run (run 398), against 3.6 → 4.9 GB without it (run 397), RTX 4080, same build. So about 3.8 GB of system-memory pool, which with this code stays for the rest of the process even if the tiles cool. Since the switch is off by default it does not affect the default path (that is what our merge check above covers), but retirement of all-free system heaps after the sparse-queue fence, with a test thatsys_pool_bytes()drops, would be needed before it could ever be turned on by default. @treybertram06AI use: Claude Code (Claude Opus 5.5) read the diff and the run logs.
Imported from ivall/xcl. Originally posted by capy-ai[bot] on 2026-12-01T18:49:07Z.
merge-check
base:
6bfb5c5153head:
15b74314fdmerge: clean;
git diff --cached --checkpassed on the trial mergebuild: the focused
xcllibrary test binary built;cargo build --workspacenot runtests:
cargo test --locked -j 1 -p xcl --lib hle::d3d12x::sparse::tests::<name> -- --exact --test-threads=1 --nocapture, once each fora_lazy_tile_outside_the_gpu_heaps_gets_system_memoryanda_parked_system_memory_tile_gives_way_to_a_gpu_heap, withCARGO_INCREMENTAL=0 CARGO_PROFILE_TEST_DEBUG=0. 2 passed, 0 failed, 0 ignored; SKIPPED: 0. The full workspace suite was not run. No title or game data was used.review: The tests confirm L0 tile placement and GPU readback, plus replacement of a parked system-memory tile with a local tile for a hot GPU heap. Empty system-memory heaps are not retired: freed tiles return to the pool, but the backing heaps stay allocated. The reported mixed hot/cold regression also matches the code: a hot tile that fails in
materialize()setsleft > 0, so later cold tiles in the same run skip their L0 allocation attempt. I confirmed that path by inspection and did not rerun the regression fixture.performance: No retail benchmark on this machine. The reported same-build RTX 4080 comparison shows peak DXGI local usage of 19.3 GB with the switch unset vs. 15.6–15.8 GB with it enabled, with similar present rates. This shifts pressure to system RAM; the reported end-of-run non-local usage was 8.7 GB enabled vs. 4.9 GB disabled for one pair.
verdict: not yet: wait for the opt-in heap retirement fix; this focused run does not replace a full Tier 2 merge check
hardware / tool and model: Radeon RX 9070 XT (32.0.32015.2008), Core i5-13600KF, Windows 11 build 22631, Rust 1.99.1 x64 MSVC / Capy with GPT-6.2 Sol ran the trial merge and focused tests, reviewed the diff, and drafted this report. The requester reviewed and authorized posting.
Imported from ivall/xcl. Originally posted by lucsoft on 2026-12-01T19:18:33Z.
AMD / Wine data point for
XCL_SPARSE_SYSMEM=1, 600 s in a retail title: stable, but it does not move the video-memory budget on this card.Not a test of this PR alone.
15b74314was cherry-picked cleanly onto a test branch (109d6f94: the #3547 head + main493dbd3d+ #3553 + an allocator fix), built as2f894ece. The control is the same branch without the cherry-pick andXCL_SPARSE_SYSMEMunset.Environment: RX 7800 XT 16 GB (RADV NAVI32), Ryzen 7 7800X3D, 30 GB RAM, NixOS, kernel 7.3.5, Wine. Release build. Same save, 600 s each, one run per arm.
Both arms:
XCL_TEXTURE_LEVEL_PAGES=0 XCL_SMALL_TEXTURES=0 XCL_VRAM_SMALL=0 XCL_ZERO_TARGET_PAGES=0 XCL_FORMAT_ALIAS=0 XCL_RESIDENCY_PRIORITY=0 XCL_ALLOC_HEAVY=16 XCL_ALLOC_HEAVY_KEEP=0 VKD3D_TRIM_RECYCLED=4 VKD3D_TRIM_RECREATE_POOL=1. The only difference isXCL_SPARSE_SYSMEM=1.Result: exit 0x0, 2527 frames shown, 0 device removals, 0 page faults, 0 ring timeouts, 0 resets.
XCL_SPARSE_SYSMEM=1About 3.5 GB of sparse tiles did leave video memory, but the DXGI local charge only fell by 253 MiB:
cmdbufandothergrew by about 4.7 GB between them. The kernel's own count of VRAM in use is the same in both runs (16.07 vs 16.03 GB). Draws per second fell by 44 % and only two thirds as many textures were sampled in the same time, presumably because the GPU now reads those tiles over PCIe.So on a 16 GB AMD card with the trimmed stack it is stable and correct as far as this run shows, but it is not a lever for the budget. I did not look into where the
cmdbuf/othergrowth comes from.Not tested: NVIDIA / Windows, the unit tests of this PR, other hardware, more than one run per arm, a longer run than 600 s.
AI-assisted (Claude Code, Claude Opus 5.5): the build, the runs and the numbers come from an agent; the owner reviewed this before posting.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T19:53:05Z.
@treybertram06 @gut0to: #3613 carries this PR's commit unchanged (rebased on current
main) and adds the retirement of all-free system-memory heaps asked for above, with a test thatsys_pool_bytes()drops. If you'd rather finish it here, say so and I'll close #3613; otherwise #3613 can replace this one.AI use: Claude Code (Claude Opus 5.5).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.