orchestrator — the run → analyze → plot → report pipeline loop
Purpose
Owns the end-to-end analysis loop: build run contexts from a spec YAML, run live or load
stored NPZ logs, reduce metrics to tables, render figures, and assemble a LaTeX/PDF report.
The single module that callsrunner/data_analyzer/plotter/star_reporter— and nowhere
else reaches across those boundaries.
Role in the system
- Entry point: top-level
run_spec.py(edit the stem) →Orchestrator(stem).run(). runs/loadsvia runner (live sim) and logger (LogStoreNPZ IO).reducesvia data_analyzer (DataSummary/LogView),rendersvia plotter,reportsvia star_reporter.loads specsvia pre_run_loader (RunSpecLoader/MetricSpecLoader).- The hard handoff between halves is the NPZ log; the loop is one direction (logger never plots, reporter never recomputes).
Inputs / Outputs
- In: a run-spec YAML stem (resolved through
RunSpecLoader), the metric catalog, the output flags, and any stored NPZ logs. - Out: an
OrchestrationResult— contexts,LogWorklogs, reduced table frames, figure paths (+ project-relative), descriptive conclusions, and report.tex/.pdfpaths. - On disk: the run-stamp contract
logs/logs_<date>/<stem>/{figures,npz,reports}/run_PMHHMM/.
Key methods
run— the full pipeline (contexts → logs → analyze → plot → report) →OrchestrationResult—analysis/orchestrator.py:1018build_run_contexts— one context for SINGLE, else one per validated variant —:218run_or_load_one— load the context’s stored NPZ if available, else run the sim live —:331analyze— per-log tables + comparison/sweep/peak tables + conclusions —:401plot/plot_overall— per-variant figures / cross-variant overlay + reduction-sweep figures —:505/:767overlay_figure_spec— one overlay figure (primary keys + optional twinx secondary keys) —:727sweep_rows— reduce each (window, metric) across variants into keyed rows —:905report/build_reporter— flat report (SINGLE) vs sectioned-per-variant —:969/:981output_run_stamp— therun_PMHHMMstamp tying every figure/log/report to one run —:181
Footguns
The stem IS the spec name
The YAML file stem is the canonical
spec.name; a differing explicitname:field triggers a
[Legacy]warn and is overwritten. Variant names/labels derive fromsafe_filename(value)or
{flag-leaf}_{value}— never repeat them in the YAML. (analysis/INSIGHTS.md[io])
key_variablesdrives all report tables
comparison.key_variablesis the authoritative metric list;Nonefalls back to the catalog
include:flag (single-log legacy). The report never auto-injects scoreboard content — the console
toolvalidation/run_scoreboard.pyis the model. (analysis/INSIGHTS.md[config])
secondsis not in the merged figure schema
figure_log_viewreadswindow.secondsviaobject_fields(...).get("seconds")(tolerant) rather
than attribute access, because a figure omitting the key has nosecondsattribute after the schema
merge. Any new zoom key needs the same tolerant read. (analysis/INSIGHTS.md[footgun])
Boolean comparison auto-synthesizes its variants
ComparisonMode.BOOLEANsynthesizes[False, True]when the spec omitsvariants, so a two-state
sweep needs onlymode: booleanandflag:. (analysis/INSIGHTS.md[config])
mask_vs_sminis the ONE allowed band hardcode
resolve_mask’smask_vs_smin: trueresolves to the singularity bandSMIN_BAND(from
data_analyzer);exclude: trueinverts it. Band-masked rows are tagged_band/_xbandto stay a
distinct row from the plain (p99) or op-window (p99_op) reduction. (analysis/INSIGHTS.md[config], [io])
Pseudocode (one run())
contexts = build_run_contexts() # SINGLE → 1; else 1 per validated variant
log_work = run_or_load_logs(contexts) # per context: load stored NPZ OR run live (Runner)
analysis = analyze(log_work) # LogView → reduced tables; comparison/sweep/peak; conclusions
variant_figures = plot(analysis) # per-variant configured + peak figures (Plotter)
overlay_figures = plot_overall(analysis) # cross-variant overlay + reduction-sweep (spans ALL variants)
report = report(...) # SINGLE → flat report; else Intro + one section per variant
return OrchestrationResult(...) # contexts, logs, tables, figures, conclusions, report paths
Related
runner · logger · data_analyzer · plotter · star_reporter · pre_run_loader · terminology