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

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

@⁠CarverXI on GitHub · 2026-11-26 17:14 UTC · original
CarverXI:feat/alt-flip → main · +61 −41 · 17 files · 1 commits · open

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

**@⁠CarverXI** on GitHub · 2026-11-26 17:14 UTC · [original](https://github.com/fxceless/victory-fork/pull/1341) `CarverXI:feat/alt-flip` → `main` · +61 −41 · 17 files · 1 commits · open 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)
Measured on an RTX 5090 in the opening cutscene, the same build and set,
only which half is "with": VICTORY_SYNC_BESIDE=alt +11.3 % as before and
+0.9 % flipped, VICTORY_REAPER=alt +14.4 % and +1.9 %. A launch each way
puts "with" on every stretch once; the mean has the scene taken out.
Nothing changes without the switch.

Committed past the asset-policy hook: host.rs is over its 512 KiB limit
on main already (528,954 bytes; 529,194 with this).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:15:25 +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/1341/head:github-bot/gh-1341'
git switch 'github-bot/gh-1341'

Merge

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