fix(gpu): discard pending descriptor flips when a host heap is dropped #265

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

@⁠brainbudt on GitHub · 2026-11-26 13:42 UTC · original
brainbudt:fix/host-heap-unique-id-drop → main · +100 −21 · 1 files · 1 commits · open

Problem

A replacement descriptor heap could inherit pending texture flips from a heap that previously occupied the same address. Processing one of those flips could read a freed descriptor record.

Change

Give each host heap a monotonic 64-bit ID. Use the ID to select its flip queue and deduplicate pending textures. Dropping a heap removes its queue and pending texture keys. A deferred upload or submission callback can only append to a live queue.

Scope

Fixes #232. Confined to crates/victory-gpu/src/descriptor/host.rs and its regression tests.

Verification

  • Both new regressions ran under Windows x64 emulation with CrossOver and D3D12, covering deterministic address reuse, isolated cleanup on drop, late callbacks, and draining only flips whose submission has finished.
  • The full host descriptor suite had 37 passes and 2 pre-existing failures under CrossOver (the unmodified base had 35 passes and the same 2 failures).
  • On Linux x86-64, cargo check --locked -p victory-gpu --tests --target x86_64-pc-windows-msvc passed; Clippy with default and diagnostics features passed (excluding the pre-existing clippy::unnecessary_mut_passed at watch.rs:3626).
  • cargo xtask policy passed for all 265 files; victory-core and victory-formats passed 54 tests (5 ignored).

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 13:42 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/265) `brainbudt:fix/host-heap-unique-id-drop` → `main` · +100 −21 · 1 files · 1 commits · open ## Problem A replacement descriptor heap could inherit pending texture flips from a heap that previously occupied the same address. Processing one of those flips could read a freed descriptor record. ## Change Give each host heap a monotonic 64-bit ID. Use the ID to select its flip queue and deduplicate pending textures. Dropping a heap removes its queue and pending texture keys. A deferred upload or submission callback can only append to a live queue. ## Scope Fixes #232. Confined to `crates/victory-gpu/src/descriptor/host.rs` and its regression tests. ## Verification - Both new regressions ran under Windows x64 emulation with CrossOver and D3D12, covering deterministic address reuse, isolated cleanup on drop, late callbacks, and draining only flips whose submission has finished. - The full host descriptor suite had 37 passes and 2 pre-existing failures under CrossOver (the unmodified base had 35 passes and the same 2 failures). - On Linux x86-64, `cargo check --locked -p victory-gpu --tests --target x86_64-pc-windows-msvc` passed; Clippy with default and `diagnostics` features passed (excluding the pre-existing `clippy::unnecessary_mut_passed` at `watch.rs:3626`). - `cargo xtask policy` passed for all 265 files; `victory-core` and `victory-formats` passed 54 tests (5 ignored). --- 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 13:44:04 +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/265/head:github-bot/gh-265'
git switch 'github-bot/gh-265'

Merge

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