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
+15
View File
@@ -1,13 +1,28 @@
"""Тесты драйвера raid_bench (#147): перцентили как в FrameStats, худшие кадры,
расписание боя и разбор отпечатка. Запуск: python3 -m unittest tools/test_raid_bench.py."""
import os
import sys
import unittest
from pathlib import Path
from unittest.mock import patch
sys.path.insert(0, str(Path(__file__).resolve().parent))
import raid_bench as rb # noqa: E402
class ReportEnvironment(unittest.TestCase):
def test_keeps_benchmark_settings_and_excludes_credentials(self):
driver = rb.Driver("out", "game", "resources", "airdef.hmod",
{"HORIZON_HD_SCALE": "0.67", "EXAMPLE_PASSWORD": "test"}, 1280, 720)
with patch.dict(os.environ, {"HORIZON_HD_WATER": "0", "EXAMPLE_API_KEY": "test"}, clear=True):
env = driver.report_env()
self.assertEqual(env["HORIZON_HD_SCALE"], "0.67")
self.assertEqual(env["HORIZON_HD_WATER"], "0")
self.assertEqual(env["HORIZON_MOD_CPU_PROFILE"], "1")
self.assertNotIn("EXAMPLE_API_KEY", env)
self.assertNotIn("EXAMPLE_PASSWORD", env)
class Percentiles(unittest.TestCase):
def test_ceil_index_like_frame_stats(self):
# FrameStats::summary: sorted[ceil(n*p).clamp(1, n) - 1].