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
|
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! |
|
Follow-up validation for #1909. I tested the updated PR revision Results:
The additional cross-PR tests exercised submit tracking and allocator-pool cleanup on the same command queue, with and without an outstanding reader reference. Verified behavior includes:
Pending completion was modeled using a native D3D12 fence with CPU signaling, rather than deliberately blocking outstanding GPU work. Integration note: #1691 and #1945 conflict in The retail-title crash remains present on main, both individual PRs, and the combined build. This should be investigated separately and does not invalidate the allocator lifecycle test results. AI assistance: ChatGPT (GPT-6.2). All reported builds and tests were executed on actual Windows hardware. |
|
Test report at the current head
AI-assisted (Claude Code). Synthetic tests only. |
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 (and State.last_submit) 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, completed Backing.marks, and completed State.last_submit entries outside STATE while moving still-pending GPU marks to Backing.retired and clearing last_submit.queue on in-flight entries so queue-address reuse cannot clobber or spoof them, and cover both leak paths with CPU and GPU regression tests. Fixes xcl-dev#1909 Assisted-by: Google Antigravity (Gemini 4 Neon)
f581057 to
ace754c
Compare
|
Rebased onto
AI use: rebased, tested, and drafted with Google Antigravity (Gemini 4 Neon). |
|
Independent Windows run on ace754c. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.
I reran the simulated queue-key reuse check with native D3D12 fences. Releasing the old key left its old list marked in flight and cleared the queue identity from that submission. Finishing the newer native submission kept both the older list in flight and the backing busy. Signaling the old fence cleared both conditions, and the next queue cleanup removed the old submission record. No live work was blocked and no allocator was reset. On the exact revision, Synthetic coverage only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report. |
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.fences(andState.last_submit, added in D3D12.X: a list reset while its last submit runs records on a spare #2163) kept the per-queueID3D12Fenceafter queue release 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.fences, prune completedBacking.marks(moving still-pending GPU marks toBacking.retiredso queue-address reuse cannot overwrite in-flight work before completion), and prune completedState.last_submitentries for the released queue (clearinglast.queue = 0on still-in-flight entries so queue-address reuse cannot reportsame_queueinnote_resubmits, and reaping orphaned completed entries on subsequent releases). Clearretiredon backing reuse intitle_reset_in, drop removed/replaced fences outsideSTATE.lock()inforget_list,forget_queue, andexecuted, clean up the unadopted list and queue ina_recording_outlives_the_reset_of_the_titles_allocatorviaforget_list/forget_queuebefore dropping them so recycled addresses do not inherit stale state across tests, and add CPU (AtomicU64/AtomicU32fake COM fence) 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.fencesandState.last_submitretain released queue's fence), and reproduced the deterministicleft: 4, right: 1test-order failure under--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): 6 passed, 0 failed, 0 ignored each run.-- --test-threads=4 --nocapture(RTX 4060): 6 passed, 0 failed, 0 ignored.XCL_ADAPTER="Microsoft Basic Render Driver"-- --test-threads=1 --nocapture(WARP): 6 passed, 0 failed, 0 ignored.cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1243 passed, 2 pre-existing failures on parent96331383(fixed onmainimmediately after in Tests: two expectations that no longer match the code #2245:gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translatorandhle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa), 46 ignored across 23 test binaries.SKIPPEDlines on stderr (27 total):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)test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state: nod3d12SDKLayers.dll)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
State.last_submitrebase integration, wrote the fix, CPU/GPU regression tests, and this description, and ran the workspace test suite and paired smoke runs on the hardware listed above.