Skip to content

[upstream #956] D3D12.X: count and report what console code cannot reach in unified memory - #148

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/956
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/956

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Part of xcl-dev#505. Diagnostics only: no behaviour change.

Once the coherent window is full, a console buffer XCL cannot place in unified memory becomes a plain PC resource, and every view of it gets an empty descriptor (num_records 0): a shader reads zeros there and its writes go nowhere. XCL counted these (NON_UMA_BUFFER_VIEWS) but never reported the count, and logged only the first one. So nobody can tell from a run whether the world load of the retail title creates thousands of them – which would fit the stop in xcl-dev#505 (the title stops submitting GPU work with no thread blocked in XCL, then its watchdog ends it) – or none.

In a hand-driven run of the retail title on main 077ce40 (RTX 5080): the coherent window was full (3998 / 4095 MB) from 43 s on; the world load started at ~44 s; the first #101 came at 59.5 s; presents and submits went to 0 at 62 s; the watchdog (+0x23cf683) at 90.4 s. 0 draws or dispatches skipped, 0 failed pipelines, 0 Wait64BitValueX timeouts, no title thread inside XCL or the driver at the crash. The single "buffer view … not in UMA" warning came at 14 s, and the log could say nothing more.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: OUTSIDE_UMA counts, by kind: buffer SRVs / UAVs / CBVs that get an empty V#, texture views XCL cannot shape (empty T#), console buffers that found no room in unified memory (coherent window and, where tried, sparse windows), committed console textures that found no room in the coherent window. The first of each kind is logged (its time shows when it starts). report.json gets them as d3d12.outside_uma (#[serde(default)], so older reports still read).
  • crates/xcl/src/host.rs: the XCL_ACTIVITY memory line (every 2 s) adds the coherent window's use and these counts, at its end (scripts/smoke.ps1 reads only its start). It reads unified memory through uma::current(), so reporting doesn't create it.
  • crates/xcl/src/gpu/uma.rs: current(), the title's graphics memory if it exists, without creating it (get() does), as @ettehn found; with a test that it's what get() made.
  • crates/xcl/src/hle/d3d12x/bind.rs: the "console code so far" line adds them too.
  • Tests in real.rs: each kind lands in its own field; a report without the field still reads.

Tested

  • NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug, DXC 1.9.2602.17
  • head 3261b74, rebased onto main 6efdabc
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 730 passed, 0 failed, 41 ignored
  • SKIPPED on this adapter (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware; no XCL_SAMPLE_* set

Regression run
main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: NVIDIA GeForce RTX 5080
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 60
exit: 0x0
frames shown: 1673 (PresentX 1673)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15184 MB

This PR:

xcl-smoke v1
commit: 3261b743ec8b256613b27978081f346f733bc7ee
gpu: NVIDIA GeForce RTX 5080
title: GTA6.Xbox.v1.0.2.1-CYBERLEEK
seconds: 60
exit: 0x0
frames shown: 1674 (PresentX 1674)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14764 MB

Not tested

AI use

  • Claude Code, Claude Opus 5.5: read the run's log and report, wrote the change, the tests and this description, and ran the tests above.

🤖 Generated with Claude Code


Mirror of xcl-dev#956 (auto-synced, do not edit).

…emory

Once the coherent window is full, a console buffer XCL cannot place in
unified memory becomes a plain PC resource and its views get empty
descriptors: shaders read zeros there and their writes go nowhere. XCL
counted these views but never reported the count and logged only the
first, so a run could not show whether the retail title's world load
(xcl-dev#505) creates many of them.

Count, by kind: buffer SRVs / UAVs / CBVs with an empty V#, texture
views XCL cannot shape, console buffers and committed textures that
found no room in unified memory. The first of each kind is logged;
report.json gets them as d3d12.outside_uma, and the XCL_ACTIVITY memory
line and the "console code so far" line add them with the coherent
window's use. The activity line reads unified memory through the new
uma::current(), which does not create it (uma::get() would). No
behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#956 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/956 branch November 25, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants