Add live switches for A/B comparisons in one session #10
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay--gone-20261126!10
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/10/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@TaynanGT on GitHub · 2026-11-25 18:58 UTC · original
TaynanGT:claude/live-switches→local/fxceless-render· +263 −5 · 5 files · 1 commits · closed without mergingWhat and why
Comparing two settings by starting the game twice costs about three minutes per run just to load the same scene again, and each run lands on a different moment of it, so the difference between two runs is often smaller than the spread between runs of the same build. Live switches change while the title runs: the scene is loaded once and the two settings take turns in it.
Full write-up:
docs/live-switches.md.How it works
crates/victory-gpu/src/live.rs:Live::new(NAME, default)reads its environment variable the first time it is checked. WithVICTORY_LIVE=<file>, a thread reads that file four times a second;NAME=VALUElines override the variable (0off, anything else on), and a name left out goes back to it. A check is one atomic load. Each change, and each value the file names anew, is logged aslive switch NAME=VALUE.VICTORY_HEAP_SYNCandVICTORY_WIDE_REFRESHare live. Only switches whose code reads them each time, with no state a change in the middle would leave inconsistent, are made live. A heap made while the sync is off is not tracked.VICTORY_METER_MSsets how often the frame line is logged. It already held only the last second's numbers; the default stays 5 s, and 1000 logs every second's.VICTORY_LIVEnothing changes: no thread starts, and the switches keep their environment values.Results
VICTORY_HEAP_SYNCin one session on77c3019with this branch, first room, three cycles of 20 s each way, 49 one-second samples per state, the first 3 s after each change left out:Per cycle, FPS on/off: 6.2/8.5, 7.1/6.8, 6.9/8.2. The comparison took about five minutes in all.
Tests
live::tests:lines_set_switches_on_and_offandthe_file_overrides_the_environment_and_leaving_a_name_out_goes_back.cargo test --workspace --release --locked: all passed (victory-gpu 255, victory-shader 296, the rest of the workspace, the asset policy).cargo clippy --workspace --all-targets --locked -- -D warnings, and with--all-features: clean.🤖 Generated with Claude Code
@TaynanGT on GitHub · 2026-11-25 19:21 UTC · original · edited 2026-11-25 20:01 UTC
Moved into #11, which holds all of this work on one branch, since merged into
main.Pull request closed