fix(gpu): retire eligible dynamic descriptor resources after fence completion #332

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

@⁠brainbudt on GitHub · 2026-11-26 17:26 UTC · original
brainbudt:fix/retire-dynamic-descriptor-resources → main · +222 −52 · 4 files · 1 commits · open

Problem

Releasing a dynamic descriptor range returns its indices to the allocator while its slots can continue holding D3D12 resources. A synthetic texture retained one extra COM reference after release, preventing the idle texture sweep (which requires a single remaining COM reference) from reclaiming it.

Change

Add opt-in VICTORY_RECLAIM_DYNAMIC=1 to retire explicitly dimensioned texture SRVs and bounded root buffer SRVs/UAVs when their recording is destroyed (replayable recordings keep their reservations until reset or discard). Reclamation checks the direct queue's actual completed fence value via a read-only Host accessor, writes a matching null descriptor, clears any raw twin, and transfers the resource to deferred retirement before publishing the slot for reuse. Unconfirmed fences or unavailable staging slots preserve the defensive hold.

Scope

Addresses #266. Defaults to off; gameplay VRAM impact remains to be measured on hardware.

Verification

  • Windows MSVC workspace cargo check --tests passed (including victory-gpu with diagnostics); cargo xtask policy passed for all 265 files.
  • Both new D3D12 tests passed under Windows x64 CrossOver across 4 configurations (default, opt-in reclaim, deferred retirement, disabled staging) plus both existing dynamic allocator regressions.
  • Real D3D12 queue-fence wait/signal probe verified that destroying a recording preserves the COM reference while pending and releases it after completion.

Reviewed with mistral-loop: APPROVE (2 rounds, mistral-large-4-0 + deepseek-v4-1-flash-1017).
Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).

**@⁠brainbudt** on GitHub · 2026-11-26 17:26 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/332) `brainbudt:fix/retire-dynamic-descriptor-resources` → `main` · +222 −52 · 4 files · 1 commits · open ## Problem Releasing a dynamic descriptor range returns its indices to the allocator while its slots can continue holding D3D12 resources. A synthetic texture retained one extra COM reference after release, preventing the idle texture sweep (which requires a single remaining COM reference) from reclaiming it. ## Change Add opt-in `VICTORY_RECLAIM_DYNAMIC=1` to retire explicitly dimensioned texture SRVs and bounded root buffer SRVs/UAVs when their recording is destroyed (replayable recordings keep their reservations until reset or discard). Reclamation checks the direct queue's actual completed fence value via a read-only `Host` accessor, writes a matching null descriptor, clears any raw twin, and transfers the resource to deferred retirement before publishing the slot for reuse. Unconfirmed fences or unavailable staging slots preserve the defensive hold. ## Scope Addresses #266. Defaults to off; gameplay VRAM impact remains to be measured on hardware. ## Verification - Windows MSVC workspace `cargo check --tests` passed (including `victory-gpu` with `diagnostics`); `cargo xtask policy` passed for all 265 files. - Both new D3D12 tests passed under Windows x64 CrossOver across 4 configurations (default, opt-in reclaim, deferred retirement, disabled staging) plus both existing dynamic allocator regressions. - Real D3D12 queue-fence wait/signal probe verified that destroying a recording preserves the COM reference while pending and releases it after completion. --- Reviewed with mistral-loop: APPROVE (2 rounds, `mistral-large-4-0` + `deepseek-v4-1-flash-1017`). Created with gpt-6.2-astra in Codex (orchestrated with Gemini 4 Neon in T3 Code).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:28:40 +00:00
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/332/head:github-bot/gh-332'
git switch 'github-bot/gh-332'

Merge

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