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

Closed
cj-tomlin wants to merge 1 commit from upstream-pr/3343 into main
cj-tomlin commented 2026-11-29 09:38:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-11-29T09:38:51Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:5549484760 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3343). Originally posted by [cj-tomlin](https://github.com/cj-tomlin) on 2026-11-29T09:38:51Z. --- `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](https://claude.com/claude-code)
cj-tomlin commented 2026-11-30 16:39:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-11-30T16:39:42Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7285030368 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3343#issuecomment-7285030368). Originally posted by [cj-tomlin](https://github.com/cj-tomlin) on 2026-11-30T16:39:42Z. --- Closing as a duplicate: #3229 (merged) adds uma::existing() and the regression test that snapshot() does not create the UMA window.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!3343
No description provided.