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
+8 -4
View File
@@ -27,7 +27,7 @@
пикселей (--min-static: ноль статичных — не «ноль ошибки», а провал). Для движущейся части
выводится отдельная средняя разница, только для информации. Картинка `<сцена>_motion.png` показывает маску.
Коды выхода: 0 — всё в порогах и бюджете; 1 — есть превышение; 2 — ошибка запуска или аргументов.
Коды выхода: 0 — всё в порогах и бюджете; 1 — не пройдены проверки; 2 — ошибка запуска, сцены или аргументов.
Только стандартная библиотека; при установленном Pillow декодирование PNG быстрее.
"""
import argparse
@@ -575,7 +575,8 @@ def write_report(out, entries, args, env_extra, size, baseline, meta):
add("")
add(f"### {e['name']}: {e['note']}")
add("")
add(f"![{e['name']}]({e['frame']})")
if (frame := e.get("frame")) and (out / frame).is_file():
add(f"![{e['name']}]({frame})")
if e.get("diff_image"):
add("")
add(f"Разница с базой (x{DIFF_GAIN}, синим — движущиеся пиксели, не сравниваются): ![diff]({e['diff_image']})")
@@ -654,8 +655,9 @@ def main(argv=None):
sys.path.insert(0, str(ROOT / "tools"))
import airdef # tools/airdef.py: ресурсы и путь к игре
game = Path(args.game) if args.game else airdef.built_game()
resources = Path(args.resources) if args.resources else airdef.resources()
# The launcher runs in HOME. Resolve caller-relative paths before changing directories.
game = (Path(args.game) if args.game else airdef.built_game()).expanduser().resolve()
resources = (Path(args.resources) if args.resources else airdef.resources()).expanduser().resolve()
try:
game_sha = file_sha256(game)
except OSError:
@@ -731,6 +733,8 @@ def main(argv=None):
for r in e["fail"]:
print(f" FAIL: {r}")
print(f"отчёт: {out / 'report.md'}")
if any(e.get("error") for e in failed):
return 2
return 1 if failed else 0