D3D12.X: report tracked resource and heap counts #1613
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1623"
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?
Imported from ivall/xcl. Originally posted by gabrielsteglich on 2026-11-24T18:22:38Z.
Adds opt-in counts of the D3D12 resources and heaps tracked by XCL. The counts let a startup trace compare object growth with process commit and video memory use. Part of #1333. Issue reservation
What is in it
XCL_D3D12_OBJECT_COUNTS=1adds tracked resources, heaps, and deferred resources toreport.json. Resources held until GPU work completes stay in the resource total. WithXCL_ACTIVITY=1, the same counts appear next to each memory sample.Tested
cargo build --offline --locked --release -p xclsucceeded on both commits. One7f519f,cargo build --offline --locked --workspaceandcargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputsucceeded in the debug profile. Cargo reported 893 passed, 0 failed, and 42 ignored. Optional sample-data tests were disabled.SKIPPED.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskandgpu::recomp::tests::gpu_wave32_program_in_wave64_hardwarerequire native wave64.test_title_draws_with_a_root_signature_under_the_debug_layeranduploads_start_from_each_subresources_staterequire the D3D12 debug layer.heap_window_out_of_memory_falls_back_to_the_switch_formrequires heap windows in the test configuration.cargo test -p xcl --libon Windows 11 with an RTX 3060 Ti and reported zero failures after locally merging the previous PR revision withmain. Independent verificationRegression run
scripts/smoke.ps1ran the same retail title offline for 60 seconds per build after the rebase, with fresh title profiles and separate XCL DXIL caches.XCL_D3D12_OBJECT_COUNTS=1was set on both builds. Each build compiled eight shaders during the run.mainPR head
Not tested
AI use
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:26:34Z.
Review: COMMENTED
The full workspace run and the smoke comparison are useful. One CONTRIBUTING.md detail: it asks for the names of skipped GPU tests on the adapter; this lists five skips only by category/count. Could you include the exact test names for the wave64, debug-layer, and heap-window skips? AI-assisted review; I checked this against the Tested section and project guide.
Imported from ivall/xcl. Originally posted by gabrielsteglich on 2026-11-24T19:24:06Z.
Thanks, @gut0to. I've added the exact names of all five skipped tests to the Tested section. The PR description check passed again.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:37:53Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:02:09Z.
XCL PR #1623 focused verification
Clean detached HEAD
e7f519f15531496ca2ef14f6e27a515301a55dfdon STOR-WINLAB. Windows 11 Enterprise Evaluation x64 build 26200, AMD64 family 23 model 113 stepping 0, Intel Arc A770 driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). The fixture requests the default D3D12 adapter. The lab probe identified the inbox default device by LUID as the A770 (8086:56A0).Tested
cargo build --workspaceandcargo test --workspace --no-runboth succeeded outside the Arc mutex with incremental compilation and dev/test debug info disabled.XCL_ADAPTER=NONE_CPU_ONLY. Ranxcl-77aca8ccb20e299f.exe --exact hle::d3d12x::real::object_count_tests::adopted_objects_stay_counted_through_deferred_release. The test verified resource and heap adoption, deferred resource accounting, and immediate and deferred release paths.Invoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. Rand3d12_object_counts-291c762794d784ae.exe --exact tracked_objects_follow_native_release_and_gpu_completion. The fixture created a D3D12 device and verified zero initial counts. It failed atCreateHeap(line 28) with0x80070057(The parameter is incorrect), before adoption and queue completion. The failure reproduced and libtest exited 101.pr1623-focused.logare 1 passed, 1 failed, 0 ignored, 0 SKIPPED. Both commands used the test executables produced by workspace compilation.Not tested
Scope was full workspace compilation and the two focused tests. The full GPU workspace suite, retail-title smoke, activity log and report.json output were omitted. The failed GPU fixture did not reach the native release and GPU completion assertions.
AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1623-focused.logand published.Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T13:26:29Z.
Correction:
tracked_objects_follow_native_release_and_gpu_completion(tests/d3d12_object_counts.rs) creates its device withagility::create_device(None, ..), so it runs on DXGI adapter 0, which on this machine is the RX 9070 XT, whateverXCL_ADAPTERsays. Both runs of that test below were on the RX 9070 XT: the AMD result stands, but the RTX 3060 line ford3d12_object_countsis not an RTX 3060 result. The per-cardgpu::counts are unaffected.AMD run (listed as untested), plus an RTX 3060: the new integration test passes on both, and nothing in the GPU suite changes.
Head
e7f519fapplied onmain1a0bbe3, debug, Windows 11 Pro 26200:cargo test -p xcl --test d3d12_object_counts: 1 passed, 0 SKIPPED (tracked_objects_follow_native_release_and_gpu_completionok, so the counts follow native release and GPU completion on the AMD driver too).cargo test -p xcl --lib -- gpu::: 629 passed, 2 failed, 22 ignored, 6 SKIPPED, the same counts asmain; the 2 failures are the AMD fuzz seeds tracked in #2115.d3d12_object_counts1 passed;gpu::631 passed, 0 failed, 22 ignored.Not tested: the device loss from #1333, a title, Intel.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:42:05Z.
Review: COMMENTED
No concrete source defect found. Resource/heap adoption/release accounting and deferred lifetime handling are correct; native blocked-queue test plus current CI/smoke are strong. Independent relaxed atomics mean live snapshots can momentarily be internally inconsistent under concurrent release; document as approximate or add concurrent snapshot stress coverage. I found no blocker.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:58:06Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T15:26:19Z.
NVIDIA test report for
e7f519f: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug. Head tested as-is on its base4178e88(not merged with currentmain, so the lib count is lower than on newer heads).cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4(head as-is): 834 passed, 0 failed, 22 ignored; 3 SKIPPED (2no wave64, 1pso_measurement_compiles_an_exact_synthetic_recordwithout Developer Mode), none in this PR's files.cargo test -p xcl --test d3d12_object_counts -- --exact tracked_objects_follow_native_release_and_gpu_completion --test-threads=1 --nocapture, 3 runs: 3/3 passed, 0 SKIPPED. DXGI adapter 0, whichcreate_device(None, ..)takes, is the RTX 3070 on this machine.adopted_objects_stay_counted_through_deferred_release, same flags: 3/3 passed.Lib tests and the PR's integration test only; no title run.
AI-assisted (Claude Code, Claude Opus 5.5).
Pull request closed