Repository navigation
D3D12.X: reserve split compute scratch before allocating it - #2532
razormontana wants to merge 1 commit into
Conversation
Two concurrent command lists could each request 256 MiB from the same 384 MiB budget before either driver call returned. Charge a request while deciding its size and return the charge when allocation fails or the recording releases the buffer. Keep live and peak measurements limited to successful allocations.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
|
Test run on exact head Tested
Regression run (60 s, default settings, a retail title) main: this PR: No crash or device removal; frames 105 % of Not tested
AI use
|
|
Tested: current PR head merged onto current
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. |
Two command lists could both ask D3D12 for 256 MiB of split-compute scratch under a shared 384 MiB budget. Each recording checked the available space before either driver allocation had returned. XCL now reserves a recording’s allowance when it chooses the buffer size. Part of #1833.
What is in it
real/dispatch_chain.rscovers the allocation in progress and then the buffer’s lifetime. An allocation failure immediately returns the reservation. Live and peak scratch counters still measure successful allocations.mainat6d12f58. D3D12.X: reuse split dispatch scratch when growth fails #2469 covers reusing a recording’s existing buffer after a failed growth request. The two patches conflict inscratch_for, and D3D12.X: reuse split dispatch scratch when growth fails #2469 already has a separate test hunk that overlaps with D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind #2118 onmain.Tested
bb33ceed26be32dba18b4799d0b6396649bed840. The focused admission tests run on the CPU.cargo +stable-x86_64-pc-windows-msvc test --offline --locked -p xcl --lib hle::d3d12x::real::dispatch_chain::tests:: -- --nocapture --test-threads=1 --skip a_list_recorded_after_another_goes_on_in_its_scratch. The original charge-after-allocation behavior with the test seam produced 1 pass and 2 failures. Concurrent recordings each requested 256 MiB and an in-progress 16 MiB allocation counted as zero. After the fix, 3 passed, 0 failed, 0 ignored and 0 runtime skips. The concurrent requests were 256 and 128 MiB.cargo build --offline --locked --workspaceandcargo build --offline --locked --release --workspacesucceeded. The debugcargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputrun withXCL_ADAPTER=3070reported 1,425 passed, 0 failed and 46 ignored across 37 targets. The pass count includes 26SKIPPEDnotices (21 native-wave64 checks, 3 unsupported per-lane forms, 1 reserved cube with mips and 1 heap-window check).Regression run
Both clean release builds ran
scripts/smoke.ps1 -Game <folder> -Seconds 60on the same retail title in the Series S profile on the RTX 3070. They usedXCL_DIRECT_DXIL=1, networking off and identical starting copies of XCL's warmed cache. NVIDIA's driver cache settings were left at their defaults.Main
Candidate
Not tested
Both retail smoke logs reported zero chained dispatches and 0 MiB peak split scratch. The concurrent-admission case is covered by the synthetic test. Retail prevalence, effect on NVIDIA device removals, and behavior on AMD and Intel GPUs remain unmeasured.
AI use
OpenAI Codex (GPT-6.2 Astra) inspected the recording path, wrote the code and tests, ran the focused tests and drafted this description. OpenAI Codex (GPT-6.2 Sol) independently reviewed the diff and evidence and edited this description. The lead agent ran the workspace suite and retail smoke using OpenAI Codex (GPT-6.2).