D3D12.X: track split and created lists on alloc_pool's active backing #1071
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1071
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@ChalanaGimhanaX on GitHub · 2026-11-24 11:16 UTC · original
ChalanaGimhanaX:d3d12x/alloc-pool-split-and-create→main· +429 −21 · 4 files · 1 commits · openWhen 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.@dcastell1 on GitHub · 2026-11-24 11:21 UTC · original
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.
@Toons29 on GitHub · 2026-11-25 03:11 UTC · original
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.@DavidM1911 on GitHub · 2026-11-25 08:51 UTC · original
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!
@ChalanaGimhanaX on GitHub · 2026-11-25 21:58 UTC · original
@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).
@DavidM1911 on GitHub · 2026-11-26 03:40 UTC · original
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
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.