D3D12.X: report.json keeps the memory by owner at its peak and at the end #2776
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2776
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2776"
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?
@joeypercia on GitHub · 2026-11-26 11:51 UTC · original
joeypercia:d3d12x-memory-table→main· +619 −11 · 13 files · 3 commits · openStacked 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.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; and that the table keeps the last snapshot and the one with the most video memory.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:(
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=4ond485694b:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way onmainon this iGPU (#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
@MatyEjsr on GitHub · 2026-11-26 12:03 UTC · original · edited 2026-11-26 12:30 UTC
Independent verification of PR #2776 at
d485694b216101c2d684d3395cfb93679cd39e56(stacked on #2750 / #2697, cleanly mergeable withmainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7) on an RTX 3090 24 GB.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)(x86_64-pc-windows-msvc), debug (test suite) and release (60 s smoke run), DXC1.9.2602.17(21d28f72).cargo build --workspace -j 8andcargo build --release --workspace -j 8: ok (exit 0).cargo test -p xcl --lib hle::d3d12x::memory_report::tests -- --nocapture --test-threads=1: 3 passed, 0 failed, 0 ignored (0.34 s), includingthe_table_keeps_the_last_snapshot_and_the_peak_of_video_memory.cargo test -p xcl --lib hle::d3d12x::resource_census::tests -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0.31 s).cargo test -p xcl --lib report::tests -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0.11 s).cargo test --workspace -j 8 --no-fail-fast -- --test-threads=8): 1439 passed, 0 failed, 47 ignored across 37 targets.SKIPPEDchecks on this host (28 total, not counted as GPU coverage):no wave64(21):gpu::dxil::kernel::dispatch_chain_native_wave64_builds_whole, 4 ingpu::recomp::lower::tests, 14 wave64 cases ingpu::recomp::lower_dxil::tests, and 2 ingpu::recomp::tests(gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).per-lane form: refused(3 sub-cases ingpu::recomp::lower_dxil::tests):f16_programs_on_the_gpu(f16 arithmetic, wave32;f16 packed, wave32) andf32_programs_on_the_gpu(f32 conversions, wave32).no heap windows(1):heap_window_out_of_memory_falls_back_to_the_switch_form(default env).no D3D12 debug layer/no d3d12SDKLayers.dll(3):test_title_draws_with_a_root_signature_under_the_debug_layer,test_title_runs_under_the_debug_layer_with_dred,uploads_start_from_each_subresources_state.report.jsonverification from the 60 sscripts/smoke.ps1run on RTX 3090 (XCL_ACTIVITY=1):memory_by_owner.last(seconds: 58.0293664) matches the final[58.029]memory by owner (MB):log line (commit_mb: 13983,video_mb: 6125,video_budget_mb: 23554,non_local_mb: 4688,non_local_budget_mb: 15298, all 14 owner entries, andother_mb: { "commit": 2330, "non-local": 463, "video": 842 }).memory_by_owner.peak_video(seconds: 34.0184304) retained the earliest snapshot that reached the6125 MBlocal video-memory plateau:Regression run
main (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):PR (
d485694b216101c2d684d3395cfb93679cd39e56):Not tested
commit_mb: nullwhenPrivateUsagereads 0), and crash-handlerreport.jsonemission on a live title fault.AI use
report.jsonagainstxcl.log, and drafted this report.@Decodere on GitHub · 2026-11-26 13:10 UTC · original
Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2776 at
d485694b216101c2d684d3395cfb93679cd39e56(stacked on PR #275044a7e6fe-> PR #269750cfb321; merge-baseorigin/mainb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements and targeted test results only; not a full 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, quiet machine (zero concurrent builds/tests during timed runs)title: 29640639viascripts/smoke.ps1 -Seconds 60(XCL_NETWORK=0 XCL_ACTIVITY=1, default flags, no input)Targeted RTX 4060 release unit tests (
d485694b)cargo test --release -p xcl --lib hle::d3d12x::memory_report:: -- --nocapture: 3 passed, 0 failed, 0 ignored (0.38 s,0skipped, exit0), coveringthe_table_keeps_the_last_snapshot_and_the_peak_of_video_memory,the_rest_is_the_total_less_the_parts, and live RTX 4060a_snapshot_on_the_device_has_its_budget_and_owners.cargo test --release -p xcl --lib hle::d3d12x::resource_census:: -- --nocapture: 1 passed, 0 failed, 0 ignored (0.36 s, live RTX 4060,0skipped, exit0).cargo test --release -p xcl --lib report:: -- --nocapture: 4 passed, 0 failed, 0 ignored (0.37 s,report::tests::a_crash_is_kept_while_another_thread_writes_the_report+ 3memory_report::tests,0skipped, exit0).cargo test --release -p xcl --lib hle::d3d12x::sparse:: -- --test-threads=4: 17 passed, 0 failed, 1 ignored (0.40 s,early_commit_timingignored,0skipped, exit0).cargo test --release -p xcl --lib hle::d3d12x::title_textures:: -- --test-threads=4: 19 passed, 0 failed, 0 ignored (0.90 s,0skipped, exit0).Live 8 GB RTX 4060
report.jsonmemory_by_ownerverification (60 s,d485694b)report.json<->xcl.logparity across29snapshots:report.jsonserialized bothmemory_by_owner.peak_video(t = 18.037 s) andmemory_by_owner.last(t = 58.062 s), matching the peak-VRAM and finalmemory by owner (MB):log lines on every single field (commit_mb,video_mb,video_budget_mb,non_local_mb,non_local_budget_mb, all14partstuples, and all3other_mbvalues):peak_video(18.037 s)last(58.062 s)commit_mb(UMA/sparse CPU/D3D12 heaps/other)4095/838/6647/2379)4095/838/6670/2365)video_mb/video_budget_mb6,958(88.8%of budget)6,958(87.9%of budget)target pages/target pools free/arenas3543/40/4653540/43/401sparse tiles/pools free/pools retired838/57/0838/57/0committed textures/video other402/829402/832non_local_mb/non_local_budget_mb15,556(29.4%)15,556(29.9%)UMA/sparse staging/zero buf/upload staging/other4095/64/1/32/3734095/64/1/32/457exit: 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 (
b49be183vsd485694b)Merge-base
origin/main(b49be183):PR #2776 head (
d485694b):Limits of coverage
d485694b(only targetedmemory_report::,resource_census::,report::,sparse::, andtitle_textures::release tests plus paired quiet 60 s smoke).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.logparity verification with assistance from Google Antigravity (Gemini 4 Neon); all numbers and smoke blocks were extracted directly fromcargo test,report.json,xcl.log, andscripts/smoke.ps1outputs.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.