Texture refresh: query for newer writes without copying page records #2795

Manually merged
github merged 1 commit from github-bot/gh-2795 into gh-pr/2795/base 2026-11-29 22:58:33 +00:00 AGit
Owner

@⁠ghptc on GitHub · 2026-11-29 17:24 UTC · original
ghptc:fix/write-query-summary-20261129 → main · +30 −5 · 2 files · 1 commits · merged 2026-11-29 22:54 UTC

The two staging refresh paths consume one property of the journal result: whether any page in the queried interval changed after the last observation. The previous implementation copied all matching page/epoch pairs to a temporary vector and scanned that vector while refreshing each texture.

The journal now evaluates the query under its existing lock and returns the boolean together with the same observation epoch. Callers needing the page list retain the original interface. Overlap, protection, ahead-of-submit handling and kernel observation keep their existing ordering.

The Windows regression covers changed and unchanged subranges and a summary-first observer followed by a full page-list reader. A separate synthetic snapshot workload ran 20,000 queries over the same journal, with matching results. The page collection went from 160,000 allocations to zero. This measures the query path; scene frame times depend on other CPU and GPU work.

**@⁠ghptc** on GitHub · 2026-11-29 17:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2795) `ghptc:fix/write-query-summary-20261129` → `main` · +30 −5 · 2 files · 1 commits · merged 2026-11-29 22:54 UTC The two staging refresh paths consume one property of the journal result: whether any page in the queried interval changed after the last observation. The previous implementation copied all matching page/epoch pairs to a temporary vector and scanned that vector while refreshing each texture. The journal now evaluates the query under its existing lock and returns the boolean together with the same observation epoch. Callers needing the page list retain the original interface. Overlap, protection, ahead-of-submit handling and kernel observation keep their existing ordering. The Windows regression covers changed and unchanged subranges and a summary-first observer followed by a full page-list reader. A separate synthetic snapshot workload ran 20,000 queries over the same journal, with matching results. The page collection went from 160,000 allocations to zero. This measures the query path; scene frame times depend on other CPU and GPU work.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:27:54 +00:00
Author
Owner

@⁠dyshay on GitHub · 2026-11-29 17:48 UTC · original

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series S with ray tracing, and Series X, DLSS Quality). Frame times will follow here.

**@⁠dyshay** on GitHub · 2026-11-29 17:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2795#issuecomment-7259985571) Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series S with ray tracing, and Series X, DLSS Quality). Frame times will follow here.
Author
Owner

@⁠icdmkg2 on GitHub · 2026-11-29 18:20 UTC · original

An in-game data point from an 8 GB laptop. It covers this PR together with four others, so it can't attribute the gain to this one alone.

Setup: RTX 5060 Laptop GPU (8 GB), Ryzen 7 H 260 (8 cores), 32 GB, Windows 11, driver 621.24. main at 55d06914, release build, Series S, DLSS performance, VICTORY_LEVELS_ON_DEMAND=0 and VICTORY_COMMIT_FLOOR_MB=1024 in both builds (see #1411 for why). Same save (the prologue's cell), driven by a script: 60 s measured after a 30 s settle, warm shader cache, two alternating pairs.

Combo: main + #2549 + #2783 + #2647 + #2665 + #2795. These merge cleanly together. #2796, #2656, #2604 and #2587 conflict with that set, so they weren't tested.

median frame time frames >50 ms per 5 s submitting thread, ms per frame
main 60.7 / 56.7 ms 15.2 / 15.4 52 / 60
combo 49.3 / 48.6 ms 7.6 / 5.8 47 / 44

That's about 15–18 % shorter frames and half the slow frames, with no crash and no device removal. A frame capture of the combo (diagnostics build, VICTORY_CAPTURE_WORLD) matched main's brightness (mean luma 66.4 against 66.2), with no black holes.

One thing for the diagnostics build: with these merged together, --features diagnostics no longer compiles. A local timing in submit shadows host::timing() at three call sites, and copystat::log_heap_elsewhere uses an mb helper it doesn't define. Both are one-line fixes; mentioning it in case whichever lands second hits it.

**@⁠icdmkg2** on GitHub · 2026-11-29 18:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2795#issuecomment-7260399129) An in-game data point from an 8 GB laptop. It covers this PR **together with four others**, so it can't attribute the gain to this one alone. **Setup:** RTX 5060 Laptop GPU (8 GB), Ryzen 7 H 260 (8 cores), 32 GB, Windows 11, driver 621.24. `main` at `55d06914`, release build, Series S, DLSS performance, `VICTORY_LEVELS_ON_DEMAND=0` and `VICTORY_COMMIT_FLOOR_MB=1024` in both builds (see #1411 for why). Same save (the prologue's cell), driven by a script: 60 s measured after a 30 s settle, warm shader cache, two alternating pairs. **Combo:** `main` + #2549 + #2783 + #2647 + #2665 + #2795. These merge cleanly together. #2796, #2656, #2604 and #2587 conflict with that set, so they weren't tested. | | median frame time | frames >50 ms per 5 s | submitting thread, ms per frame | |---|---|---|---| | `main` | 60.7 / 56.7 ms | 15.2 / 15.4 | 52 / 60 | | **combo** | **49.3 / 48.6 ms** | **7.6 / 5.8** | **47 / 44** | That's about 15–18 % shorter frames and half the slow frames, with no crash and no device removal. A frame capture of the combo (diagnostics build, `VICTORY_CAPTURE_WORLD`) matched `main`'s brightness (mean luma 66.4 against 66.2), with no black holes. One thing for the diagnostics build: with these merged together, `--features diagnostics` no longer compiles. A local `timing` in `submit` shadows `host::timing()` at three call sites, and `copystat::log_heap_elsewhere` uses an `mb` helper it doesn't define. Both are one-line fixes; mentioning it in case whichever lands second hits it.
github-bot changed target branch from main to gh-pr/2795/base 2026-11-29 22:58:10 +00:00
github manually merged commit 06ff01a67a into gh-pr/2795/base 2026-11-29 22:58:12 +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!2795
No description provided.