Skip to content

D3D12.X: a memory sample no longer makes the UMA window - #3343

Closed
cj-tomlin wants to merge 1 commit into
xcl-dev:mainfrom
cj-tomlin:d3d12x/memory-report-uma-existing
Closed

cj-tomlin wants to merge 1 commit into
xcl-dev:mainfrom
cj-tomlin:d3d12x/memory-report-uma-existing

Conversation

@cj-tomlin

Copy link
Copy Markdown

memory_report::snapshot() read the UMA window's size through uma::get(), which reserves and commits the window on first use. A sample in a process that had no window yet (a fresh child process, a test) committed it, and so changed the memory it was measuring. uma::existing() returns the window only if something else already made it. Part of #3211 (C).

The accessor and the child-process regression are @thehollowedone's, from their review of #2697. #2999 has the same uma::get() call in its report and uma_imported_bytes(); I asked about overlap there before opening this.

What is in it

  • gpu/uma.rs: existing(), the window without making it
  • hle/d3d12x/memory_report.rs: snapshot() uses it; snapshot_does_not_initialize_uma runs a sample in a fresh child process and checks no window was made

Tested

  • RTX 3080 10 GB (NVIDIA 621.40), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0; tests in debug, smoke in release
  • cargo test -p xcl --lib memory_report::tests::snapshot_does_not_initialize_uma: fails without the fix (a memory sample made the UMA window, 0 passed, 1 failed), passes with it
  • cargo test --workspace --no-fail-fast -- --test-threads=4 at 49e8f5fc: 2,619 passed, 0 failed, 49 ignored (41 targets)
  • SKIPPED on this adapter: 21 no wave64, 3 refused per-lane forms (V_MUL_F16, V_PK_MUL_F16, V_CVT_F16_F32), 2 no heap windows, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer

Regression run
A retail title, 120 s, XCL_PREPARE=0, XCL_PRESS_AT=25:A (loads a save into the world), the same DXIL cache copy and data root for both.

xcl-smoke v1
commit: d8bd9a38204667f3ca7dd9eeffcc2f1c937b07b0
gpu: NVIDIA GeForce RTX 3080
title: 9cc6a39e
seconds: 120
exit: 0x0
frames shown: 1933 (PresentX 1933)
presents per 2 s (last 3): 0 0 0
device removals: 0
crashes: 0
peak commit: 33571 MB
xcl-smoke v1
commit: 49e8f5fcf754c178f5a95a0294fd4dd68cb6b2bf
gpu: NVIDIA GeForce RTX 3080
title: 9cc6a39e
seconds: 120
exit: 0x0
frames shown: 1915 (PresentX 1915)
presents per 2 s (last 3): 19 35 0
device removals: 0
crashes: 0
peak commit: 34447 MB

Not tested

  • AMD, other NVIDIA drivers, integrated GPUs
  • the title run does not reach the change (the game makes its window before any sample), so it is a regression check only

AI use

  • Claude Code (Claude Opus 5.5): adapted the accessor and test to main, ran the tests and smoke runs, wrote this description. I checked the diff and the results.

🤖 Generated with Claude Code

memory_report::snapshot() read the UMA window's size through uma::get(),
which reserves and commits the window on first use. A sample in a process
that had no window yet (a fresh child, a test) committed it, and so changed
the memory it was measuring. uma::existing() returns the window only if
something else made it.

The child-process regression and the accessor are @thehollowedone's from
their review of xcl-dev#2697. The test fails without the fix ("a memory sample
made the UMA window") and passes with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@cj-tomlin

Copy link
Copy Markdown
Author

Closing as a duplicate: #3229 (merged) adds uma::existing() and the regression test that snapshot() does not create the UMA window.

@cj-tomlin cj-tomlin closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:memory Virtual/physical memory, arenas, VRAM budget, UMA gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant