gpu: keep faulted pages under a budget #722

Merged
tharun-37 merged 1 commit from upstream-pr/722 into main 2026-11-29 00:24:47 +00:00
tharun-37 commented 2026-11-28 04:28:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tharun-37 on 2026-11-28T04:28:52Z.


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5536655566 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/722). Originally posted by [tharun-37](https://github.com/tharun-37) on 2026-11-28T04:28:52Z. --- 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).
Dukestar69 commented 2026-11-28 05:16:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T05:16:24Z.

Review: APPROVED


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6095969775 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/722#pullrequestreview-6095969775). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-28T05:16:24Z. **Review:** APPROVED --- 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).
jptorres96 commented 2026-11-28 09:17:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jptorres96 on 2026-11-28T09:17:01Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237137902 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/722#issuecomment-7237137902). Originally posted by [jptorres96](https://github.com/jptorres96) on 2026-11-28T09:17:01Z. --- `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.
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
trustno1-coder/VIctory-NVIDIA!722
No description provided.