D3D12.X: track split and created lists on alloc_pool's active backing #1063
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1071"
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?
Imported from ivall/xcl. Originally posted by ChalanaGimhanaX on 2026-11-24T11:16:07Z.
When a command allocator is swapped out by
alloc_poolwhile an earlier command list still holds an active recording (or has not finished on the GPU), follow-on list/allocator paths could still touch the stale backing or lose track of live recordings on spares:list_x::split,list_x::deferred_segment): creating a new PC command list segment resolvedalloc_pool::current(...)for the nativeCreateCommandListcall, but never registered the newly created PC segment withalloc_pool(created_on_backing), leaving the active backing unpinned for that segment.list_x::clear_segment_state): resetting a wrapper moves extra split segments and retired stand-in lists intotitle_list's spare pool without dropping their backing pin inalloc_pool, holding allocator spares pinned until process shutdown. At the same time, retiring a segment into spares must preservelast_submit/recordingssoalloc_pool::in_flight(#1452) still blockspop_sparefrom reusing a list whose GPU work has not finished yet.device_x::create_list,list_x::reset_stand_in):create_listpassed the raw titleallocinstead of resolvingpc_alloc = alloc_pool::current(alloc), creating new lists onto a retired busy allocator;reset_stand_inpassedpc_allocas both title allocator and backing toon_create, inserting the substitute backing intos.typesinstead of keyings.typesonalloc.real::cl_reset):ID3D12GraphicsCommandList::Resetbypassedalloc_pool::reset_list, both failing to redirect the titleallocatortocurrent(allocator)and failing to movethisonto the resolved PC backing inalloc_pool.What is in it
crates/xcl/src/hle/d3d12x/alloc_pool.rs: addcreated_on_backing(list, title_alloc, pc_alloc, ty)(keeping therecordingsincrement and gatingcreated_onunder#[cfg(test)]); addrelease_recording(list)to unpinof_list/userson retired spare segments while preservinglast_submitandrecordingsforin_flight; add testscl_reset_and_new_list_after_swap_use_active_backing,created_list_after_swap_tracks_active_backing,release_recording_unpins_backing_while_preserving_in_flight, andconcurrent_allocator_reset_and_list_reset_keep_backing_invariants(deterministic barrier-synchronized interleaving + 4-thread concurrent stress test).crates/xcl/src/hle/d3d12x/list_x.rs: addon_create_with_backing(list, alloc, pc_alloc, pso, ty)delegating fromon_create; useon_create_with_backinginreset_stand_in; callalloc_pool::release_recording(list)inclear_segment_state; register newly created split and deferred PC segments insplitanddeferred_segmentviaalloc_pool::created_on_backing(...); add testmid_list_split_tracks_new_segment_in_alloc_pool_and_releases_spare_on_reset.crates/xcl/src/hle/d3d12x/device_x.rs: resolvepc_alloc = alloc_pool::current(alloc)increate_listand pass bothallocandpc_alloctolist_x::on_create_with_backing.crates/xcl/src/hle/d3d12x/real.rs: wrapID3D12GraphicsCommandList::Resetincl_resetwithalloc_pool::reset_list(this as usize, allocator as usize, -1, ...).Tested
ffc3f6conorigin/maine1d84b7:32.0.16.1714), Intel Core i5-10400F (12 threads), 16 GB RAM, Windows 11 Pro Build 26200,rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.8.2502.11(Windows SDK10.0.26100.0), release profile.cargo test --release -p xcl --lib -- alloc_pool::tests mid_list_split_tracks_new_segment_in_alloc_pool_and_releases_spare_on_reset title_list::tests --test-threads=1): 12 passed, 0 failed, 0 ignored.cargo build --release --workspace+cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture): 1,428 passed, 0 failed, 46 ignored across 37 test binaries (26SKIPPEDlines: 21no wave64on 32-lane RTX 3060, 3 per-lane refused f16/f32 forms#1426, 1no heap windows, 1pso_measurement_compiles_an_exact_synthetic_recordrequiring Windows Developer Mode).cargo test --release -p xcl --test e2e -- --test-threads=1: 4 passed, 0 failed.Regression run
Paired 60 s retail smoke runs (
.\scripts\smoke.ps1 -Game <retail> -Seconds 60, release build, same title):main(6d051da):PR head (
ffc3f6c):Not tested
ffc3f6c.XCL_SAMPLE_*unset).AI use
origin/maine1d84b7(includingdeferred_segmentactive-backing registration and the concurrent allocator-reset vs. command-list-reset stress test), ran the full workspace test suite, e2e suite, and 60 s retail smoke run, and updated this description under author review.Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T11:21:12Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@47efa2e(baseline 741 passed, 0 failed, 41 ignored on this box):Three more passing tests than the baseline; tracking split and created lists on the allocator pool ships its coverage and it runs green here.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:11:05Z.
Regression run of
522a3b73on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 100 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:51:29Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:35:16Z.
Review: COMMENTED
No concrete lifetime/synchronization defect found. Current-backing tracking, retired segment pin removal with last_submit retention, and split-created-list tracking look coherent; current CI/smoke evidence is green. GitHub merge state is dirty, so rebase before merge. Nonblocking gap: no explicit concurrent allocator-reset vs command-list-reset stress case.
Imported from ivall/xcl. Originally posted by ChalanaGimhanaX on 2026-11-25T21:58:25Z.
@bmjask Thanks for the review! Rebased onto current \main\ (\
e1d84b7, new head \fc3f6c), extended \created_on_backing\ to the newly merged \deferred_segment\ path in \list_x.rs, and added \concurrent_allocator_reset_and_list_reset_keep_backing_invariants\ in \lloc_pool.rs\ (covering both a barrier-synchronizedeset_list\ vs. \ itle_reset_in\ swap interleaving and a 4-thread concurrent stress loop). Re-verified full release workspace tests (1,428 passed, 0 failed), \e2e\ (4/4), and a 60 s retail smoke run (1,514 frames, 0 crashes/removals).
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:40:54Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T06:08:31Z.
Two contributors checked independently and found that #1453 #2707 #2936 solves the same problem in a different way: #1607, group D147. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:45:00Z.
Triage (#1607) – head
ffc3f6cMost of this is on main now.
680ea612creates title lists onalloc_pool::current(alloc)and records them on that backing (list_x::on_create_with_backing).31930d85addsalloc_pool::retire_recording, the same asrelease_recordinghere, called for retired split segments. Main's mid-list split no longer records new segments on the title's backing:reserve_closed_segmentmakes them closed on a private allocator, so thecreated_on_backingcalls insplit/deferred_segmenthave no counterpart left.What main does not have is the
real.rs:cl_resetredirect throughalloc_pool::reset_list(ty -1) and the tests. #1453 and #2707 attack the same retired-segment pinning differently.The PR conflicts. It needs a rebase down to the remaining part, with a case that shows the
cl_resetpath matters.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.