"""Consequence check of the new diagnosis, read off the existing sweep_decision.json. If the flat families are won by BISECTING (Chandrupatla bisects 93-100% there), then his band inside our step - which refuses and bisects - must HELP on fun3-fun6 and HURT on the families where our step is good. Per-problem costs, band against no gate, same similarity, scale and guard. No new run: the numbers are the Linux sweep's. python -u diag_band_by_family.py """ from __future__ import annotations import json from collections import defaultdict def main(): with open("sweep_decision.json", encoding="utf8") as fh: rows = json.load(fh) by = {(r["spec"][1], r["spec"][5], r["spec"][3]): r for r in rows} for gu in ("project", "credit"): base = by[("ratio", "none", gu)]["CHA"]["per"] band = by[("ratio", "band", gu)]["CHA"]["per"] fam = defaultdict(lambda: [0, 0]) for pid, (n0, ok0) in base.items(): n1, ok1 = band[pid] k = pid.split(".")[0] fam[k][0] += n0 if ok0 else 200 fam[k][1] += n1 if ok1 else 200 print(f"guard={gu}: family no-gate band delta") for k in sorted(fam): a, b = fam[k] print(f" {k:<6} {a:7d} {b:6d} {b - a:+6d}") print() if __name__ == "__main__": main()