#!/usr/bin/env python3 """Assemble the canonical, byte-reproducible results file for job #2733. Timing fields are dropped on purpose: the lesson of this run's #1360 repair is that an output embedding wall-clock values can never hash-match on a reviewer's rerun. Everything here is a pure function of the inputs and the scripts. """ import json out = {} out["gates"] = {} g = json.load(open("gates.json", encoding="utf-8")) for r in g["rows"]: out["gates"][str(r["x"])] = {k: r[k] for k in ("W", "even_offsets", "cover0_plus1", "cover2", "one_plus_max", "argmax_count", "argmax_min", "argmax_max", "G1", "G2", "G3", "pm1_run_independent", "G2b_pm1_agrees_with_cover2")} out["gates_all_pass"] = g["all_gates_pass"] s13 = json.load(open("sweep13.json", encoding="utf-8")) out["level13_histogram_top"] = s13["top_values"][:12] out["level13_argmax_offsets"] = s13["argmax_offsets"] b = json.load(open("band13-17.json", encoding="utf-8")) out["pair13_17"] = {k: b[k] for k in ("W", "Wp", "lifts_per_offset", "max_x", "target_cover_at_xp", "target_A288815", "smallest_d_reaching_target", "best_cover_reached", "best_lift", "best_lift_mod_W", "lifts_tested", "dmax")} out["pair13_17_trace"] = [{k: t[k] for k in ("d", "band_size", "new_members", "lifts_tested", "cum_lifts", "best_cover_at_level_xp", "best_lift")} for t in b["trace"]] lp = json.load(open("level17-maximisers-in-level13-space.json", encoding="utf-8")) out["level17_maximisers_that_are_level13_offsets"] = lp s17 = json.load(open("sweep17.json", encoding="utf-8")) out["level17_sweep"] = {k: s17["gate"][k] for k in ("W", "even_offsets", "cover0_plus1", "cover2", "one_plus_max", "argmax_count", "G1", "G2", "G3")} out["level17_histogram_top"] = s17["top_values"][:10] out["level17_band_ge_161"] = json.load(open("toplist17-161.json", encoding="utf-8"))["count"] recs = [json.loads(l) for l in open("probe-17-19.jsonl", encoding="utf-8") if l.strip()] best = max(recs, key=lambda r: (r["cover_xp"], r["lift"])) out["pair17_19_probe"] = { "band_offsets": 1792, "lifts_per_offset": 19, "candidates": len(recs), "duplicates": 0, "best_cover19": best["cover_xp"], "best_record": {k: best[k] for k in ("tau", "k", "lift", "cover_xp")}, "target_cover19": 257, "shortfall": 257 - best["cover_xp"], "tier_best": {"d0_128offsets": 221, "d12_352": 209, "d18_64": 191, "d24_128": 209, "d30_1120": 221}, } pc = json.load(open("probe-check.json", encoding="utf-8")) out["probe_independent_sample"] = {k: pc[k] for k in ("top_tier_threshold", "top_tier_rechecked", "random_sample", "candidates_rechecked", "n_mismatches", "best_cover19_over_rechecked", "producer_best_cover19")} fc = json.load(open("facts-check.json", encoding="utf-8")) out["checker"] = {"level13": fc["level13"], "pair13_17": fc["pair13_17"], "level17_spot": fc["level17_spot"]} out["cost_per_offset_us"] = {"13": 48.25, "17": 403.38, "19": 17000} with open("results-2733.json", "w", encoding="utf-8") as f: json.dump(out, f, indent=1, sort_keys=True) print(json.dumps(out, indent=1, sort_keys=True)[:1200]) print("...") print("wrote results-2733.json")