Watch: VICTORY_AHEAD_GAP_KB, the gap ranges asked ahead are joined over (default unchanged) #2246

Manually merged
github merged 1 commit from github-bot/gh-2246 into main 2026-11-30 14:17:34 +00:00 AGit
Owner

@⁠Bazovsky on GitHub · 2026-11-29 11:00 UTC · original
Bazovsky:pr/ahead-gap-switch → main · +54 −16 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

What it changes

Adds VICTORY_AHEAD_GAP_KB: the distance over which a submission's ranges are joined into one asking of the write watch (AHEAD_GAP in crates/victory-gpu/src/watch.rs). Nothing changes without the switch: the default stays 8 MiB.

  • The grouping loop of ask_ahead moves into a function of its own, ahead_runs(pieces, gap), with a unit test (ranges_asked_ahead_join_within_the_gap_alone).
  • With the switch set, the gap in use is logged once.

Why a switch. In a comment on #1637 @⁠POMXARK measured a smaller gap together with CPU-only memory left unwatched (6.7 to 5.6 ms of write-watch time on a Ryzen 7 5700X). An asking walks and resets the pages between its ranges too, so the gap is worth measuring on its own, and that needs no rebuild with this.

How it was tested

  • GPU and profile: RTX 5090 (driver 610.88), Ryzen 9 9950X3D, 62 GB, Windows 11 26300. Series X, 2560x1440, DLSS Quality, frame generation off, ray tracing off. Release builds started with victory play.
  • The measurement was taken on e1f2eb6 with #1392, #1442, #1633, #1637 and #1857 (all in main now), one exe, the switch alone changed, five 190 s runs each way in turn. A loaded save standing in the first playable scene (about 4,800 draws a frame), seconds 60 to 140 of 3D counted:
"asking the write watch" a frame, per run frames a second, per run
8 MiB (default) 2.1 / 2.2 / 2.3 / 2.3 / 2.3 ms 39.0 / 38.3 / 38.3 / 37.0 / 37.9
VICTORY_AHEAD_GAP_KB=512 1.9 / 2.0 / 2.0 / 2.0 / 2.1 ms 39.9 / 39.2 / 38.2 / 38.4 / 38.0
  • So on this CPU the gap is worth about 0.2 to 0.3 ms of the submitting thread's 25, and the frame rate does not move beyond the spread of the runs. I have no measurement that would justify another default; on fewer cores it may differ, which is what the switch is for.
  • The other half of that comment, CPU-only memory left unwatched, did nothing here (two runs each way, 2.2 / 2.3 ms): in these runs the title's CPU-only allocations that get a write watch come to 33 MiB. Its 24 GiB CPU reservation is a placeholder, which is not watched anyway.
  • On this branch (main at 829188e + the commit): victory-gpu tests, 875 pass and the 41 of watch::tests run one at a time pass; clippy reports nothing new in watch.rs. The diagnostics build does not compile on main itself at 829188e (copystat.rs:1349, host.rs:9168), so it was not checked.
  • For shader changes, the wave sizes tested: no shader change.

Checked for overlap

  • I searched the open pull requests for AHEAD_GAP and for changes to ask_ahead. None found.

Measured unattended by an AI assistant (Claude Code) on my PC.

🤖 Generated with Claude Code

**@⁠Bazovsky** on GitHub · 2026-11-29 11:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2246) `Bazovsky:pr/ahead-gap-switch` → `main` · +54 −16 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC ## What it changes Adds `VICTORY_AHEAD_GAP_KB`: the distance over which a submission's ranges are joined into one asking of the write watch (`AHEAD_GAP` in `crates/victory-gpu/src/watch.rs`). Nothing changes without the switch: the default stays 8 MiB. - The grouping loop of `ask_ahead` moves into a function of its own, `ahead_runs(pieces, gap)`, with a unit test (`ranges_asked_ahead_join_within_the_gap_alone`). - With the switch set, the gap in use is logged once. **Why a switch.** In a comment on #1637 @⁠POMXARK measured a smaller gap together with CPU-only memory left unwatched (6.7 to 5.6 ms of write-watch time on a Ryzen 7 5700X). An asking walks and resets the pages between its ranges too, so the gap is worth measuring on its own, and that needs no rebuild with this. ## How it was tested - GPU and profile: RTX 5090 (driver 610.88), Ryzen 9 9950X3D, 62 GB, Windows 11 26300. Series X, 2560x1440, DLSS Quality, frame generation off, ray tracing off. Release builds started with `victory play`. - The measurement was taken on `e1f2eb6` with #1392, #1442, #1633, #1637 and #1857 (all in main now), one exe, the switch alone changed, five 190 s runs each way in turn. A loaded save standing in the first playable scene (about 4,800 draws a frame), seconds 60 to 140 of 3D counted: | | "asking the write watch" a frame, per run | frames a second, per run | |---|---|---| | 8 MiB (default) | 2.1 / 2.2 / 2.3 / 2.3 / 2.3 ms | 39.0 / 38.3 / 38.3 / 37.0 / 37.9 | | `VICTORY_AHEAD_GAP_KB=512` | 1.9 / 2.0 / 2.0 / 2.0 / 2.1 ms | 39.9 / 39.2 / 38.2 / 38.4 / 38.0 | - So on this CPU the gap is worth about 0.2 to 0.3 ms of the submitting thread's 25, and the frame rate does not move beyond the spread of the runs. I have no measurement that would justify another default; on fewer cores it may differ, which is what the switch is for. - The other half of that comment, CPU-only memory left unwatched, did nothing here (two runs each way, 2.2 / 2.3 ms): in these runs the title's CPU-only allocations that get a write watch come to 33 MiB. Its 24 GiB CPU reservation is a placeholder, which is not watched anyway. - On this branch (main at `829188e` + the commit): `victory-gpu` tests, 875 pass and the 41 of `watch::tests` run one at a time pass; clippy reports nothing new in `watch.rs`. The diagnostics build does not compile on main itself at `829188e` (`copystat.rs:1349`, `host.rs:9168`), so it was not checked. - For shader changes, the wave sizes tested: no shader change. ## Checked for overlap - [x] I searched the open pull requests for `AHEAD_GAP` and for changes to `ask_ahead`. None found. Measured unattended by an AI assistant (Claude Code) on my PC. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
An asking ahead walks and resets the pages between its ranges too. The switch
lets the gap be measured alone, after POMXARK's numbers in a comment on PR #1637;
the grouping is a function of its own with a test.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 11:01:15 +00:00
github manually merged commit e64d51c3eb into main 2026-11-30 14:17:34 +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!2246
No description provided.