GPU: cut write-watch scans between sparse buffer ranges #4572

Closed
github-bot wants to merge 14 commits from github-bot/gh-4571 into main AGit
Owner

@⁠yumaste on GitHub · 2026-11-30 22:55 UTC · original
yumaste:nvidia/perf-write-watch-views → main · +993 −863 · 33 files · 14 commits · closed without merging

## Change

The default kept write-watch query joined ranges separated by up to 8 MiB. On a submission with sparse buffer reads, Windows then walked many pages in between that the submission did not use. Limit those gaps to 512 KiB and reuse the existing ahead_runs planner. VICTORY_ASK_ONCE_GAP_KB=8192 restores the previous limit for an A/B. The flush-local VICTORY_AHEAD_GAP_KB setting continues to govern its own path.

Requested ranges are still queried and noted under the same locks. If a later read asks about a gap that was not queried, it still uses the normal write-watch path. A new Windows test checks the dirty page in that gap with both limits.

Performance

A/B on Windows with a Core Ultra 9 275HX and RTX 5080 Laptop GPU. Used the host submission bench from #3820 on base e1251c31 plus this patch. The same optimized executable ran three times per limit in alternating order, with two warm-up and twelve measured frames per scenario. The bench sends 30 submissions and 8,973 refreshes per simulated frame. Each number is the median of the three run means.

Scenario Preparation, 8 MiB Preparation, 512 KiB Time saved
Nothing written 19.07 ms 8.65 ms 10.43 ms
1% of pages written at the primary address 21.53 ms 13.76 ms 7.77 ms
1% of pages written through an alias 21.12 ms 13.19 ms 7.93 ms

The write-watch phase fell from 11.87 to 3.87 ms in the alias scenario. Every run reported zero stale CPU copies and zero GPU differences after the final refresh. The single-buffer control asked about 0.01 ms per frame in both modes. These results are for synthetic submissions. A gameplay run is still needed for an FPS or frame-pacing estimate.

Validation

  • 70 write-watch tests passed. The new regression also passed with VICTORY_ASK_ONCE_GAP_KB=8192.
  • Staged asset policy and git diff --check passed.
  • The full GPU suite reports 1,132 passed and 66 ignored on this patch. Both this run and the baseline report the same two failures (list::thin::tests::bindings_record_no_work and shader_cache::tests::every_switch_of_the_translator_is_in_the_key).

Refs #2415. The benchmark from #3820 was applied in a separate worktree for measurement. This PR changes only watch.rs.

**@⁠yumaste** on GitHub · 2026-11-30 22:55 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4571) `yumaste:nvidia/perf-write-watch-views` → `main` · +993 −863 · 33 files · 14 commits · closed without merging ## Change The default kept write-watch query joined ranges separated by up to 8 MiB. On a submission with sparse buffer reads, Windows then walked many pages in between that the submission did not use. Limit those gaps to 512 KiB and reuse the existing ahead_runs planner. VICTORY_ASK_ONCE_GAP_KB=8192 restores the previous limit for an A/B. The flush-local VICTORY_AHEAD_GAP_KB setting continues to govern its own path. Requested ranges are still queried and noted under the same locks. If a later read asks about a gap that was not queried, it still uses the normal write-watch path. A new Windows test checks the dirty page in that gap with both limits. ## Performance A/B on Windows with a Core Ultra 9 275HX and RTX 5080 Laptop GPU. Used the host submission bench from #3820 on base e1251c31 plus this patch. The same optimized executable ran three times per limit in alternating order, with two warm-up and twelve measured frames per scenario. The bench sends 30 submissions and 8,973 refreshes per simulated frame. Each number is the median of the three run means. | Scenario | Preparation, 8 MiB | Preparation, 512 KiB | Time saved | | --- | ---: | ---: | ---: | | Nothing written | 19.07 ms | 8.65 ms | 10.43 ms | | 1% of pages written at the primary address | 21.53 ms | 13.76 ms | 7.77 ms | | 1% of pages written through an alias | 21.12 ms | 13.19 ms | 7.93 ms | The write-watch phase fell from 11.87 to 3.87 ms in the alias scenario. Every run reported zero stale CPU copies and zero GPU differences after the final refresh. The single-buffer control asked about 0.01 ms per frame in both modes. These results are for synthetic submissions. A gameplay run is still needed for an FPS or frame-pacing estimate. ## Validation - 70 write-watch tests passed. The new regression also passed with VICTORY_ASK_ONCE_GAP_KB=8192. - Staged asset policy and git diff --check passed. - The full GPU suite reports 1,132 passed and 66 ignored on this patch. Both this run and the baseline report the same two failures (list::thin::tests::bindings_record_no_work and shader_cache::tests::every_switch_of_the_translator_is_in_the_key). Refs #2415. The benchmark from #3820 was applied in a separate worktree for measurement. This PR changes only watch.rs.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 22:57:35 +00:00
github-bot closed this pull request 2026-12-01 18:43:03 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:37 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4571#issuecomment-7321240419) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

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