Skip to content

Release resources held by freed dynamic descriptor slots - #1627

Open
chaseb64 wants to merge 1 commit into
trustno1-coder:mainfrom
chaseb64:fix/dynamic-view-resource-retention
Open

chaseb64 wants to merge 1 commit into
trustno1-coder:mainfrom
chaseb64:fix/dynamic-view-resource-retention

Conversation

@chaseb64

@chaseb64 chaseb64 commented Nov 28, 2026 •

Copy link
Copy Markdown

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 Crash at the first story cutscene's prestream (FBK_STRY000_INTRO): null write at victory-image+0x23cf683, 5 of 5 runs (RTX 2060 6 GB, Linux/Proton) #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 used OpenAI Codex to help investigate, implement, and test this change.

@github-actions github-actions Bot added memory RAM or VRAM use, out of memory, leaks pr-fix Pull request: fixes a bug labels Nov 28, 2026
@github-actions github-actions Bot changed the title [pr-fix][memory] Release resources held by freed dynamic descriptor slots Release resources held by freed dynamic descriptor slots Nov 28, 2026
@chaseb64
chaseb64 marked this pull request as ready for review November 29, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

memory RAM or VRAM use, out of memory, leaks pr-fix Pull request: fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant