GPU: allow memory fault budget to recover per frame and exempt title buffers (#102) #126

Open
github-bot wants to merge 1 commit from github-bot/gh-126 into main AGit
Owner

@⁠ESAT586 on GitHub · 2026-11-26 05:27 UTC · original
ESAT586:avatarmanz/fault-budget-recovery → main · +41 −3 · 1 files · 1 commits · open

Addresses part 2 of #102 (fault budget exhaustion).

Problem

In crates/victory-gpu/src/memory.rs, self.faulted only ever incremented inside ake_faults() (FAULTS = 128 per frame, FAULTS_ALL = 2048 total) and never recovered. Once 2,048 faulted pages were mapped—even if many resolved to legitimate title buffers via shadow::in_buffer—fault-mapping stopped permanently for the remainder of the session (had no copy every frame in #102).

Fix (crates/victory-gpu/src/memory.rs)

  • Per-frame leaky-bucket recovery (FAULT_RECOVER = 16): Decay self.faulted by 16 at the start of ake_faults() (called once per frame). This keeps the original FAULTS = 128 per-frame limit and FAULTS_ALL = 2048 initial burst ceiling (preserving the
    un light-4 runaway-ray guard), while allowing new world regions to keep mapping pages across a long session instead of locking at 0 permanently.
  • Exempt existing title buffers from stray-fault charge: Only increment self.faulted when self.map(page) actually placed a page in an arena (self.pages.contains_key(&page)), not when the page resolved directly to a tracked title buffer.
  • Added unit test ault_budget_enforces_burst_cap_and_recovers_across_frames.

Verification (zero game data)

  • cargo test -p victory-gpu --lib --locked -- memory::tests on RTX 3060 Ti 8 GB: 3/3 passed
  • VICTORY_WARP=1 cargo test -p victory-gpu --lib --locked -- memory::tests: 3/3 passed
  • cargo clippy -p victory-gpu --lib --tests --locked: 0 warnings in memory.rs
  • cargo xtask policy --staged: 1 files ok

(Authored and verified with Gemini 4 Neon — High Mode, AI coding agent — with zero game data.)

**@⁠ESAT586** on GitHub · 2026-11-26 05:27 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/126) `ESAT586:avatarmanz/fault-budget-recovery` → `main` · +41 −3 · 1 files · 1 commits · open Addresses part 2 of #102 (fault budget exhaustion). ### Problem In crates/victory-gpu/src/memory.rs, self.faulted only ever incremented inside ake_faults() (FAULTS = 128 per frame, FAULTS_ALL = 2048 total) and never recovered. Once 2,048 faulted pages were mapped—even if many resolved to legitimate title buffers via shadow::in_buffer—fault-mapping stopped permanently for the remainder of the session (had no copy every frame in #102). ### Fix (crates/victory-gpu/src/memory.rs) - **Per-frame leaky-bucket recovery (FAULT_RECOVER = 16):** Decay self.faulted by 16 at the start of ake_faults() (called once per frame). This keeps the original FAULTS = 128 per-frame limit and FAULTS_ALL = 2048 initial burst ceiling (preserving the un light-4 runaway-ray guard), while allowing new world regions to keep mapping pages across a long session instead of locking at 0 permanently. - **Exempt existing title buffers from stray-fault charge:** Only increment self.faulted when self.map(page) actually placed a page in an arena (self.pages.contains_key(&page)), not when the page resolved directly to a tracked title buffer. - Added unit test ault_budget_enforces_burst_cap_and_recovers_across_frames. ### Verification (zero game data) - cargo test -p victory-gpu --lib --locked -- memory::tests on RTX 3060 Ti 8 GB: **3/3 passed** - VICTORY_WARP=1 cargo test -p victory-gpu --lib --locked -- memory::tests: **3/3 passed** - cargo clippy -p victory-gpu --lib --tests --locked: **0 warnings in memory.rs** - cargo xtask policy --staged: **1 files ok** *(Authored and verified with Gemini 4 Neon — High Mode, AI coding agent — with zero game data.)*
Authored and verified by Gemini 4 Neon (High Mode, AI coding agent) with
zero game data.

Addresses the fault-budget exhaustion reported in #102:
1. Decay Memory::faulted by FAULT_RECOVER (16 pages) once per frame
   at the start of 	ake_faults, preserving the per-frame (FAULTS = 128)
   and burst (FAULTS_ALL = 2048) runaway-ray guards while preventing a
   busy stretch from permanently halting fault-mapping for the rest of
   the session.
2. Only charge self.faulted when self.map(page) places an arena page
   (self.pages.contains_key(&page)), not when the page resolves to an
   already-tracked title buffer (shadow::in_buffer).
3. Add a unit test verifying burst capping and per-frame recovery.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:12:43 +00:00
Author
Owner

@⁠nachitoooo on GitHub · 2026-11-26 05:36 UTC · original · approved these changes

**@⁠nachitoooo** on GitHub · 2026-11-26 05:36 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/126#pullrequestreview-6069050975) · **approved these changes**
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:36 UTC · original

Left open: changes the fault-page budget for every card; needs an in-game check first.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:36 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/126#issuecomment-7185635863) Left open: changes the fault-page budget for every card; needs an in-game check first.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/memory.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/126/head:github-bot/gh-126'
git switch 'github-bot/gh-126'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-126'
git switch 'github-bot/gh-126'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-126'
git switch 'github-bot/gh-126'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-126'
git switch 'main'
git merge --squash 'github-bot/gh-126'
git switch 'main'
git merge --ff-only 'github-bot/gh-126'
git switch 'main'
git merge 'github-bot/gh-126'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.