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

Manually merged
github merged 2 commits from github-bot/gh-417 into gh-pr/417/base 2026-12-04 03:15:30 +00:00 AGit
Owner

@⁠Androtim on GitHub · 2026-12-04 02:21 UTC · original
Androtim:perf/rt-by-address-reclaim-lane-priority-pull → main · +715 −63 · 2 files · 2 commits · merged 2026-12-04 03:13 UTC

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).
**@⁠Androtim** on GitHub · 2026-12-04 02:21 UTC · [original](https://github.com/Androtim/MiniVI/pull/417) `Androtim:perf/rt-by-address-reclaim-lane-priority-pull` → `main` · +715 −63 · 2 files · 2 commits · merged 2026-12-04 03:13 UTC ## 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\).
Wave 6A GPL-3.0 ports adapted cleanly to MiniVI:

1. crates/victory-gpu/src/memory.rs (ReTerryDavis/ReVIctory PR #33, a11b8d3, GPL-3.0):
   - Track builder root view pages (Held::view) mapped before packed structures stream in; adopt them (including tail pages past packed end up to VIEW) when Memory::land runs, and reclaim them when packed structures leave or are replaced.
   - Add optional read-only view-page eviction via VICTORY_MEMORY_EVICT_FRAMES=<n> (off by default) and VICTORY_MEMORY_EVICT_ABOVE_MB=<mb> (default 2048), keeping fault-managed pages separate and re-mapping evicted pages on fault regardless of fault allowance.
   - Add periodic report counters for replaced structures, packed pages freed, view breakdown, adopted view pages, evicted pages, and re-faulted evicted pages.
   - Preserves all MiniVI-specific VRAM scaling, unified ArenaPool/ArenaChunk epochs, fault-page recycling, and solo-tail replacement logic.

2. crates/victory-gpu/src/cores.rs (ReTerryDavis/ReVIctory PR #9, 7adf1b9, GPL-3.0):
   - Port VICTORY_LANE_PRIORITY (Part, ASKED, settle()) and uniform-core registration so processors whose cores are all alike (empty fast_sets) still register submitting/helper threads, pass (null, 0) to SetThreadSelectedCpuSets, and apply thread priorities.
   - Preserves MiniVI Priority helper and explicit VICTORY_HELPER_PRIORITY=<n> override.

Note: lobomfz/VIctory-xmem commit 6064c04 (crates/victory-gpu/src/pull.rs) is N/A on MiniVI because MiniVI does not include the unified-memory BAR card-pull subsystem.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-04 02:24:44 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-04 02:32 UTC · original

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).
**@⁠Androtim** on GitHub · 2026-12-04 02:32 UTC · [original](https://github.com/Androtim/MiniVI/pull/417#issuecomment-7399054895) 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).
github-bot force-pushed github-bot/gh-417 from ecb8d7b929 to 08daa229f3 2026-12-04 02:48:11 +00:00 Compare
github-bot changed target branch from main to gh-pr/417/base 2026-12-04 03:15:19 +00:00
github manually merged commit 08daa229f3 into gh-pr/417/base 2026-12-04 03:15:30 +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!417
No description provided.