VICTORY_ALT_FLIP=1 swaps the halves of every alt switch (a scripted scene biases one launch by about 5 points) #1341

Open
CarverXI wants to merge 1 commit from upstream-pr/1341 into main
CarverXI commented 2026-11-26 17:14:24 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by CarverXI on 2026-11-26T17:14:24Z.


Every =alt switch decides its phase the same way: (seconds since the first call / 20) % 2 == 1. The phases start with the process, so in a scripted scene (a cutscene from a save, started by a key file at the same frame) "with" falls on the same stretches of the scene in every launch. The scene's own difference between those stretches is then read as the switch's.

What it measured here

RTX 5090, i9-14900K, the opening cutscene from one save, 60 s to 220 s after the world starts loading, frames over time per phase with the first 4 s after each change dropped. Same build, same switch set, the only difference is which half is "with":

Switch set to alt as today flipped mean
VICTORY_SYNC_BESIDE +11.3 % +0.9 % +6.1 %
VICTORY_REAPER +14.4 % +1.9 % +8.2 %
VICTORY_GUARD_OUTSIDE (#1315) +10.4 % +7.7 % +9.1 %

So one launch can be off by about 5 points either way in this scene, which is more than most of the steps being measured. Equal-draws comparisons take part of it out, not all (the stretches differ in more than draws).

Change

victory_gpu::alt_on_phase() returns 1 (as today) or, with VICTORY_ALT_FLIP=1, 0, and the 40 places that compare the phase with 1 compare it with that. Nothing changes without the switch. One launch each way puts "with" on every stretch once; their mean has the scene taken out.

17 files, all of it the one-token replacement except the function in victory-gpu/src/lib.rs (pub, because victory-hle's xmem.rs has one such switch) and four lines in the README.

The asset-policy check

This commit was made past the pre-commit hook, and the check job will fail on it, for a reason that is on main already: cargo xtask policy refuses any file over 512 KiB, and crates/victory-gpu/src/host.rs is 528,954 bytes on main (e4245f3), 529,194 with this change (240 bytes more, from the places that are in it). crates/victory-shader/src/emit/lower.rs is over as well (535,588 bytes), which is why CI is red on main now (#1342). Nothing from the game is in the change: it is the one token at each place, the function and the README lines. If you would rather I leave host.rs out until the limit or the file is dealt with, say so and I will cut it down to the other files.

Checked

  • cargo test -p victory-gpu --lib with diagnostics, unset and with VICTORY_ALT_FLIP=1: 240 passed, 7 ignored (run with --skip stacks_that_mean_nothing: that profiler test ends in an access violation on this machine on main too, in full runs).
  • cargo check -p victory --features diagnostics and cargo clippy on victory-gpu and victory-hle: nothing new.
  • In the game: the six launches of the table, each change said in the log on the expected half.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6631734197 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1341). Originally posted by [CarverXI](https://github.com/CarverXI) on 2026-11-26T17:14:24Z. --- Every `=alt` switch decides its phase the same way: `(seconds since the first call / 20) % 2 == 1`. The phases start with the process, so in a scripted scene (a cutscene from a save, started by a key file at the same frame) "with" falls on the same stretches of the scene in every launch. The scene's own difference between those stretches is then read as the switch's. ## What it measured here RTX 5090, i9-14900K, the opening cutscene from one save, 60 s to 220 s after the world starts loading, frames over time per phase with the first 4 s after each change dropped. Same build, same switch set, the only difference is which half is "with": | Switch set to `alt` | as today | flipped | mean | |---|---|---|---| | `VICTORY_SYNC_BESIDE` | +11.3 % | +0.9 % | +6.1 % | | `VICTORY_REAPER` | +14.4 % | +1.9 % | +8.2 % | | `VICTORY_GUARD_OUTSIDE` (#1315) | +10.4 % | +7.7 % | +9.1 % | So one launch can be off by about 5 points either way in this scene, which is more than most of the steps being measured. Equal-draws comparisons take part of it out, not all (the stretches differ in more than draws). ## Change `victory_gpu::alt_on_phase()` returns 1 (as today) or, with `VICTORY_ALT_FLIP=1`, 0, and the 40 places that compare the phase with `1` compare it with that. Nothing changes without the switch. One launch each way puts "with" on every stretch once; their mean has the scene taken out. 17 files, all of it the one-token replacement except the function in `victory-gpu/src/lib.rs` (`pub`, because `victory-hle`'s `xmem.rs` has one such switch) and four lines in the README. ## The asset-policy check This commit was made past the pre-commit hook, and the `check` job will fail on it, for a reason that is on `main` already: `cargo xtask policy` refuses any file over 512 KiB, and `crates/victory-gpu/src/host.rs` is 528,954 bytes on `main` (`e4245f3`), 529,194 with this change (240 bytes more, from the places that are in it). `crates/victory-shader/src/emit/lower.rs` is over as well (535,588 bytes), which is why CI is red on `main` now (#1342). Nothing from the game is in the change: it is the one token at each place, the function and the README lines. If you would rather I leave `host.rs` out until the limit or the file is dealt with, say so and I will cut it down to the other files. ## Checked - `cargo test -p victory-gpu --lib` with diagnostics, unset and with `VICTORY_ALT_FLIP=1`: 240 passed, 7 ignored (run with `--skip stacks_that_mean_nothing`: that profiler test ends in an access violation on this machine on `main` too, in full runs). - `cargo check -p victory --features diagnostics` and `cargo clippy` on `victory-gpu` and `victory-hle`: nothing new. - In the game: the six launches of the table, each change said in the log on the expected half. 🤖 Generated with [Claude Code](https://claude.com/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/1341:upstream-pr/1341'
git switch 'upstream-pr/1341'

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