fix(gpu/descriptor): purge deferred upload queues on HostHeap drop (#282) #376

Manually merged
github merged 1 commit from github-bot/gh-376 into gh-pr/376/base 2026-12-03 08:03:13 +00:00 AGit
Owner

@⁠RUIZ-Enrique-25002136 on GitHub · 2026-12-03 07:51 UTC · original
RUIZ-Enrique-25002136:fix/descriptor-heap-drop-purge → main · +99 −0 · 1 files · 1 commits · merged 2026-12-03 08:02 UTC

Summary

Purges deferred upload/flip entries (UPLOAD_WAITS, PENDING_LIST_FLIPS, FLIPS, NEW_PENDING) when a HostHeap is dropped, preventing lingering Arc<HostTexture> references or address-reuse aliasing across destroyed shader-visible descriptor heaps.

Addresses #282 (Pass #7 [P2] #4).

Changes

  • crates/victory-gpu/src/descriptor/host.rs:
    • Added purge_pending_for_heap(heap: usize) clearing entries keyed by heap across UPLOAD_WAITS (dropping removed Arc<HostTexture> outside the lock), PENDING_LIST_FLIPS (updating PENDING_LIST_COUNT), FLIPS, and NEW_PENDING.
    • Implemented Drop for HostHeap calling purge_pending_for_heap(std::ptr::from_ref(self) as usize).
    • Added unit test purge_pending_for_heap_clears_target_heap_entries_only.

Rig Specs Tested On

  • CPU: Linux workstation (x86_64)
  • GPU & VRAM: N/A (Windows-only victory-gpu crate; full clippy & tests verified on GitHub Actions windows-latest CI)
  • System RAM: N/A
  • OS & GPU Driver: Linux (x86_64) — Windows x86_64-pc-windows-msvc CI verifies compilation, clippy, and unit tests

Run Settings & Profile

  • Build & Commit SHA: rebased on origin/main
  • Console Profile & Internal Resolution / Scale: N/A
  • Ray Tracing: N/A
  • Upscaling: N/A
  • Frame Generation: N/A
  • Launcher Command / Preset & Extra VICTORY_* Overrides: N/A
  • Scene / Area & Session Length: N/A

Measurements & Verification

  • Base FPS (without Frame Gen): N/A
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: N/A
  • Crashes / DRED Resets: N/A
  • Automated Checks:
    • cargo clippy --workspace --all-targets --locked -- -D warnings (verified on GitHub Actions windows-latest CI)
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (verified on GitHub Actions windows-latest CI)
    • cargo test --locked -p xtask -> 8 passed, 0 failed
    • cargo xtask policy -> asset policy: 349 files ok
    • cargo test -p victory-gpu --locked -- --test-threads=1 (verified on GitHub Actions windows-latest CI)
**@⁠RUIZ-Enrique-25002136** on GitHub · 2026-12-03 07:51 UTC · [original](https://github.com/Androtim/MiniVI/pull/376) `RUIZ-Enrique-25002136:fix/descriptor-heap-drop-purge` → `main` · +99 −0 · 1 files · 1 commits · merged 2026-12-03 08:02 UTC ## Summary Purges deferred upload/flip entries (`UPLOAD_WAITS`, `PENDING_LIST_FLIPS`, `FLIPS`, `NEW_PENDING`) when a `HostHeap` is dropped, preventing lingering `Arc<HostTexture>` references or address-reuse aliasing across destroyed shader-visible descriptor heaps. Addresses #282 (Pass #7 `[P2]` #4). ### Changes - **`crates/victory-gpu/src/descriptor/host.rs`:** - Added `purge_pending_for_heap(heap: usize)` clearing entries keyed by `heap` across `UPLOAD_WAITS` (dropping removed `Arc<HostTexture>` outside the lock), `PENDING_LIST_FLIPS` (updating `PENDING_LIST_COUNT`), `FLIPS`, and `NEW_PENDING`. - Implemented `Drop for HostHeap` calling `purge_pending_for_heap(std::ptr::from_ref(self) as usize)`. - Added unit test `purge_pending_for_heap_clears_target_heap_entries_only`. ## Rig Specs Tested On - **CPU:** Linux workstation (`x86_64`) - **GPU & VRAM:** N/A (Windows-only `victory-gpu` crate; full clippy & tests verified on GitHub Actions `windows-latest` CI) - **System RAM:** N/A - **OS & GPU Driver:** Linux (`x86_64`) — Windows `x86_64-pc-windows-msvc` CI verifies compilation, clippy, and unit tests ## Run Settings & Profile - **Build & Commit SHA:** rebased on `origin/main` - **Console Profile & Internal Resolution / Scale:** N/A - **Ray Tracing:** N/A - **Upscaling:** N/A - **Frame Generation:** N/A - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** N/A - **Scene / Area & Session Length:** N/A ## Measurements & Verification - **Base FPS (without Frame Gen):** N/A - **Frame-Gen FPS (if enabled):** N/A - **VRAM / RAM Usage:** N/A - **Crashes / DRED Resets:** N/A - **Automated Checks:** - [ ] `cargo clippy --workspace --all-targets --locked -- -D warnings` (verified on GitHub Actions `windows-latest` CI) - [ ] `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (verified on GitHub Actions `windows-latest` CI) - [x] `cargo test --locked -p xtask` -> 8 passed, 0 failed - [x] `cargo xtask policy` -> `asset policy: 349 files ok` - [ ] `cargo test -p victory-gpu --locked -- --test-threads=1` (verified on GitHub Actions `windows-latest` CI)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 07:52:26 +00:00
github-bot changed target branch from main to gh-pr/376/base 2026-12-03 08:03:07 +00:00
github manually merged commit 9ced7f9f65 into gh-pr/376/base 2026-12-03 08:03:13 +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/Androtim--MiniVI!376
No description provided.