Repository navigation
D3D12.X: forget released command queues from vram::Pages::waited - #1899
emirduran707 wants to merge 1 commit into
Conversation
|
An interaction to watch, from reading the diffs (not run). This PR, #1819 ( On This PR adds AI-assisted (Claude Code). |
…SLATOR_VERSION=10), and xcl-dev#1899 (vram::forget_queue)
|
NVIDIA test report for Tested
Regression run ( base ( this PR: Not tested: the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD. AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it. |
…-dev#1899) `vram::Pages::waited` caches the last tile-mapping fence value each command queue waited on, keyed by the raw `ID3D12CommandQueue` COM pointer. `real::q_release` notified `list_x::on_queue_release` when a queue's refcount reached zero, but left its entry in `vram::Pages::waited`. If a newly created command queue reuses a freed queue's COM pointer while `pages.value` has not advanced, `vram::before_execute` sees the stale entry and skips `queue.Wait(&pages.fence, pages.value)`, allowing the new queue to execute against tiled resources before pending `UpdateTileMappings` complete (and leaking map entries for every destroyed queue). Extract the wait tracker into `FenceWaits`, add `vram::forget_queue`, and call it from `real::q_release` when the queue's refcount reaches zero. Assisted-by: Antigravity (Gemini 4 Neon)
`vram::Pages::waited` caches the last tile-mapping fence value each command queue waited on, keyed by the raw `ID3D12CommandQueue` COM pointer. `real::q_release` notified `list_x::on_queue_release` when a queue's refcount reached zero, but left its entry in `vram::Pages::waited`. If a newly created command queue reuses a freed queue's COM pointer while `pages.value` has not advanced, `vram::before_execute` sees the stale entry and skips `queue.Wait(&pages.fence, pages.value)`, allowing the new queue to execute against tiled resources before pending `UpdateTileMappings` complete (and leaking map entries for every destroyed queue). Extract the wait tracker into `FenceWaits`, add `vram::forget_queue`, and call it from `real::q_release` when the queue's refcount reaches zero. Assisted-by: Antigravity (Gemini 4 Neon)
|
Verification on RTX 3060 Ti (Windows 11): merge conflict with current |
7b493f3 to
9c33650
Compare
vram::Pages::waitedcaches the last tile-mapping fence value each command queue waited on, keyed by the rawID3D12CommandQueueCOM pointer.real::q_releasenotifiedlist_x::on_queue_releasewhen a queue's refcount reached zero, but left its entry invram::Pages::waited.If a newly created command queue reuses a freed queue's COM pointer while
pages.valuehas not advanced,vram::before_executesees the stale entry and skipsqueue.Wait(&pages.fence, pages.value), allowing the new queue to execute against tiled resources before pendingUpdateTileMappingscomplete (and leaking a map entry for every destroyed queue).What is in it
crates/xcl/src/hle/d3d12x/vram.rs: extract the wait tracker intoFenceWaits, addvram::forget_queue, and add unit testreleased_queue_address_rewaits_on_reuse.crates/xcl/src/hle/d3d12x/real.rs: callsuper::vram::forget_queue(this as usize)inq_releasewhen the queue's refcount reaches zero.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on 9c33650 (rebased ontomain2aa2d1a): 1136 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpu;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record)gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) fail identically on unmodifiedmain2aa2d1aon this GPU (seeds 722 and 1599).cargo test -p xcl --lib released_queue_address_rewaits_on_reuse: 1 passed, 0 failedRegression run
main:
this PR:
Not tested
AI use
main2aa2d1a(a conflict incrates/xcl/src/hle/d3d12x/vram.rs; main's newnote_internal_waitcall kept in the rewritten wait) and reran the suite and smoke runs above.