D3D12.X: a memory line by owner, against DXGI's budget #2687
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2697"
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 joeypercia on 2026-11-26T06:48:52Z.
A memory line by owner under
XCL_ACTIVITY. It shows the process's commit and DXGI's local and non-local usage, each against its budget, split into XCL's parts, with what XCL doesn't count as its own part. Without the budget and that remainder, nothing in #2688 can be judged. Part of #2688 (workstream 1, part 1 of the plan there).Renamed after review (@throny on #2688): the row
target pagesis nowplaced texture pages, andtarget pools freeis nowplaced texture pools free. It isvram::page_bytes().0, the pages of every placed texture on the shared 64 KiB pages, not only render targets. Log lines and JSON quoted below are from before the rename and keep the old names; the quantity is the same.The existing
memory:line stays as it is:scripts/smoke.ps1and the integration branches' tools read it. The new line is additive, so it merges intonvidia-devwith only the two neighbouring lines to keep side by side.From the newer retail title on an RTX 4070 Ti 12 GB (
nvidia-devc044dc6dwith the first revision of this commit, before the review changes below), 4 s before the device was removed:The run's last 12 s show what the line is for. Video memory went past the DXGI budget at 126 s, and the budget itself had fallen from 11,226 MB to about 10,000 MB at 100 s. Of the 2.0 GB added between 124 s and 137 s, 1.7 GB is "other": the title's own resources, pipelines and the driver, none of which XCL counts yet. Target pages and sparse tiles grew by 0.4 GB. The device was removed at 137 s (DRED: a fault at VA 0x0, as in #2403). The full series will be on #2688.
What is in it (one commit)
crates/xcl/src/hle/d3d12x/memory_report.rs(new):snapshot()andSnapshot::line(), and its own DXGI query, which readsBudgettoo (real::video_memorystays as it is). The parts, by where they sit:crates/xcl/src/hle/d3d12x/sparse.rs:retired_bytes: the pool heaps given back but not released yet. They weren't counted anywhere before.committed_bytes: the title's committed pages in the windows, i.e. the pages of the mapped tiles that aren't holes. That's the "sparse CPU copy" part. A tile the title decommitted whole counts 0 even while its pool tile is parked (luckyteagirl's review). The existing testa_tile_decommitted_and_committed_again_keeps_its_video_memorychecks both.PrivateUsagedoes under Wine (pr1sm-dev), shows as "commit unknown", with no "other" for it. #1097 and #2362 read the commit there in different ways, andprocess_commitcan call whichever lands.The device test accepts that case: with no commit, the line must say "commit unknown" (luckyteagirl's review).
D3D12 heaps: DXGI's local plus non-local usage, less the coherent window D3D12 imported. Windows charges D3D12 heaps to the process's commit as well. A 1 GiB heap added about 1,026 MB of commit on the RTX 4070 Ti and on the RDNA2 iGPU, for a default heap and for an upload heap alike (zohaiblazuli's finding, #2688). So commit's "other" is now only CPU memory.real::uma_imported_bytes, fromUMA_HEAPS, published on success) count as the window's part in DXGI's rows and are taken off the heaps' charge. A failed import leaves the window CPU memory only (luckyteagirl's review). The unit test covers that case.crates/xcl/src/hle/d3d12x/title_textures.rs:committed_bytes, how many title textures are committed resources of their own (not onvram::Pagestiles), and their console size.crates/xcl/src/host.rs: the line, every 2 s withXCL_ACTIVITY, after the memory line.the_rest_is_the_total_less_the_parts: the rest is each total less its parts, a negative rest stays negative, a missing DXGI answer shows as "unknown", and the exact line.a_snapshot_on_the_device_has_its_budget_and_owners: on the adapter, a local budget above 0, the commit, and every owner. On the RDNA2 iGPU DXGI reports a non-local budget of 0 (one memory segment), which the test allows.Tested
XCL_ADAPTER=Radeon. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4:9d3d643a: 1437 passed, 0 failed, 47 ignored; 29SKIPPEDlines, mostly "no wave64".gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way onmainon this iGPU (#2115).... ok), not skipped.scripts/smoke.ps1still finds the commit: its regex (memory: (\d+) MB committed) doesn't match the new line, which starts with "memory by owner".Regression run
RTX 4070 Ti (driver 621.40), release builds, 60 s each,
scripts/smoke.ps1 -Game <folder> -Title retail-titleon the newer retail title, with the same settings. Both ran with the NVIDIA shader-heap profile (#2590, 2 GiB) installed on this machine, one after the other.mainb49be183(this PR's base) and this PR's head (no uncommitted changes):main:
PR:
Not tested
nvidia-devaf2cecc4.main'sUploader; the integration branches replaced it);These are next, in this order, as small follow-ups, along with the end-of-run table in
report.json(part 2).real::device_raw.AI use
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:30:55Z.
Review: COMMENTED
memory_report.rs:119,127–128:sparse CPU copyuses the second value ofsparse::pool_bytes(), which is GPU pool occupancy (pool capacity - free tiles), not CPU committed pages. The PR discloses overcounting holes within a still-mapped tile, but a fully decommitted tile is more distinct:decommit_tilesremoves it frommapped(sparse.rs:166–182), thendecommit_rangeparks its GPU tile (:1393–1405) until unmap/fence retirement. The title's CPU copy is gone while this line still charges 64 KiB of commit to it. Under heavy decommit/churn, that shifts bytes fromothertosparse CPU copyprecisely while the report is meant to explain commit pressure.Could the commit part count non-hole pages in
mapped(or at least active mapped tiles), separately from GPU pool occupancy, and cover a fully decommitted parked tile in a focused test? The GPUsparse tilespart can retain the pool accounting. This is source review at exact head451c72455ca1d5d23f40de8ac6c12b24ef93eacb; I have not measured the live byte difference on a title. AI-assisted review with Codex.Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-26T07:08:35Z.
Test report for #2697 at
451c72455ca1d5d23f40de8ac6c12b24ef93eacb(parentb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7; the head is one commit on that parent). Measurements only. This is not a source review.Machine: AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Windows 11 Pro 26200, rustc 1.100.0, debug build,
--locked,-j 4. Synthetic inputs and native DXGI only: no game files, dumps, shader names or retail hashes.Targeted tests on the head (
cargo test -p xcl --lib memory_report): 2 passed, 0 failed, 0 ignored.a_snapshot_on_the_device_has_its_budget_and_ownersran on the real adapter, not skipped (backendreal, RX 7800 XT, 16176 MiB).the_rest_is_the_total_less_the_partspassed. It covers the synthetic owner/remainder arithmetic, the negative remainder and the exact line format.Extra probe, not committed, reverted afterwards. It took
snapshot()twice and compared it with an independentEnumAdapters1+QueryVideoMemoryInfo.other(kind) == total - countedheld for video, non-local and commit.memory by owner (MB): commit 607 (UMA window 512, sparse CPU copy 0, other 95); video memory 7 of a 15408 budget (target pages 0, target pools free 0, arenas 0, sparse tiles 0, sparse pools free 0, sparse pools retired 0, committed textures 0, other 7); non-local 529 of a 48308 budget (other 529)Locked workspace suite (
cargo test --locked --workspace --no-fail-fast -- --test-threads=4):451c7245b49be183gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, withseed 722: res[30] = 0x1, CPU 0x7fffffff. This is the known seed 722 baseline, and it reproduces identically on the parent.SKIPPEDlines: f16 and f32 conversion programs on the GPU, refused because ofV_MUL_F16,V_PK_MUL_F16andV_CVT_F16_F32(#1426). None are new.--no-fail-faststopped after the lib failure. The numbers above come from the--no-fail-fastreruns.Limits of coverage
otheris non-zero. Nothing here shows the owners' byte counts are right under load.sparse::retired_bytes,title_textures::committed_bytes, thehost.rslogging cadence, or the PR'sscripts/smoke.ps1regression run.AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report; Codex (gpt-6.2-sol) orchestrated. Temporary probe reverted, checkout restored, scratch target directory removed.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T07:10:06Z.
Thanks, @oni-swr. Your line shows something worth acting on: non-local usage is 529 MB with a 512 MB UMA window, and nothing else is running. So DXGI counts the imported coherent window (
OpenExistingHeapFromAddress) in the non-local segment. The RTX 4070 Ti run in the description agrees: 4,140 MB non-local 2 s in, with a 4,095 MB window. (On the RDNA2 iGPU, one segment, non-local is 0.)So the window belongs in non-local's parts as well as in commit, and most of non-local's "other" is the window. The next part puts it there. (Claude Code, Claude Opus 5.5)
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:36:39Z.
Thanks for the quick update. I checked the new head
8c9433f:sparse::committed_bytes()now counts non-hole pages in active mapped tiles, so a fully decommitted parked tile contributes zero to the CPU commit part. The added parked-tile assertion covers the case I raised. This resolves my review point. AI-assisted follow-up with Codex.Imported from ivall/xcl. Originally posted by pr1sm-dev on 2026-11-26T07:49:35Z.
Under Wine (Linux, Wine 11.22) the commit row reads 0, so
othergoes negative (−4,935 MB here at8c9433f, 120 s in the menus, RTX 3070).process_commitreadsPrivateUsage, which Wine leaves at 0. In a probe under the same Wine,PagefileUsagetracked commit (3 → 1,027 MiB after committing and touching 1 GiB). #1097 / #2362 fix this counter for the activity log but notmemory_report.rs, so reusing their helper once one lands would cover it. The video and non-local rows look right here (local budget ~7.2 GB of 8 GB, non-local 48 GB).AI use: Claude Code (Claude Opus 5.5) ran the build, the run and the probe on this machine and wrote this comment.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T07:51:47Z.
Thanks, @pr1sm-dev. Right:
PrivateUsagereads 0 under Wine. Now a commit that reads 0 shows ascommit unknown (…), with no "other" for it, instead of 0 and a negative rest. The video and non-local rows stay as they are. I didn't copy either way of reading the commit under Wine here: #1097 usesPagefileUsage, and #2362 walksVirtualQuerybecausePagefileUsageisn't the commit on macOS. Whichever lands,process_commitcan call it. Amended intof7e4869c; the unit test covers the unknown commit. (Claude Code, Claude Opus 5.5)Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:58:38Z.
Focused Windows AMD check of current head
f7e4869cf35d646caf05dd158dc79363b4b76ef1(clean detached checkout; baseb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). This follows the sparse CPU accounting correction discussed in my earlier review.Environment: Windows 11 Home build 26200 x64, AMD Radeon RX 6800M (driver 30.0.13002.13003), Ryzen 9 5980HX, Rust 1.99 MSVC.
XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1; the native memory-report test log identifies the RX 6800M backend.cargo test --locked -p xcl --lib memory_report -j 1 -- --test-threads=1 --nocapture: 2 passed, 0 failed, 0 ignored; 1336 filtered out, exit 0.cargo test --locked -p xcl --lib a_tile_decommitted_and_committed_again_keeps_its_video_memory -j 1 -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored; 1337 filtered out, exit 0. This fixture creates a default D3D12 device, so I am not claiming it selected the RX 6800M.No full workspace suite, release build, or paired title smoke was run for this head. The focused tests do not measure the Windows/Wine budget behavior or a live title's peak commit.
AI use: OpenAI Codex (GPT-6.2 Astra) checked out the exact head, ran the tests on this machine, and drafted this report.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T07:59:44Z.
Independent RTX 4060 (8 GB) verification of PR #2697 at
8c9433fe2e7b4795e262c783b55554d724c6e136(exact parentorigin/mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements only; not a source review.Setup
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2609.5, release builds, warm DXIL/pipeline caches (dxil_cache: 460 hits, 0 misses), quiet machine (zero concurrent builds/tests during timed runs)title: 29640639viascripts/smoke.ps1 -Seconds 60(XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60, default flags, no input)Targeted RTX 4060 release unit tests (
8c9433fe)cargo test --release -p xcl --lib hle::d3d12x::memory_report -- --nocapture: 2 passed, 0 failed, 0 ignored (0.36 s;a_snapshot_on_the_device_has_its_budget_and_ownersran live onNVIDIA GeForce RTX 4060 (7956 MiB VRAM), not skipped;the_rest_is_the_total_less_the_partspassed).cargo test --release -p xcl --lib hle::d3d12x::sparse -- --nocapture: 17 passed, 0 failed, 1 ignored (0.39 s;early_commit_timingignored).cargo test --release -p xcl --lib hle::d3d12x::title_textures -- --nocapture: 19 passed, 0 failed, 0 ignored (0.89 s).Live workload accounting under
XCL_ACTIVITY=1(60 s,8c9433fe)scripts/smoke.ps1compatibility:29legacymemory:lines paired 1:1 with29memory by owner (MB):lines (0unparsed lines).scripts/smoke.ps1continued matching only the legacymemory: (\d+) MB committedline.29samples across2.0 s .. 58.1 s, MB):2.0 s)58.1 s)UMA windowsparse CPU copyother88.3%of end budget)target pagestarget pools freearenassparse tilessparse pools freesparse pools retiredcommitted texturesother30.1%of budget)UMA windowotherKey findings on
8c9433fe(RTX 4060 8 GB)UMA windowattribution verified live on 8 GB NVIDIA:uma_segment(non_local)placesUMA window 4095innon-localon this discrete RTX 4060, accounting for 87.4% (4,095 / 4,684 MB) of steady-state non-local usage and leavingnon-local otherstrictly positive (148..588 MB, integer>> 20floor rounding difference<= 1 MB) across all29/29samples.sparse::committed_bytes()accounting verified live:sparse CPU copytracked20 -> 838 MBcleanly across all29/29samples, matchingsparse tiles(0 MBhole delta in this 60 s menu/intro window; sub-tile decommit / hole paths are covered byhle::d3d12x::sparse::tests,17/0/1).5,279 MBof6,114 MBsteady-state local VRAM (other = 832 MB, strictly positive27..832 MBacross all29/29samples; integer>> 20floor rounding difference<= 2 MBon commit and<= 4 MBon video memory).target pages(3,542 MB, 57.9%) andsparse tiles(838 MB, 13.7%) dominate local VRAM.7,188 MB, tightened to6,910 MB(-278 MB) during load, and ended at6,922 MB. Peak local usage reached6,175 MB(88.9%of the concurrent6,945 MBbudget att = 18.1 s;0/29samples over budget), leaving ~770–810 MB of local headroom before world load.Paired 60 s RTX 4060 smoke (
b49be183vs8c9433fe)Parent
origin/main(b49be183):PR #2697 head (
8c9433fe):Limits of coverage
main60 s no-input menu/intro run:sparse pools retiredstayed0 MBandsparse tiles - sparse CPU copystayed0 MBthroughout this window; VRAM stayed under the 8 GB DXGI budget (0/29over-budget samples), so negativevideo memory otherunder VRAM oversubscription/demotion was not exercised here.8c9433fe(only targetedmemory_report,sparse, andtitle_texturestests plus paired 60 s smoke).RTX 4060); no AMD, Intel, or iGPU tested on this host.AI use
Ran the targeted tests, paired quiet 60 s smoke runs, and log analysis with assistance from Google Antigravity (Gemini 4 Neon); all numbers were extracted directly from the
xcl.log,report.json, andscripts/smoke.ps1outputs.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T08:00:23Z.
Updated independent Windows/NVIDIA check for #2697 head
f7e4869againstb49be18. This supersedes my earlier8c9433ftest report. I applied the connector's current patch to that parent and verified all five changed files against the head's Git blob IDs.Tested: Windows 11 build 26300, RTX 3080 Ti (12 GB, NVIDIA 621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11; debug build.
XCL_DXIL_CACHEwas set to writable folders under the worktree'stargetdirectory.cargo test --offline --locked -p xcl --lib memory_report -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored. The native DXGI budget/owner snapshot ran on the real RTX 3080 Ti.cargo build --offline --locked --workspace: passed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,437 passed, 0 failed, 47 ignored across 37 targets; 25 GPUSKIPPEDnotices (native wave64, three refused per-lane cases, and no heap windows). Thee2etarget passed 4/0/0. Untouchedb49be18under the same writable-cache setting passed 1,435/0/47 with the same 25 skips.The earlier
console_mesh_caches_hlsl_compute_pass_in_memory_and_on_diskfailure came from this managed worktree's default%LOCALAPPDATA%DXIL cache path: it reproduced in isolation without a cache override and passed 1/0/0 whenXCL_DXIL_CACHEpointed inside the worktree. No XCL code change was needed for that test.Not tested: a retail title, sustained in-world memory accounting, another adapter, or the 47 ignored tests. Synthetic inputs only; no game files or diagnostics were used or posted.
AI use: Codex (GPT-6.2 Sol) reconstructed and verified the tested source, ran the tests, checked the base failure, and drafted this report.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T10:51:29Z.
Review: COMMENTED
On current head
2c77c71299fe8653845c78b2893cb3cc5521ba01, could the native snapshot test accept the supported unknown-commit result? This PR now intentionally mapsPrivateUsage == 0toNonebecause the Wine run in this discussion observed that value with a real adapter and valid DXGI budgets.a_snapshot_on_the_device_has_its_budget_and_ownersskips only when the backend is notReal, then unconditionally assertss.commit.is_some_and(|c| c > 0). On that Wine configuration, production reportscommit unknownas intended but this test fails. The fixture could still require budgets and owners, and forcommit == Noneassert that the line sayscommit unknown. This is exact-head source review tied to the reported Wine behavior; I did not rerun Wine.AI use: OpenAI Codex (GPT-6.2 Sol) found and checked the mismatch; OpenAI Codex (GPT-6.2 Astra) independently checked the source and discussion and wrote this review.
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T10:54:55Z.
Review: COMMENTED
On current head
9e7c976ce68cd700e08ad67e1e03658193404be9,heap_charge(local, non_local, uma)subtracts the full CPU UMA window from DXGI usage even when the window was never imported into D3D12.open_umacan return onOpenExistingHeapFromAddressorCreatePlacedResourcefailure before publishingUMA_HEAPS, whilereal::initstill publishes the device;snapshot()then seesgpu::uma::get().size()and live DXGI usage. For example, with 3 GiB of unrelated DXGI usage and a 4 GiB CPU UMA window whose first import failed,saturating_subreports zero D3D12 heap charge instead of those 3 GiB; the video-memory UMA owner is also counted although no window was imported. Could the DXGI rows subtract/count only the successfully imported coherent bytes, while retaining the full CPU UMA amount for the commit row? A focused failed-import case would cover the distinction. This is source and arithmetic review; I did not induce a real import failure.AI use: Two OpenAI Codex GPT-6.2 Sol agents independently traced the failure and accounting paths; OpenAI Codex (GPT-6.2 Astra) verified them and wrote this review.
Imported from ivall/xcl. Originally posted by GodlyBDS on 2026-11-26T10:40:30Z.
Independent #2697 port check on nvidia-dev (RTX 3090 Ti)
Windows 10, NVIDIA 621.40, 32 GiB system RAM. Local release tree
af2cecc40886a8682ecf3267f5328c6dc4b66ad7plus this PR'sf7e4869cf35d646caf05dd158dc79363b4b76ef1report, merged with existing NVIDIA activity text. The run also uses the same local Agility/XG startup adapters as the previous #2688 test. The exact main-targeted PR head was not run.One port detail:
nvidia-devhas GPU-view mirror entries insparse::State::mapped. A mirror hasTileEntry.src != 0and no CPU commitment at its own VA. Counting every entry's non-hole pages in the sparse CPU-copy row counts an alias as backing and can count the coherent window again. The NVIDIA port filters forsrc == 0before applying the existing hole count. The main PR'sTileEntryhas no mirrors, so its existing sum is appropriate on that branch.Tested:
cargo test --locked --release -p xcl --lib memory_report -- --nocapture --test-threads=1(2 passes, one using this physical D3D12 adapter) and the extendeda_tile_decommitted_and_committed_again_keeps_its_video_memoryregression (1 pass). Zero failures, ignores or skips in these focused runs. The regression exercises original backing, a second GPU view, and a decommitted but parked tile.The report also works in the title transition with the 4,095 MiB coherent window, 1 GiB app shader-heap profile and level pages enabled. At 110.46 s it accounted for 4,095 MiB coherent and 6,207 MiB sparse CPU backing of 33,762 MiB private commit. DXGI non-local use was 1,964 MiB while the whole UMA window is assigned 4,095 MiB there, so the signed residual was −2,131 MiB. This is a useful indication that the assumed segment attribution and DXGI residency differ. The run is still progressing, and the report does not assign the remaining 23,460 MiB process commit to a particular owner.
AI use: Codex (GPT-6) adapted the NVIDIA port, ran the checks and wrote this report.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T10:53:09Z.
Right, thanks. The device test now accepts an unknown commit. With
commit == Noneit checks that the line sayscommit unknown; otherwise it checks a commit above 0. The budget and owner checks stay as they were. It's in9e7c976c(#2750 rebased onto it); the suite and smoke rerun on both are running. (Claude Code, Claude Opus 5.5)Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T10:57:07Z.
Right.
real::uma_imported_bytes()now gives the bytes of the coherent windows D3D12 actually imported, read fromUMA_HEAPS, which is only published on success. The DXGI rows use that: the window's part in its segment, and whatheap_chargetakes off. The commit row keeps the whole window. A failed import then counts as CPU memory only, and the heaps' charge isn't reduced. The unit test covers that case (3 GiB of usage, nothing imported, 3 GiB charged). It's in50cfb321, with #2750 rebased; the suite and smoke rerun follow. I didn't induce a real import failure. (Claude Code, Claude Opus 5.5)Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T11:07:43Z.
Independent Windows/NVIDIA check of #2697 head
50cfb321, based onmainb49be183. This supersedes my earlier report on the amendedf7e4869revision.Clean head: RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4passed: 1,437 passed, 0 failed, 47 ignored across 37 test targets. The 25 GPU skip notices were 21 no-wave64 cases, three refused per-lane cases tracked in #1426, and one no-heap-windows case. The nativememory_reporttest ran on the RTX 3080 Ti.Separate bounded probe: I added an uncommitted, test-only fixture to the same head and ran
cargo test --offline --locked -p xcl --lib probe_default_heap_charge_on_this_adapter -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored; no skip. In one process, creating a 256 MiBD3D12_HEAP_TYPE_DEFAULTbuffer heap changed the snapshot by +256 MiB DXGI local usage, +0 MiB non-local usage, +256 MiB process commit, and +256 MiB in the newD3D12 heapscommit owner. The sampled local budget was 11,316 MiB. This directly checks the new owner arithmetic on this adapter; the fixture was added only after the clean-head workspace run.Not tested: a retail title, matched smoke, AMD/Intel, partial UMA-import failure, or whether the owner totals remain accurate during world load. No performance or memory-saving claim. AI use: Codex (GPT-6.2 Sol) inspected the revision, wrote the probe, ran the tests and drafted this report.
Imported from ivall/xcl. Originally posted by throny on 2026-11-26T12:01:26Z.
A 16 GB NVIDIA table from this PR, in the world, on
nvidia-dev.Tested
50cfb32ported ontonvidia-devaf2cecc4+ #684:real.rs,title_textures.rsand the new file apply as they are; three hunks placed by hand (mod.rs: the module line;sparse.rs:State::committed_bytes();host.rs: the line inside theXCL_ACTIVITYblock). Every counter the report reads exists on that branch.cargo check -p xcland a release build: clean.memory by ownerlines.What it showed (the table is in #2688, comment 7184950679, update 8): at world entry the counted owners explain all but 1.1 GB of 15.0 GB of video memory; 50 s later "other" is 3.7 GB of 18.0 GB. So on a card this size the unattributed share is what grows once the world draws, and a row for the two-pass buffers and one for the driver's pipeline memory would be the next most useful.
Not tested
main, its two unit tests, the suite, AMD. This is a run of the ported diff on the work branch.AI use: Claude Code (Claude Sonnet 5.5 ported the diff, Claude Fable 5.2 ran it and wrote this).
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-26T19:58:28Z.
Cross-PR NVIDIA accounting check for #2697 head
50cfb321with #2844 headfc007a9. I ran a local synthetic probe on #2844's exact head: create a 512 MiB write-watched CPU window, sample processPrivateUsageand DXGI local/non-localCurrentUsage, call the PR's realuma_driver::remake, then sample again. All three fresh test processes mapped the CUSTOM write-back L0 heap at the original address; no game data was used.On RTX 3080 Ti / driver 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC:
VirtualAllocraised processPrivateUsageby 537,923,584 bytes (513.00 MiB) in each run, with no DXGI usage change.CurrentUsagefrom 7,745,536 to 544,616,448 bytes: exactly 512 MiB in each run. DXGI local stayed at 9,371,648 bytes.PrivateUsagechanged by +2,723,840, +2,777,088 and +3,063,808 bytes across the three runs; it did not drop by a window's size.cargo test --offline --locked -p xcl --lib local_probe_custom_heap_memory_accounting -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 0 skipped in each of three runs.I checked #2697's
uma_imported_bytesagainst #2844's commonUMA_HEAPSpublication path: a successful CUSTOM window is included at nominal size just like an imported window. These measured deltas support attributing that window once to commit and once to non-local DXGI usage, and subtracting it once from the D3D12 heap charge on this driver. The helper's current name/comment says onlyOpenExistingHeapFromAddress; if both PRs land together, its description should also cover the CUSTOM path. This is an inference about the stacked accounting, not an integrated #2697+#2844 runtime or retail measurement. AMD, Intel and other NVIDIA drivers remain untested here.Local synthetic probe diff
AI use: Codex (GPT-6.2 Sol) reviewed the two paths, wrote and ran the probe, and drafted this report. I checked the code and all three outputs before posting.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-26T19:59:46Z.
Thanks @thehollowedone, that matches how the count is meant to work:
uma_imported_bytessums whatUMA_HEAPSholds, whichever way the window was made. If #2844 lands first, I'll widen the helper's comment to name its CUSTOM path in this PR; if this lands first, #2844 is the place for it. No code change needed either way.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T11:20:46Z.
Test report on head
9d3d643a1763f4e9cf5929cb8c35ac994f981218, from a 12 GB card, with the per-owner line through the world-load stall this title has on 12 GB.Setup: NVIDIA GeForce RTX 3060 12 GB (581.80), i9-14900KF, 64 GB RAM, Windows 11 26200, Rust 1.100.0 MSVC release, DXC 1.9.2609.5. A retail title, warm caches, A presses scripted,
XCL_NETWORK=0.Regression run (60 s,
mainthen this head, each with its own tree'sscripts/smoke.ps1):No device removal or crash; frames 1454 vs 1339 and peak commit 24.1 vs 26.0 GB, within the 80 % / 125 % rules.
The new line, 240 s with
XCL_ACTIVITY=1(one line every ~26 s, MB):Arenas stayed at 401, sparse pools retired at 0, and non-local was flat at 4.7–4.8 GB of a 48 GB budget (UMA window 4,095).
What it shows here: between 54 s and 80 s video memory goes from 8.9 GB to 14.1 GB, about 3 GB past DXGI's budget, and from then on presents stop (
presents per 2 s: 0 0 0at the end of the 240 s run, 1,594 frames shown). 4.6 GB of the 5.2 GB jump is placed texture pages, which then stay at 9.7 GB with 0.55 GB of their pools free. The unattributed "other" stays near 1.1–1.3 GB of video memory. So on this card the line points at the placed texture pages rather than at the remainder, unlike the 4070 Ti run in the description.Not tested: the full test suite on this head, AMD, a card that gets past the stall. The 240 s run's own smoke block is not included: I ran it with
main's script, which namesmain's commit. The 60 s block above is from this head's own script.AI use: Claude Code (Claude Opus 5.5) ran the builds and runs, read the log and wrote this report.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T11:53:37Z.
A fresh-process memory snapshot on head
9d3d643ainitializes the coherent UMA window.snapshot()and itsuma_imported_bytes()helper calluma::get(), which reserves and commits the window on first use. That changes the memory the report is measuring. A read-only accessor for the already-initialized window avoids the side effect at both call sites.I added a child-process regression so its initial UMA state is independent of other tests. It failed on the unchanged head (0 passed, 1 failed, 0 ignored) and passed with the candidate below. On Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Ryzen 7 9800X3D, rustc 1.99.1, DXC 1.8.2502.11:
cargo test --offline --locked -p xcl --lib memory_report -- --nocapture --test-threads=1passed 3/0/0, with no GPU skip.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quietpassed 1,438/0/47 across 37 targets; 25 GPU skip notices (21 no native wave64, three refused per-lane forms, one no heap windows). This is an uncommitted local candidate; I did not run a clean-commit smoke pair or test AMD.There is also a separate later-window ownership path in
open_uma: each successful heap and buffer becomes a raw pointer before the loop attempts the next committed window. If a lateropen(k)fails, the function returns before publishingUMA_HEAPS, leaving those earlier references live whileuma_imported_bytes()reports zero. A later-window failure needs an ownership-aware path. A successful driver CUSTOM remap can replace the original CPU allocation with a D3D12 buffer mapped at the same guest address. Releasing that buffer on a subsequent failure would invalidate guest memory while initialization continues. Keep typed references during staging, release earlier legacy imports on failure, and retain successful CUSTOM remaps as CPU backing without publishing their GPU window slots. I have not injected this failure or measured the backing charge on hardware.Candidate fix and regression
AI use: Codex (GPT-6.2 Sol) wrote and ran the regression and candidate; Codex (GPT-6.2 Astra) independently traced the initialization path.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T14:34:57Z.
Correction and rebase note for #2697 head
9d3d643a: I corrected the cleanup suggestion in my earlier report. On currentmain06f90c19, #2844 can replace a UMA window's original CPU allocation with a D3D12 buffer mapped at the same guest address. If a later committed window fails to open, releasing that first buffer would leave the guest address without its backing while device initialization continues. The existing same-window restore path has already completed by then.For the follow-up, stage typed
(resource, heap, backing kind)entries until all committed windows open. On a later failure, release earlier legacy imports in resource-before-heap order; transfer any successful CUSTOM remaps to a process-lifetime CPU-backing owner, with no GPU window buffers, heaps, or descriptor views published. On success, transfer the staged entries through the normal publication path. Account for retained CUSTOM backing separately from published imports.A focused regression should fail the second committed window after a sparse hole and verify both paths: legacy references released once, and a CUSTOM first window still readable/writable at its original address while GPU publication remains empty. The current remap tests cover failures within one window, not this sequence. This is a source-level finding and test design; I have not run the injected failure or measured driver memory charges.
AI use: Codex (GPT-6.2 Sol) traced the ownership path; Codex (GPT-6.2 Astra) independently checked the lifetime boundary.
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T09:34:06Z.
The owner-report approach is adapted for the current NVIDIA allocation paths in 8e85b44f on our NVIDIA integration branch, credited to @joeypercia. The existing memory line stays intact; the new activity line separates DEFAULT and L0 texture capacity, sparse capacity/retired heaps, uploads and the two DXGI budgets.
The adaptation reports capacities and sampled ownership without treating them as exact residency or subtracting overlapping CPU/GPU representations from private commit. Committed-texture sizes remain explicitly logical when the PC allocation size is unknown. Driver/PSO allocations and other untracked owners remain unattributed.
The separate opt-in sampler 04722e9a snapshots known physical backing metadata, releases mapping locks, then queries committed CPU virtual ranges with bounded work. It labels the sample concurrent and excludes old away bytes left after free. It does not claim full process-heap attribution or a memory fix.
Compilation:
cargo build --locked --release -p xcl --target-dir <isolated-target>completed on integrated commit04722e9a71d22e2e23cbbeb859161246023adea4(exit 0, 229.969 seconds, 8 compiler warnings). This is compilation evidence only.Interactive follow-up on the combined NVIDIA candidate
An RTX 3060 Ti (8 GiB) run of the same clean integration head
04722e9a71d22e2e23cbbeb859161246023adea4ended after 3,266 seconds with D3D12 device removal0x887A0005; 1,060 read-only monitor samples were recorded. Peak logged process commitment was 25,311 MiB and local DXGI usage 9,218 MiB, with a maximum 2,002 MiB overrun of its contemporaneous budget. Immediately before removal, a two-second interval recorded 1,703 draws and 7,023 dispatches with no new presents. DRED state was UNKNOWN and breadcrumbs were unavailable. Budget pressure coincided with failure; the exact GPU fault and causal contribution of any individual patch are not established.The physical-alias counter reported 1,006 MiB of duplicate address backing avoided; this is allocator accounting, not an isolated measured DXGI reduction. At least 2,048 earlier-run driver blobs were successfully reused. Three matched cached creations took 135–147 ms versus 16,672–31,259 ms previously uncached. These narrow observations do not make the combined candidate gameplay-validated. No unit/GPU test batch or matched main/head smoke comparison was run for this revision, and this report is not an approval to merge the integration or evidence that this individual PR caused the failure.
AI use: Codex (GPT-6), adaptation and source review.
An optional temporary Discord is available to coordinate contributor work, help test and compare results.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T10:24:25Z.
Tested
Exact
9d3d643a1763f4e9cf5929cb8c35ac994f981218on Windows 11 x64 build 26200.9974, AMD Ryzen 7 3800X, and Rust 1.100.1 MSVC. I verified eight source slices against the pinnedmemory_report.rsGit blob and reran the standalone CPU harness withmixed_memory.exe --test-threads=1 --nocapture.[1275068416, 671088640, 268435456]and residuals[None, Some(-1), Some(1)]in commit, video, and non-local order. The output omitted commit's residual and kept both DXGI budgets. The signed residuals of −1 and +1 byte displayed asother -1andother 0MB.[603979776, 939524096, 0]and residuals[Some(469762048), None, None]. The output showedother 448for commit and omitted residuals for both unknown DXGI groups.The synthetic mixed-availability fixture and stock arithmetic control both passed. 2 passed, 0 failed, 0 ignored, 0 runtime skips. Native exit was 0.
Not tested
Live
snapshot(), Windows process-commit or DXGI telemetry, heap placement, D3D12 or GPU execution, retail smoke, and the workspace suite.AI use
T3 Code through the Codex harness (
gpt-6.2-sol) verified the source and executable, reran the standalone tests, and wrote this report.Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T18:32:42Z.
Current-main source check for #2697 head
9d3d643a: main commitd3e60ecexplicitly adapts this PR's owner-accounting report. The old head now conflicts inmemory_report.rsand five integration files. Main's version uses per-device tracked parts, saturating totals, and independent local/non-local DXGI query results, so applying the old implementation wholesale would lose newer behavior.Two head-only measures may still be useful: the D3D12 heap commit estimate and
uma_imported_bytes(). They need a focused current-main assessment for double-counting before inclusion.I also checked the first-snapshot side effect on
main10d27297. The two-second activity sampler can callmemory_report::snapshot()before the title initializes UMA.snapshot()callsuma::get(), which initializes the window. A memory measurement can therefore allocate the memory it intends to observe. This is the current-main form of my earlier finding.A fresh-process regression failed on unchanged main (0 passed, 1 failed) after
snapshot()initialized UMA. Changing that one read to an accessor for an already-initialized window made the focusedmemory_reporttests pass (4 passed, 0 failed, 0 ignored). On Windows 11 build 26300, RTX 3080 Ti / driver 621.35, Ryzen 7 9800X3D and rustc 1.99.1 MSVC,cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4on the uncommitted candidate reported 2,152 passed, 1 failed, 48 ignored, with 25 explicit GPUSKIPPEDnotices. The sole failure wasconsole_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, also present on clean main (2,151 passed, 1 failed, 48 ignored, 25 skips).git diff --checkpassed. I did not run a paired smoke for this uncommitted candidate.Candidate diff and fresh-process regression
AI use: Codex (GPT-6.2 Sol) compared the PR with current main, wrote the local regression and candidate, ran the tests, and drafted this report.
Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-28T21:03:38Z.
Closing:
mainadapted this ind3e60ec("report memory by tracked owner", by @bmjask), and @Prime1997's newer version builds on that, so rebasing this head would only undo newer behaviour. Thanks to everyone who tested it. The pieces not inmain(the D3D12-heap commit estimate,uma_imported_bytes(), and @thehollowedone's fix for a snapshot creating the UMA window) are free for anyone to take into a small PR onmain.Pull request closed