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

Merged
RUIZ-Enrique-25002136 merged 1 commit from upstream-pr/376 into main 2026-12-03 08:02:52 +00:00
RUIZ-Enrique-25002136 commented 2026-12-03 07:51:13 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by RUIZ-Enrique-25002136 on 2026-12-03T07:51:13Z.


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)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5622283098 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/376). Originally posted by [RUIZ-Enrique-25002136](https://github.com/RUIZ-Enrique-25002136) on 2026-12-03T07:51:13Z. --- ## 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)
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
Androtim/MiniVI!376
No description provided.