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

Open
github-bot wants to merge 1 commit from github-bot/gh-254 into main AGit
Owner

@⁠TG0000 on GitHub · 2026-11-24 23:01 UTC · original
TG0000:tools/flip → main · +87 −4 · 5 files · 1 commits · open

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

**@⁠TG0000** on GitHub · 2026-11-24 23:01 UTC · [original](https://github.com/fxceless/victory-fork/pull/254) `TG0000:tools/flip` → `main` · +87 −4 · 5 files · 1 commits · open 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:17 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/254/head:github-bot/gh-254'
git switch 'github-bot/gh-254'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-254'
git switch 'github-bot/gh-254'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-254'
git switch 'github-bot/gh-254'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-254'
git switch 'main'
git merge --squash 'github-bot/gh-254'
git switch 'main'
git merge --ff-only 'github-bot/gh-254'
git switch 'main'
git merge 'github-bot/gh-254'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.