#!/usr/bin/env python3 # ============================================================================ # job #1927 -- ADDENDUM to job1927-checks.py. The original ledger is NOT edited # and its log is NOT overwritten (README gotcha 66b): it recorded ONE failed # check, and the failure is a real result. This addendum only (a) states why the # check failed, (b) records the pre-registered DECISION RULE v2 for the successor # -- explicitly marked second-stage, since v1 was written before the run and v2 # after it -- and (c) computes the exact T29 null band the successor must beat. # # WHY THE v1 CHECK FAILED. v1 pre-registered one direction only: # H1: Lambda_p > 1.05 (kill positions CLUSTER beyond exchangeability) # FALSIFIER: all Lambda_p in [0.95, 1.05] # The measurement (job1927-checks.log) returned Lambda = 0.0385 / 0.0729 / 0.0553 # at p = 29 / 31 / 37 (z = -85.8 / -84.2 / -32.5), i.e. 13-26x BELOW the # exchangeable expectation. Neither branch of the v1 rule covers Lambda < 0.95, # so the check correctly reported "MIXED: report per-fold" and FAILED. The # pre-registered hypothesis is therefore FALSIFIED IN DIRECTION but the statistic # is decided, in the opposite direction: the fold-kill positions are strongly # ANTI-clustered. # # DECISION RULE v2 (second-stage, for the successor run; recorded now, before it): # A2: Lambda(T_x,p) in [0.02, 0.12] for x = 29, p in {29, 31, 37} -- the T23 # anti-clustering ratio is a tile-invariant of the fold kills. # FALSIFIER for A2: any measured Lambda(T29,p) > 0.30, or any Lambda < 0.005, # falsifies A2 and makes the ratio tile-specific (report the table). # The successor test is one constant-memory segmented T29 pass (~11-16 s, # README gotcha 47), counting only K2 -- not the full census. # ============================================================================ import json, math D23, D29 = 7952175, 214708725 P29 = 6469693230 CHECKS = [] def check(name, cond, detail=""): ok = bool(cond) CHECKS.append({"name": name, "pass": ok, "detail": detail}) print(("PASS " if ok else "FAIL ") + name + ((" " + detail) if detail else ""), flush=True) def null_k2(D, m): p1 = m * (m - 1) / (D * (D - 1)) p_adj = m * (m - 1) * (m - 2) / (D * (D - 1) * (D - 2)) p_far = m * (m - 1) * (m - 2) * (m - 3) / (D * (D - 1) * (D - 2) * (D - 3)) E = D * p1 E2 = D * p1 + 2 * D * p_adj + (D * (D - 1) - 2 * D) * p_far return E, math.sqrt(max(E2 - E * E, 0.0)) res = json.load(open("job1927-result.json", encoding="utf-8")) rows = res["rows"] lam23 = {int(p): rows[str(p)]["lambda"] for p in (29, 31, 37)} k223 = {int(p): rows[str(p)]["k2"] for p in (29, 31, 37)} # the per-fold matched control is already in the ledger result (same histogram, permutation order) perm_k2 = {int(p): v for p, v in res["nonredundancy"]["perm_k2"].items()} lam_ctrl = {p: perm_k2[p] / rows[str(p)]["E"] for p in (29, 31, 37)} print(" T23 measured Lambda " + str({p: round(lam23[p], 4) for p in (29, 31, 37)}), flush=True) print(" T23 permutation-control Lambda " + str({p: round(lam_ctrl[p], 4) for p in (29, 31, 37)}), flush=True) # one permutation per fold at p=29/37 and four at p=31 (ledger: mean 7744.8 vs E 7737.8, sd 85.2), # so the control band is |Lambda_ctrl - 1| <= 0.05; the measured ratios are ~20x further away. check("the matched control sits at Lambda = 1 to within 0.05 at every fold (null calibrated per fold)", all(abs(lam_ctrl[p] - 1.0) <= 0.05 for p in (29, 31, 37)), str({p: round(lam_ctrl[p], 4) for p in (29, 31, 37)})) check("the measured ratio is BELOW the control at every fold by at least 12x (anti-clustering is real, not noise)", all(lam_ctrl[p] / lam23[p] > 12 for p in (29, 31, 37)), str({p: round(lam_ctrl[p] / lam23[p], 1) for p in (29, 31, 37)})) # ---- the T29 prediction the successor can beat ----------------------------- M_W1_31 = 8022924 # #1023: weight-1 kill-class occurrence count at T29/p=31 E29, sd29 = null_k2(D29, M_W1_31) pred = {p: lam23[p] * E29 for p in (29, 31, 37)} print(f" T29/p=31 exchangeable null: E={E29:.0f} sd={sd29:.1f} (sd/E={sd29/E29:.5f})", flush=True) print(" T29 predicted K2 under A2 (Lambda from T23): " + str({p: int(pred[p]) for p in (29, 31, 37)}), flush=True) print(f" => the null is excluded at (E - pred)/sd = {(E29 - pred[31])/sd29:.0f} sigma", flush=True) check("A2's prediction is decidable at T29: the exchangeable null is >25 sigma above the predicted anti-clustered value", (E29 - pred[31]) / sd29 > 25, f"E={E29:.0f} pred={pred[31]:.0f} sd={sd29:.1f} sigma={(E29 - pred[31])/sd29:.0f}") check("A2's band [0.02, 0.12] contains the three measured T23 ratios and is 12x away from the null in sd terms", all(0.02 <= lam23[p] <= 0.12 for p in (29, 31, 37)) and (1 - 0.12) * E29 / sd29 > 1000, f"sigmas from null to band edge = {(1-0.12)*E29/sd29:.0f}") # ---- what the statistic decides that the retained census cannot ------------- # The census's size->=3 entries need adjacent kill pairs: n3 <= K2. Exchangeability # would put K2 near E29 = 299 800 at T29/p=31 while #161/#1023 publish n3 = 12 992, # so the retained column is NOT what the histogram + exchangeable order predicts; # but the retained column alone cannot say this, because it records sizes, not runs. N3_T29_31 = 12992 check("the census cannot state this: n3 = 12 992 (T29/p=31) is 23x below the exchangeable adjacent-pair count", E29 / N3_T29_31 > 20, f"E(K2)={E29:.0f} vs published n3={N3_T29_31} ratio={E29/N3_T29_31:.1f}") out = {"lambda_t23": {str(p): lam23[p] for p in (29, 31, 37)}, "lambda_t23_control": {str(p): lam_ctrl[p] for p in (29, 31, 37)}, "t29_null_E": E29, "t29_null_sd": sd29, "t29_predicted_k2": {str(p): pred[p] for p in (29, 31, 37)}, "decision_rule_v2": {"A2_band": [0.02, 0.12], "falsifier": "Lambda(T29,p) > 0.30 or < 0.005 for some p in {29,31,37}", "v1_outcome": "H1 falsified in direction (anti-clustering, Lambda << 1)"}, "checks": CHECKS, "pass": sum(1 for c in CHECKS if c["pass"]), "fail": sum(1 for c in CHECKS if not c["pass"])} with open("job1927-addendum.json", "w", encoding="utf-8") as f: json.dump(out, f, indent=1, sort_keys=True) print(f"ALL_PASS={out['fail'] == 0} ({out['pass']} pass / {out['fail']} fail)", flush=True)