Files
vvsandClaude Opus 5 9884b21204 PREREG_flat_twice outcome: stage 1 passed (twice-in-a-row fires on 27.8% of model steps on the flat families, 8.7% on APS, 4.3% on fun1; flat/APS ratio 3.20 against the single flag's 2.47), stage 2 FAILED: under the projection APS 2806 -> 2803 (W2 holds, the per-problem edge over Chandrupatla kept at 83/28/42) but CHA 3220 -> 3341 and the flat families 1823 -> 1975 (W1, W4 fail); with G2 the same. Under safe/step the twice gate is inert (3390 -> 3388) where the single one gave 3037.
Mechanism: the flat cycle is undershoot, undershoot, crossing, near-empty step. The single flag fires after the first undershoot and replaces the second - a useless step; the twice flag fires after the second and replaces the CROSSING, the one step of the cycle that collapses the bracket. The second undershoot's r is ~0.26, next to the 1/4 threshold, so the pair often does not even form. Again a detectability gain that did not carry to run cost. Next candidate (not pre-registered): the unkept promise AND a creep - the same step moving the same way as the previous one.

Removed a vacuous pin I had written (s2 <= max(s1, s2)). Regression on the branch: 935 pass twice; the only red test is the paper-number check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 13:45:20 +01:00

55 lines
2.8 KiB
Python

"""Verdicts Z1-Z5 of PREREG_flat_regime_2026-09-21.md (stage 2) from sweep_flat.json.
python -u analyze_flat.py
"""
from __future__ import annotations
import json
from analyze_extrap import FAMILY, FLAT, fam_sum, h2h, load, sign_p
def main(path="sweep_flat.json", gate="flat"):
rows = load(path)
cha = {r["label"]: r for r in load("sweep_full.json")}["chandrupatla"]
cell = {}
for r in rows:
s = r["spec"]
cell[(s[1], s[3], s[9], s[5])] = r
print("tent, 3-point, pairs (no gate -> flat gate) APS CHA both flat fun3-6")
for gu in ("none", "step", "bracket", "both", "project", "safe", "credit"):
for ext in ("none", "pattern"):
a, b = cell[("ratio", gu, ext, "none")], cell[("ratio", gu, ext, gate)]
print(f" {gu:<8} {'+G2' if ext == 'pattern' else ' '} "
f"{a['APS']['total']:5d}->{b['APS']['total']:<5d} {a['CHA']['total']:5d}->"
f"{b['CHA']['total']:<5d} {a['APS']['total'] + a['CHA']['total']:5d}->"
f"{b['APS']['total'] + b['CHA']['total']:<5d} {fam_sum(a, FLAT):5d}->"
f"{fam_sum(b, FLAT):<5d} solved {b['APS']['solved'] + b['CHA']['solved']} "
f"over {b['APS']['over'] + b['CHA']['over']}")
print("\nVERDICTS")
for ext, name in (("none", "proposed rule"), ("pattern", "proposed rule + G2")):
a, b = cell[("ratio", "project", ext, "none")], cell[("ratio", "project", ext, gate)]
fam = [r for k, r in cell.items() if k[3] == gate and k[1] in FAMILY]
viol = sum(r["APS"]["over"] + r["CHA"]["over"] for r in fam)
low = sum(1 for r in fam if r["APS"]["solved"] + r["CHA"]["solved"] < 193)
z1 = b["CHA"]["total"] < a["CHA"]["total"]
z2 = b["APS"]["total"] <= a["APS"]["total"]
z3 = viol == 0 and low == 0
z4 = fam_sum(b, FLAT) < fam_sum(a, FLAT)
w, t, l = h2h(b, cha, "APS")
print(f" {name:<20} APS {a['APS']['total']}->{b['APS']['total']} (Z2 {'✓' if z2 else '✗'}) "
f"CHA {a['CHA']['total']}->{b['CHA']['total']} (Z1 {'✓' if z1 else '✗'}) "
f"Z3 {'✓' if z3 else '✗'} ({viol} viol, {low} cells <193) Z4 {'✓' if z4 else '✗'} "
f"both {b['APS']['total'] + b['CHA']['total']} vs Chandrupatla APS {w}/{t}/{l} "
f"p={sign_p(w, l):.2g}" + (" ACCEPTED" if z1 and z2 and z3 else " not accepted"))
print("\nnine functions, projection, no gate -> flat gate, both sets:")
for sim in sorted({k[0] for k in cell}):
a, b = cell[(sim, "project", "none", "none")], cell[(sim, "project", "none", gate)]
print(f" {sim:<11} {a['APS']['total'] + a['CHA']['total']:6d} -> "
f"{b['APS']['total'] + b['CHA']['total']:6d}")
if __name__ == "__main__":
import sys
main(*sys.argv[1:3]) if len(sys.argv) > 2 else main()