memory: recycle a 512 MB budget of ray-tracing fault pages #401

Closed
github-bot wants to merge 1 commit from github-bot/gh-401 into main AGit
Owner

@⁠Kikoarl on GitHub · 2026-11-27 21:55 UTC · original
Kikoarl:feat/rt-recycled-page-budget → main · +423 −46 · 1 files · 1 commits · closed without merging

Summary

Ports the 512 MB recycled ray-tracing fault-page budget and fault-miss breakdown from fxceless/victory-fork commit 3e573d2556adc5a5b22ccd2d6d92231a72ee55bb (GPL-3.0-or-later), rebased onto main (df2daaf).

Changes

  • crates/victory-gpu/src/memory.rs:
    • Tracks fault-allocated ray-tracing pages separately under a 512 MB budget, recycles oldest fault pages first when pressure hits (goes_first, fault_room, give_back), and reports the per-frame fault-miss breakdown while preserving merged PR #88 (Memory::another).

Distinct from PR #181 (shadow::exact() buffer pooling) and PR #295 (placed-page write-watch stamps).

Verification

Verified on Windows (x86_64-pc-windows-msvc) against main (df2daaf):

  • git diff --check main..HEAD — clean
  • cargo test -p xtask --locked — 6 passed, 0 failed (asset policy: 287 files ok)
  • cargo clippy -p victory-gpu --all-targets --locked — exit 0, 0 warnings in changed files (main has pre-existing clippy warnings in untouched files)
  • cargo test -p victory-gpu --locked memory:: — 5 passed, 0 failed
**@⁠Kikoarl** on GitHub · 2026-11-27 21:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/401) `Kikoarl:feat/rt-recycled-page-budget` → `main` · +423 −46 · 1 files · 1 commits · closed without merging ### Summary Ports the 512 MB recycled ray-tracing fault-page budget and fault-miss breakdown from `fxceless/victory-fork` commit `3e573d2556adc5a5b22ccd2d6d92231a72ee55bb` (`GPL-3.0-or-later`), rebased onto `main` (`df2daaf`). ### Changes - **`crates/victory-gpu/src/memory.rs`**: - Tracks fault-allocated ray-tracing pages separately under a 512 MB budget, recycles oldest fault pages first when pressure hits (`goes_first`, `fault_room`, `give_back`), and reports the per-frame fault-miss breakdown while preserving merged PR #88 (`Memory::another`). Distinct from PR #181 (`shadow::exact()` buffer pooling) and PR #295 (placed-page write-watch stamps). ### Verification Verified on Windows (`x86_64-pc-windows-msvc`) against `main` (`df2daaf`): - `git diff --check main..HEAD` — clean - `cargo test -p xtask --locked` — 6 passed, 0 failed (`asset policy: 287 files ok`) - `cargo clippy -p victory-gpu --all-targets --locked` — exit 0, 0 warnings in changed files (`main` has pre-existing clippy warnings in untouched files) - `cargo test -p victory-gpu --locked memory::` — 5 passed, 0 failed
Port the recycled ray-tracing fault-page budget from fxceless/victory-fork commit 3e573d2556adc5a5b22ccd2d6d92231a72ee55bb (including the fault-miss breakdown from 52dfd12 carried in 3e573d2) into crates/victory-gpu/src/memory.rs while preserving PR #88 (30b979ee) in Memory::another.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:58:21 +00:00
Author
Owner

@⁠Mumogg on GitHub · 2026-11-28 16:59 UTC · original

Data point from Linux (Wine + GE vkd3d-proton, RTX 5070 Ti 16 GB, Series X profile, title ray tracing on with VICTORY_BVH_BUILDER=1). Two 8-minute runs on the same save, without and with fxceless 3e573d25 (the same change as this PR):

  • Without: "faults in all" reached the run-wide cap of 2048 about 35 s after ray tracing started and stayed there for the rest of the run. Every fault warning after that point said made=0, with about 150-330 pages a frame left without a copy. Cars turned lime green about when the cap was reached.
  • With: "faults in all" kept climbing (15,700 by the end of the run), and pages kept being made late in the run, so the cap no longer runs out.

On frame rate: ray tracing stays expensive on this card (9-12 fps at 4K output), but that cost is separate from this change. The builder dispatches (150-1500 a frame) account for most of it. (AI-assisted test and write-up.)

**@⁠Mumogg** on GitHub · 2026-11-28 16:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/401#issuecomment-7242665762) Data point from Linux (Wine + GE vkd3d-proton, RTX 5070 Ti 16 GB, Series X profile, title ray tracing on with VICTORY_BVH_BUILDER=1). Two 8-minute runs on the same save, without and with fxceless 3e573d25 (the same change as this PR): - **Without:** "faults in all" reached the run-wide cap of 2048 about 35 s after ray tracing started and stayed there for the rest of the run. Every fault warning after that point said `made=0`, with about 150-330 pages a frame left without a copy. Cars turned lime green about when the cap was reached. - **With:** "faults in all" kept climbing (15,700 by the end of the run), and pages kept being made late in the run, so the cap no longer runs out. On frame rate: ray tracing stays expensive on this card (9-12 fps at 4K output), but that cost is separate from this change. The builder dispatches (150-1500 a frame) account for most of it. (AI-assisted test and write-up.)
github-bot closed this pull request 2026-11-28 20:28:48 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-28 20:23 UTC · original

Thanks for this. I'm closing it without merging because #722 covers the same problem (#688: the faulted-page budget ran out and never came back) and is going into main: faulted pages are kept under a reusable budget (VICTORY_RT_FAULT_MB, VICTORY_RT_FAULT_KEEP). The two conflict throughout memory.rs. If yours does something #722 doesn't, please rebase it on main once #722 is in and open a new pull request.

**@⁠trustno1-coder** on GitHub · 2026-11-28 20:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/401#issuecomment-7245248652) Thanks for this. I'm closing it without merging because #722 covers the same problem (#688: the faulted-page budget ran out and never came back) and is going into main: faulted pages are kept under a reusable budget (`VICTORY_RT_FAULT_MB`, `VICTORY_RT_FAULT_KEEP`). The two conflict throughout memory.rs. If yours does something #722 doesn't, please rebase it on main once #722 is in and open a new pull request.

Pull request closed

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!401
No description provided.