P2r main grid: runner, summary, results; close the P2r decision

- scripts/11: check_rids guard; scripts 14/15 accept the protocol_p2r main grid
  (realizations 8-15) only when protocol_p2r and its inputs match the locked SHA-256
- scripts/run_p2r_main.sh: per-regime pipelines (posterior then training) on cuda:0/cuda:1
- scripts/18_summarize_p2r.py: H2a / H2b / H3 / sigma_a verdicts per the locked rules
- docs/plan.md, report.html: H2a and H2b pass, sigma_a arm fails, no Pivot 1
- logs/index.csv: run records of the P2r grid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 14:27:32 +00:00
parent f95123174f
commit 5a6fb2fc8c
9 changed files with 509 additions and 13 deletions

View File

@@ -2,7 +2,8 @@
python scripts/15_diag_train.py --rids 900 901 --c 0 1 2 --n 4 16 --seeds 0 1 --workers 4
Dev realizations only. Each cell (rid, c, N): re-register as in protocol_p2 with a fixed registration seed (default 0,
Dev realizations, or the protocol_p2r main grid (realizations 8–15, checked against the locked SHA-256 as in
scripts/14; scripts/run_p2r_main.sh). Each cell (rid, c, N): re-register as in protocol_p2 with a fixed registration seed (default 0,
the same seed as scripts/14, hence the same hyperparameters, old phase and old label bank), load the SMC samples and the
re-estimated phase from outputs/p2/diag/posterior/, then train with the same backbone, optimizer, windows and label
normalization as protocol_p2:
@@ -285,9 +286,8 @@ def main() -> None:
os.environ.setdefault(k, v)
P = run_d2.load_protocol(check=True)
bad = sorted(set(args.rids) & set(P["grid"]["realizations"]))
if bad:
raise SystemExit(f"realizations {bad} belong to the protocol_p2 main grid: diagnostics use dev realizations only")
if run_d2.check_rids(args.rids, P) is not None:
print("protocol_p2r main grid: protocol and inputs match the locked SHA-256", flush=True)
post_dir = args.post_dir or outputs_dir() / "p2" / "diag" / "posterior"
out_dir = args.out_dir or outputs_dir() / "p2" / "diag" / "train"
cell_dir = out_dir / "cells"