Complete GP manuscript checks and verify revision artifacts
Move the comparator definitions and core evidence into the main text and lead with effect sizes and intervals. Preserve the locked verdicts and record the independent GP-D referee report. Archive the saved GP results and regenerate 43 outputs in the clean room. Add a source-backed numerical guard for the submission and record the correction to anchor warp RMSE and the scope of the pooled blind-well power estimates. Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
@@ -147,6 +147,21 @@ RULES = [
|
||||
("lambda_limit/*", "f3_results", "scripts/41_lambda_limit.py"),
|
||||
("point_tie/*", "f3_results", "scripts/44_point_tie_arm.py"),
|
||||
("band_spectra/*", "f3_results", "scripts/40_band_spectra.py"),
|
||||
# Saved cells and summaries for the exploratory GP revision. Keep mixed field tables with Volve.
|
||||
("gp_review/*.npz", None, ""),
|
||||
("gp_review/a7/*", "volve", "scripts/51_gp_review.py --stage a7"),
|
||||
("gp_review/a_results.md", "volve", "scripts/51_gp_review.py"),
|
||||
("gp_review/a_sections.json", "volve", "scripts/51_gp_review.py"),
|
||||
("gp_review/tables/field_wells.tex", "volve", "scripts/55_gp_field_table.py"),
|
||||
("gp_review/tables/misspec.tex", "f3_results", "scripts/56_gp_misspec_table.py"),
|
||||
("gp_review/tables/anchornoise.tex", "f3_results", "E1 table formatted from scripts/54_gp_anchor_noise.py summary"),
|
||||
("gp_review/a[1-9]/*", "f3_results", "scripts/51_gp_review.py"),
|
||||
("gp_review/e1/*", "f3_results", "scripts/54_gp_anchor_noise.py"),
|
||||
("gp_review/e2/*", "f3_results", "scripts/53_gp_practitioner_tie.py"),
|
||||
("gp_review/e[456]/*", "f3_results", "scripts/52_gp_experiments.py"),
|
||||
("replication/train/*/cells/*.csv", "f3_results", "scripts/run_r6.sh"),
|
||||
("replication/arms/*.csv", "f3_results", "scripts/run_r6.sh arms"),
|
||||
("r6/a1_nstar.csv", "f3_results", "scripts/48_r6_cheap.py"),
|
||||
# P3 F3 field test (protocol_f3; reproduce from tag protocol-f3)
|
||||
("p3/summary/predictions.npz", "f3_predictions", "scripts/20_summarize_f3.py"),
|
||||
("p3/summary/*", "f3_results", "scripts/20_summarize_f3.py"),
|
||||
@@ -194,6 +209,12 @@ STEPS = [
|
||||
("referee_r5_f2", ["scripts/45_referee_r5_followups.py", "--stage", "f2"], "files"),
|
||||
("lambda_limit_summary", ["scripts/41_lambda_limit.py", "--stage", "summary"], "files"),
|
||||
("point_tie_summary", ["scripts/44_point_tie_arm.py", "--stage", "summary"], "files"),
|
||||
("gp_review_a_tables", ["scripts/51_gp_review.py", "--repro-tables"], "files"),
|
||||
("gp_review_e456_summary", ["scripts/52_gp_experiments.py", "--stage", "summary"], "files"),
|
||||
("gp_review_e2_summary", ["scripts/53_gp_practitioner_tie.py", "--stage", "summary"], "files"),
|
||||
("gp_review_e1_summary", ["scripts/54_gp_anchor_noise.py", "--stage", "summary"], "files"),
|
||||
("gp_review_field_table", ["scripts/55_gp_field_table.py"], "files"),
|
||||
("gp_review_misspec_table", ["scripts/56_gp_misspec_table.py"], "files"),
|
||||
("figures_main", ["scripts/22_paper_figures.py"], "figures"),
|
||||
("figures_bench", ["scripts/38_bench_figures.py"], "figures"),
|
||||
("s8_flipband", ["scripts/38_bench_figures.py", "--flipband"], "stdout"),
|
||||
@@ -202,6 +223,29 @@ STEPS = [
|
||||
REPO_OUTPUTS = {"bench_tables": ["benchmark/reference/cells.csv", "benchmark/reference/main_table.md"]}
|
||||
NO_CODE = ("logs/", "refs/", "code_thesis/", "outputs_thesis/", ".agents/")
|
||||
|
||||
# A stage that silently skips a missing input must not pass by leaving an extracted output in place.
|
||||
GP_EXPECTED = {
|
||||
"gp_review_a_tables": (
|
||||
"a1/a1_point_ties.csv", "a1/a1_warp_checks.csv", "a2/a2_budgets.csv", "a3/a3_transfer.csv",
|
||||
"a3/a3_decision.json", "a4/a4_band_ratios.csv", "a4/a4_spectra.csv", "a5/a5_flags.csv", "a5/a5_f3.csv",
|
||||
"a6/a6_nstar.csv", "a6/a6_f2_power.csv", "a7/a7_wells.csv", "a8/a8_pooled.csv", "a9/a9_gaussian_bank.csv",
|
||||
),
|
||||
"gp_review_e456_summary": (
|
||||
"e4/optimizer.csv", "e4/ratios.csv", "e4/reading.json", "e4/summary.md",
|
||||
"e5/coverage.csv", "e5/label_distance.csv", "e5/ratios.csv", "e5/reading.json", "e5/summary.md",
|
||||
"e6/band_rmse_by_budget.csv", "e6/h2a_by_budget.csv", "e6/reading.json", "e6/reproduction.csv", "e6/runs.csv",
|
||||
"e6/summary.md",
|
||||
),
|
||||
"gp_review_e2_summary": tuple(f"e2/{name}" for name in (
|
||||
"h2a_with_b3p.csv", "ratios.csv", "reading.json", "summary.md", "warp_rmse.csv",
|
||||
)),
|
||||
"gp_review_e1_summary": tuple(f"e1/summary/{name}" for name in (
|
||||
"means.csv", "p4_posterior.csv", "posterior_cells.csv", "ratios.csv", "summary.md", "verdict.json", "warp_rmse.csv",
|
||||
)),
|
||||
"gp_review_field_table": ("tables/field_wells.tex",),
|
||||
"gp_review_misspec_table": ("tables/misspec.tex",),
|
||||
}
|
||||
|
||||
SITECUSTOMIZE = '''
|
||||
import os, sys
|
||||
_log = os.environ.get("REPRO_AUDIT_LOG")
|
||||
@@ -465,9 +509,11 @@ def audit_summary(opens: Path, repo: Path, work: Path) -> dict:
|
||||
|
||||
|
||||
def verify(a) -> None:
|
||||
if unknown := set(a.only or ()) - {name for name, _, _ in STEPS}:
|
||||
raise SystemExit(f"unknown verify stages: {', '.join(sorted(unknown))}")
|
||||
man = json.loads(MANIFEST.read_text(encoding="utf-8"))
|
||||
out = Path(a.out)
|
||||
work = Path(a.work) if a.work else out / "work"
|
||||
out = Path(a.out).resolve()
|
||||
work = Path(a.work).resolve() if a.work else out / "work"
|
||||
if work.exists():
|
||||
shutil.rmtree(work)
|
||||
repo, logs, audit, tmp = work / "repo", work / "logs", work / "audit", work / "raster"
|
||||
@@ -508,13 +554,17 @@ def verify(a) -> None:
|
||||
"code_files": len(files), "package_files": len(man["files"]), "steps": []}
|
||||
steps = [s for s in STEPS if not a.only or s[0] in a.only]
|
||||
for name, argv, kind in steps:
|
||||
expected = {f"outputs/gp_review/{p}" for p in GP_EXPECTED.get(name, ())}
|
||||
before = set(p.relative_to(repo).as_posix() for p in (repo / "outputs").rglob("*") if p.is_file())
|
||||
t_step = time.time()
|
||||
r = run_step(name, argv, repo, logs, audit)
|
||||
au = audit_summary(logs / f"{name}.opens", repo, work)
|
||||
cmp_ = []
|
||||
for rel in au["written"]:
|
||||
for rel in sorted(set(au["written"]) | expected):
|
||||
f = repo / rel
|
||||
if rel in expected and (rel not in au["written"] or not f.is_file() or rel not in by_path):
|
||||
cmp_.append({"path": rel, "status": "missing", "detail": "not regenerated from the archive"})
|
||||
continue
|
||||
if rel.startswith("outputs/") and f.is_file():
|
||||
if rel in by_path:
|
||||
cmp_.append({"path": rel, **compare_file(f, REPO_ROOT / rel, repo)})
|
||||
@@ -553,6 +603,10 @@ def verify(a) -> None:
|
||||
report["finished_utc"] = datetime.now(timezone.utc).isoformat(timespec="seconds")
|
||||
(work / "verify.json").write_text(json.dumps(report, indent=1))
|
||||
write_report(report, work, DOC / "verify_report.md" if not a.only else work / "verify_report.md")
|
||||
failed = [s["name"] for s in report["steps"] if s["rc"] or s["original_repo_reads"] or s["read_outside_package"]
|
||||
or any(c["status"] in ("differs", "missing") for c in s["compared"])]
|
||||
if failed:
|
||||
raise SystemExit(f"verification failed in {', '.join(failed)} (details in {work / 'verify.json'})")
|
||||
if not a.keep and not a.only:
|
||||
shutil.rmtree(work)
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ def extra_arm_rows(regime: str, c: float, N: int, rep: bool) -> tuple[pd.DataFra
|
||||
# A1
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def stage_a1() -> list[str]:
|
||||
def stage_a1(reproduce_original: bool = False) -> list[str]:
|
||||
rng = np.random.default_rng(0)
|
||||
rows, checks, extra_seen = [], [], set()
|
||||
for rep in (False, True):
|
||||
@@ -315,7 +315,14 @@ def stage_a1() -> list[str]:
|
||||
for regime, c, N in A1_CELLS:
|
||||
run = p2r_cell_rows(regime, c, N, rep)
|
||||
arms, adiag = arm_rows(regime, c, N, rep)
|
||||
ex, exw = extra_arm_rows(regime, c, N, rep)
|
||||
# The original A1 aggregation preceded E2 and all but one complete E4 cell.
|
||||
if not reproduce_original or (not rep and (regime, c, N) == ("R10", 0, 16)):
|
||||
ex, exw = extra_arm_rows(regime, c, N, rep)
|
||||
if reproduce_original:
|
||||
ex = ex[ex.method == "SMC-opt"]
|
||||
exw = {"SMC-opt": exw["SMC-opt"]}
|
||||
else:
|
||||
ex, exw = pd.DataFrame(), {}
|
||||
rids = sorted(set(run.rid))
|
||||
have = [k for k in ((regime, r, c, N) for r in rids) if k in cells]
|
||||
if not len(run) or not have:
|
||||
@@ -964,11 +971,17 @@ def main() -> None:
|
||||
ap.add_argument("--workers", type=int, default=4)
|
||||
ap.add_argument("--force", action="store_true", help="re-aggregate the chosen stages")
|
||||
ap.add_argument("--force-jobs", action="store_true", help="also recompute the per-cell and A5 jobs")
|
||||
ap.add_argument("--repro-tables", action="store_true", help="regenerate the archived numeric tables from saved cells")
|
||||
args = ap.parse_args()
|
||||
sha = check_declaration()
|
||||
set_threads(2)
|
||||
if os.environ.get("CUDA_VISIBLE_DEVICES", None) != "":
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = ""
|
||||
if args.repro_tables:
|
||||
stage_a1(reproduce_original=True)
|
||||
for aggregate in (stage_a2, stage_a3, stage_a4, stage_a5, stage_a6, stage_a7, stage_a8, stage_a9):
|
||||
aggregate()
|
||||
return
|
||||
workers = min(args.workers, 4)
|
||||
stages = ["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9"] if "all" in args.stage else args.stage
|
||||
OUT.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user