Release resources held by freed dynamic descriptor slots #1627

Merged
chaseb64 merged 1 commit from upstream-pr/1627 into main 2026-11-29 08:16:55 +00:00
chaseb64 commented 2026-11-28 22:34:40 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by chaseb64 on 2026-11-28T22:34:40Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5545239040 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1627). Originally posted by [chaseb64](https://github.com/chaseb64) on 2026-11-28T22:34:40Z. --- ## 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.
Sign in to join this conversation.
No reviewers
No labels
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.

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