#!/usr/bin/env python3 """Matched-ceiling V-ladder at the top scales (job #2040). Pre-registered in PREREG-2040.md: the V-ladder of v_ladder.py moves the split's ceiling AND the chain endpoint at once (chain = {1,...,V}). This script holds the chain at {1,2,4,8,16} and varies only the split's ceiling V, so Tx_matched(V) = tI_V(16) - tI_V(1) isolates the leg-ceiling axis, which is the axis the disclosed S2 correction puts the mechanism question on. S2m (same thresholds as S2): refuted if max_{V>=128} |Tx(V) - Tx(32)| / (0.08x) >= 2, supported if <= 1, inconclusive between. Env: VM_JLIST="24,25", VM_VS="16,32,64,128,256", VM_OUT=v-matched-24.json """ import json import math import os import sys HERE = os.path.dirname(os.path.abspath(__file__)) RUN = os.path.join(HERE, "..") sys.path.insert(0, os.path.join(RUN, "job2050")) from window_increments import family # noqa: E402 ALLOWANCE = 0.08 CHAIN = [1, 2, 4, 8, 16] VS = [int(v) for v in os.environ.get("VM_VS", "16,32,64,128,256").split(",")] JLIST = [int(v) for v in os.environ.get("VM_JLIST", "24").split(",")] OUT = os.environ.get("VM_OUT", "v-matched-24.json") def main(): out = {"chain": CHAIN, "allowance": ALLOWANCE, "jlist": JLIST, "vs": VS, "rows": []} for j in JLIST: x = 2 ** j byV = {} for V in VS: r = family(x, CHAIN, V) inc = r["increments_over_x"] row = { "j": j, "V": V, "surviving_pairs": r["surviving_pairs"], "Tx_over_x": sum(inc), "Vx_over_x": sum(abs(v) for v in inc), "G": r["G_sum_abs_inc_over_max_member"], "window_abs_mass_over_x": r["window_abs_mass_over_x"], "members_over_x": r["members_over_x"], "increments_over_x": inc, "sign_changes": r["sign_changes"], "mu_identity_violations": r["mu_identity_violations"], "window_identity_resid_rel": r["window_identity_resid_rel"], "invariant_matches_free_side": r["invariant_matches_free_side"], } out["rows"].append(row) byV[V] = row print(json.dumps({k: row[k] for k in ("j", "V", "Tx_over_x", "Vx_over_x", "G", "sign_changes", "mu_identity_violations", "invariant_matches_free_side", "surviving_pairs")}), flush=True) base = byV[32]["Tx_over_x"] dev = {str(V): abs(byV[V]["Tx_over_x"] - base) / ALLOWANCE for V in VS} out.setdefault("S2m", {})["x=2^%d" % j] = { "Tx_by_V": {str(V): byV[V]["Tx_over_x"] for V in VS}, "dev_from_V32_in_allowance_units": dev, "max_dev_V_ge_128": max(dev[str(V)] for V in VS if V >= 128), } for k, v in out["S2m"].items(): v["S2m_refuted"] = v["max_dev_V_ge_128"] >= 2 v["S2m_supported"] = v["max_dev_V_ge_128"] <= 1 with open(os.path.join(HERE, OUT), "w") as fh: json.dump(out, fh, indent=1) print(json.dumps(out["S2m"], indent=1)) if __name__ == "__main__": main()