Repository navigation
Conversation
|
Independent validation — PASS Tested exact commit
I also checked three-way merge compatibility with #1691 ( When integrating both PRs, allocator-pool cleanup needs to be preserved on both final-release paths introduced by #1691. I have a prepared three-cycle synthetic workload with D3D12 live-object reporting that can validate the combined fix once this integration is resolved. Thanks for addressing #1909! AI assistance: ChatGPT (GPT-6.2). Synthetic tests only. |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Heads-up from reading the diff (not run): The other point is when that branch runs. On AI-assisted (Claude Code). |
|
Code review on
Remaining before merge: |
|
CI update on
|
Internal per-queue fences created in alloc_pool::executed leaked with Refcount: 2 across released command queues for two compounding reasons: 1. Calling ID3D12Device::CreateFence on the adopted title device went through real::dev_create_fence, which permanently AddRef'd the fence into real::FENCES (alloc_pool never waits on these fences, so end_title does not need them). 2. alloc_pool::State.fences retained each queue's ID3D12Fence forever because real::q_release never notified alloc_pool on final release. Bypass dev_create_fence with real::create_pc_fence (invoking the original native CreateFence on adopted devices), add alloc_pool::forget_queue called from real::q_release when n == 0 to drop State.fences and completed Backing.marks while moving still-pending GPU marks to Backing.retired so queue-address reuse cannot clobber them, and cover both leak paths with CPU and GPU regression tests. Fixes xcl-dev#1909 Assisted-by: Google Antigravity (Gemini 4 Neon)
907cf34 to
f581057
Compare
|
@raylitebull Found and fixed the exact cause of the
Ready for CI re-run! AI use: Google Antigravity (Gemini 4 Neon). |
|
Independent validation of
Total: 35/35 passed. The exact upstream revision was tested without source modifications. The updated test cleanup appears stable in these runs. However, passing repeated tests does not establish the absence of data races or resolve the separate Testing and report analysis assisted by ChatGPT (GPT-6.2). |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Stops allocator-pool internal fences from leaking with
Refcount: 2across released command queues.Two compounding paths kept every fence created in
alloc_pool::executedalive after its command queue hit finalRelease:d.CreateFenceon the adopted title device went throughreal::dev_create_fence, which permanentlyAddRefd the fence intoreal::FENCES(alloc_poolonly signals and polls these internal fences and never waits on them, soend_titledoes not need them).alloc_pool::State.fenceskept the per-queueID3D12Fenceforever becausereal::q_releasenever notifiedalloc_poolwhen a queue's refcount reached zero.Fixes #1909
What is in it
crates/xcl/src/hle/d3d12x/real.rs: addcreate_pc_fencecalling the nativeCreateFenceslot viaorig_fnon adopted devices (falling back todev.CreateFenceon unhooked test devices), notifyalloc_pool::forget_queueinq_releasewhenn == 0, and exposeis_fenceaspub(super)for testing.crates/xcl/src/hle/d3d12x/alloc_pool.rs: usereal::create_pc_fenceinexecuted, addforget_queueto removeState.fencesand prune completedBacking.markswhile moving still-pending GPU marks toBacking.retired(so queue-address reuse cannot overwrite in-flight work before completion), clearretiredon backing reuse intitle_reset_in, drop removed/reaped fences outsideSTATE.lock()inforget_queueandexecuted, clean up the unadopted queue ina_recording_outlives_the_reset_of_the_titles_allocatorviaforget_queuebefore dropping it so recycled queue addresses do not inherit staleSTATE.fencesentries across tests, and add CPU and GPU regression tests (forget_queue_prunes_completed_and_preserves_pending_across_address_reuseandreleased_queue_frees_alloc_pool_fence_and_skips_title_fences).Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5; release build.released_queue_frees_alloc_pool_fence_and_skips_title_fencesfails independently withoutcreate_pc_fence(fence registered inreal::FENCES) and withoutq_release→alloc_pool::forget_queue(State.fencesretains released queue), and reproduced the deterministicleft: 4, right: 1test-order failure atalloc_pool.rs:646under--test-threads=1before addingforget_queuecleanup toa_recording_outlives_the_reset_of_the_titles_allocator.cargo test --release -p xcl --lib hle::d3d12x::alloc_pool::tests:-- --test-threads=1 --nocapture(3 consecutive runs, RTX 4060): 5 passed, 0 failed, 0 ignored each run.-- --test-threads=4 --nocapture(RTX 4060): 5 passed, 0 failed, 0 ignored.XCL_ADAPTER="Microsoft Basic Render Driver"-- --test-threads=1 --nocapture(WARP): 5 passed, 0 failed, 0 ignored.cargo build --release --workspace+cargo test --release --workspace -- --test-threads=4: 1113 passed, 0 failed, 46 ignored across 20 test binaries.SKIPPEDlines on stderr (25 total; D3D12 debug-layer tests also skip withoutd3d12SDKLayers.dll):no wave64(gpu::recomp::lower::tests(4),gpu::recomp::lower_dxil::tests(14),gpu::recomp::tests(2))#1426refusals (gpu::recomp::lower_dxil::tests:f16_programs_on_the_gpu(2),f32_programs_on_the_gpu(1))shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(cannot disable driver cache without Windows Developer Mode)heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
main:
this PR:
Not tested
d3d12SDKLayers.dllis not installed on this machine), debug-profile full workspace test run, or stacked on top of open#1691's queue-retention fix across multi-cycle synthetic copy workloads; the smoke run above is a regression check only.AI use