"""Three independent clean runs of run_v9_cite.sh, side by side. cite_v9_runs.py OUT_A OUT_B OUT_C Per point: each run's median ratio v9/v9n with its bootstrap 95% CI (as cite_v9.py), the strict cita verdicts A->B and B->C (second median inside the first's CI), the envelope [lowest CI bound, highest CI bound] over the three runs, which also holds the run-to-run spread, and whether all rounds of all runs were faster. """ import statistics as st import sys import importlib.util spec = importlib.util.spec_from_file_location("c", __file__.replace("cite_v9_runs.py", "cite_v9.py")) sys_argv = sys.argv sys.argv = [sys_argv[0], sys_argv[1]] c = importlib.util.module_from_spec(spec) import io, contextlib with contextlib.redirect_stdout(io.StringIO()): spec.loader.exec_module(c) runs = [c.ratios(p) for p in sys_argv[1:4]] print("point: A med [CI] n | B | C | A->B B->C | envelope over 3 runs | every round of 3 runs faster") for k in sorted(runs[0]): meds, cis = [], [] for r in runs: meds.append(st.median(r[k])); cis.append(c.ci(r[k])) v = lambda i, j: "ok" if cis[i][0] <= meds[j] <= cis[i][1] else "UNST" allx = [x for r in runs for x in r[k]] lo, hi = min(x[0] for x in cis), max(x[1] for x in cis) cells = " | ".join(f"{m:.3f} [{a:.3f}, {b:.3f}] n={len(r[k])}" for m, (a, b), r in zip(meds, cis, runs)) flag = "yes" if max(allx) < 1 else "no" print(f" {k[0]} {k[1]} {k[2]}: {cells} | {v(0,1)} {v(1,2)} | [{lo:.3f}, {hi:.3f}] | {flag} ({len(allx)} rounds)")