"""Example page for the probe test set: the README's claims, shown. A README can assert that the overlay lands on the sensor. A page with 72 of them lets a reader check. Static stills, not clips: the question here is where ground truth IS, not how it moves — the clips already exist under /probes/. """ from __future__ import annotations import argparse import json import shutil import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1])) from react_paths import out_root, testset_root # noqa: E402 SRC = testset_root() def _sessions_note(man, runs): """State what the POLICY is and what this DRAW happened to contain. An earlier version of this page said "2026-05-19 is excluded" long after that decision was reversed. The draw happened not to select it, and the prose turned an accident of sampling into a stated policy — a reader would have concluded the session is unusable. Both facts are now read from the manifest, so the page cannot outlive the decision. """ used = sorted({r["episode"].split("/")[0] for r in runs}) elig = sorted(man.get("trusted_sessions", [])) excl = man.get("excluded_sessions") or {} parts = [f"Start frames are drawn from held-out intervals of " f"splits.json — never training frames."] parts.append(f"Eligible sessions: {', '.join(elig)}. " f"This draw happened to select {', '.join(used)}" + (f"; {', '.join(sorted(set(elig) - set(used)))} was not sampled " f"this time, which is chance, not a judgement about it." if set(elig) - set(used) else ".")) if excl: parts.append("Excluded by policy: " + "; ".join( f"{k} — {v}" for k, v in excl.items())) resid = man.get("world_residual", {}) noted = [k for k, v in resid.items() if v and v.get("yaw_deg") is None and v.get("in_plane_mm") is None and k in used] if "2026-05-19" in elig: parts.append("2026-05-19 had its OptiTrack world redefined " "mid-collection; the release applies a translation-only " "correction and the residual yaw about the table normal is " "unmeasured (about 16 px at the workspace). It is " "included with that stated in world_residual " "rather than dropped — a bounded, declared error is " "not a reason to discard a fifth of the sessions.") return " ".join(parts) def main() -> int: ap = argparse.ArgumentParser() ap.add_argument("--out", default=str(out_root("testset_page"))) args = ap.parse_args() out = Path(args.out) if out.exists(): shutil.rmtree(out) out.mkdir(parents=True) shutil.copytree(SRC / "overlays", out / "overlays") shutil.copy(SRC / "overlay_example.jpg", out / "overlay_example.jpg") man = json.loads((SRC / "manifest.json").read_text()) runs = [json.loads((SRC / p["meta"]).read_text()) for p in man["probes"]] allp = [q for r in runs for q in r["probes"]] tr = [q["amplitude"] for q in allp if q["amplitude_unit"] == "m"] ro = [q["amplitude"] for q in allp if q["amplitude_unit"] == "deg"] pc = [q["speed_percentile"] for q in allp] sep = min(q["min_separation_m"] for q in allp) px = man["overlay_error_budget_px"]["camera_reprojection"] cards = [ (f"{len(allp)}", f"probes · {len(runs)} start frames"), (f"{min(tr):.2f}–{max(tr):.2f} m", f"translation · {min(ro):.0f}–{max(ro):.0f}° rotation"), (f"p{min(pc):.0f}–p{max(pc):.0f}", "speed vs the dataset"), (f"~{max(px.values()):.0f} px", "worst reprojection noise floor"), (f"{sep:.3f} m", "closest the hands come (rule 0.12)"), ] sec = [] for r in runs: tiles = "".join( f"
" f"
{q['name']} · {q['amplitude']:g}" f"{'m' if q['amplitude_unit'] == 'm' else '°'} · " f"{q['horizon_s']:.2f}s · p{q['speed_percentile']:.0f}
" f"
" for q in r["probes"]) sec.append( f"

run{r['run']} — {r['episode']}, rows " f"{r['context_rows'][0]}–{r['context_rows'][-1]}  " f"moving {r['moving_side']}, holding {r['held_side']}

" f"
{tiles}
") html = """ React probe test set

React probe test set

__N__ commanded action sequences over __R__ start frames, for scoring a tactile world model's rollouts against ground truth that is geometric, not photometric. Nobody performed these motions, so there is no ground-truth future image — what is ground truth is where the sensor would be, and its projection into each camera. Full method and usage in the README; per-probe clips are under /probes/.

Yellow: commanded ground truth. Red: a deliberately wrong rollout, offset 25 mm in world x — it reads 18–19 px against a ~6 px noise floor. Dimmed: the hand that must stay still.
__CARDS__

__SESSIONS__

__SECS__
""" html = (html.replace("__N__", str(len(allp))) .replace("__R__", str(len(runs))) .replace("__CARDS__", "".join( f"
{a}{b}
" for a, b in cards)) .replace("__SESSIONS__", _sessions_note(man, runs)) .replace("__SECS__", "".join(sec))) (out / "index.html").write_text(html) shutil.copy(SRC / "README.md", out / "README.md") print(f"{len(allp)} overlays -> {out}/index.html") return 0 if __name__ == "__main__": raise SystemExit(main())