Repository navigation
Conversation
|
Ran the async-pipeline lifetime tests at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. Results
The new lifetime tests ( What this adds: the author ran these filters on an Ampere RTX 3060; this is a Blackwell wave32 part. No test report from another machine exists in the thread yet. Not tested: the whole AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
8142aa1 to
75726f7
Compare
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
75726f7 to
1029a82
Compare
bmjask
left a comment
There was a problem hiding this comment.
P1: pso_release can misclassify a normal 2->1 release as final and double-release a retained pending stand-in. With late release enabled, real.rs:1721-1734 treats f(this)==1 as final, removes async state, and queues a deferred raw Release. But this PR intentionally AddRefs a bound pending stand-in via Resolved/retained_psos, so title Release commonly changes title+list retention from 2 to 1. The branch then reports zero/forgets state and schedules release of the list-owned ref; when the list resets and drops its retained ID3D12PipelineState, it releases that same ref again. Please retain a separate deferred ref only after proving the caller released the actual last ref, and add a bind/retain -> title Release -> list reset regression.
1029a82 to
5333a9b
Compare
|
Thanks for catching this! Removed the |
|
Two points from reading the diff against
I checked AI use:
The points were checked by the account owner as well (edited to complete this AI use line). |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
luckyteagirl
left a comment
There was a problem hiding this comment.
At head 5333a9b91290a0163e2368bc27e89907c5e4207a, the mid-list split now calls resolve_cached_for_bind(bound_pso, &bound_resolved) (list_x.rs:2855). For a still-tracked compute PSO, that calls resolve_for_bind_retained, which waits for the build (or runs an unclaimed job on the recording thread); the default XCL_PSO_WAIT_MS budget is unbounded. A normal SetPipelineState records the pending PSO in both bind and list_x, and bind::dispatch calls defer specifically so the build is waited for at submit. The split therefore blocks inside Dispatch before defer can return, losing the record-now/wait-at-submit behavior. Could the split use a retained nonwaiting lookup for the continuation's initial PSO, and extend a_dispatch_with_a_pipeline_still_building_waits_at_the_submit through the normal SetPipelineState path? That test currently initializes list_x::bound_pso to zero, so it misses this branch.
This is a source-derived timing review of the exact head; I did not run a native timing reproduction. AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source and drafted this point; I checked the call chain and existing test before posting.
`pso_async::resolve`, `resolve_wait`, and `resolve_for_bind` previously returned unretained raw `ID3D12PipelineState` addresses while `released()` could synchronously drop `real` outside any shared lock with callers or before command list reset and GPU retirement. Synchronize pending pipeline completion, resolution, and stand-in release under `Pending::state`, introduce `Resolved` COM-owning handles across command list creation, reset, binding, draw/dispatch, KickoffX, and `console_list` replay, keep bound resolved pipelines on `bind`/`list_x` state (using nonwaiting `resolve_cached_if_pending` on mid-list split so deferred compute dispatches still wait only at submit) so released stand-ins are not re-dereferenced, and route final stand-in/real COM release (including unadopted COM objects and `pso_release` only when `add(this) == 2` proves the caller released the actual last ref) through `late_release::hold_deferred` until GPU queues pass their fences. Drop unstarted orphaned jobs immediately across `Pending::finish_release` and `drop_unstarted_job`, guard pre-allocated test pipelines against early-orphan drops and worker saturation in `pso_async::used_tests`, clone `present` queue COM references under `QUEUES` in `late_release::drain_known` while purging retired test queue fences, extend `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` to exercise a non-zero `list_x::bound_pso` across mid-list splits, and add bind/retain -> title Release -> list Reset regression coverage in `async_pso_lifetime_tests` (selecting WARP via `XCL_ADAPTER` / `agility::create_device` fallback). Part of xcl-dev#916 Part of xcl-dev#1488 Assisted-by: Antigravity (Gemini 4 Hydrogen)
5333a9b to
1a51cb9
Compare
|
@luckyteagirl Good catch, thanks! Changed |
Retain resolved async pipeline COM references across command list recording, reset, and GPU queue retirement so background-built pipelines cannot be freed while bound or in flight (
XCL-BT-008). Part of #916. Part of #1488.What is in it
Pendingcompletion, state updates, and unstarted/adopted stand-in release underPending::state(Pending::finish_release), return COM-retainingResolvedhandles (resolve_wait_retained,resolve_for_bind_retained,resolve_if_pending,resolve_cached_*including nonwaitingresolve_cached_if_pending) with settled fast-path tracking, and gate adopted stand-in release viatry_release_standin(pso_async.rs)ID3D12PipelineStatereferences on command lists (list_x::ListState::retained_psos,console_list::ListState::retained_psos, and bound-pipeline tracking inbind/list_x) across creation,Reset,ClearState,SetPipelineState,Draw*/Dispatch/ExecuteIndirect,RSSetDepthBiasXrestore/prepare,KickoffX, mid-list split (using nonwaitingresolve_cached_if_pendingso deferred compute dispatches still wait only at submit), andconsole_list::closeuntil reset or releaseadd(this) == 2proves the caller released the actual last ref, removing theelse if f(this) == 1branch so2 -> 1releases stay non-final) and unadopted COM pipeline releases through non-spinninglate_release::hold_deferred, dispatch unadopted COM objects via vtable slot 2 inlate_release::drain_known, and clone queue COM references safely underQUEUES(present::known_queue_refs) while purging retired test queues fromHeld::fences(real.rs,late_release.rs,present.rs,pso_async.rs)UnstartedRealRAII guard), GPU queue retirement (late_release+ stalled queue),standin::shellcommand-list lifetime, pending stand-in bind/retain -> titleRelease(2 -> 1) -> listReset(1 -> 0) regression tests, and extenda_dispatch_with_a_pipeline_still_building_waits_at_the_submitto bind a real still-building stand-in viaSetPipelineStateacross mid-list splits (withXCL_ADAPTER=warp/agility::create_devicefallback and clean skip when no D3D12 adapter is present) inpso_async.rs,late_release.rs,list_x.rs, andreal.rslist_x/bind/console_listand deferred retirement/locking inpso_async/late_release/realform a single COM reference-lifetime invariant across command-list recording, reset, and GPU queue retirement. Landing list-side retention withoutpso_release'sadd(this) == 2guard andtry_release_standinwould misclassify2 -> 1title releases as final (double-releasing or forgetting tracked state while lists still hold refs) or leak retained refs; landingpso_async/late_releasewithout list-sideResolvedretention would leave use-after-free windows while stand-ins or resolved PSOs are bound on open or split command lists.Tested
32.0.15.9144), AMD Ryzen 5 7500F 6-Core Processor, Windows 11 x64 (10.0.26200.0),rustc 1.100.0 (0ef1bc386 2026-11-09), debug and release (rebased ontoupstream/mainb49be1836844, head1a51cb95ebd73348679073a39eaab7f185e6fce6)cargo build --workspace: exited0with 0 new compiler warnings (3 pre-existing warnings inreal.rs,xgameruntime/mod.rs, andvram.rs)cargo test -p xcl --lib pso_async -- --test-threads=1(default RTX 3060):15 passed, 0 failed, 0 ignoredcargo test -p xcl --lib list_x -- --test-threads=1(default RTX 3060):40 passed, 0 failed, 0 ignoredcargo test -p xcl --lib hle::d3d12x -- --test-threads=4(default RTX 3060):260 passed, 0 failed, 2 ignored(0SKIPPEDGPU tests)XCL_ADAPTER=warp cargo test -p xcl --lib pso_async -- --test-threads=1:15 passed, 0 failed, 0 ignoredXCL_ADAPTER=warp cargo test -p xcl --lib list_x -- --test-threads=1:40 passed, 0 failed, 0 ignoredXCL_ADAPTER=warp cargo test -p xcl --lib hle::d3d12x -- --test-threads=1:260 passed, 0 failed, 2 ignored(0SKIPPEDGPU tests)cargo test --workspace --no-fail-fast -- --test-threads=4(default RTX 3060):1440 passed, 1 failed, 47 ignored(26 SKIPPEDGPU tests: 21no wave64, 3 wave32 per-lanerefused, 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_recordrequiring Windows Developer Mode; the 1 failure is the unrelated pre-existinggpu::recomp::tests::gpu_clamp_and_omod_per_instruction)Regression run
main (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7):PR (
1a51cb95ebd73348679073a39eaab7f185e6fce6):Not tested
ShaderCacheControlpaths, Linux / Wine withoutVKD3D_CONFIG=retain_psos, and non-Windows targets (not built / not tested)XCL_SAMPLE_*external shader packs (unset).\scripts\test.ps1pass (unrelated pre-existinggpu::recomp::tests::gpu_clamp_and_omod_per_instructionfailure on RTX 3060)AI use
XCL-BT-008unclaimed via GitHub REST API, authored failing-first and multi-threaded COM lifetime tests, implemented COM reference retention,late_releasesynchronization, and WARP/no-GPU test guards acrossd3d12x, addressed@bmjaskreview feedback (pso_releaseadd(this) == 2check and pending stand-in2 -> 1 -> 0reset regression), addressed@luckyteagirlreview feedback (nonwaitingresolve_cached_if_pendinginlist_x::splitand extendinga_dispatch_with_a_pipeline_still_building_waits_at_the_submitto bind a real stand-in viaSetPipelineState), rebased ontoupstream/mainb49be1836844, and ranhle::d3d12x, WARP, workspace tests, and 60 s smoke runs