VICTORY_MAX_STEP_MS: raise the title's longest simulation step (world near real time below 15 fps) #124
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/124"
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?
Imported from TaynanGT/Vice-Tay. Originally posted by Geckomacabre on 2026-11-27T03:09:03Z.
Depends on #123 (the Series S upscaler PR): it needs that PR's known-build entry, and this branch contains its commit. Review that one first; only the last commit is new here.
The title's timer step is
max(min(dt, 1/15 s), 1/30 s)(+0x2226040), and the world update clamps to 1/15 s again (+0x8dec0), as does the paused branch (+0x22264d0). So below 15 fps the world runs slow: half speed at 8 fps, a quarter at 4.VICTORY_MAX_STEP_MS=<66.7..333>(off by default) points the three loads of the shared 1/15 s constant (it has 64 readers, so it stays) at a float in theint3padding after +0x2226040'sret(+0x2226128). Every site's whole instruction is compared first, all or nothing, only on the known build, written in memory after load. Longer steps mean more of the title's 1/15 s physics substeps per frame; 100 is a good value.VICTORY_STEP_LOG=1logs game time against wall time every 5 s, with or without the patch.Tested: played with 100 for days on a sibling tree (RTX 4090, 5-15 fps): the world keeps near real time. Cards at 5-10 fps (e.g. #75) would run at half speed without it.
Checks:
cargo check -p victory --features diagnostics --testspasses on this branch. Unit tests (victory-gamestep tests,victory-loader) are pending; results will follow as a comment.🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T03:13:38Z.
Thanks for keeping the step change opt-in and calling out the dependency on #123. I reviewed the step commit on its own.
write_all_checkedcompares all the expected bytes up front, then changes the protection and writes each site in turn. If a later protection change fails, the earlier writes remain and the launch message says the step was left alone. Please make that failure leave the original bytes in every site, and add a loader test for a failure after the first site.VICTORY_STEP_LOGreads a fixed timer offset on any executable large enough to contain it. Please gate the logger on the matching build and collect the timer fields where the title updates them. The detached thread's volatile reads have no synchronization with those writes.Once #123 lands, could you rebase and share the focused test results and one matched
game/wallcomparison with the patch off and on? At 5 FPS, a 100 ms cap still allows only 100 ms of simulation per roughly 200 ms frame, so the trace would help pin down where the setting gets close to real time.Imported from TaynanGT/Vice-Tay. Originally posted by Geckomacabre on 2026-11-27T03:34:11Z.
Test results for this branch (Windows 11, RTX 4090, toolchain 1.98.1,
--test-threads=1):cargo check -p victory --features diagnostics --tests: clean.cargo test -p victory-loader -p victory-game -- --test-threads=1 step resolution: all passed (victory-game 2, victory-loader 6; 0 failed):step::tests::the_loads_read_the_titles_fifteenth_and_then_ours,step::tests::the_switch_range, and the resolution tests the checked writer (write_all_checked) sits beside.🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T04:01:28Z.
Thanks for posting the focused test results, @Geckomacabre. I approved the Windows workflow. Clippy caught a constant-only
assert!instep.rs:106under-D warnings. A compile-time assertion can keep that range check. The earlier review still needs the all-or-nothing writes and build-specific timer handling before we can evaluate the opt-in step change. CI runImported from TaynanGT/Vice-Tay. Originally posted by Geckomacabre on 2026-11-27T04:07:05Z.
Thanks for the review. Pushed
27c91ae(rebased onto the updated #123 branch; the step commit is the last one):write_all(): all compared up front, and if a later site cannot be made writable, the sites already written get their original bytes back before the error is reported. Test:a_failed_step_site_after_the_first_rolls_all_back(the writer fails on the 2nd, 3rd and 4th write in turn; every site is checked back to its original bytes).VICTORY_STEP_LOG: runs only on the known build (it says so and stops otherwise). The detached thread still samples the title's words without a lock; a sample is kept only when the time word reads the same before and after the frame count and step (acquire fences between the reads), so a sample torn by the title's update is taken again. Collecting the fields where the title updates them would need a hook at that site; I kept the logger as a read-only diagnostic instead. Happy to drop the logger from this PR if you prefer it separate.Status:
cargo checkand the unit tests of this revision are not run yet; results will follow after the next build window, together with a matchedgame/wallpair (patch off, patch at 100) from the same spot once #123 lands. Your point about 5 fps stands: at ~200 ms frames a 100 ms cap still allows about half of real time, so the trace should show where it gets close.🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by Geckomacabre on 2026-11-27T04:13:47Z.
Results for
27c91ae(Windows 11, RTX 4090, toolchain 1.98.1,--test-threads=1):cargo check -p victory --features diagnostics --tests: clean, no warnings.cargo test -p victory-loader -p victory-game -- --test-threads=1 step resolution: 11 passed, 0 failed (victory-game 2, victory-loader 9), including the newa_failed_step_site_after_the_first_rolls_all_back.🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T04:18:22Z.
Thanks for separating the timing question from the patch, @Geckomacabre. Draft #150 carries your opt-in step change with the compile-time range check and the four-site preflight. The loader, game and app checks passed locally. The detached timer reader is split out so the pacing change and the measurement approach can be reviewed independently. A matched off/on gameplay run would help once #149 is ready.
Pull request closed