Two values of a switch compared in one launch (VICTORY_FLIP) #254

Open
TG0000 wants to merge 1 commit from upstream-pr/254 into main
TG0000 commented 2026-11-24 23:01:17 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by TG0000 on 2026-11-24T23:01:17Z.


Launch-to-launch differences (scene timing, driver cache, what else the PC does) were as large as most gains we tried to measure. VICTORY_FLIP=3 compares two values of a switch inside one launch: every second of frames is one window, one log line each, and the value changes every three windows in the order ABBA, so a drift of the scene cancels. The first window after a change is marked to be left out.

A switch takes part when it is read through flip::Pair, for example VICTORY_HEAP_TEXTURES_MS="250|20" or VICTORY_TEXTURE_NO_WAIT="0|1"; VICTORY_HEAP_TEXTURES_MS is new here and sets the time a frame may spend on textures picked by index (it comes before main's VICTORY_TEXTURE_STAGE_MS; 250 ms without either, as before). Nothing changes without these variables.

Limits: not for shader translation switches, and a switch that leaves something behind for seconds (a queue, a cache) reaches into the other value's first windows. Medians per block work better than means: a single one-second stall decided our first table.

Example (RX 6800, one launch): the 20 ms budget took the heap pass from 275 to 36 ms and the frame from 402 to 316 ms, but far fewer textures were uploaded and faces went black, so we do not propose that value.

One unit test for the order. Tests on this head (b56a86f, on a253706, one thread, RX 6800 and WARP): victory-gpu 169 passed, 1 failed; victory-shader 215 passed. The failure is warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which also failed 2 of 6 times on unchanged f85101b here (#847 and #849 are about it). Clippy with -D warnings for the Windows target (both feature sets), with #841's patch on top: one error, shadow.rs (is_multiple_of), the same on unchanged a253706. This head has not been run in a game; the same code on 7b0f736 has, five times, and adapted to f85101b in a combined build.

One warning from that: do not flip switches that change the card's queues. One launch here that flipped seven switches together every 4 s, an asynchronous present of ours among them, lost the device (0x887A0007); the cause is not isolated.

AI-assisted.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:5481781314 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/254). Originally posted by [TG0000](https://github.com/TG0000) on 2026-11-24T23:01:17Z. --- Launch-to-launch differences (scene timing, driver cache, what else the PC does) were as large as most gains we tried to measure. `VICTORY_FLIP=3` compares two values of a switch inside one launch: every second of frames is one window, one log line each, and the value changes every three windows in the order ABBA, so a drift of the scene cancels. The first window after a change is marked to be left out. A switch takes part when it is read through `flip::Pair`, for example `VICTORY_HEAP_TEXTURES_MS="250|20"` or `VICTORY_TEXTURE_NO_WAIT="0|1"`; `VICTORY_HEAP_TEXTURES_MS` is new here and sets the time a frame may spend on textures picked by index (it comes before main's `VICTORY_TEXTURE_STAGE_MS`; 250 ms without either, as before). Nothing changes without these variables. Limits: not for shader translation switches, and a switch that leaves something behind for seconds (a queue, a cache) reaches into the other value's first windows. Medians per block work better than means: a single one-second stall decided our first table. Example (RX 6800, one launch): the 20 ms budget took the heap pass from 275 to 36 ms and the frame from 402 to 316 ms, but far fewer textures were uploaded and faces went black, so we do not propose that value. One unit test for the order. Tests on this head (b56a86f, on a253706, one thread, RX 6800 and WARP): victory-gpu 169 passed, 1 failed; victory-shader 215 passed. The failure is `warp_budget_saturates_without_wraparound_and_preserves_draw_fields`, which also failed 2 of 6 times on unchanged f85101b here (#847 and #849 are about it). Clippy with `-D warnings` for the Windows target (both feature sets), with #841's patch on top: one error, `shadow.rs` (`is_multiple_of`), the same on unchanged a253706. This head has not been run in a game; the same code on 7b0f736 has, five times, and adapted to f85101b in a combined build. One warning from that: do not flip switches that change the card's queues. One launch here that flipped seven switches together every 4 s, an asynchronous present of ours among them, lost the device (0x887A0007); the cause is not isolated. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TG0000 commented 2026-11-28 01:14:48 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by TG0000 on 2026-11-28T01:14:48Z.


Checked after main moved to the new tree: this still merges cleanly and compiles (diagnostics build, cross-built; not run). It overlaps with VICTORY_AB, which turns switches on and off; this one compares two values of a setting. Close it if VICTORY_AB is enough. (AI-assisted comment.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7231527552 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/254#issuecomment-7231527552). Originally posted by [TG0000](https://github.com/TG0000) on 2026-11-28T01:14:48Z. --- Checked after `main` moved to the new tree: this still merges cleanly and compiles (diagnostics build, cross-built; not run). It overlaps with `VICTORY_AB`, which turns switches on and off; this one compares two values of a setting. Close it if `VICTORY_AB` is enough. (AI-assisted comment.)
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/254:upstream-pr/254'
git switch 'upstream-pr/254'

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/254'
git switch 'upstream-pr/254'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/254'
git switch 'upstream-pr/254'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/254'
git switch 'main'
git merge --squash 'upstream-pr/254'
git switch 'main'
git merge --ff-only 'upstream-pr/254'
git switch 'main'
git merge 'upstream-pr/254'
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
fxceless/victory-fork!254
No description provided.