Repository navigation
D3D12.X: report.json keeps the memory by owner at its peak and at the end - #2776
joeypercia wants to merge 3 commits into
Conversation
What the video memory in use is made of could not be told from the XCL_ACTIVITY memory line: it gives no budget, and three of XCL's owners (xcl-dev#2688, workstream 1). memory_report::snapshot() takes the process's commit, and DXGI's local and non-local usage with their budgets, and XCL's parts of each: - commit: the UMA coherent window, and the CPU copy of mapped sparse tiles (a title page in a sparse window is committed on the CPU too); - video memory: target pages and the free part of their pools, arenas, mapped sparse tiles, free sparse pools, retired sparse pools (counted now: sparse::retired_bytes), and title textures that are committed resources of their own (title_textures::committed_bytes, console size). What each total holds besides them is its own part, "other". XCL_ACTIVITY logs it as a line of its own after the memory line, which stays as it was (scripts/smoke.ps1 and the integration branches' tools read it). Part of xcl-dev#2688. Assisted-by: Claude Code (Claude Opus 5.5)
…them XCL's buffers sized per list or per submit (copy scratch, fill patterns, readbacks, upload staging, ...) were not in the memory line, so memory that grows with the title's submits could not be told apart from the title's own (xcl-dev#2688, workstream 1). resource_census::track gives a resource XCL made a small COM object as private data; D3D12 releases it with the resource, which takes it off its place's count. The eleven places XCL makes committed resources at run time are tracked. Each place's bytes are a part of the memory line, and a line of its own gives how many of each are alive and made. Part of xcl-dev#2688. Stacked on xcl-dev#2697. Assisted-by: Claude Code (Claude Opus 5.5)
|
Updated independent verification of PR #2776 at Review follow-up & branch status
Tested
Regression run main (merge-base PR ( (102.8% of Not tested
AI use
|
|
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2776 at Setup
Targeted RTX 4060 release unit tests (
|
| Field | peak_video (18.037 s) |
last (58.062 s) |
|---|---|---|
commit_mb (UMA / sparse CPU / D3D12 heaps / other) |
13,961 (4095 / 838 / 6647 / 2379) |
13,970 (4095 / 838 / 6670 / 2365) |
video_mb / video_budget_mb |
6,176 / 6,958 (88.8% of budget) |
6,116 / 6,958 (87.9% of budget) |
— target pages / target pools free / arenas |
3543 / 40 / 465 |
3540 / 43 / 401 |
— sparse tiles / pools free / pools retired |
838 / 57 / 0 |
838 / 57 / 0 |
— committed textures / video other |
402 / 829 |
402 / 832 |
non_local_mb / non_local_budget_mb |
4,566 / 15,556 (29.4%) |
4,650 / 15,556 (29.9%) |
— UMA / sparse staging / zero buf / upload staging / other |
4095 / 64 / 1 / 32 / 373 |
4095 / 64 / 1 / 32 / 457 |
- Quiet 60 s retail smoke ran cleanly (
exit: 0x0,1603frames shown,60 60 60steady-state presents per 2 s,0device removals,0crashes,13971 MBpeak commit vsorigin/mainb49be183's14018 MB/1518frames).
Paired 60 s RTX 4060 smoke (b49be183 vs d485694b)
Merge-base origin/main (b49be183):
xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB
PR #2776 head (d485694b):
xcl-smoke v1
commit: d485694b216101c2d684d3395cfb93679cd39e56
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1603 (PresentX 1603)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13971 MB
Limits of coverage
- Full workspace test suite was not re-run on
d485694b(only targetedmemory_report::,resource_census::,report::,sparse::, andtitle_textures::release tests plus paired quiet 60 s smoke). - Verified with
XCL_ACTIVITY=1on a discrete 8 GB NVIDIA GPU (RTX 4060) on native Windows 11; defaultXCL_ACTIVITY=0omission behavior, crash-time report writes, and UMA/iGPU systems were not exercised in this smoke.
AI use
Ran the targeted release unit tests, paired quiet 60 s smoke runs, and report.json / xcl.log parity verification with assistance from Google Antigravity (Gemini 4 Neon); all numbers and smoke blocks were extracted directly from cargo test, report.json, xcl.log, and scripts/smoke.ps1 outputs.
Prime1997
left a comment
There was a problem hiding this comment.
Please rank peak samples by raw DXGI bytes. The top commit selects peak_video after rounding CurrentUsage to MiB. Sample 104,857,600 bytes, then 104,858,623 bytes with a different owner breakdown. Both display as 100 MiB, so the report can keep the earlier breakdown even though the second usage is higher. An unknown reading can similarly mask a later known reading below 1 MiB.
Keep an optional raw-byte value for selection, rank a known sample above unknown, and retain the existing MiB output. Please add both cases to the peak-selection test; distinct whole-MiB fixtures cannot detect this. The issue is in this top commit. Hosted Windows results and the reported hardware checks are useful, but there was no independent NVIDIA execution here because the stack conflicts with af2cecc4.
AI use: Codex (GPT-6) reviewed the pinned changes and verified the reported evidence. Optional temporary Discord for coordinating contributor work, testing, and comparing results.
… end The XCL_ACTIVITY line by owner was only in the log, so comparing runs meant reading logs (xcl-dev#2688, workstream 1: an end-of-run table). The activity thread keeps each snapshot it logs (memory_report::note): the last one, and the one where video memory in use was highest. report.json gets them as memory_by_owner (MB: totals, budgets, XCL's parts and the rest of each total, with the second of the run). The report takes what was kept and makes no DXGI call, which a crash report may make from any thread. Without XCL_ACTIVITY there is no table. Part of xcl-dev#2688. Stacked on xcl-dev#2750. Assisted-by: Claude Code (Claude Opus 5.5)
d485694 to
c5d9342
Compare
|
Thanks, both cases were real: Fixed in Reran on the new head, RTX 4070 Ti: AI use: Claude Code (Claude Opus 5.5) made the change, ran the tests and wrote this reply. |
|
Ran the memory-report table test at 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. The test passes: it covers the JSON round trip, keeping the last snapshot and the peak by video bytes, and the byte-level tie-break that would fail if the ranking were done in MB. This is a CPU-side report-serialization test; the report copies what was noted and makes no DXGI call. The thread has RTX 5090 + Radeon iGPU and RTX 4060 reports, but no 5070 Ti; this adds a Blackwell desktop datapoint on driver 32.0.16.2124 with DXC 1.9.2609.5. Not tested: a real 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. |
Stacked on #2750 (itself on #2697); only the top commit belongs here.
report.jsongets the memory table workstream 1 of #2688 asked for: the snapshot by owner where video memory in use was highest, and the last one of the run, in MB. Runs can be compared from their reports instead of their logs. Part of #2688 (workstream 1, part 2 of the plan there).What is in it (one commit)
crates/xcl/src/hle/d3d12x/memory_report.rs:Recordis a snapshot as the report keeps it, with owned strings so the report can be read back: the second of the run, commit, video and non-local usage with their budgets, XCL's parts as (owner, memory, MB), and the rest of each total.Tableholdslastandpeak_video.notekeeps them, andtable()hands them to the report. The peak is chosen on DXGI'sCurrentUsagein bytes (kept beside it, not written to the report), not on the MB, and a known reading ranks above an unknown one.crates/xcl/src/host.rs: theXCL_ACTIVITYthread takes one snapshot every 2 s. It logs that snapshot's line, as before, and now alsonotes it.crates/xcl/src/report.rs:memory_by_owner(with#[serde(default)]: older reports still read). The report copies what was kept and makes no DXGI call, because a crash report can be written from any thread. WithoutXCL_ACTIVITYthe table is empty.the_table_keeps_the_last_snapshot_and_the_peak_of_video_memory: a record's totals, budgets, parts and rests in MB; a JSON round trip; that the table keeps the last snapshot and the one with the most video memory; that of two readings within one MB it keeps the higher one in bytes, with its own parts; and that a known reading under 1 MB ranks above an earlier unknown one. The last two fail on a ranking by MB.The newer retail title on an RTX 4070 Ti 12 GB (
nvidia-devaf2cecc4with this stack, 1 GiB shader heap). The run ended in a device removal at 282 s, and the table was in the report all the same.peak_video:{ "seconds": 279.7938144, "commit_mb": 35641, "video_mb": 14438, "video_budget_mb": 10534, "non_local_mb": 5743, "non_local_budget_mb": 15162, "parts": [ [ "UMA window", "commit", 4095 ], [ "sparse CPU copy", "commit", 2538 ], [ "D3D12 heaps", "commit", 16085 ], [ "target pages", "video", 6859 ], [ "target pools free", "video", 116 ], [ "arenas", "video", 401 ], [ "sparse tiles", "video", 2581 ], [ "sparse pools free", "video", 170 ], [ "sparse pools retired", "video", 0 ], [ "committed textures", "video", 415 ], [ "UMA window", "non-local", 4095 ], [ "dispatch chain scratch", "video", 391 ], [ "sparse readback", "non-local", 16 ], [ "sparse staging", "non-local", 64 ], [ "sparse zero buffer", "non-local", 1 ] ], "other_mb": { "commit": 12921, "non-local": 1566, "video": 3500 } }(
UMA windowappears twice: once in commit, as CPU memory, and once in non-local, where DXGI counts the imported window.)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:c5d93421: 1439 passed, 0 failed, 47 ignored; 29SKIPPEDlines, mostly "no wave64".d485694b(before the peak ranking by bytes): 1438 passed, 1 failed, 47 ignored. The failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way onmainon this iGPU (DXIL fuzz tests: fuzz_validate_and_gpu_1 fails on AMD (seed 722 and others, RDNA2-4), so the default suite is red there #2115).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, 1 GiB) installed on this machine.mainb49be183(the base of the stack) and this PR's head (no uncommitted changes):main:
PR:
Not tested
table()usestry_lockand gives an empty table then, rather than waiting.XCL_ACTIVITY: no table, by design (a snapshot costs a DXGI query).AI use