fix(gpu): reclaim overflow thin backing lists and return warm HostLists (#276, #282) #371

Merged
Androtim merged 1 commit from upstream-pr/371 into main 2026-12-03 01:00:26 +00:00
Androtim commented 2026-12-03 00:52:46 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T00:52:46Z.


Summary

Fixes thin backing-list HostList/VRAM leakage and premature backing-list destruction when BACKS overflows:

  • \crates/victory-gpu/src/list.rs:
    • Add
      eturn_idle_host(host: HostList)\ to reset unused/already-completed host command lists and return them to \IDLE\ (respecting \pools(), \idle_most(), and \IDLE_MOST.1\ byte caps).
    • Have non-thin \oxed()\ lists draw from \ resh_list()\ instead of always allocating fresh host command lists.
  • \crates/victory-gpu/src/list/thin.rs:
    • Add \Recording::return_back(&self)\ to return closed backing \List\ shells to \BACKS\ right after \jobs_of()\ detaches their \HostList\s, instead of pinning idle backing shells until the front list resets frames later.
    • Raise \BACKS_CAP\ from \256\ to \512\ and add
      eclaim_back\ /
      ecycle_back\ so overflow backing \List\ shells (
      efs == 0\ from \Box::into_raw) return any remaining \host\ and \earlier\ \HostList\s to \list::IDLE\ and drop cleanly via \Box::from_raw\ instead of underflow-bailing in \object::release_boxed.
    • Add unit test
      eturn_back_is_idempotent_and_reclaim_back_handles_refs_zero.
  • \crates/victory-gpu/src/queue/behind.rs:
    • Call
      .return_back()\ for unfolded
      ecordings\ immediately after \jobs_of(queue as This, &lists)\ extracts their backing \HostList\s.

Verification

  • \cargo +1.98.1-x86_64-pc-windows-gnu xtask policy\ (\342 files ok, --staged\ \3 files ok)
  • \cargo +1.98.1-x86_64-pc-windows-gnu check --workspace --all-targets\ (passed)

Refs #276, #282

<!-- greyfinch-sync:Androtim/MiniVI:issue:5617538931 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/371). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T00:52:46Z. --- ## Summary Fixes thin backing-list HostList/VRAM leakage and premature backing-list destruction when BACKS overflows: - \crates/victory-gpu/src/list.rs\: - Add \ eturn_idle_host(host: HostList)\ to reset unused/already-completed host command lists and return them to \IDLE\ (respecting \pools()\, \idle_most()\, and \IDLE_MOST.1\ byte caps). - Have non-thin \oxed()\ lists draw from \ resh_list()\ instead of always allocating fresh host command lists. - \crates/victory-gpu/src/list/thin.rs\: - Add \Recording::return_back(&self)\ to return closed backing \List\ shells to \BACKS\ right after \jobs_of()\ detaches their \HostList\s, instead of pinning idle backing shells until the front list resets frames later. - Raise \BACKS_CAP\ from \256\ to \512\ and add \ eclaim_back\ / \ ecycle_back\ so overflow backing \List\ shells (\ efs == 0\ from \Box::into_raw\) return any remaining \host\ and \earlier\ \HostList\s to \list::IDLE\ and drop cleanly via \Box::from_raw\ instead of underflow-bailing in \object::release_boxed\. - Add unit test \ eturn_back_is_idempotent_and_reclaim_back_handles_refs_zero\. - \crates/victory-gpu/src/queue/behind.rs\: - Call \ .return_back()\ for unfolded \ ecordings\ immediately after \jobs_of(queue as This, &lists)\ extracts their backing \HostList\s. ## Verification - \cargo +1.98.1-x86_64-pc-windows-gnu xtask policy\ (\342 files ok\, \--staged\ \3 files ok\) - \cargo +1.98.1-x86_64-pc-windows-gnu check --workspace --all-targets\ (passed) Refs #276, #282
Androtim commented 2026-12-03 01:01:15 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T01:01:15Z.


Deep Static Audit Pass #5 (#276 comment 7362570756) verified fix/thin-hostlist-leak (d2a0cee3) sound & race-free (Recording::return_back + Job::unfold early return + direct Box::from_raw in reclaim_back returning warm HostLists via return_idle_host, with unit test return_back_is_idempotent_and_reclaim_back_handles_refs_zero). CI 47006889289 is GREEN and has zero file overlap with #370 (16d546b8). Merging to main — once main CI finishes green on #370 + #371 (+ #357), v2026.12.03.01 will be ready to cut!

<!-- greyfinch-sync:Androtim/MiniVI:comment:7363857557 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/371#issuecomment-7363857557). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T01:01:15Z. --- Deep Static Audit Pass #5 (`#276` comment `7362570756`) verified `fix/thin-hostlist-leak` (`d2a0cee3`) **sound & race-free** (`Recording::return_back` + `Job::unfold` early return + direct `Box::from_raw` in `reclaim_back` returning warm `HostList`s via `return_idle_host`, with unit test `return_back_is_idempotent_and_reclaim_back_handles_refs_zero`). CI `47006889289` is **GREEN** and has zero file overlap with `#370` (`16d546b8`). Merging to `main` — once `main` CI finishes green on `#370` + `#371` (+ `#357`), **`v2026.12.03.01`** will be ready to cut!
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!371
No description provided.