Fix HD benchmark reporting and record renderer A/B results (#147)
build / mod (push) Failing after 17s

Resolve benchmark input paths before switching to the disposable game home and report startup failures without a missing screenshot traceback. Capture the executable hash and keep report environment metadata limited to benchmark settings.

Record the earlier light and smoke measurements and the repeated idle A/B runs. Verified with 18 Python benchmark tests, 36 Horizon HD tests, the Metal TAAU smoke test, and the real idle launch and error paths.
This commit is contained in:
2026-11-24 18:24:00 +03:00
parent 4b8fef6d8a
commit aaf72ef171
6 changed files with 158 additions and 9 deletions
+22 -1
View File
@@ -78,6 +78,15 @@ REPLAY_WARM_TICKS = 100 # 5 с записи до окна замера
STATS_RE = re.compile(r"В воздухе: (\d+), ракет: (\d+), ПВО: (\d+), сбито: (\d+), поражений: (\d+)")
# The mod's per-phase CPU profile lines (#147 step 3.1): `PROFILE key=value ...`.
PROFILE_RE = re.compile(r"(\w+)=(-?\d+(?:\.\d+)?)")
REPORT_ENV_KEYS = {
"HORIZON_LAUNCHER_NO_SELF_UPDATE",
"HORIZON_MODEL_INSTANCING",
"HORIZON_MOD_CPU_PROFILE",
"HORIZON_MOD_FUEL_PROFILE",
"HORIZON_NO_AUDIO",
"HORIZON_SHADER_PACK_TIMING",
"HORIZON_SPIKES",
}
class BenchError(RuntimeError):
@@ -265,6 +274,11 @@ class Driver:
env.update(self.extra_env)
return env
def report_env(self):
# Keep the renderer and profiler settings without copying login credentials or the shell environment.
return {key: value for key, value in self.env().items()
if key in REPORT_ENV_KEYS or key.startswith("HORIZON_HD_")}
def launch(self):
if self.sock.exists():
self.sock.unlink()
@@ -451,9 +465,15 @@ def static_parity(args):
def run(args):
from hd_bench import file_sha256
d = Driver(args.out, args.game, args.resources, args.mod,
dict(kv.split("=", 1) for kv in args.env), args.width, args.height,
scheduler=args.scheduler)
try:
game_sha256 = file_sha256(d.game)
except OSError:
game_sha256 = None
d.prepare()
d.launch()
report = {
@@ -467,9 +487,10 @@ def run(args):
"airdef_branch": git_branch(ROOT),
"horizon": git_sha(ROOT / "horizon"),
},
"game_sha256": game_sha256,
"platform": {"system": platform.system(), "machine": platform.machine(),
"mac_ver": platform.mac_ver()[0]},
"env": d.env(),
"env": d.report_env(),
"battle_schedule": [[t, c] for t, c in BATTLE_SCHEDULE],
"windows": {},
"checks": {},