rename: deployed/as_trained policy views, kill 'knob' (schema paired_final_v2)

Disambiguate the overloaded deploy/train/knob vocabulary (paper-consistent:
'quarantine' + 'ablated' + 'deployed' all match Cloud et al.). One opposite each:
- policy view: hack_deployed/solve_deployed (quarantine ablated, ships) vs
  hack_as_trained/solve_as_trained (quarantine attached). Unifies the old split
  deploy_hack (JSON) vs hack_deploy (table key) into one name.
- 'knob' -> 'quarantine'/'adapter' throughout comments and log strings.
- train/test reserved for the DATA split only.
Bump RUN_SCHEMA v1->v2 so old deploy_test.json files are skipped (not crashed) by
completed_runs. CLI flags untouched (queued jobs unaffected). Fixed two
replace_all collision bugs (hack_deploy substring of hack_deployed -> deployeded)
and the missed eval_curve writer (eval_checkpoint_curve.py) + readers
(results_deploy.py). Smoke green: v2 written + read; gates pass.

Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-06-10 05:26:51 +00:00
parent 51c5a757ef
commit c3af6cc03c
7 changed files with 61 additions and 64 deletions
+22 -22
View File
@@ -80,31 +80,31 @@ def build_csv() -> pl.DataFrame:
ev = [json.loads(l) for l in (run / "eval_curve.jsonl").read_text().splitlines()]
rows.append(dict(
label=label, kind="method",
hack_deploy=round(dep["deploy_hack"], 4), solve_deploy=round(dep["deploy_solve"], 4),
hack_deployed=round(dep["hack_deployed"], 4), solve_deployed=round(dep["solve_deployed"], 4),
# knob-ON deploy (deployed-as-trained) on the SAME n=119 set -- None until backfilled
# (rescore_deploy.py) so the deploy before->after is honest, not borrowed from val.
hack_deploy_on=_r4(dep.get("deploy_hack_on")), solve_deploy_on=_r4(dep.get("deploy_solve_on")),
hack_on=round(_l5(ev, "train_hack"), 4), hack_off=round(_l5(ev, "deploy_hack"), 4),
solve_on=round(_l5(ev, "train_solve"), 4), solve_off=round(_l5(ev, "deploy_solve"), 4),
hack_as_trained=_r4(dep.get("hack_as_trained")), solve_as_trained=_r4(dep.get("solve_as_trained")),
hack_on=round(_l5(ev, "hack_as_trained"), 4), hack_off=round(_l5(ev, "hack_deployed"), 4),
solve_on=round(_l5(ev, "solve_as_trained"), 4), solve_off=round(_l5(ev, "solve_deployed"), 4),
source=f"{run.name}/[deploy_test.json + eval_curve.jsonl]", status=status))
base = json.loads((_find_run("_dir8_baseline_s43") / "deploy_test.json").read_text())
rows.append(dict(label="base (floor)", kind="anchor_floor",
hack_deploy=round(base["deploy_hack"], 4), solve_deploy=round(base["deploy_solve"], 4),
hack_deploy_on=None, solve_deploy_on=None,
hack_deployed=round(base["hack_deployed"], 4), solve_deployed=round(base["solve_deployed"], 4),
hack_as_trained=None, solve_as_trained=None,
hack_on=None, hack_off=None, solve_on=None, solve_off=None,
source="*_dir8_baseline_s43/deploy_test.json", status="ok (base model; steps=0)"))
ceil_path = next(RUNS.glob("*noloophole*/deploy_test.json"), None)
if ceil_path:
ceil_solve, status = round(json.loads(ceil_path.read_text())["deploy_solve"], 4), "ok"
ceil_solve, status = round(json.loads(ceil_path.read_text())["solve_deployed"], 4), "ok"
source = f"{ceil_path.parent.name}/deploy_test.json"
else:
ceil_solve, status = PAPER_CEILING, "FIXME: PROVISIONAL paper 0.223 -- awaiting job 24 (no-loophole ceiling)"
source = "Ariahw et al. 2025 (paper), NOT our run"
rows.append(dict(label="ceiling", kind="anchor_ceiling",
hack_deploy=0.0, solve_deploy=ceil_solve,
hack_deploy_on=None, solve_deploy_on=None,
hack_deployed=0.0, solve_deployed=ceil_solve,
hack_as_trained=None, solve_as_trained=None,
hack_on=None, hack_off=None, solve_on=None, solve_off=None,
source=source, status=status))
@@ -135,9 +135,9 @@ GOLD, DARK = "#c8920a", "#3a3a3a"
def _anchors(df: pl.DataFrame) -> dict:
g = lambda kind, col: df.filter(pl.col("kind") == kind)[col][0]
ceil_status = g("anchor_ceiling", "status")
return dict(base_solve=g("anchor_floor", "solve_deploy"),
vanilla_hack=df.filter(pl.col("label") == "vanilla GRPO")["hack_deploy"][0],
ceiling=g("anchor_ceiling", "solve_deploy"),
return dict(base_solve=g("anchor_floor", "solve_deployed"),
vanilla_hack=df.filter(pl.col("label") == "vanilla GRPO")["hack_deployed"][0],
ceiling=g("anchor_ceiling", "solve_deployed"),
provisional=ceil_status.startswith("FIXME"))
@@ -166,8 +166,8 @@ def plot(df: pl.DataFrame) -> None:
pick = lambda lab: df.filter(pl.col("label") == lab).to_dicts()[0]
best, rand, van = pick("routeV per-token"), pick("routeV random-V"), pick("vanilla GRPO")
def hsupp(r): return (vh - r["hack_deploy"]) / vh
def suplift(r): return (r["solve_deploy"] - base) / (ceil - base)
def hsupp(r): return (vh - r["hack_deployed"]) / vh
def suplift(r): return (r["solve_deployed"] - base) / (ceil - base)
# OURS ONLY -- no paper bars. The paper comparison is cross-scale/regime (their converged
# full-env vs our 60-step fast surrogate) so it can only ever be directional; the paper
@@ -175,14 +175,14 @@ def plot(df: pl.DataFrame) -> None:
# vanilla is the floor anchor (defines vh, so its hack-suppression is 0 by construction);
# random-V is the directionality control; per-token is the live arm.
hack_rows = [
("vanilla GRPO\n(floor)", hsupp(van), f"{van['hack_deploy']:.3f}", RED),
("routeV random-V\n(direction control)", hsupp(rand), f"{rand['hack_deploy']:.3f}", DARK),
("routeV per-token\n(best)", hsupp(best), f"{best['hack_deploy']:.3f}", GOLD),
("vanilla GRPO\n(floor)", hsupp(van), f"{van['hack_deployed']:.3f}", RED),
("routeV random-V\n(direction control)", hsupp(rand), f"{rand['hack_deployed']:.3f}", DARK),
("routeV per-token\n(best)", hsupp(best), f"{best['hack_deployed']:.3f}", GOLD),
]
solve_rows = [
("vanilla GRPO\n(floor)", suplift(van), f"{van['solve_deploy']:.3f}", RED),
("routeV random-V\n(direction control)", suplift(rand), f"{rand['solve_deploy']:.3f}", DARK),
("routeV per-token\n(best)", suplift(best), f"{best['solve_deploy']:.3f}", GOLD),
("vanilla GRPO\n(floor)", suplift(van), f"{van['solve_deployed']:.3f}", RED),
("routeV random-V\n(direction control)", suplift(rand), f"{rand['solve_deployed']:.3f}", DARK),
("routeV per-token\n(best)", suplift(best), f"{best['solve_deployed']:.3f}", GOLD),
]
prov = " (ceiling PROVISIONAL=0.223, FIXME job 24)" if a["provisional"] else ""
fig, (axl, axr) = plt.subplots(1, 2, figsize=(11.5, 5.0), sharey=False)
@@ -225,7 +225,7 @@ def _methods(df: pl.DataFrame) -> list[dict]:
def plot_scatter(df: pl.DataFrame) -> None:
a = _anchors(df)
base, ceil = a["base_solve"], a["ceiling"]
H = lambda r: r["hack_deploy"]; S = lambda r: r["solve_deploy"]
H = lambda r: r["hack_deployed"]; S = lambda r: r["solve_deployed"]
prov = "*" if a["provisional"] else ""
fig, ax = plt.subplots(figsize=(7.2, 5.4))
@@ -244,7 +244,7 @@ def plot_scatter(df: pl.DataFrame) -> None:
# not an eval-set artifact. Arms without the backfill fall back to dot-only.
for r in _methods(df):
col = ARM_COLOR.get(r["label"], GREY)
hon, son = r["hack_deploy_on"], r["solve_deploy_on"]
hon, son = r["hack_as_trained"], r["solve_as_trained"]
if hon is not None and (abs(hon - H(r)) > 1e-6 or abs(son - S(r)) > 1e-6):
ax.annotate("", xy=(H(r), S(r)), xytext=(hon, son),
arrowprops=dict(arrowstyle="-|>", color=col, lw=2.0, alpha=0.85, shrinkA=6, shrinkB=8))