Repository navigation
[perf/fight-frames] VU0 FMAC inlined; the frame pacer on a waitable timer on Windows - #138
Merged
Merged
Conversation
… functions add, sub, mul, madd and msub keep their SIMD shortcut and hand the other cases to addExact, subExact, mulExact, maddExact and msubExact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… every call add, sub, mul, madd and msub were real calls from the generated code (built at -O1) and from the port's microprograms. They are now always_inline with their sources by reference, and the field-by-field paths stay out of line, so only the rare exact case pays for a call. Tales of Souls fight (PAL60, Valentine Mansion), headless game-thread work: 7.42 -> 6.30 ms a frame. The US route's record is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FramePacer::frameEnd and the window's own present schedule slept with std::this_thread::sleep_until, which MinGW turns into nanosleep. Under Proton Experimental with fsync that oversleeps by up to 13 ms, so a game with 1 ms of work a frame ran its menus at 55 frames a second while the presents held 60. bozo::app::sleepUntil waits on a high-resolution waitable timer instead (a plain one where that kind is missing, then sleep_until); other systems keep sleep_until. PAL sc3.exe under Proton Experimental with fsync, menus: 58.6 -> 59.95 game frames a second (a standalone pacer loop: 55 -> 60.00). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frame-time work for TheBozos/SoulCaliburIII_Recomp#15 (fights below 60 game frames/s on a Ryzen 7 3800X; menus at 55 under Proton Experimental with fsync).
Layers:
refactor(vu0): the field-by-field FMAC paths as named functions (no behaviour change).perf(vu0): the four-field FMAC shortcut (madd,mul,add,sub) always inlined at every call, sources by reference; the rare exact path stays out of line. These were real calls from both the generated code and the VU0 microprogram interpreter.fix(app):bozo::app::sleepUntilsleeps on a high-resolution waitable timer on Windows (falling back to a plain waitable timer, thensleep_until); the frame pacer and the window thread use it. Under Proton Experimental with fsync,sleep_untiloverslept by up to 13 ms and a 60 cap ran at 52-57.Measured with Soulcalibur III (game-thread work per frame,
PS2X_FRAME_STATS=1, Tales of Souls fight on a Ryzen 7 7800X3D): 6.9 ms on this master, 6.45 ms with layer 2; the game's own mesh changes take it to 5.2 ms. A standalone pacer loop under Proton Experimental + fsync: 55 -> 60.00 frames/s. The game's headless US route record (calls, threads, sound, draw-list hashes) is identical on every frame after every layer. 58 tests pass at each layer.🤖 Generated with Claude Code