D3D12.X: a released descriptor heap's RTV entries go with it #1771
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!1771
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1771"
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?
@b3IKK on GitHub · 2026-11-24 20:30 UTC · original
b3IKK:d3d12x/rtv-entries-dropped-with-heap→main· +89 −1 · 2 files · 1 commits · openAddresses
XCL-BT-045from #1488.present::note_rtvkeeps the resource every render target view is made for — oneAddRefeach — inRTVS, and only a view made again in the same handle ever replaced it. A title that makes its views in descriptor heaps it later releases (a streaming ring, a resize) therefore left every one of those references behind: the resources, and the video memory behind them, for the life of the process.This records each descriptor heap's CPU descriptor range when it is created (
ID3D12Device::CreateDescriptorHeap, every type — the console-heap path and the plain one) and drops theRTVSentries in that range when the heap's lastReleasearrives, releasing the resources they held. Another heap's entries are untouched.What is in it
crates/xcl/src/hle/d3d12x/present.rs:HEAP_RANGES(heap →(base, size)),note_heap_range,take_rtv_range,forget_heap; testa_released_descriptor_heaps_rtv_entries_go_with_it(two heaps plus an entry past the released heap's end; fails without the cleanup atthe heap's own entries go).crates/xcl/src/hle/d3d12x/real.rs:note_heap_rangerecords the range for bothCreateDescriptorHeappaths;heap_releasecallspresent::forget_heapwhen the last reference goes.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib present: 7 passed, 0 failedRegression run
main (
c4d37be, clean tree, no local changes):PR (
e267c2a, clean tree, no local changes):Not tested
AI use
XCL-BT-045againstnote_rtv/heap_release, wrote the range bookkeeping and test (and confirmed it fails without the cleanup), rebased ontoc4d37be, ran the test suite andscripts/smoke.ps1regression runs with #677's title hashing, and drafted this PR description.@b3IKK on GitHub · 2026-11-24 21:26 UTC · original
Rebased onto
c4d37beand re-ran everything with the current scripts/smoke.ps1 (#677's hashed itle: line): 960 passed, 0 failed, 43 ignored — the run now includes the direct-DXIL per-lane tests that landed on main, which skip on this 32-lane adapter.@futurepro62 on GitHub · 2026-11-24 21:24 UTC · original · edited 2026-11-24 22:04 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
02f3229(on its basec160d86).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 858 passed, 0 failed, 42 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.a_released_descriptor_heaps_rtv_entries_go_with_it.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 859 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipon NVIDIA. Both fail on main7f7e768too, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns their skips into failures.heap_window_out_of_memory_falls_back_to_the_switch_formskips whenXCL_HEAP_WINDOWSis unset (#1651), andshaders::tests::pso_measurement_compiles_an_exact_synthetic_recordskips because Developer Mode is off on this PC (it cannot disable the driver cache). The AMD run does not setXCL_REQUIRE_GPU, so there both just print SKIPPED.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 23:24 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@JJAutoCompare on GitHub · 2026-11-25 03:32 UTC · original
PR #1771 — D3D12.X descriptor-heap RTV cleanup
Tested commit
e267c2aab84871d9adc16ddc9222c4c8946fe4b4from a clean detached checkout. The change records each heap’s CPU descriptor range and removes its tracked render-target view (RTV) entries and their resource references on final heap release.Tested
DoublePrecisionFloatShaderOps=0,d3d12SDKLayers.dllabsent. Rust 1.100.0 (0ef1bc386, 2026-11-09), DXC/DXIL 1.9.2609.5, unoptimized builds with debug info and incremental compilation disabled.cargo build --workspaceandcargo test --workspace --no-runsucceeded outside the GPU lock.cargo test -p xcl --lib hle::d3d12x::present::tests::a_released_descriptor_heaps_rtv_entries_go_with_it -- --exactrecorded 1 passed, 0 failed, 0 ignored, 0 skips. The test verified removal within the heap’s range, preservation of entries at the exclusive end and in another heap, and a repeated cleanup call. It passed again in the full suite.cargo test --workspace --no-fail-fast -- --test-threads=4withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1exited 101. Across 20 result summaries, Cargo recorded 941 passed, 19 failed, 43 ignored. The log contains 25SKIPPEDlines, which represent omitted coverage.The 19 failures comprised 14
CreateComputePipelineStaterejections (0x80070057), four GPU result mismatches (FMA contraction, implicit-LOD sampling, packed VALU, pixel wave reduction), and one test-title dynamic depth-bias check (RSSetDepthBiasX, blue pixel where green was expected).The 25 skip lines comprised 17 for missing wave64, three for refused per-lane DXIL variants, two for the missing debug layer, and one each for tiled-resource tier, unavailable heap windows, and inability to disable the driver cache. Retail sample checks also returned early when their inputs were unset.
Not tested
Live COM resource release through the heap hook, retail-title smoke runs, a
mainbaseline, and other GPU vendors.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 againstpr1771-suite.logand published this report.@thehollowedone on GitHub · 2026-11-25 11:29 UTC · original
Independent Windows run on e267c2a. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
cargo build --offline --locked --workspacepassed.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 960 passed, 0 failed, 43 ignored, with 23 runtime skip notices included in Cargo's pass count.A scratch fixture created two native RTV heaps through the console descriptor-heap handler. The first heap had two views and the second had one. A non-final COM release preserved all three mappings. The first heap's final release removed its two mappings and dropped both resource references while the second heap kept its view and reference. After releasing the second heap, both resources were back at their starting reference counts. Disabling only the heap cleanup call left the first heap's views tracked and failed the assertion.
cargo test --offline --locked -p xcl --lib console_rtv_heap_final_release_drops_only_its_own_views -- --nocapture --test-threads=1passed 1/0/0 with zero skips. This covers the synthetic console RTV path on the native adapter. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the fixture, ran the tests, and drafted this report.@ClosetPie107 on GitHub · 2026-11-25 20:46 UTC · original
Independent AMD RDNA4 / Linux (RADV, native wave64) test report for head
e267c2aab84871d9adc16ddc9222c4c8946fe4b4(merged cleanly ontomain6d12f58).Hardware & environment
experimental-11.0-20261112),vkd3d-protonmasterec207194(3.2.0) +dxil-spirvb540c8a2+ relaxed-vtable patch (-Db_ndebug=true), DXVKv3.1.1-209, DXC1.9.2609.5, Rustx86_64-pc-windows-gnu(debug for tests, release for retail)Unit tests (
XCL_REQUIRE_GPU=wave64,XCL_DXC_DIR,VKD3D_CONFIG=ignore_shared_fence,--test-threads=1 --nocapture)hle::d3d12x::present: 10 passed, 0 failed, 0 ignored (0 skipped; includesa_released_descriptor_heaps_rtv_entries_go_with_it)Combined retail sanity run (
main6d12f58+#2068,#1771,#1740,#1256merged together;XCL_DIRECT_DXIL=1,XCL_TEXTURE_LEVEL_PAGES=1,XCL_PSO_WAIT_MS=50,XCL_SPLIT_MIDLIST_WAIT=0,XCL_COHERENT_MB=1024,VKD3D_CONFIG=ignore_shared_fence,XCL_PSO_PRELOAD=0,XCL_NETWORK=0)exit=0) with 0 crashes and 0 device removals (11.55 GiBpeak VRAM / 0 GTT spill,13.35 GiBpeak RSS,1,800+frames presented,16,442translated draws,4,499dispatches,11,257Opus packets).Not tested
AI use
main, ran the tests and combined retail run under Proton on this machine, 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.