D3D12.X: reuse split dispatch scratch when growth fails #2469
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!2469
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2469"
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?
@razormontana on GitHub · 2026-11-25 19:39 UTC · original
razormontana:d3d12x/reuse-split-scratch-on-growth-failure→main· +42 −10 · 2 files · 1 commits · openA split compute dispatch can use smaller slabs when a command list’s scratch buffer holds at least one thread group. If allocating a larger buffer failed, XCL discarded that option and built or bound the whole compute pipeline. Reusing the buffer avoids bringing an additional whole pipeline into use on this path. Part of #2403.
What is in it
real/dispatch_chain.rs, reuse the same recording’s scratch after a failed growth request if one group fits. Report reuse to the command recorder so it issues its UAV barrier. Only a successful allocation updates scratch usage and replaces the shared buffer.README.mddescribes when split dispatches can continue with the recording’s existing scratch buffer.Tested
cargo +stable-x86_64-pc-windows-msvc test --offline --locked -p xcl --lib hle::d3d12x::real::dispatch_chain::tests:: -- --nocapture --test-threads=1. With the original selection behavior on base2898511, 1 passed and 1 failed. An injected failure growing from 2 MiB to 8 MiB returned no buffer for a 64 KiB group. On the fixed source, 2 passed, 0 failed, 0 ignored and 0 skipped. The local focused run preceded the README update. Head44a66e6has the identical runtime and test source.cargo build --offline --locked --workspacesucceeded in debug and release. On the exact PR head,cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputreported 1,364 passed, 0 failed and 46 ignored. There were 26 runtimeSKIPPEDnotices for cases Cargo counted as passed.Regression run
Both 60-second release runs used the same retail title on the RTX 3070, the Series S profile, identical starting DXIL cache contents, and
XCL_DIRECT_DXIL=1plusXCL_TEXTURE_LEVEL_PAGES=1. The starting cache was copied from the first main run. The head showed 778 frames at 14,668 MB peak commit. Main showed 773 frames at 14,620 MB. Each completed with zero crashes and device removals.Main
PR head
The first 60-second pair used the original cache seed. The head showed 590 frames at 15,071 MB peak commit. Main showed 795 frames at 14,457 MB. Both completed cleanly, and the head missed the 80% frame gate. Each log recorded zero chained dispatches and peak scratch of 0 MiB.
Not tested
Both retail smoke pairs recorded zero chained dispatches. The CPU test simulates the scratch allocation failure. The effect on shader-code usage during retail world loading remains unmeasured.
The retail smoke covers launcher stability and present counts. World entry was outside the verified coverage.
AI use
Codex (GPT-6.2 Astra) investigated the path, wrote the change and regression test, ran the focused tests and drafted this description.
OpenAI Codex (GPT-6.2) reviewed the change and ran the exact-head workspace suite and paired retail smoke checks.
@DavidM1911 on GitHub · 2026-11-25 20:22 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!
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.