Repository navigation
GPU: record per-span stamps for partial watched-page refreshes - #1388
n-romanovich wants to merge 1 commit into
Conversation
|
All four focused stale-page tests passed under GE-Proton11-14 on Bazzite 44 with an RTX 5060 Laptop. I also replayed the same Series S checkpoint from identical initial caches on the same local integration of main and #257, with #1388 as the app source change. The patched run reached the cell and recorded 206 distinct presents over 54 seconds at 3.82 FPS, with 965 MiB minimum free VRAM and no pending pipelines. Camera movement responded to input. The unpatched run reached the matched view and hit the local GPU headroom stop at 618 MiB free before completing the window. This pair establishes a working Proton run with the patch. A complete control window is still needed for an FPS or CPU-copy comparison. Assisted by Codex (GPT-6.2-Sol High). |
…ans (#1388)
Port two CPU-side GPU prep and shadow-refresh improvements into `victory-gpu`
without touching rendering, shader, descriptor, texture, or DXR pipelines:
1. CPU prep wins (GPL-3.0 provenance: Peppacodes/playablegames-peppa #6 &
fxceless/victory-fork #1146 by beamdotdev):
- Add opt-in `VICTORY_LAND_ASIDE=1` (`victory-land-aside` worker thread
with coalesced wakeups and process-lifetime `OnceLock` lifecycle matching
`VICTORY_BURY_ASIDE`, off by default and A/B-flippable in diagnostics
builds) while preserving `victory-rtx`'s relay fast path when off.
- Fix `CARD_DIRTY_QUEUE` lock ordering by enqueuing inside `card.dirty.lock()`
in `card_changed_runs`, store `(start, end, Weak<Shadow>)` in `CARDED` to
range-filter `send_copied` before `Weak::upgrade()`, prune dead `CARDED`
entries periodically in `card_dirty`, and add `VICTORY_CARD_TOUCHED` A/B
switch support in diagnostics builds.
- Expose `shadow::helper_priority` (`VICTORY_WIDE_PRIORITY`) and wire it
into `land::Pool::help` for `victory-under` and `victory-records`.
2. Partial-page shadow spans (GPL-3.0 provenance: fxceless/victory-fork #1388):
- Track per-page sub-64 KiB copied spans in `Shadow::partial`, lifting
sub-page refreshes out of full-page re-uploads, promoting full-page
coverage back to whole-page `copied` stamps, fixing `by_parts` multi-gap
indexing, adding `watch::nothing_new_by` for `Shadow::nothing_new`,
advancing owner partial stamps on clean landings in `Shadow::landed`, and
clearing partial spans on whole-page refreshes / `merge_under_writes`.
Note: `fxceless/victory-fork #1385` (cross-shadow sibling propagation) was
intentionally omitted after review identified concurrency races in cross-thread
sibling mutation.
Provenance (GPL-3.0):
- Peppacodes/playablegames-peppa#6 (and fxceless/victory-fork#1146 / beamdotdev)
- fxceless/victory-fork#1388
|
An in-game data point from a setup where nearly every buffer refresh is the case this PR is about, plus a profile that says where the rest of the time is. Setup. RTX 3090 Ti 24 GB, Ryzen 9 9950X3D, Windows 11 26200.
The picture in the cell is the same (four frames of each side by side). So it does what it says: about a quarter fewer bytes read, with no fault I could find. The time does not follow the bytes, and the profile says why. Built-in sampler over 60 s of the cell, with this PR, submitting thread, ms a frame:
The asking is paid once per range, whether the range then copies anything or not. A possible next step, not written: the spans this PR keeps are what Two things I did not explain. What goes up to the copies in the card's memory did not change with this PR in these runs (38–39 against 40 MB a frame), so the reads it saves are not in what is sent there; I have not looked into which copies they belong to. And on another tree (#994's head with #868 and others, same card and scene) Numbers and text only. AI-assisted (Claude Code, Claude Fable 5.2). |
Fixes #1344.
Previously,
Shadow::copy_staleonly updatedcopied[page - base]when a refresh covered the entire 64 KiB page (within the shadow buffer). Partial or unaligned refreshes left the page unstamped, causing repeated refreshes of the same unchanged span to re-copy boundary bytes on every frame.Changes in
crates/victory-gpu/src/shadow.rs:(lo, hi, stamp)inShadow::partialalongsideShadow::copied.copy_stale/copy_stale_with, prune any partial spans invalidated by a newer CPU write (stamp < write), copy only the uncovered gaps (including whenVICTORY_DIRTY_4Ksubpage filtering is active), and promote to a whole-page stamp when a full page is refreshed.partialstamps in sync inShadow::wrote_own.shadow::stale_testscovering unaligned cross-boundary refreshes, consecutive refreshes skipping unchanged bytes, CPU write invalidation, overlapping extensions, promotion to whole-page stamps, andVICTORY_DIRTY_4Kinteraction.Verified locally:
cargo test --locked -p victory-gpu --lib shadow(34 passed, 0 failed)cargo test --locked -p victory-gpu --features diagnostics --lib shadow(34 passed, 0 failed)cargo test --locked -p victory-gpu --lib(226 passed, 0 failed, 6 ignored)cargo build --release --locked -p victory