D3D12.X: clear dispatch_chain shared scratch on list lifecycle transitions #2533
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2543"
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 ramon-victor on 2026-11-25T22:25:04Z.
Clears
dispatch_chain::SHAREDentries when command lists are created, released, recycled as split segments, or reset/closed viaconsole_list, preventing a new recording from reusing an in-flight recording's split-dispatch scratch buffer.Previously
real::dispatch_chain::list_resetwas called only fromlist_x::reset_copy_scratch, never fromlist_x::on_create,list_x::on_release,list_x::clear_segment_state, orconsole_list(create_with_allocator,cl_reset,cl_release,close). When a command list recording split compute dispatches on allocatorAwas submitted and released while in flight, a newly created command list reusing the same pointer onA(or a recycledWait64split segment or reset console list) matchedSHARED[list]and reused the active scratch buffer without synchronization.Part of #2459 (specifically item 1; item 2 is tracked separately by #2333/#2519).
What is in it
crates/xcl/src/hle/d3d12x/list_x.rs: callsuper::real::dispatch_chain::list_resetinon_create,on_release, andclear_segment_statealongsidetitle_textures::list_reset.crates/xcl/src/hle/d3d12x/console_list.rs: callsuper::real::dispatch_chain::list_resetfor the backing PC list increate_with_allocator,cl_reset,cl_release, andclose.crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs: addtests::list_lifecycle_transitions_clear_shared_scratchverifying thatlist_x::on_release,list_x::on_create,list_x::clear_segment_state, andconsole_listReset/Releaseall clearSHAREDso subsequentscratch_forcalls allocate a fresh scratch buffer.Tested
621.24, wave32), AMD Ryzen 7 5700X, 32 GiB RAM, Windows 11 Pro (26300),rustc 1.99.0(x86_64-pc-windows-msvc), DXC/DXIL1.8.2502.11(Windows SDK10.0.26100.0).cargo test -p xcl --lib list_lifecycle_transitions_clear_shared_scratch -- --nocapturefailed (0 passed, 1 failed:on_release must clear shared dispatch scratch).cargo test -p xcl --lib hle::d3d12x::real::dispatch_chain::tests -- --test-threads=1:3 passed, 0 failed, 0 ignored..\scripts\test.ps1, debug):1424 passed, 0 failed, 46 ignored(skipped on this adapter: wave64-only GPU tests, unsupported per-lane semantics variants,no heap windows).cargo build --release -p xcl) and clean 60 s retail smoke run (.\scripts\smoke.ps1).Regression run
Baseline (
main):PR (
12141cc):Not tested
list_lifecycle_transitions_clear_shared_scratch).AI use
dispatch_chain::list_resetacross the missing command-list and console-list lifecycle hooks with a failing-first test, ran.\scripts\test.ps1, release build, and the 60 ssmoke.ps1run, and drafted this PR description.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T22:32:07Z.
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 xpatfussy69x on 2026-11-25T22:40:46Z.
Test run on exact head
12141cc(12141ccbfa162b7e169d913a20c1b7e3fd1bf1dd, on its basee1d84b7), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib list_lifecycle: 1 passed, 0 failedlist_lifecycle_transitions_clear_shared_scratch: okcrates/xcl/src/hle/d3d12x/real/dispatch_chain.rs(git merge-treeof both heads); whichever lands second needs a rebaseRegression run (60 s, default settings, a retail title)
main:
this PR:
No crash or device removal; frames 104 % of
main's, peak commit 100 %.Not tested
main(tested on its own base; it merges intoe1d84b7without conflicts)AI use
Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T22:42:01Z.
AMD run (listed as untested; the reports above are NVIDIA): the new test passes on an RX 9070 XT.
Head
12141ccapplied onmaine1d84b7, debug, Windows 11 Pro 26200, RX 9070 XT (RDNA4, driver 32.0.32029.2010):cargo test -p xcl --lib -- list_lifecycle_transitions_clear_shared_scratch --nocapture: 1 passed, 0 failed, no SKIPPED.D3D12CreateDevice(None, ..)), which is the RX 9070 XT here, so they ran on the AMD driver, not WARP.Not tested: the whole suite with this PR, Intel, a title.
AI use: Claude Code (Claude Opus 5.5) ran the test on this machine and wrote this report.
Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T22:52:03Z.
Independent AMD RDNA4 (native wave64) verification of exact PR head
12141ccbfa162b7e169d913a20c1b7e3fd1bf1ddon 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:1422 passed, 2 failed, 46 ignored(8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1heap_window_out_of_memory_falls_back_to_the_switch_formno heap windows, 1pso_measurement_compiles_an_exact_synthetic_recordWindows Developer Mode off).hle::d3d12x::real::dispatch_chain::tests::list_lifecycle_transitions_clear_shared_scratchpassed.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1andfuzz_validate_and_gpu_3) are pre-existing on unmodifiedmainon this RX 9060 XT / driver32.0.31044.16.cargo build --release -p xcl+ 60 s retail-title smoke test (scripts/smoke.ps1, offline):(Compare against
main68a284aon this machine:1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)Not tested
AI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T23:24:56Z.
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (cold cache): 165 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of
list_lifecycle_transitions_clear_shared_scratch: passed.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T01:41:59Z.
Independent desktop NVIDIA verification of PR #2543 at head
12141ccbfa162b7e169d913a20c1b7e3fd1bf1dd(1commit; exact parent & merge-base:e1d84b7d9153f86a97d2ec5d209d196046fc0bea, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
12141ccb)cargo test --release -p xcl --lib list_lifecycle_transitions_clear_shared_scratch -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1324 filtered out× 3 (0.27s,0.19s,0.19s,0skipped — live D3D12 execution on RTX 4060)cargo test --release -p xcl --lib hle::d3d12x::real::dispatch_chain:: -- --test-threads=1(3 consecutive runs)3 passed; 0 failed; 0 ignored; 1322 filtered out× 3 (0.33s× 3,0skipped)cargo test --release -p xcl --lib hle::d3d12x::list_x:: -- --test-threads=1(3 consecutive runs)40 passed; 0 failed; 0 ignored; 1285 filtered out× 3 (1.16s,1.14s,1.14s,0skipped)cargo build --release -p xcl1m 08s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
e1d84b7d9153f86a97d2ec5d209d196046fc0bea, cached baseline on the same machine):PR #2543 (
12141ccbfa162b7e169d913a20c1b7e3fd1bf1dd):Runtime log observations (
xcl.log)9220log lines,0[ERROR]/ device-removal / panic lines.19477 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13979 MB committed by the process; video memory 6115 MB local, 4651 MB non-local.Limits of coverage
dispatch_chainshared scratch across command-list lifecycle transitions was exercised directly on desktop D3D12 / RTX 4060 vialist_lifecycle_transitions_clear_shared_scratch(3/3,0skipped),hle::d3d12x::real::dispatch_chain::(3/3× 3), andhle::d3d12x::list_x::(40/40× 3).title: 29640639confirms zero runtime regression across normal list recording/reset/release cycles (frame-count delta vs. cached parent reflects single-run startup variance, not this PR).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T21:49:15Z.
merge-check claim
head:
12141ccbfaImported from ivall/xcl. Originally posted by throny on 2026-11-27T22:11:27Z.
merge-check
base:
2c717a04head:
12141ccbfamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored
review: none. It only adds dispatch_chain::list_reset calls at list create, release and reset; the lock order (list table, then the shared scratch) is the one main already uses on close. The test fails on main by reading the code. No conflict in meaning with #2333 (the scratch stays keyed by list and allocator) or #2936 (parked spares are already cleared on reuse). A textual conflict with #2532 in dispatch_chain.rs is reported in the thread.
performance: one map remove under a mutex per list create, release or reset (reasoned).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:12:20Z.
merge-check claim
head:
12141ccbfaImported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:51:08Z.
merge-check
base:
2c717a043chead:
12141ccbfamerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 6 other PRs' suites, in one queued job.
review: none. Whole diff read (console_list.rs release / reset / create / close, list_x.rs on_create / on_release / clear_segment_state, dispatch_chain.rs test). dispatch_chain::list_reset now clears a list's shared dispatch scratch at every point where its recording starts or ends, so a list reset, recreated at the same address, or recycled as a spare no longer reuses scratch an in-flight recording still owns (the Recording entries keep it alive per allocator).
performance: reasoned, not measured: one SHARED lock per list create / reset / close / release; a new recording allocates its first scratch again.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 79ffc1b863455fd8c9dc0808d480ade29fc1c687 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:19:55Z.
Triage (#1607) – head
12141ccPart of this is already on main:
be9d4057(reuse indirect commands within one recording list) callsdispatch_chain::list_resetinlist_x::on_create_with_backingandon_release. The other calls are not on main and still add something:clear_segment_state, andconsole_listcreate/Reset/Release/close. No open PR does those; #2532 touches the same file for the scratch budget.After a rebase, drop the two now-duplicate
list_xcalls; test parts 1 and 2 then only re-check main's behaviour.The branch conflicts with main.
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.