gpu: keep faulted pages under a budget #722

Manually merged
github merged 1 commit from github-bot/gh-722 into main 2026-11-29 00:28:02 +00:00 AGit
Owner

@⁠tharun-37 on GitHub · 2026-11-28 04:28 UTC · original
tharun-37:fix/rt-fault-pages → main · +169 −16 · 2 files · 1 commits · merged 2026-11-29 00:24 UTC

Fixes #688.

Faulted pages were counted once and never released, so after the 2048-page budget was spent later missing pages read zeros for the rest of the run. This keeps faulted arena pages under \VICTORY_RT_FAULT_MB\ (1024 MiB by default), refreshes pages that fault again through the existing write-watch path, and gives back the oldest pages that no packed structure owns and no shader has looked at lately. Pages taken or looked at in the last few frames are kept, so the builder still has them. \VICTORY_RT_FAULT_KEEP=0\ keeps the old once-only budget for comparison.

Adds tests for the budget parsing, the switch, and the retired-page order. Documents both switches.

Validation: \cargo test -p victory-gpu --locked; \cargo check --workspace --locked; \cargo xtask policy.

AI-assisted (OpenCode).

**@⁠tharun-37** on GitHub · 2026-11-28 04:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/722) `tharun-37:fix/rt-fault-pages` → `main` · +169 −16 · 2 files · 1 commits · merged 2026-11-29 00:24 UTC Fixes #688. Faulted pages were counted once and never released, so after the 2048-page budget was spent later missing pages read zeros for the rest of the run. This keeps faulted arena pages under \VICTORY_RT_FAULT_MB\ (1024 MiB by default), refreshes pages that fault again through the existing write-watch path, and gives back the oldest pages that no packed structure owns and no shader has looked at lately. Pages taken or looked at in the last few frames are kept, so the builder still has them. \VICTORY_RT_FAULT_KEEP=0\ keeps the old once-only budget for comparison. Adds tests for the budget parsing, the switch, and the retired-page order. Documents both switches. Validation: \cargo test -p victory-gpu --locked\; \cargo check --workspace --locked\; \cargo xtask policy\. AI-assisted (OpenCode).
Faulted pages used to stay counted for the whole run, so later ones could not be mapped. Keep them under VICTORY_RT_FAULT_MB (1024 MiB by default): refresh pages that fault again through the write watch, and give back the oldest pages no packed structure owns and no shader has looked at lately. Pages taken or looked at in the last few frames stay, so the builder still has them. VICTORY_RT_FAULT_KEEP=0 keeps the old once-only count.

Fixes #688.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 04:31:24 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-28 05:16 UTC · original · approved these changes

LGTM — verified on Windows:

  • cargo test -p victory-gpu --lib memory:: passed (4/4, including fault_budget_and_switch_have_sane_defaults and the_oldest_idle_fault_pages_go_back_first)
  • 0 new compiler warnings in touched files
  • cargo xtask policy passed (294 files ok)

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-28 05:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/722#pullrequestreview-6095969775) · **approved these changes** LGTM — verified on Windows: - `cargo test -p victory-gpu --lib memory::` passed (4/4, including `fault_budget_and_switch_have_sane_defaults` and `the_oldest_idle_fault_pages_go_back_first`) - 0 new compiler warnings in touched files - `cargo xtask policy` passed (`294 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠jptorres96 on GitHub · 2026-11-28 09:17 UTC · original

save_share tests: 5/5 passed, three consecutive runs. One earlier run hit OS error 32 (file in use) in the_game_settings_are_never_shared_and_the_players_own_are_kept. I couldn't reproduce it, and it looks like another process was holding the file, but it might be worth making the test use a unique temp dir.

Env: RTX 4080 SUPER (driver 621.01), Ryzen 5 5600X, Windows build 26300, rustc 1.98.1, DXC 1.9.2609.5 (VICTORY_DXIL), --test-threads=1. VICTORY_INDIRECT_REST=1 set to sidestep main's two indirect budget-test failures (fixed in #67), unrelated to this PR.

**@⁠jptorres96** on GitHub · 2026-11-28 09:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/722#issuecomment-7237137902) `save_share` tests: 5/5 passed, three consecutive runs. One earlier run hit OS error 32 (file in use) in `the_game_settings_are_never_shared_and_the_players_own_are_kept`. I couldn't reproduce it, and it looks like another process was holding the file, but it might be worth making the test use a unique temp dir. Env: RTX 4080 SUPER (driver 621.01), Ryzen 5 5600X, Windows build 26300, rustc 1.98.1, DXC 1.9.2609.5 (`VICTORY_DXIL`), `--test-threads=1`. `VICTORY_INDIRECT_REST=1` set to sidestep main's two indirect budget-test failures (fixed in #67), unrelated to this PR.
github-bot referenced this pull request from a commit 2026-11-29 00:27:22 +00:00
github manually merged commit ea00b3cc79 into main 2026-11-29 00:28:02 +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!722
No description provided.