perf(gpu): reclaim RT by-address view pages, optional read-only eviction, and uniform-core lane priority (Wave 6A) #417

Merged
Androtim merged 2 commits from upstream-pr/417 into main 2026-12-04 03:13:13 +00:00
Androtim commented 2026-12-04 02:21:48 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T02:21:48Z.


Summary

Ports Wave 6A (GPL-3.0) RT long-session memory stability and uniform-core thread-priority fixes onto MiniVI \main\ (\e2cbc10), preserving all MiniVI-specific VRAM scaling, unified \ArenaPool/\ArenaChunk\ epochs, fault-page recycling, and solo-tail replacement behavior.

1. Title Memory By-Address View-Page Reclaim & Optional Read-Only Eviction (\crates/victory-gpu/src/memory.rs)

  • Attribution: \ReTerryDavis/ReVIctory\ PR #33 (\11b8d3, \GPL-3.0).
  • View-page reclaim (\Held::view): Builder root-view pages mapped before a packed structure streams in now record \ iew: Option. When \Memory::land\ lands a packed structure at that address, matching view pages (including tail pages past \last\ up to \VIEW) are adopted as \ heirs = true\ and reclaimed when the structure leaves or is replaced.
  • Optional read-only page eviction: Adds \VICTORY_MEMORY_EVICT_FRAMES=\ (off by default) and \VICTORY_MEMORY_EVICT_ABOVE_MB=\ (default \2048). Unnamed read-only view pages (\loose && owners == 0 && !theirs && fault == 0) are released once held pages reach the threshold, and any page a shader later faults on is prioritized and re-mapped regardless of fault-room limits.
  • Telemetry: Extends the periodic \ itle memory by address\ report with replaced-structure, packed-reclaim, view-breakdown, view-adoption, eviction, and re-fault counters.
  • Preserved MiniVI logic: Keeps MiniVI's \most_pages_for, \spare_pages_for, \ ault_pages_for, \card_room_for, \ArenaPool/\ArenaChunk\ dirty epochs, fault-page recycling, and solo-tail replacement in
    elease_packed_pages.

2. Uniform-Core \VICTORY_LANE_PRIORITY\ Registration (\crates/victory-gpu/src/cores.rs)

  • Attribution: \ReTerryDavis/ReVIctory\ PR #9 (\7adf1b9, \GPL-3.0).
  • Ports \VICTORY_LANE_PRIORITY\ (\Part, \part_of, \priority_of, \ASKED, \settle()) and fixes \cores::ask\ on uniform-core / single-CCD processors where \ ast_of\ is empty: threads are still registered in \ASKED, \settle()\ passes (null, 0)\ to \SetThreadSelectedCpuSets\ (leaving threads free to run on any core), and submitting/helper threads receive their raised priority.
  • Preserves MiniVI's existing \Priority\ helper and explicit numeric \VICTORY_HELPER_PRIORITY=\ override.

3. \lobomfz/VIctory-xmem\ commit \6064c04\ (\crates/victory-gpu/src/pull.rs) — N/A

  • Verified not applicable on MiniVI: MiniVI does not include the unified-memory (\um\ / \pull.rs) BAR card-copy read subsystem, so no dead code was introduced.

Verification

  • \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib memory::tests cores::tests: 16 passed, 0 failed (including 3 new unit tests covering view-tail adoption/reclaim, eviction env parsing & stale-loose eligibility, and uniform-core \VICTORY_LANE_PRIORITY\ registration).
  • \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib: 969 passed, 39 ignored (1 parallel race in unrelated \ exture::ahead::tests::failed_finish_reverts_state_and_suppresses_callbacks, which passed 1/1 when re-run directly).
  • \cargo +1.98.1-x86_64-pc-windows-gnu check --workspace: passed (0 errors, 0 warnings).
  • \cargo +1.98.1-x86_64-pc-windows-gnu xtask policy: 0 violations on modified files (only pre-existing size-limit violation on untouched \crates/victory-shader/src/emit/lower.rs).
<!-- greyfinch-sync:Androtim/MiniVI:issue:5638840948 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/417). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T02:21:48Z. --- ## Summary Ports **Wave 6A** (GPL-3.0) RT long-session memory stability and uniform-core thread-priority fixes onto MiniVI \main\ (\e2cbc10\), preserving all MiniVI-specific VRAM scaling, unified \ArenaPool\/\ArenaChunk\ epochs, fault-page recycling, and solo-tail replacement behavior. ### 1. Title Memory By-Address View-Page Reclaim & Optional Read-Only Eviction (\crates/victory-gpu/src/memory.rs\) - **Attribution:** \ReTerryDavis/ReVIctory\ PR #33 (\11b8d3\, \GPL-3.0\). - **View-page reclaim (\Held::view\):** Builder root-view pages mapped before a packed structure streams in now record \ iew: Option<u64>\. When \Memory::land\ lands a packed structure at that address, matching view pages (including tail pages past \last\ up to \VIEW\) are adopted as \ heirs = true\ and reclaimed when the structure leaves or is replaced. - **Optional read-only page eviction:** Adds \VICTORY_MEMORY_EVICT_FRAMES=<n>\ (off by default) and \VICTORY_MEMORY_EVICT_ABOVE_MB=<mb>\ (default \2048\). Unnamed read-only view pages (\loose && owners == 0 && !theirs && fault == 0\) are released once held pages reach the threshold, and any page a shader later faults on is prioritized and re-mapped regardless of fault-room limits. - **Telemetry:** Extends the periodic \ itle memory by address\ report with replaced-structure, packed-reclaim, view-breakdown, view-adoption, eviction, and re-fault counters. - **Preserved MiniVI logic:** Keeps MiniVI's \most_pages_for\, \spare_pages_for\, \ ault_pages_for\, \card_room_for\, \ArenaPool\/\ArenaChunk\ dirty epochs, fault-page recycling, and solo-tail replacement in \ elease_packed_pages\. ### 2. Uniform-Core \VICTORY_LANE_PRIORITY\ Registration (\crates/victory-gpu/src/cores.rs\) - **Attribution:** \ReTerryDavis/ReVIctory\ PR #9 (\7adf1b9\, \GPL-3.0\). - Ports \VICTORY_LANE_PRIORITY\ (\Part\, \part_of\, \priority_of\, \ASKED\, \settle()\) and fixes \cores::ask\ on uniform-core / single-CCD processors where \ ast_of\ is empty: threads are still registered in \ASKED\, \settle()\ passes \(null, 0)\ to \SetThreadSelectedCpuSets\ (leaving threads free to run on any core), and submitting/helper threads receive their raised priority. - Preserves MiniVI's existing \Priority\ helper and explicit numeric \VICTORY_HELPER_PRIORITY=<n>\ override. ### 3. \lobomfz/VIctory-xmem\ commit \6064c04\ (\crates/victory-gpu/src/pull.rs\) — N/A - Verified not applicable on MiniVI: MiniVI does not include the unified-memory (\um\ / \pull.rs\) BAR card-copy read subsystem, so no dead code was introduced. ## Verification - \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib memory::tests cores::tests\: **16 passed, 0 failed** (including 3 new unit tests covering view-tail adoption/reclaim, eviction env parsing & stale-loose eligibility, and uniform-core \VICTORY_LANE_PRIORITY\ registration). - \cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib\: **969 passed, 39 ignored** (1 parallel race in unrelated \ exture::ahead::tests::failed_finish_reverts_state_and_suppresses_callbacks\, which passed **1/1** when re-run directly). - \cargo +1.98.1-x86_64-pc-windows-gnu check --workspace\: **passed** (0 errors, 0 warnings). - \cargo +1.98.1-x86_64-pc-windows-gnu xtask policy\: **0 violations** on modified files (only pre-existing size-limit violation on untouched \crates/victory-shader/src/emit/lower.rs\).
Androtim commented 2026-12-04 02:32:30 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-04T02:32:30Z.


Triage (ecb8d7b9, CI check PASS):

  • Clean, high-value ports of ReVIctory #33 (Held::view view-page reclaim) and #9 (uniform-core VICTORY_LANE_PRIORITY registration), but marked triage: needs work under the no-opt-in-toggle rule:
    • VICTORY_MEMORY_EVICT_FRAMES=<n> in crates/victory-gpu/src/memory.rs is wired as an off-by-default opt-in toggle (only =0 kill-switches for default-on replacements are allowed).
    • Please either drop the opt-in VICTORY_MEMORY_EVICT_FRAMES path for now (keeping the clean default-on Held::view reclaim + uniform-core VICTORY_LANE_PRIORITY), or promote it to a verified default-on policy with a =0 kill-switch.
  • Once resolved, proceed to Gate 2 Audit (#282) + Gate 3 live GPU verification (plain---release A/B + RT-on memory check).
<!-- greyfinch-sync:Androtim/MiniVI:comment:7399054895 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/417#issuecomment-7399054895). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-04T02:32:30Z. --- Triage (`ecb8d7b9`, **CI `check` PASS**): - Clean, high-value ports of `ReVIctory` `#33` (`Held::view` view-page reclaim) and `#9` (uniform-core `VICTORY_LANE_PRIORITY` registration), **but marked `triage: needs work` under the no-opt-in-toggle rule:** - `VICTORY_MEMORY_EVICT_FRAMES=<n>` in `crates/victory-gpu/src/memory.rs` is wired as an **off-by-default opt-in toggle** (only `=0` kill-switches for default-on replacements are allowed). - Please either drop the opt-in `VICTORY_MEMORY_EVICT_FRAMES` path for now (keeping the clean default-on `Held::view` reclaim + uniform-core `VICTORY_LANE_PRIORITY`), or promote it to a verified default-on policy with a `=0` kill-switch. - Once resolved, proceed to **Gate 2 Audit (`#282`)** + **Gate 3 live GPU verification** (plain-`--release` A/B + RT-on memory check).
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!417
No description provided.