Release resources held by freed dynamic descriptor slots #1627

Manually merged
github merged 1 commit from github-bot/gh-1627 into main 2026-11-29 08:21:52 +00:00 AGit
Owner

@⁠chaseb64 on GitHub · 2026-11-28 22:34 UTC · original
chaseb64:fix/dynamic-view-resource-retention → main · +80 −25 · 4 files · 1 commits · merged 2026-11-29 08:16 UTC

What it changes

Dynamic descriptor slots in the host heap keep strong references to resources they describe. A returned slot holds its last resource until another allocation writes it. Free slots can therefore prevent reclamation of buffers that the game has stopped using.

Take those references when returning slots from completed detached command lists and when resetting or destroying a recording. Retire the references through the existing submission-based retirement queue after dropping the allocator and slot locks. Attached command lists can still be resubmitted, so their returned slots keep their resource references until overwritten.

How it was tested

  • RTX 4070, Windows, Series X at 1440p, DLSS Performance, 2× DLSS frame generation, ray tracing off.
  • Before, a local diagnostic counted up to 218,246 free dynamic slots still holding references during a run through the prison checkpoint and guard route. At most 5.5 MiB of buffer widths in a sample were referenced exclusively by free slots. That count measures D3D12 resource widths. Process-private memory stayed within 29,775–29,907 MiB during the five-minute stationary segment.
  • After, the same diagnostic counted zero free slots holding references in all 10 samples from startup, a 60-second stop at the same checkpoint, and the walk into the guard corridor. The control measured 29,775–29,851 MiB of private memory in its first stationary minute, and the patched run measured 29,384–29,648 MiB. A repeatable process-memory reduction remains unverified.
  • One startup attempt in each group hit the null-write crash reported in #628. The successful patched retry completed the timed smoke test without a GPU device removal.
  • The D3D12 regression confirms that an eligible release clears its resource owner. It covers adjacent and fixed slots, a mismatched heap ID, repeated release, and preservation for attached lists.
  • cargo test --offline --locked --profile diag --features diagnostics -p victory-gpu --lib descriptor:: -- --test-threads=1 passed all 80 selected tests.
  • cargo check --offline --locked --features diagnostics -p victory passed. The asset-policy check reports the same oversized crates/victory-shader/src/emit/lower.rs blob on upstream main and this branch.

Checked for overlap

  • I searched open pull requests and #1138. #1467 changes when slots are returned, #1358 batches returns, and #704 changes the allocator.

I used OpenAI Codex to help investigate, implement, and test this change.

**@⁠chaseb64** on GitHub · 2026-11-28 22:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1627) `chaseb64:fix/dynamic-view-resource-retention` → `main` · +80 −25 · 4 files · 1 commits · merged 2026-11-29 08:16 UTC ## What it changes Dynamic descriptor slots in the host heap keep strong references to resources they describe. A returned slot holds its last resource until another allocation writes it. Free slots can therefore prevent reclamation of buffers that the game has stopped using. Take those references when returning slots from completed detached command lists and when resetting or destroying a recording. Retire the references through the existing submission-based retirement queue after dropping the allocator and slot locks. Attached command lists can still be resubmitted, so their returned slots keep their resource references until overwritten. ## How it was tested - RTX 4070, Windows, Series X at 1440p, DLSS Performance, 2× DLSS frame generation, ray tracing off. - Before, a local diagnostic counted up to 218,246 free dynamic slots still holding references during a run through the prison checkpoint and guard route. At most 5.5 MiB of buffer widths in a sample were referenced exclusively by free slots. That count measures D3D12 resource widths. Process-private memory stayed within 29,775–29,907 MiB during the five-minute stationary segment. - After, the same diagnostic counted zero free slots holding references in all 10 samples from startup, a 60-second stop at the same checkpoint, and the walk into the guard corridor. The control measured 29,775–29,851 MiB of private memory in its first stationary minute, and the patched run measured 29,384–29,648 MiB. A repeatable process-memory reduction remains unverified. - One startup attempt in each group hit the null-write crash reported in #628. The successful patched retry completed the timed smoke test without a GPU device removal. - The D3D12 regression confirms that an eligible release clears its resource owner. It covers adjacent and fixed slots, a mismatched heap ID, repeated release, and preservation for attached lists. - `cargo test --offline --locked --profile diag --features diagnostics -p victory-gpu --lib descriptor:: -- --test-threads=1` passed all 80 selected tests. - `cargo check --offline --locked --features diagnostics -p victory` passed. The asset-policy check reports the same oversized `crates/victory-shader/src/emit/lower.rs` blob on upstream main and this branch. ## Checked for overlap - [x] I searched open pull requests and #1138. #1467 changes when slots are returned, #1358 batches returns, and #704 changes the allocator. I used OpenAI Codex to help investigate, implement, and test this change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 22:35:43 +00:00
github-bot referenced this pull request from a commit 2026-11-29 08:20:38 +00:00
github manually merged commit e3d6f60f37 into main 2026-11-29 08:21:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1627
No description provided.