D3D12.X: skip repeated exhausted descriptor searches #2545

Open
github-bot wants to merge 1 commit from github-bot/gh-2545 into main AGit
Owner

@⁠jeroenhaentjens on GitHub · 2026-11-25 22:33 UTC · original
jeroenhaentjens:d3d12x/cache-exhausted-descriptor-searches → main · +159 −6 · 1 files · 1 commits · draft

Unmapped descriptor pages repeatedly scan the same fragmented shared pool after allocation fails. Remember the smallest failed request separately for view and sampler pools until a nonzero release; smaller requests still use the existing first-fit allocator.

What is in it

  • One change in console_heap.rs: failure-size caching under the existing pool mutexes, invalidated by both release paths.
  • Four regressions cover repeated failures, smaller requests, coalescing, cursor straddles, independent pools and 8192 operations compared with the uncached allocator. The production-page fixture reduces 256 failed lookups to two searches.
  • Independently implemented around XCL's allocator after investigating Belobug's exhaustion report; no external source imported. Existing capacity and fallback behavior are preserved.

Tested

  • Windows 11 build 26200, Intel i7-9750H, NVIDIA Quadro RTX 3000 (597.06), Rust 1.100.0 MSVC; debug/unoptimized, incremental/debug info disabled, XCL_ADAPTER=nvidia.
  • Clean head 35aaf980394992ca340dc0aa38461ce1daf198cb, based on main e1d84b7: cargo build --workspace --locked passed; cargo test --workspace --locked --no-fail-fast -- --test-threads=4 exited 0: 1427 reported passes, 0 failures, 46 ignored across 37 completed suites.
  • 29 explicit SKIPPED records: 21 native-wave64, 3 unsupported per-lane FP16/conversion, 1 driver-cache control, 3 debug-layer cases, 1 heap-window case. Reported passes include skipped cases; these and absent game-sample inputs are not coverage.
  • cargo test --locked -p xcl --lib hle::d3d12x::console_heap::tests:: -- --test-threads=4 --nocapture: 16 passed, 0 failed/ignored/skipped. Removing only the cache guard makes both repeated-search regressions fail: 14 passed, 2 failed, exit 101.
  • git diff --check passed; independent subagents reviewed allocation invariants, release invalidation and test isolation.

Regression run
Not run: no suitable game package available. Remains draft pending paired main/head scripts/smoke.ps1 runs.

Not tested
Retail descriptor pressure, gameplay/FPS improvement and AMD hardware. The deterministic regressions establish avoided scans and unchanged allocation results, not a measured world-load improvement.

AI use
OpenAI Codex, GPT-6 (exact deployment variant unavailable), with subagents: implementation, tests, independent reviews and the reported local validation.

**@⁠jeroenhaentjens** on GitHub · 2026-11-25 22:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2545) `jeroenhaentjens:d3d12x/cache-exhausted-descriptor-searches` → `main` · +159 −6 · 1 files · 1 commits · draft Unmapped descriptor pages repeatedly scan the same fragmented shared pool after allocation fails. Remember the smallest failed request separately for view and sampler pools until a nonzero release; smaller requests still use the existing first-fit allocator. **What is in it** - One change in `console_heap.rs`: failure-size caching under the existing pool mutexes, invalidated by both release paths. - Four regressions cover repeated failures, smaller requests, coalescing, cursor straddles, independent pools and 8192 operations compared with the uncached allocator. The production-page fixture reduces 256 failed lookups to two searches. - Independently implemented around XCL's allocator after investigating [Belobug's exhaustion report](https://github.com/Belobug/VIctory-Belobug-AMD/commit/788ea4676ec7ddf11ff35ac213afa83d828cfa4c); no external source imported. Existing capacity and fallback behavior are preserved. **Tested** - Windows 11 build 26200, Intel i7-9750H, NVIDIA Quadro RTX 3000 (597.06), Rust 1.100.0 MSVC; debug/unoptimized, incremental/debug info disabled, `XCL_ADAPTER=nvidia`. - Clean head `35aaf980394992ca340dc0aa38461ce1daf198cb`, based on main `e1d84b7`: `cargo build --workspace --locked` passed; `cargo test --workspace --locked --no-fail-fast -- --test-threads=4` exited 0: 1427 reported passes, 0 failures, 46 ignored across 37 completed suites. - 29 explicit `SKIPPED` records: 21 native-wave64, 3 unsupported per-lane FP16/conversion, 1 driver-cache control, 3 debug-layer cases, 1 heap-window case. Reported passes include skipped cases; these and absent game-sample inputs are not coverage. - `cargo test --locked -p xcl --lib hle::d3d12x::console_heap::tests:: -- --test-threads=4 --nocapture`: 16 passed, 0 failed/ignored/skipped. Removing only the cache guard makes both repeated-search regressions fail: 14 passed, 2 failed, exit 101. - `git diff --check` passed; independent subagents reviewed allocation invariants, release invalidation and test isolation. **Regression run** Not run: no suitable game package available. Remains draft pending paired main/head `scripts/smoke.ps1` runs. **Not tested** Retail descriptor pressure, gameplay/FPS improvement and AMD hardware. The deterministic regressions establish avoided scans and unchanged allocation results, not a measured world-load improvement. **AI use** OpenAI Codex, GPT-6 (exact deployment variant unavailable), with subagents: implementation, tests, independent reviews and the reported local validation.
Unmapped pages retry the same fragmented shared allocator on every lookup,
walking both free-range scans again even when no descriptors were released.
Remember the smallest failed request per view/sampler pool until a nonzero
release. Smaller requests retain first-fit behavior and ordinary allocation
cannot make a previously impossible request fit.

Four regressions cover search counts, smaller requests, coalescing, cursor
straddles, independent pool invalidation and 8192 operations compared with
the uncached allocator. The 16 focused tests pass; removing only the cache
guard makes both repeated-search regressions fail (14 pass, 2 fail).

Motivated by cross-project descriptor-exhaustion reports, including:
788ea4676e
Implemented independently around XCL's allocator; no external code imported.
No retail or frame-time improvement is claimed.

Assisted-by: OpenAI Codex (GPT-6; exact deployment variant unavailable)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:33:25 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 22:46 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!

**@⁠DavidM1911** on GitHub · 2026-11-25 22:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2545#issuecomment-7176778915) 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!
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 23:33 UTC · original

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 target x86_64-pc-windows-gnu run 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 runs of the four new range-search tests (cached_range_search_matches_uncached_allocation_and_release_sequences, the two failed_range_search* retry/reuse tests, failed_page_searches_retry_when_their_own_pool_releases_space): 4 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.

**@⁠SlopTart** on GitHub · 2026-11-25 23:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2545#issuecomment-7177728373) **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 target `x86_64-pc-windows-gnu` run 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 runs of the four new range-search tests (`cached_range_search_matches_uncached_allocation_and_release_sequences`, the two `failed_range_search*` retry/reuse tests, `failed_page_searches_retry_when_their_own_pool_releases_space`): 4 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2545/head:github-bot/gh-2545'
git switch 'github-bot/gh-2545'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2545'
git switch 'github-bot/gh-2545'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2545'
git switch 'github-bot/gh-2545'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2545'
git switch 'main'
git merge --squash 'github-bot/gh-2545'
git switch 'main'
git merge --ff-only 'github-bot/gh-2545'
git switch 'main'
git merge 'github-bot/gh-2545'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.