GPU: reduce work in texture refresh and readback #401

Closed
github-bot wants to merge 1 commit from gh-pr/401/head into gh-pr/401/base
Owner

@⁠cat4blep on GitHub · 2026-11-24 02:56 UTC · original
cat4blep:victory-d2a4bae1 → main · +228 −76 · 6 files · 1 commits · closed without merging

Changes

  • Skip BLAKE3 for a bounded burst of full detiles after four consecutive hash changes in an unwatched texture. Run eight such refreshes before hashing again. Returning to write-watch invalidates the unwatched digest.
  • Reuse the diagnostics present probe's readback buffer across frames, under the existing presentation lock and fence.
  • Reuse one 64 KiB CPU buffer per submission for GPU copy-back. Merge the GPU's changed bytes with concurrent title edits using a vectorizable loop and preserve the existing write predicate.
  • Record consecutive dirty kernel pages that belong to one title page once per journal epoch, without an intermediate allocation.

Runtime context

An earlier local Windows run on an RTX 3060 Ti processed 12.7 MB of movie-texture data per frame. With the hash bypass, about 5.1 MB was hashed and 7.6 MB was detiled without hashing. That run also carried independent pacing and rendering changes, so these figures describe the hash workload in that build. Verification of this branch uses the tests below.

Verification

  • cargo test --locked --workspace --profile diag --features victory/diagnostics
  • cargo check --locked --workspace --profile diag
  • cargo xtask policy --staged
  • git diff --check
**@⁠cat4blep** on GitHub · 2026-11-24 02:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/401) `cat4blep:victory-d2a4bae1` → `main` · +228 −76 · 6 files · 1 commits · closed without merging ## Changes - Skip BLAKE3 for a bounded burst of full detiles after four consecutive hash changes in an unwatched texture. Run eight such refreshes before hashing again. Returning to write-watch invalidates the unwatched digest. - Reuse the diagnostics present probe's readback buffer across frames, under the existing presentation lock and fence. - Reuse one 64 KiB CPU buffer per submission for GPU copy-back. Merge the GPU's changed bytes with concurrent title edits using a vectorizable loop and preserve the existing write predicate. - Record consecutive dirty kernel pages that belong to one title page once per journal epoch, without an intermediate allocation. ## Runtime context An earlier local Windows run on an RTX 3060 Ti processed 12.7 MB of movie-texture data per frame. With the hash bypass, about 5.1 MB was hashed and 7.6 MB was detiled without hashing. That run also carried independent pacing and rendering changes, so these figures describe the hash workload in that build. Verification of this branch uses the tests below. ## Verification - `cargo test --locked --workspace --profile diag --features victory/diagnostics` - `cargo check --locked --workspace --profile diag` - `cargo xtask policy --staged` - `git diff --check`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:02:33 +00:00
github-bot closed this pull request 2026-11-26 04:02:33 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:30 UTC · original

Thanks @⁠cat4blep for the GPU refresh/readback changes. I tested head 0b5838d4d2711021beca723254075f67a248d4c2 with:

cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1

Result: 49 passed, 0 failed, 1 ignored. The suite includes the bounded texture-refresh burst and interrupted-streak cases, copyback merge behavior, guarded-view checks, and the affected GPU unit modules. The ignored per-submission benchmark was not run, so this verifies correctness tests but provides no performance measurement; no title workload was run.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/401#issuecomment-7122083699) Thanks @⁠cat4blep for the GPU refresh/readback changes. I tested head `0b5838d4d2711021beca723254075f67a248d4c2` with: ``` cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1 ``` Result: 49 passed, 0 failed, 1 ignored. The suite includes the bounded texture-refresh burst and interrupted-streak cases, copyback merge behavior, guarded-view checks, and the affected GPU unit modules. The ignored per-submission benchmark was not run, so this verifies correctness tests but provides no performance measurement; no title workload was run.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:02 UTC · original

Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

Four unrelated micro-optimisations (skipping hashes in bursts, a reused probe buffer, a reused copy-back buffer, a tweak to watch::writes), each against code main replaced today.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/401#issuecomment-7148071823) Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current). Four unrelated micro-optimisations (skipping hashes in bursts, a reused probe buffer, a reused copy-back buffer, a tweak to watch::writes), each against code main replaced today. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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