gpu(book): drop Notice on SetPrivateDataInterface failure instead of leaking #3281

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

@⁠RanoGames on GitHub · 2026-11-29 21:16 UTC · original
RanoGames:fix/record-drop-notice-on-attach-fail → main · +0 −1 · 1 files · 1 commits · open

What it changes

Fixes a permanent book-entry leak in crates/victory-gpu/src/book.rs:

  • watch() attaches a COM Notice via SetPrivateDataInterface so release can call Book::remove when the D3D12 object dies.
  • On attach failure the code did std::mem::forget(notice), so the Notice never released and the entry inserted by b.add(...) stayed in the book forever.
  • Drops notice on both success and failure: success leaves the object's AddRef; failure frees the Notice so release() removes the orphaned entry.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (code-verified COM/book cleanup fix)
  • Before: a failed SetPrivateDataInterface leaked the Notice and left a live book entry with no watcher.
  • After: attach failure drops the Notice and clears the book entry through the normal release path.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A
  • cargo test passed for the crates it touches: yes (cargo test --locked -p victory-gpu --lib -- book; cargo xtask policy --staged passed)

Checked for overlap

  • Searched open and closed pull requests for book.rs / SetPrivateDataInterface / mem::forget(notice). Related: #915 (broader mixed PR that also mentions book).
**@⁠RanoGames** on GitHub · 2026-11-29 21:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3281) `RanoGames:fix/record-drop-notice-on-attach-fail` → `main` · +0 −1 · 1 files · 1 commits · open ## What it changes Fixes a permanent book-entry leak in `crates/victory-gpu/src/book.rs`: - `watch()` attaches a COM `Notice` via `SetPrivateDataInterface` so `release` can call `Book::remove` when the D3D12 object dies. - On attach failure the code did `std::mem::forget(notice)`, so the `Notice` never released and the entry inserted by `b.add(...)` stayed in the book forever. - Drops `notice` on both success and failure: success leaves the object's AddRef; failure frees the `Notice` so `release()` removes the orphaned entry. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): N/A (code-verified COM/book cleanup fix) - Before: a failed `SetPrivateDataInterface` leaked the `Notice` and left a live book entry with no watcher. - After: attach failure drops the `Notice` and clears the book entry through the normal release path. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A - `cargo test` passed for the crates it touches: yes (`cargo test --locked -p victory-gpu --lib -- book`; `cargo xtask policy --staged` passed) ## Checked for overlap - [x] Searched open and closed pull requests for `book.rs` / `SetPrivateDataInterface` / `mem::forget(notice)`. Related: #915 (broader mixed PR that also mentions book).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 21:22:05 +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/3281/head:github-bot/gh-3281'
git switch 'github-bot/gh-3281'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3281'
git switch 'github-bot/gh-3281'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3281'
git switch 'github-bot/gh-3281'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3281'
git switch 'main'
git merge --squash 'github-bot/gh-3281'
git switch 'main'
git merge --ff-only 'github-bot/gh-3281'
git switch 'main'
git merge 'github-bot/gh-3281'
git push origin 'main'
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!3281
No description provided.