Skip to content

D3D12.X: skip repeated exhausted descriptor searches - #2545

Draft
jeroenhaentjens wants to merge 1 commit into
xcl-dev:mainfrom
jeroenhaentjens:d3d12x/cache-exhausted-descriptor-searches
Draft

jeroenhaentjens wants to merge 1 commit into
xcl-dev:mainfrom
jeroenhaentjens:d3d12x/cache-exhausted-descriptor-searches

Conversation

@jeroenhaentjens

Copy link
Copy Markdown
Contributor

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.

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:
Belobug/VIctory-Belobug-AMD@788ea46
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)
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@SlopTart

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants