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

Merged
ghptc merged 1 commit from upstream-pr/2795 into main 2026-11-29 22:54:42 +00:00
ghptc commented 2026-11-29 17:24:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-29T17:24:53Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5553204747 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2795). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-29T17:24:53Z. --- 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.
dyshay commented 2026-11-29 17:48:57 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T17:48:57Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7259985571 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2795#issuecomment-7259985571). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T17:48:57Z. --- 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.
icdmkg2 commented 2026-11-29 18:20:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by icdmkg2 on 2026-11-29T18:20:04Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260399129 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2795#issuecomment-7260399129). Originally posted by [icdmkg2](https://github.com/icdmkg2) on 2026-11-29T18:20:04Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!2795
No description provided.