D3D12.X: clear rebind state, raise scratch pool cap, name UAV scratch for DRED, and bind active backing on CreateCommandList #2738
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!2738
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2738"
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?
@Saksukella on GitHub · 2026-11-26 09:22 UTC · original
Saksukella:fix/bind-rebind-scratch-pool-and-create-list→amd-dev· +194 −17 · 4 files · 3 commits · openWhat is in it
crates/xcl/src/hle/d3d12x/bind.rs:rebind_allocator: unconditionally clear per-recording state reset by nativeReset()(heaps_ensured,pc_abi_gfx,pc_abi_cs,arg_order_clean,inline_guard,prelude_built, prelude scratch/job queues, and scratch slot states back toCOMMON) and retireprelude_ownedontobackingeven whens.allocator == backing, preventing stale descriptor-heap/ABI caches, replayed prelude jobs, and premature prelude teardown afterKickoffXor deferred-segment resets.inherit_for_split: retires.res_bufalongsides.res_retired(matchingbind::reset).pool_keeps: raiseFREE_RESentry count cap from16to256(still bounded byFREE_RES_CAP = 256 MiB) to avoid heavy 1 MiB scratch buffer create/drop churn under multi-allocator frames.default_uav_buffer: attach debug names viareal::name_resource(res.as_raw(), what)whenXCL_DRED=1(real::dred_on()).freed_two_pass_buffers_kept_for_reuse_are_cappedand addrebind_allocator_clears_per_recording_state_even_on_same_backing.crates/xcl/src/hle/d3d12x/device_x.rs&crates/xcl/src/hle/d3d12x/list_x.rs:create_list: resolvelet pc_alloc = super::alloc_pool::current(alloc);forreal::dev_create_command_listand pass both(alloc, pc_alloc)vialist_x::on_create_with_backingsoalloc_pool::created_ontracks the active PC backing whileListState.allocatorkeeps the logical title allocator for future splits/KickoffXresets.amd-dev(whererebind_allocator,default_uav_buffer, andFREE_RESlive).Tested
32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows;rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).cargo test -p xcl --lib hle::d3d12x::bind::tests::freed_two_pass_buffers_kept_for_reuse_are_capped: 1 passed, 0 failed (0.00s).cargo test -p xcl --lib hle::d3d12x::bind::tests::rebind_allocator_clears_per_recording_state_even_on_same_backing: 1 passed, 0 failed (0.00s).Regression run
Not tested
AI use
prelude_guard_dispatch_argsscratch buffers, authoring thebind.rsanddevice_x.rsfixes and unit tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.@luckyteagirl on GitHub · 2026-11-26 09:38 UTC · original · reviewed
On
223ed4d,create_listcorrectly resolves title allocator A to native backing B forCreateCommandList, but then passes B as theallocargument tolist_x::on_create. That stores B asListState.allocator, which later continuation/Kickoff paths use as the logical allocator foralloc_pool::reset_list/current. If A rotates again to C while the initial recording still holds B, those paths look up B rather than A and can continue on the stale backing instead of C.Could the list retain A as its title allocator while separately registering B as its native recording backing? Open PR #1071 already introduces
on_create_with_backing(list, title_alloc, pc_alloc, ...)andcreated_on_backing, so this change may be easiest to coordinate with that branch. A two-rotation test (A→B at create, A→C before continuation) should verify the continuation selects C while the first recording remains pinned to B. This is exact-head source review; I did not run a title or GPU fixture.@emirduran707 on GitHub · 2026-11-26 09:47 UTC · original
Independent AMD RDNA4 (native wave64) verification of commit
223ed4dc80a067de057e3914e6d0704607ee46d8(tested just before the push ofed6c6825) on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC1.9.2602.17).Tested
cargo build --workspace(debug): passed (0errors).cargo test --workspace --no-fail-fast -- --test-threads=4:1657 passed, 14 failed, 47 ignored(5 SKIPPED: 4f16_programs_on_the_gpuper-lane forms refused by host adapter/driver, 1pso_measurement_compiles_an_exact_synthetic_recordWindows Developer Mode off).hle::d3d12x::bind::tests::rebind_allocator_clears_per_recording_state_even_on_same_backingpassed.amd-devbase (#2726on the same base reproduces the exact same 14 failures on this machine).cargo build --release -p xcl+ 60 s retail-title smoke test (scripts/smoke.ps1, offline):Not tested
ed6c6825, NVIDIA / Intel GPUs, Linux / Wine.AI use
@Saksukella on GitHub · 2026-11-26 10:14 UTC · original
Thanks @luckyteagirl —
ed6c6825already introduced list_x::on_create_with_backing(list, title_alloc, pc_alloc, pso, ty) so ListState.allocator keeps the logical title allocator A while lloc_pool::created_on and ind::reset pin the first recording to B. Added the requested two-rotation unit test (created_on_rotated_backing_keeps_title_allocator_across_second_rotation, covering A -> B at create, A -> C before continuation, and verifying ListState.allocator == A, initial recording + ind pinned to B, and continuation selecting C) in20b0ad31(passes cleanly).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.