texture: VICTORY_PARTIAL_DELTA=1 and VICTORY_REFRESH_ONCE=1 (Scarlett deltas, off by default) #306

Open
zocram4cc wants to merge 2 commits from upstream-pr/306 into main
zocram4cc commented 2026-11-26 15:19:30 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by zocram4cc on 2026-11-26T15:19:30Z.


What

Two texture-upload deltas from Scarlett's tree, both off by default:

  • VICTORY_PARTIAL_DELTA=1: a host copy uploaded before gets only the subresources (level x array slice) whose title bytes changed since its last submitted upload. Content-addressed per host copy and subresource; 2D, thin, single-sample layouts only.
  • VICTORY_REFRESH_ONCE=1: a copy's range that a flush brought up to date is not asked again in that submission until a write of ours lands there. =verify (diagnostics builds) checks each skip without changing the result.

VICTORY_BAKE_DELTA is not in this PR. It depends on the texture write-watch asking (ASK_TEXTURES, our fc25c61) and its state, which is not on v7900/main; it will follow once that is upstream.

Credit: Op-lite/victory-scarlett 7c8f019 (scarlett-local, GPL-3.0). Ported with the original author kept (094611a, 8477461 are cherry-picks of 096e9f0 and 1b652c4).

Why

When more of a texture picked by index maps, its staging buffer is made again and uploaded whole, even when most of it did not change. The refresh-once skip avoids re-asking ranges a flush already brought up to date.

Measured

Linux, Proton, Series S, release build, single 300 s runs (world time) each. Arms differ only in the switches named:

  • base: 73.3 ms;
  • PORT_GUARD + PORT_JOURNAL + PARTIAL_DELTA + REFRESH_ONCE: 69.8 ms (best on every metric in that set);
  • PARTIAL_DELTA alone: 77.2 ms;
  • REFRESH_ONCE alone: 74.5 ms.

The gain appears only in combination with ports 6 and 7 (PORT_GUARD, PORT_JOURNAL, both on v7900/main); alone, each switch is slower than base. These are single runs, so treat the ~3.5 ms gap as indicative, not established.

Linux/Proton only measured. Windows untested.

Tests

texture::delta::tests (four, PARTIAL_DELTA state machine) and host::refresh_once_tests (two, join and trim rules). Red against stubs, green after, under Proton with --test-threads 1 in the original tree. The upload hooks are compile-checked only.

Run under Proton on this head (8477461), one test exe, --test-threads 1:

  • texture::delta::tests and host::refresh_once_tests (6) with VICTORY_PARTIAL_DELTA=1 VICTORY_REFRESH_ONCE=1: 6 pass.
  • watch:: (48 tests) with the two switches on: 45 pass, 3 fail; unset: 45 pass, 3 fail. The same 3 fail in both, and they are the Wine-only failures that also fail on upstream: holes_are_known_until_the_runtime_tells, no_mapping_is_lost_between_askers, what_is_left_alone_is_no_known_hole.

Build

cargo xwin build --profile release -p victory --target x86_64-pc-windows-msvc: passes on this branch.

AI-assisted (Claude Code).

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6629755322 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/306). Originally posted by [zocram4cc](https://github.com/zocram4cc) on 2026-11-26T15:19:30Z. --- ## What Two texture-upload deltas from Scarlett's tree, both off by default: - `VICTORY_PARTIAL_DELTA=1`: a host copy uploaded before gets only the subresources (level x array slice) whose title bytes changed since its last submitted upload. Content-addressed per host copy and subresource; 2D, thin, single-sample layouts only. - `VICTORY_REFRESH_ONCE=1`: a copy's range that a flush brought up to date is not asked again in that submission until a write of ours lands there. `=verify` (diagnostics builds) checks each skip without changing the result. `VICTORY_BAKE_DELTA` is not in this PR. It depends on the texture write-watch asking (ASK_TEXTURES, our fc25c61) and its state, which is not on `v7900/main`; it will follow once that is upstream. Credit: Op-lite/victory-scarlett 7c8f019 (scarlett-local, GPL-3.0). Ported with the original author kept (094611a, 8477461 are cherry-picks of 096e9f0 and 1b652c4). ## Why When more of a texture picked by index maps, its staging buffer is made again and uploaded whole, even when most of it did not change. The refresh-once skip avoids re-asking ranges a flush already brought up to date. ## Measured Linux, Proton, Series S, release build, single 300 s runs (world time) each. Arms differ only in the switches named: - base: 73.3 ms; - PORT_GUARD + PORT_JOURNAL + PARTIAL_DELTA + REFRESH_ONCE: 69.8 ms (best on every metric in that set); - PARTIAL_DELTA alone: 77.2 ms; - REFRESH_ONCE alone: 74.5 ms. The gain appears only in combination with ports 6 and 7 (PORT_GUARD, PORT_JOURNAL, both on `v7900/main`); alone, each switch is slower than base. These are single runs, so treat the ~3.5 ms gap as indicative, not established. Linux/Proton only measured. Windows untested. ## Tests `texture::delta::tests` (four, PARTIAL_DELTA state machine) and `host::refresh_once_tests` (two, join and trim rules). Red against stubs, green after, under Proton with `--test-threads 1` in the original tree. The upload hooks are compile-checked only. Run under Proton on this head (8477461), one test exe, `--test-threads 1`: - `texture::delta::tests` and `host::refresh_once_tests` (6) with `VICTORY_PARTIAL_DELTA=1 VICTORY_REFRESH_ONCE=1`: 6 pass. - `watch::` (48 tests) with the two switches on: 45 pass, 3 fail; unset: 45 pass, 3 fail. The same 3 fail in both, and they are the Wine-only failures that also fail on upstream: `holes_are_known_until_the_runtime_tells`, `no_mapping_is_lost_between_askers`, `what_is_left_alone_is_no_known_hole`. ## Build `cargo xwin build --profile release -p victory --target x86_64-pc-windows-msvc`: passes on this branch. AI-assisted (Claude Code).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/306:upstream-pr/306'
git switch 'upstream-pr/306'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/306'
git switch 'upstream-pr/306'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/306'
git switch 'upstream-pr/306'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/306'
git switch 'main'
git merge --squash 'upstream-pr/306'
git switch 'main'
git merge --ff-only 'upstream-pr/306'
git switch 'main'
git merge 'upstream-pr/306'
git push origin 'main'
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
avatarmanz/VIctory-7900XTX!306
No description provided.