Repository navigation
D3D12.X: fence sparse tile reuse after the last placed-buffer pin - #2531
razormontana wants to merge 1 commit into
Conversation
A decommitted sparse tile can stay pinned after the window unmap is queued. Queue its eventual last unpin for the existing fence retirement path before the tile can enter the free list. Mark the sparse queue and title queues from an allocation or submission, outside the Release callback. Part of xcl-dev#2457 (item 1) and xcl-dev#1773.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Test run on exact head Tested
Regression run (60 s, default settings, a retail title) main: this PR: No crash or device removal; frames 104 % of Not tested
AI use
|
|
Independent AMD RDNA4 (native wave64) verification of exact PR head Tested
(Compare against 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. |
…cl-dev#2531 + xcl-dev#2638) (cherry picked from commit fa5b533156ecdf632edcb1b703c54a16948928bf)
|
Independent desktop NVIDIA verification of PR #2531 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib unpinned_sparse_tiles_wait_for_every_queue_before_reuse -- --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1324 filtered out × 3 (0.00s × 3, 0 skipped) |
cargo test --release -p xcl --lib hle::d3d12x::sparse:: -- --test-threads=1 (3 consecutive runs) |
18 passed; 0 failed; 1 ignored; 1306 filtered out × 3 (1.21s, 1.22s, 1.18s, 0 skipped) |
cargo build --release -p xcl |
Clean build (1m 10s, exit 0, 0 new warnings) |
Paired quiet 60 s retail smoke (title: 29640639)
Exact parent & merge-base (6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):
xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1606 (PresentX 1606)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14004 MB
PR #2531 (6d7f8b9269a1a83f0b1e23805fd3388cdc0c2c44):
xcl-smoke v1
commit: 6d7f8b9269a1a83f0b1e23805fd3388cdc0c2c44
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1583 (PresentX 1583)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14023 MB
Runtime log observations (xcl.log)
9221log lines,0[ERROR]/ device-removal / panic lines.- Final draw/memory telemetry in log:
19525 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14023 MB committed by the process; video memory 6114 MB local, 4686 MB non-local.
Limits of coverage
- Fencing sparse tile reuse after the last placed-buffer pin across every active queue was verified via
unpinned_sparse_tiles_wait_for_every_queue_before_reuse(3/3) andhle::d3d12x::sparse::(18/0/1× 3). - The 60 s retail smoke on
title: 29640639exercises live sparse VRAM allocation (7445 MBsparse) with zero device removals or crashes (frame-count and commit deltas vs. cached parent reflect single-run startup variance, not this PR); heavy multi-minute placed-buffer churn under tight 8 GB VRAM eviction was not separately stressed here.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
I tested the last-pin retirement case on NVIDIA GeForce RTX 5070 12 GB, driver 616.92, Windows 11, at PR head The fixture mapped a native reserved buffer and a sparse window to the same 64 KiB tile. It registered one placed-buffer pin, removed the sparse window mapping, and waited for the sparse queue to finish the unmap. It then gated a separate D3D12 direct queue on a native fence and queued a four-byte
AI use: OpenAI Codex with GPT-6.2 Astra prepared the fixture and ran the test; Codex coordinated and prepared this report. |
D3D12.X: fence sparse tile reuse after the last placed-buffer pin
When a sparse window unmaps a tile still pinned by a placed buffer, the last unpin can put the tile back in the pool before outstanding queue work completes. Defer that return to the existing sparse tile quarantine and take fence marks after the last pin drops. Part of #2457 (item 1), #1773 and #1833.
What is in it
sparse.rsqueues unused tiles at the last unpin. Allocation and submission fence the queued tiles on the sparse and title queues. Pool reuse and retirement continue to use the free list.Tested
6d7f8b9269a1a83f0b1e23805fd3388cdc0c2c44.cargo test -p xcl --lib -j 2 hle::d3d12x::sparse::tests::unpinned_sparse_tiles_wait_for_every_queue_before_reuse -- --exactpassed 1 test with 0 failures, ignored tests or GPU skips.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,424 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
AI use