Build game 1.1.1 with the kit's execution profile, and make its instrumented build.

tools/make_game.py, the build players run through the launcher, read no profile: only tools/build_game.py did, which
does not build 1.1.1. A kit with data/pgo-v111.profdata (build/pgo/ in a checkout) now compiles the lifted code at -O2
with it and the runtime too, the prebuilt runtime library included. The profile is left out, and every command and
key is what it was, when the kit has none, when its record names another recomp/ than the kit's, when a compiler of
the build refuses the file in one trial compile before the others start, and with NX2NAVI_PGO=off. The record holds
recomp/ by content, which a kit without git can compare. The object keys hold the profile's content and not the kit's
folder, so a launcher update that moves the kit keeps the objects.

--pgo gen (NX2NAVI_PGO=gen from a launcher) builds the instrumented game into the game folder: it counts into
<out>/pgo, records what it was built from for the merge, and stops at once when the build tools lack the profile
runtime. tools/pgo.py merge takes that record, refuses a game built from another recomp/ and finds llvm-profdata in an
MSYS2 folder too. tools/check_content.py refuses profiles in a commit.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 22:28:19 -05:00
parent a84a555128
commit 2ede7101fa
5 changed files with 851 additions and 44 deletions

View File

@@ -108,6 +108,14 @@ def recorded_in_play(path: Path, data: bytes | None) -> bool:
return data[:8] in RECORD_MAGICS
def execution_profile(path: Path) -> bool:
"""The counts an instrumented game wrote (.profraw) or their merged profile (.profdata, tools/pgo.py): they name
the lifted functions and count their branches, so they are derived from the game's code. A launcher release or
an installer release may carry a profile (data/pgo-<version>.profdata), so make_launcher.py and make_release.py,
which call problems_for, are not held to this."""
return path.suffix.lower() in (".profdata", ".profraw")
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
parser.add_argument("--staged", action="store_true", help="check staged files only")
@@ -123,6 +131,8 @@ def main() -> int:
problems.append("compiled shader: the repository holds the source, tools/build_shaders.py builds this")
if recorded_in_play(path, data):
problems.append("recorded from a game folder (shaders, answers, pipeline keys or a pipeline list)")
if execution_profile(path):
problems.append("execution profile of the game's code: it stays in build/ (tools/pgo.py)")
for problem in problems:
print(f"{path}: {problem}")
failed = True