Repeated refreshes recopy unchanged spans at watched-page boundaries #1344

Open
opened 2026-11-26 17:32:31 +00:00 by github-bot · 1 comment
Owner

@⁠Marukooh on GitHub · 2026-11-26 17:30 UTC · original

In the Series X opening scene on RTX 5070 Ti / Proton, the same part of a watched page can be uploaded repeatedly when a refresh covers only part of the page. On the measured branch, a full-page stamp could only be recorded when the entire page was covered; the next refresh could not reuse a stamp for the part it already uploaded.

A local prototype keeps a stamp for the covered byte span and invalidates it when the watched page changes. In a four-run off/on/on/off comparison, refresh dropped from 104–106 to 75–78 MB/frame. Frame medians were 117.9 / 121.3 ms off and 108.8 / 115.0 ms on. There was no device loss. These numbers predate the 4 KiB tracking in e4245f3.

Please check the current refresh path with an unaligned span, two consecutive refreshes, a CPU write, and a third refresh. A useful regression test proves the second refresh skips the covered bytes and the third refresh uploads the newly written bytes, including when the span crosses a tracking boundary.

**@⁠Marukooh** on GitHub · 2026-11-26 17:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/1344) In the Series X opening scene on RTX 5070 Ti / Proton, the same part of a watched page can be uploaded repeatedly when a refresh covers only part of the page. On the measured branch, a full-page stamp could only be recorded when the entire page was covered; the next refresh could not reuse a stamp for the part it already uploaded. A local prototype keeps a stamp for the covered byte span and invalidates it when the watched page changes. In a four-run off/on/on/off comparison, refresh dropped from 104–106 to 75–78 MB/frame. Frame medians were 117.9 / 121.3 ms off and 108.8 / 115.0 ms on. There was no device loss. These numbers predate the 4 KiB tracking in e4245f3. Please check the current refresh path with an unaligned span, two consecutive refreshes, a CPU write, and a third refresh. A useful regression test proves the second refresh skips the covered bytes and the third refresh uploads the newly written bytes, including when the span crosses a tracking boundary.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:32:31 +00:00
Author
Owner

@⁠fladit123 on GitHub · 2026-11-26 19:40 UTC · original

I have implemented an experimental partial-span freshness cache against main 52ac4ec0.

The issue reproduces through the actual Shadow::update path on both WARP and an RTX 4060, with VICTORY_DIRTY_4K enabled and disabled.

With the experimental optimization enabled:

  • Repeated unchanged 37-byte refreshes copy 0 bytes instead of 37.
  • The primary regression workload copies 253 bytes instead of 390.
  • All 65 readback checks pass in each tested adapter/Dirty-4K combination.
  • Synthetic CPU timings show lower refresh costs for repeated partial spans.
  • The existing WARP suite reports 242 passing tests on both revisions, with the same unrelated driver-event permission failure.

The implementation is deliberately conservative: it tracks at most 16 spans per shadow, requires a direct Windows write-watch result and a complete read, and preserves existing whole-page freshness and pending GPU-write decisions.

One important limitation is that standing write-watch queries and guarded views retain the original refresh behavior. Consequently, the eligible fraction of refreshes in a real gameplay workload is still unknown.

I would be interested in comparing this approach with your original prototype, particularly its handling of standing queries, and arranging an independent gameplay validation once the patch is ready.

No gameplay performance improvement is claimed yet.

AI-assisted implementation and validation using OpenAI Codex; additional source review using ChatGPT.

**@⁠fladit123** on GitHub · 2026-11-26 19:40 UTC · [original](https://github.com/fxceless/victory-fork/issues/1344#issuecomment-7201846088) I have implemented an experimental partial-span freshness cache against main `52ac4ec0`. The issue reproduces through the actual `Shadow::update` path on both WARP and an RTX 4060, with `VICTORY_DIRTY_4K` enabled and disabled. With the experimental optimization enabled: - Repeated unchanged 37-byte refreshes copy 0 bytes instead of 37. - The primary regression workload copies 253 bytes instead of 390. - All 65 readback checks pass in each tested adapter/Dirty-4K combination. - Synthetic CPU timings show lower refresh costs for repeated partial spans. - The existing WARP suite reports 242 passing tests on both revisions, with the same unrelated driver-event permission failure. The implementation is deliberately conservative: it tracks at most 16 spans per shadow, requires a direct Windows write-watch result and a complete read, and preserves existing whole-page freshness and pending GPU-write decisions. One important limitation is that standing write-watch queries and guarded views retain the original refresh behavior. Consequently, the eligible fraction of refreshes in a real gameplay workload is still unknown. I would be interested in comparing this approach with your original prototype, particularly its handling of standing queries, and arranging an independent gameplay validation once the patch is ready. No gameplay performance improvement is claimed yet. AI-assisted implementation and validation using OpenAI Codex; additional source review using ChatGPT.
This discussion has been locked. Commenting is limited to contributors.
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/fxceless--victory-fork#1344
No description provided.