GPU: guard real VRAM budget margin in room() (VICTORY_ROOM_REAL, from FoxHound v0.8) #1888

Manually merged
github merged 1 commit from github-bot/gh-1888 into main 2026-11-29 08:21:06 +00:00 AGit
Owner

@⁠Nosheboo on GitHub · 2026-11-29 01:42 UTC · original
Nosheboo:port/foxhound-room-real → main · +82 −2 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC

Fixes #

What it changes

Ports VICTORY_ROOM_REAL (REAL_MARGIN, real_budget_blocks(), and room_allowed()) from readmet3xt-lab/foxhound commit 4349ab56 (GPL-3.0-or-later) into crates/victory-gpu/src/resource.rs (room()).

  • Reserves a 256 MiB (REAL_MARGIN) headroom margin below DXGI's real VRAM budget in room() (used >= budget.saturating_sub(REAL_MARGIN), inclusive) so texture/host allocations back off or evict instead of pushing the device into 0x887A0006 (DXGI_ERROR_DEVICE_REMOVED) when real VRAM nears capacity.
  • Opt-out / legacy behavior switch: set VICTORY_ROOM_REAL=0 (via crate::toggled!("VICTORY_ROOM_REAL")) to restore the prior behavior.
  • Scope is strictly limited to crates/victory-gpu/src/resource.rs.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 4070 Ti (12 GiB), Windows 11 — unit tests, clippy, and rustfmt verified locally; live in-game telemetry A/B pending after merge/release testing.
  • Before: room() did not enforce a real VRAM margin check below DXGI's reported real budget when credited allocations were checked.
  • After: room() blocks new allocations once real VRAM usage reaches budget.saturating_sub(256 MiB) unless VICTORY_ROOM_REAL=0; verified by resource::tests::real_budget_blocks_near_or_over_vram_budget covering headroom, inclusive budget - 256 MiB boundary, over-budget, VICTORY_ROOM_REAL=0 bypass, credited == false, u64::MAX, and 0.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes).
  • cargo test passed for the crates it touches: yes
    • cargo test -p victory-gpu --lib --locked -- --test-threads=1 on de2d4ba: 590 passed; 0 failed; 44 ignored (--test-threads=1 used due to pre-existing parallel watch flake #724; VICTORY_HOME/LOCALAPPDATA isolated, VICTORY_STREAMLINE_DIR unset).
    • cargo clippy -p victory-gpu --no-deps --all-targets --locked: 0 warnings in touched lines of crates/victory-gpu/src/resource.rs (only pre-existing baseline warnings elsewhere in victory-gpu).
    • rustfmt --edition 2024 --config-path rustfmt.toml: 0 formatting diffs on touched lines in crates/victory-gpu/src/resource.rs.
    • Note: cargo xtask policy fails on pre-existing untouched crates/victory-shader/src/emit/lower.rs (> 655,360 bytes) already present on main (#1460/#1493/#1527).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. No duplicate open PR ports VICTORY_ROOM_REAL in crates/victory-gpu/src/resource.rs.

Council review

Reviewer Model Round 1 Round 2 Verdict
Concurrency & Safety Auditor gpt-6-luna (xhigh) 8/10 (C2 inclusive >= boundary) 9/10 (C2 resolved) APPROVE
Performance & Modernization Architect gpt-6-luna (xhigh) 8/10 (stacked nosh-perf) 8/10 (verified) APPROVE
Upstream PR Hygiene & Test Critic gpt-6-luna (xhigh) 7/10 (H1 baseline, H2–H3, H5) 9/10 (H1 acknowledged baseline, H2–H5 resolved) APPROVE

Created with Gemini Pro Orchestrator (Neon) and reviewed by GPT-6 Luna (xhigh) in T3 Code.

**@⁠Nosheboo** on GitHub · 2026-11-29 01:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1888) `Nosheboo:port/foxhound-room-real` → `main` · +82 −2 · 1 files · 1 commits · merged 2026-11-29 08:16 UTC Fixes # ## What it changes Ports `VICTORY_ROOM_REAL` (`REAL_MARGIN`, `real_budget_blocks()`, and `room_allowed()`) from `readmet3xt-lab/foxhound` commit `4349ab56` (GPL-3.0-or-later) into `crates/victory-gpu/src/resource.rs` (`room()`). - Reserves a 256 MiB (`REAL_MARGIN`) headroom margin below DXGI's real VRAM budget in `room()` (`used >= budget.saturating_sub(REAL_MARGIN)`, inclusive) so texture/host allocations back off or evict instead of pushing the device into `0x887A0006` (`DXGI_ERROR_DEVICE_REMOVED`) when real VRAM nears capacity. - Opt-out / legacy behavior switch: set `VICTORY_ROOM_REAL=0` (via `crate::toggled!("VICTORY_ROOM_REAL")`) to restore the prior behavior. - Scope is strictly limited to `crates/victory-gpu/src/resource.rs`. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): NVIDIA GeForce RTX 4070 Ti (12 GiB), Windows 11 — unit tests, `clippy`, and `rustfmt` verified locally; live in-game telemetry A/B pending after merge/release testing. - Before: `room()` did not enforce a real VRAM margin check below DXGI's reported real budget when `credited` allocations were checked. - After: `room()` blocks new allocations once real VRAM usage reaches `budget.saturating_sub(256 MiB)` unless `VICTORY_ROOM_REAL=0`; verified by `resource::tests::real_budget_blocks_near_or_over_vram_budget` covering headroom, inclusive `budget - 256 MiB` boundary, over-budget, `VICTORY_ROOM_REAL=0` bypass, `credited == false`, `u64::MAX`, and `0`. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes). - `cargo test` passed for the crates it touches: yes - `cargo test -p victory-gpu --lib --locked -- --test-threads=1` on `de2d4ba`: `590 passed; 0 failed; 44 ignored` (`--test-threads=1` used due to pre-existing parallel watch flake #724; `VICTORY_HOME`/`LOCALAPPDATA` isolated, `VICTORY_STREAMLINE_DIR` unset). - `cargo clippy -p victory-gpu --no-deps --all-targets --locked`: 0 warnings in touched lines of `crates/victory-gpu/src/resource.rs` (only pre-existing baseline warnings elsewhere in `victory-gpu`). - `rustfmt --edition 2024 --config-path rustfmt.toml`: 0 formatting diffs on touched lines in `crates/victory-gpu/src/resource.rs`. - Note: `cargo xtask policy` fails on pre-existing untouched `crates/victory-shader/src/emit/lower.rs` (> 655,360 bytes) already present on `main` (`#1460`/`#1493`/`#1527`). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. No duplicate open PR ports `VICTORY_ROOM_REAL` in `crates/victory-gpu/src/resource.rs`. ## Council review | Reviewer | Model | Round 1 | Round 2 | Verdict | | --- | --- | --- | --- | --- | | Concurrency & Safety Auditor | `gpt-6-luna` (`xhigh`) | 8/10 (`C2` inclusive `>=` boundary) | 9/10 (`C2` resolved) | APPROVE | | Performance & Modernization Architect | `gpt-6-luna` (`xhigh`) | 8/10 (stacked `nosh-perf`) | 8/10 (verified) | APPROVE | | Upstream PR Hygiene & Test Critic | `gpt-6-luna` (`xhigh`) | 7/10 (`H1` baseline, `H2`–`H3`, `H5`) | 9/10 (`H1` acknowledged baseline, `H2`–`H5` resolved) | APPROVE | Created with Gemini Pro Orchestrator (Neon) and reviewed by GPT-6 Luna (xhigh) in T3 Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 01:46:06 +00:00
github-bot force-pushed github-bot/gh-1888 from 7c0cb4f814 to de2d4ba1b7 2026-11-29 02:17:47 +00:00 Compare
Author
Owner

@⁠amazedturnip on GitHub · 2026-11-29 05:38 UTC · original

Tested on RTX 5070 Ti 16 GB across 20+ min sessions. Real DXGI VRAM budget margin in room() works cleanly without false throttling or crashes.

**@⁠amazedturnip** on GitHub · 2026-11-29 05:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1888#issuecomment-7251377736) Tested on RTX 5070 Ti 16 GB across 20+ min sessions. Real DXGI VRAM budget margin in room() works cleanly without false throttling or crashes.
github manually merged commit e055f9dcc0 into main 2026-11-29 08:21:06 +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/trustno1-coder--VIctory-NVIDIA!1888
No description provided.