D3D12.X: memory by owner on nvidia-dev: two-pass buffers, GPU-view tiles #2999
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!2999
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2999"
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?
@pr1sm-dev on GitHub · 2026-11-27 10:48 UTC · original
pr1sm-dev:pr/memory-owners→nvidia-dev· +731 −14 · 15 files · 8 commits · openThe memory line by owner (#2697, #2750, #2776) on
nvidia-dev, with the two owners this branch has andmaindoes not. Part of #2688 (workstream 1).Stacked on #2697, #2750 and #2776: the first three commits are @joeypercia's, cherry-picked onto
nvidia-devwith their authorship (three conflicts, both sides kept;git range-diffagainst the originals shows context lines only). Only the last five commits belong here: 93 added and 5 removed lines. The whole branch is 731 added and 14 removed.What is in it
bind.rs,memory_report.rs: atwo-pass buffersrow, read from the count the buffers' cap keeps (the bytes asked for). Onnvidia-devthese buffers were inother.sparse.rs,texture_upload.rs: two census places,sparse readback jobsandtexture upload jobs(both pooled; made on a pool miss only).sparse.rs,memory_report.rs: aGPU-view tilesrow, taken out ofsparse tiles. A view tile parked since the last submit, or kept withXCL_VIEW_KEEP, still counts with the windows' own.present.rs,memory_report.rs,host.rs: one moreXCL_ACTIVITYline besideother: the swap chain's size (bytes computed, not counted) andpso_async's pipeline builds so far.README.md: theXCL_ACTIVITYentry names the lines.On
nvidia-dev,sparse pools freealso holds the tiles that are cooling or quarantined (pool_bytesleaves them out of the mapped ones here).Tested
71dad56b, debug:cargo test --workspace --offline --no-fail-fast -- --test-threads=4: 1829 passed, 8 failed, 48 ignored; 28SKIPPED(no wave64: 21, per-lane f16 forms refused: 3, no heap windows: 2, no xgameruntime.dll: 2).nvidia-dev3f39671d, same command: 1824 passed, 8 failed, 48 ignored; the same 28SKIPPED. The 8 failures are the same six tests on both:texture_upload'spieces_hold_the_texels_of_their_levelsandgpu_parts_of_a_texture_go_up_and_the_rest_stays,async_compute_pso_registers_real_pso_and_not_standin,console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, andsplit_compute_prefers_the_offline_whole_pipelineandtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, each reported twice. The five more passes are this branch's tests.3292b096reverted, which this card needs to stay in the world, #2867): Series S profile,XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_COHERENT_HEAPS=sparse:1024 XCL_TWO_PASS_MB=3072 XCL_TEXTURE_LEVEL_PAGES=1 XCL_GFX_PSO_WAIT_MS=100 XCL_PREPARE_GRAPHICS=0 XCL_FRAME_DUMP=60, 2 GiB shader heap (#2590), warm caches, 540 s of title time, 421 s of it in the world. The lines at the end:Without the two rows,
otherwould have read 5,607 MB of the 17,231 andsparse tiles6,157. Video memory was level by then (17,170 MB at 480 s).report.jsonhad the same table.Regression run
60 s each, the same settings (Series S profile,
XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1 XCL_COHERENT_HEAPS=sparse:1024 XCL_TWO_PASS_MB=3072 XCL_PREPARE_GRAPHICS=0), no input: the title's first screens.mainb49be183(the commit #2697 is based on):nvidia-dev3f39671d(the base):This PR's head:
Not tested
XCL_VIEW_KEEP, an fp16 swap chain, a resize.AI use
@Decodere on GitHub · 2026-11-27 11:48 UTC · original
Independent desktop NVIDIA RTX 4060 (8 GB) / Windows 11
--releaseverification of PR #2999 at71dad56b13e366dd36a64b14af8defa448a82ed3(8 commits stacked on exact parent andnvidia-devmerge-base3f39671d5239c33100ba25b692d60b6582b779d2:73a39337->2c4a79e3->2f7b2210->fda79731->744c1419->ec24e607->fa74f7d0->71dad56b).Environment
32.0.16.2114(NVIDIA621.14), WDDM 3.2rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5Release build & targeted
--release --libtestsAll runs executed sequentially (
--test-threads=1 --nocapture) on71dad56b13e366dd36a64b14af8defa448a82ed3against the RTX 4060:cargo build --release -p xcl: passed (2m 00s),0new compiler warnings compared to exact parent3f39671d(identical 8 pre-existingxcllib warnings;0warnings inmemory_report.rs,resource_census.rs, or modified hunks).cargo test --release -p xcl --lib hle::d3d12x::memory_report:: -- --test-threads=1 --nocapture: 3/3 runs passed (4 passed; 0 failed; 0 ignored; 0 skipped,0.37s–0.38seach) — includes live RTX 4060 execution ofa_snapshot_on_the_device_has_its_budget_and_ownersplusthe_rest_is_the_total_less_the_parts,the_line_beside_other_has_the_swap_chain_and_the_builds, andthe_table_keeps_the_last_snapshot_and_the_peak_of_video_memory.cargo test --release -p xcl --lib hle::d3d12x::resource_census:: -- --test-threads=1 --nocapture: 3/3 runs passed (1 passed; 0 failed; 0 ignored; 0 skipped,0.37s–0.39seach) — live RTX 4060 execution ofa_tracked_resource_counts_until_it_is_destroyed(verifyingDEFAULTlocal video vsUPLOADnon-local tracking, refcount retention across clones, and live-count drop on destruction while preservingmade).cargo test --release -p xcl --lib hle::d3d12x::sparse:: -- --test-threads=1 --nocapture: 3/3 runs passed (66 passed; 0 failed; 1 ignored[early_commit_timing],0 skipped,4.09s–5.01seach) — covers the newcommitted_bytes()assertions alongside the sparse tile/view test suite.cargo test --release -p xcl --lib hle::d3d12x::title_textures:: -- --test-threads=1 --nocapture: 3/3 runs passed (29 passed; 0 failed; 0 ignored; 0 skipped,1.36s–1.39seach).cargo test --release -p xcl --lib hle::d3d12x::bind:: -- --test-threads=1 --nocapture: 3/3 runs passed (53 passed; 0 failed; 0 ignored; 1 skipped,0.60s–0.61seach;two_pass_binds_set_the_shared_view_heapskipped as expected without opt-inXCL_HEAP_WINDOWS=1).cargo test --release -p xcl --lib report:: -- --test-threads=1 --nocapture: 1/1 run passed (5 passed; 0 failed; 0 ignored; 0 skipped,0.49s; includesreport::tests::a_crash_is_kept_while_another_thread_writes_the_report).Paired quiet 60 s retail smoke (
XCL_PREPARE=0,XCL_NETWORK=0)Both runs used
scripts/smoke.ps1 -Seconds 60 -StartupTimeoutSeconds 180(which setsXCL_ACTIVITY=1) withXCL_PREPARE=0andXCL_NETWORK=0on a quiet machine against the same local retail title (title: 29640639):Exact parent (
3f39671d5239c33100ba25b692d60b6582b779d2):PR #2999 (
71dad56b13e366dd36a64b14af8defa448a82ed3):Both runs finished cleanly in
63 swall time with0device removals,0crashes, steady60 60 60presents per 2 s, and no regression in frame count (1583vs1535) or peak commit (14790vs14725 MB). All 29 legacymemory: N MB committedlines were emitted alongside the new lines and parsed cleanly byscripts/smoke.ps1.Runtime memory-by-owner telemetry &
report.jsonverificationDuring the 60 s
71dad56bsmoke on the RTX 4060 (8 GB),xcl.logemitted29memory by owner (MB)snapshots (t = 2.002 sto58.097 s),28memory: XCL's own resources (alive)census lines (t = 4.003 sto58.097 s), and28memory: not in the rowsbeside lines (t = 4.004 sto58.100 s), with0negativeothervalues across all29snapshots and0over-budget warnings:t = 18.032 s):commit:14694 MB(UMA window 4095,sparse CPU copy 838,D3D12 heaps 6822,other 2937)video memory:6177of a6901 MBbudget (placed texture pages 3546,placed texture pools free 37,arenas 465,sparse tiles 838,GPU-view tiles 0,sparse pools free 57,sparse pools retired 0,committed textures 402,two-pass buffers 0,other 830— ~86.5%accounted by named owners)non-local:4740of a15556 MBbudget (UMA window 4095,sparse staging 64,sparse zero buffer 1,texture upload jobs 195,other 384— ~91.9%accounted)t = 58.097 s):commit:14743 MB(UMA window 4095,sparse CPU copy 838,D3D12 heaps 6835,other 2973)video memory:6116of a6892 MBbudget (placed texture pages 3498,placed texture pools free 86,arenas 401,sparse tiles 838,GPU-view tiles 0,sparse pools free 57,sparse pools retired 0,committed textures 402,two-pass buffers 0,other 832)non-local:4815of a15556 MBbudget (UMA window 4095,sparse staging 64,sparse zero buffer 1,texture upload jobs 195,other 459)t = 58.097 s):memory: XCL's own resources (alive): sparse staging 1 of 1 made, 64 MB; sparse zero buffer 1 of 1 made, 1 MB; texture upload jobs 8 of 8 made, 195 MB(all 3 active sites also routed intonon-localin bothxcl.logandreport.json).t = 58.100 s):memory: not in the rows: swap chain 3 buffers of 3840x2160, about 94 MB; pipeline builds so far: 4324 finished, 0 failed, 56429 pending(up from1759 finished, 0 failed, 42106 pendingatt = 4.004 s).report.json(memory_by_owner): Absent on baseline3f39671d, present and populated on71dad56b. Bothmemory_by_owner.peak_video(seconds: 18.0317998,video_mb: 6177,video_budget_mb: 6901) andmemory_by_owner.last(seconds: 58.0972428,video_mb: 6116,commit_mb: 14743) match the correspondingxcl.loglines exactly, with every segment'sparts + other_mbreconciling to the DXGI/process total within1–2 MBof integer>> 20truncation.Limits of coverage
XCL_PREPARE=0(XCL_NETWORK=0), bypassing startupprepare_for_launchshader precompilation (reusing the existing local DXIL cache).29640639,two-pass buffers,GPU-view tiles, andsparse pools retiredstayed at0 MB, and the remaining 10resource_censussites (upload staging,ExecuteIndirect argument order,copy scratch,fill pattern,timestamp readback,predication,frame dump readback,dispatch chain scratch,sparse readback,sparse readback jobs) were not allocated; those paths were covered only by unit tests / code inspection here rather than non-zero retail smoke traffic.non_local.budget == 0->Kind::Video) and Winecommit unknownhandling were verified via unit tests (the_rest_is_the_total_less_the_parts), not on iGPU or Wine hosts.hle::d3d12x::bind::tests::two_pass_binds_set_the_shared_view_heapskipped as expected without opt-inXCL_HEAP_WINDOWS=1,hle::d3d12x::sparse::tests::early_commit_timingis#[ignore], and the full workspace test suite / visual screenshot capture were not run.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
@JJAutoCompare on GitHub · 2026-11-27 12:25 UTC · original
Tested
71dad56b13e366dd36a64b14af8defa448a82ed3on Intel Arc A770 (16,258 MiB, driver 32.0.101.9175), Ryzen 7 3800X, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, debug. Built the checked-in tests and a separate test-only probe withrustc --testand lockfile-matched cached dependencies after an interrupted Cargo launch.xcl-stock.exe --exact <filter> --test-threads=1 --nocaptureforhle::d3d12x::memory_report::tests::{the_rest_is_the_total_less_the_parts,the_line_beside_other_has_the_swap_chain_and_the_builds,a_snapshot_on_the_device_has_its_budget_and_owners}. Ranxcl-probe.exe --exact hle::d3d12x::bind::probe_two_pass_owner_lifetime_on_arc --test-threads=1 --nocapture. The last stock test and the probe used the Arc mutex withXCL_ADAPTER=A770andXCL_TWO_PASS_MB=64. All four tests passed, with 0 failed, 0 ignored, and 0 skipped. All native children and the GPU wrapper exited 0.two-pass buffersvideo owner and raw live counter both read 0 before allocation, 3,211,264 bytes while live, held for allocator release, and pooled, and 0 after reuse-pool retrieval and final drop. DXGI local usage went from 3,997,696 to 7,208,960 and back to 3,997,696 bytes. Localotherstayed at 3,997,696 bytes. The rendered line and in-memory report record showed 3 MiB while the buffer was held.Not tested
AI use
gpt-6.2-solwith high reasoning effort, ran the controls and synthetic probe, checked the raw outputs, and drafted this report.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.