Share worker setup, residual preparation, and scenario capture

This commit is contained in:
Jan Petykiewicz 2026-11-27 00:38:00 -08:00
commit 0c059cc7d6

View file

@ -7,27 +7,7 @@ from dataclasses import asdict
from datetime import date
from pathlib import Path
from inire.tests.example_scenarios import PERFORMANCE_SCENARIO_SNAPSHOTS, SCENARIO_SNAPSHOTS
SUMMARY_METRICS = (
"route_iterations",
"nets_routed",
"nodes_expanded",
"ray_cast_calls",
"moves_generated",
"moves_added",
"dynamic_tree_rebuilds",
"visibility_builds",
"congestion_check_calls",
"verify_path_report_calls",
)
def _snapshot_registry(include_performance_only: bool) -> tuple[tuple[str, object], ...]:
if not include_performance_only:
return SCENARIO_SNAPSHOTS
return SCENARIO_SNAPSHOTS + PERFORMANCE_SCENARIO_SNAPSHOTS
from inire.tests.example_scenarios import capture_scenario_snapshots
def _build_payload(
@ -35,12 +15,7 @@ def _build_payload(
*,
include_performance_only: bool = False,
) -> dict[str, object]:
allowed = None if selected_scenarios is None else set(selected_scenarios)
snapshots = []
for name, run in _snapshot_registry(include_performance_only):
if allowed is not None and name not in allowed:
continue
snapshots.append(run())
snapshots = capture_scenario_snapshots(selected_scenarios, include_performance_only=include_performance_only)
return {
"generated_on": date.today().isoformat(),
"generator": "scripts/record_performance_baseline.py",