mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-12 10:21:02 +00:00
build_game.py --pgo gen builds an instrumented totk.exe (llvm-mingw: MSYS2's clang has no profile runtime) that adds its counts to <out>/pgo/*.profraw every minute and at exit; plat_exit ends the process with ExitProcess, which skips compiler-rt's atexit write. tools/pgo.py merges them into build/pgo/pgo-<ver>.profdata with a record of the recomp/ tree it fits. build_game.py --pgo FILE compiles the generated code at -O2 and the runtime with that profile. make_release.py ships build/pgo's profiles in data/ and builds the runtime libraries with them; the installer passes the update's profile to build_game.py, and builds at -O1 without one. Profiles name lifted functions by address and hold branch counts and control-flow hashes of the generated C, no bytes of the game. 1.4.3 on machine A, mean frame by world clock: the fight2 bench 11.49 -> 10.06 ms (-12.5%), a fight outside the training 13.00 -> 12.24 ms (-5.8%); every window CPU-bound. The profile was trained on scripted runs and 24 minutes of play. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>