Skip to content

GPU: Graceful degradation and dynamic recycling for descriptor heaps exceeding 1,000,000 slots - #2189

Open
Xvania7 wants to merge 3 commits into
Marvisak:mainfrom
Xvania7:fix/issue-887-descriptor-heap-limit
Open

Xvania7 wants to merge 3 commits into
Marvisak:mainfrom
Xvania7:fix/issue-887-descriptor-heap-limit

Conversation

@Xvania7

@Xvania7 Xvania7 commented Nov 25, 2026

Copy link
Copy Markdown

Fixes #887 (supersedes tracking issue #902; related to #871, #876, #562).

Summary

  • Multi-tiered Heap Fallback (crates/victory-gpu/src/descriptor/host.rs): When requested views + dynamic headroom exceed PORTABLE_VIEWS (1,000,000) or heap creation fails, gracefully steps down through [PORTABLE_VIEWS, 500_000, 250_000, MIN_DYNAMIC] with 131_072 dynamic slots on capped 1M heaps.
  • Cursor Wraparound & Lifetime-Safe Allocation (descriptor/host.rs, draw.rs): Fixes free-span search across the ring cursor and keeps occupied dynamic slots strictly reserved until owning command lists release them (incorporating @andrewpozdnakov7-jpg's lifetime fix 280d033 + @MichaelSmithAI's review feedback).
  • Safe Out-of-Bounds Mirroring (HostHeap::mirror): Recovers and returns the underlying title View when index >= self.count so resource transitions and barriers continue cleanly.

Verification

@Xvania7
Xvania7 force-pushed the fix/issue-887-descriptor-heap-limit branch from 77d9f68 to 1df7823 Compare November 25, 2026 07:38

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Graceful degradation + dynamic recycling for descriptors — resource-exhaustion handling; relates to #2099's bounded view table.

@MamaLeVrai

Copy link
Copy Markdown

Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head 7e1292d6 into main 940d32f in a throwaway tree (no conflict). cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with --all-features: clean. cargo test --workspace --locked: 704 passed, 0 failed, 10 ignored, two runs (main alone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.

AI-assisted (Claude Code); no game data.

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.

Test report: Win10 19045 + RTX 5060 — #876 clears the black screen, then the descriptor heap caps at count=124518

4 participants