Official Codebase of 3DCodeVerse
Python
bench: the head-to-head protocols (astra3d-brilliana gallery GLBs, scene_multifile outputs) and the fancy_v1 batteries
gaoypengc60ee703619c
diff --git a/harness/bench/h2h_glb.py b/harness/bench/h2h_glb.pynew file mode 100644index 00000000..0970581f--- /dev/null+++ b/harness/bench/h2h_glb.py@@ -0,0 +1,294 @@+"""Objects head-to-head: this harness vs the astra3d-brilliana curated gallery.++Protocol (one fixed judge, one renderer, one gate set, for BOTH sides):++1. A battery ``bench/prompts/h2h_brilliana_v1_<lang>.yaml`` carries THEIR prompts+ verbatim with an empty ``must_have`` (their run had no checklist, so ours gets none);+ each prompt's last tag is the gallery slug.+2. THEIR GLB is ``<gallery>/<slug>/object.glb`` (built by their harness, never+ rebuilt here). OUR GLB is the best round of the harness run under+ ``<bench_out>/<lang>/runs/<id>/`` (``deliverable/object.glb``, else+ ``artifacts/object.glb`` — ``finalise`` restores and rebuilds the best round).+3. Both GLBs go through the same pipeline as ``bench/_fixed_eval.FixedEvaluator``:+ ``measure_glb`` → ``check_connectivity`` → ``render_glb`` (OBJECT_VIEWS, settings+ size, contact sheet) → ``VlmJudge(static_object_v1, gemini-3.1-pro-preview,+ n_samples=2)`` with a ``Spec`` built from the prompt and an EMPTY acceptance list.+ The judge is called directly on a ``JudgeInput`` because their side has no+ workspace to build from. Every judged side is cached as+ ``<out>/eval/<id>/<side>.json`` so a re-run never re-buys a verdict.+4. Outputs: ``<out>/h2h.jsonl`` (one row per prompt), ``<out>/pairs/<id>.png``+ (their sheet | our sheet) and ``<out>/h2h_summary.md`` (paired mean delta, sd,+ exact two-sided sign test, per-language rows). The gallery's own score is kept+ in the row for reference only — it came from a different judge and is never+ compared with ours.++Usage::++ python bench/h2h_glb.py bench/prompts/h2h_brilliana_v1_{blender,cadquery,threejs}.yaml \+ --gallery /home/yipeng/projects/astra3d-brilliana/gallery --bench-out bench/out/h2h_brilliana_v1+ python bench/h2h_glb.py <battery.yaml> --theirs-only --id h2h_c_clamp_mv # prove the judge path+"""++from __future__ import annotations++import argparse+import json+import math+import statistics+import sys+from datetime import datetime+from pathlib import Path+from typing import Any++from pydantic import BaseModel, Field++sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) # `python bench/h2h_glb.py` from the repo root++from bench._fixed_eval import RUBRIC # noqa: E402+from bench.run_bench import Battery, BenchPrompt # noqa: E402++JUDGE_MODEL = "gemini:gemini-3.1-pro-preview"+N_SAMPLES = 2+TERMINAL = {"passed", "plateau", "budget", "failed"} # RunStatus values a finished run can hold+_H2H_TAGS = {"h2h", "brilliana"}+++class Side(BaseModel):+ """One judged GLB (theirs or ours) — everything the row needs, nothing more."""++ source: str+ glb: str = ""+ score: float | None = None+ score_std: float = 0.0+ passed: bool | None = None+ gate_errors: list[str] = Field(default_factory=list)+ floating_parts: int = 0+ tris: int | None = None+ parts: int | None = None+ ground_gap_m: float | None = None+ sheet: str = ""+ summary: str = ""+ error: str = ""+ rounds: int | None = None # harness side only+ cost_usd: float | None = None+ minutes: float | None = None+ status: str = ""+ gallery_score: float | None = None # their own judge; reference only+++class Row(BaseModel):+ id: str+ slug: str+ language: str+ prompt: str+ theirs: Side+ ours: Side+ delta: float | None = None+ side_by_side: str = ""+++# ----------------------------------------------------------------------------- locate+def slug_of(item: BenchPrompt) -> str:+ slugs = [t for t in item.tags if t not in _H2H_TAGS]+ if not slugs:+ raise ValueError(f"{item.id}: no gallery slug tag")+ return slugs[-1]+++def their_side(gallery: Path, slug: str) -> Side:+ meta = json.loads((gallery / slug / "meta.json").read_text())+ glb = gallery / slug / "object.glb"+ return Side(source="brilliana", glb=str(glb), gallery_score=meta.get("score"),+ error="" if glb.is_file() else f"missing {glb}")+++def our_side(runs_dir: Path, item_id: str) -> Side:+ ws = runs_dir / item_id+ rec_path = ws / "record.json"+ if not rec_path.is_file():+ return Side(source="3dcodeverse", status="not_run", error=f"no record.json under {ws}")+ rec: dict[str, Any] = json.loads(rec_path.read_text())+ status = str(rec.get("status", ""))+ side = Side(source="3dcodeverse", status=status, rounds=len(rec.get("rounds", [])),+ cost_usd=float((rec.get("total_usage") or {}).get("cost_usd", 0.0)))+ try:+ t0 = datetime.fromisoformat(rec["started_at"])+ t1 = datetime.fromisoformat(rec["finished_at"])+ side.minutes = round((t1 - t0).total_seconds() / 60, 2)+ except (KeyError, TypeError, ValueError):+ pass+ if status not in TERMINAL or rec.get("best_round") is None:+ side.error = f"run not finished (status={status!r}, best_round={rec.get('best_round')})"+ return side+ for cand in (ws / "deliverable" / "object.glb", ws / "artifacts" / "object.glb"):+ if cand.is_file():+ side.glb = str(cand)+ return side+ side.error = f"finished run has no object.glb under {ws}"+ return side+++# ----------------------------------------------------------------------------- evaluate+def build_spec(battery: Battery, item: BenchPrompt) -> Any:+ from codeverse.contracts.spec import Spec++ return Spec(id=f"h2h/{item.id}", track=battery.track, language=item.language or battery.language,+ prompt=item.prompt, tags=["h2h", *item.tags])+++def evaluate(side: Side, spec: Any, out_dir: Path, judge: Any) -> Side:+ """measure → connectivity → render → judge, exactly the FixedEvaluator order."""+ from codeverse.config import get_settings+ from codeverse.conventions import OBJECT_VIEWS+ from codeverse.judges.base import JudgeInput+ from codeverse.spatial.connectivity import check_connectivity+ from codeverse.spatial.measure import measure_glb+ from codeverse.spatial.render import render_glb++ if side.error or not side.glb:+ return side+ try:+ glb = Path(side.glb)+ m = measure_glb(glb)+ side.tris, side.parts, side.ground_gap_m = m.tri_count, m.n_meshes, round(m.ground_gap_m, 4)+ gate = check_connectivity(glb, language=str(spec.language))+ side.gate_errors = [f"{gate.gate}: {f.message}" for f in gate.errors]+ side.floating_parts = sum("is floating" in f.message for f in gate.errors)+ r = get_settings().render+ renders = render_glb(glb, out_dir / "renders", views=list(OBJECT_VIEWS), width=r.width, height=r.height, sheet=True)+ side.sheet = renders.contact_sheet or ""+ j = judge.judge(JudgeInput(spec=spec, renders=renders, measurement=m, gates=[gate], acceptance=[], round_index=0))+ side.score, side.score_std, side.passed, side.summary = j.overall, j.score_std, j.passed, j.summary+ (out_dir / "judgment.json").write_text(j.model_dump_json(indent=2))+ except Exception as e: # noqa: BLE001 — one bad GLB must not kill the battery+ side.error = f"{type(e).__name__}: {e}"+ return side+++def cached_eval(side: Side, spec: Any, out_dir: Path, judge: Any, *, force: bool) -> Side:+ cache = out_dir / f"{side.source}.json"+ if cache.is_file() and not force:+ prev = Side.model_validate_json(cache.read_text())+ if prev.score is not None and prev.glb == side.glb:+ return prev.model_copy(update={k: getattr(side, k) for k in ("rounds", "cost_usd", "minutes", "status")})+ out_dir.mkdir(parents=True, exist_ok=True)+ side = evaluate(side, spec, out_dir, judge)+ cache.write_text(side.model_dump_json(indent=2))+ return side+++def side_by_side(theirs: Side, ours: Side, dst: Path, slug: str) -> str:+ from PIL import Image, ImageDraw++ tiles = [(f"THEIRS brilliana/{slug}", theirs.sheet, theirs.score), (f"OURS 3dcodeverse/{slug}", ours.sheet, ours.score)]+ imgs = [Image.open(p).convert("RGB") if p and Path(p).is_file() else Image.new("RGB", (768, 768), (40, 40, 40)) for _, p, _ in tiles]+ h = min(i.height for i in imgs)+ imgs = [i.resize((int(i.width * h / i.height), h)) for i in imgs]+ band, gap = 36, 12+ canvas = Image.new("RGB", (sum(i.width for i in imgs) + gap, h + band), (20, 20, 20))+ draw, x = ImageDraw.Draw(canvas), 0+ for (label, _, score), im in zip(tiles, imgs, strict=True):+ canvas.paste(im, (x, band))+ draw.text((x + 8, 10), f"{label} score={score if score is None else f'{score:.3f}'}", fill=(255, 255, 255))+ x += im.width + gap+ dst.parent.mkdir(parents=True, exist_ok=True)+ canvas.save(dst)+ return str(dst)+++# ----------------------------------------------------------------------------- stats+def sign_test_p(deltas: list[float]) -> float | None:+ """Exact two-sided sign test on the non-zero deltas (ours - theirs)."""+ nz = [d for d in deltas if d != 0.0]+ if not nz:+ return None+ n, k = len(nz), sum(d > 0 for d in nz)+ cdf = lambda x: sum(math.comb(n, i) for i in range(x + 1)) / 2**n # noqa: E731+ return min(1.0, 2 * min(cdf(k), 1 - cdf(k - 1)))+++def _stats(rows: list[Row]) -> str:+ d = [r.delta for r in rows if r.delta is not None]+ if not d:+ return "n=0 (no pair judged on both sides)"+ sd = statistics.stdev(d) if len(d) > 1 else 0.0+ wins, losses = sum(x > 0 for x in d), sum(x < 0 for x in d)+ p = sign_test_p(d)+ return (f"n={len(d)} mean Δ(ours−theirs)={statistics.mean(d):+.3f} sd={sd:.3f} "+ f"wins/losses/ties={wins}/{losses}/{len(d) - wins - losses} sign-test p={'n/a' if p is None else f'{p:.3f}'}")+++def summary_md(rows: list[Row]) -> str:+ out = ["# Objects head-to-head: 3dcodeverse vs astra3d-brilliana gallery", "",+ f"Judge: `{JUDGE_MODEL}` × {N_SAMPLES} samples, rubric `{RUBRIC}`, empty acceptance list, "+ "same renderer / views / connectivity gate on both GLBs.", "",+ f"**All languages**: {_stats(rows)}", ""]+ for lang in sorted({r.language for r in rows}):+ out.append(f"- **{lang}**: {_stats([r for r in rows if r.language == lang])}")+ out += ["", "| id | lang | theirs | ours | Δ | theirs gate errs / floating | ours gate errs / floating | ours rounds / $ / min | their gallery score (ref only) |",+ "|---|---|---|---|---|---|---|---|---|"]+ fmt = lambda v: "—" if v is None else f"{v:.3f}" # noqa: E731+ for r in rows:+ t, o = r.theirs, r.ours+ out.append(f"| {r.id} | {r.language} | {fmt(t.score)} | {fmt(o.score)} | {'—' if r.delta is None else f'{r.delta:+.3f}'} "+ f"| {len(t.gate_errors)} / {t.floating_parts} | {len(o.gate_errors)} / {o.floating_parts} "+ f"| {o.rounds or '—'} / {'—' if o.cost_usd is None else f'{o.cost_usd:.2f}'} / {'—' if o.minutes is None else f'{o.minutes:.0f}'} "+ f"| {fmt(t.gallery_score)} |")+ errs = [f"- {r.id} {s.source}: {s.error}" for r in rows for s in (r.theirs, r.ours) if s.error]+ if errs:+ out += ["", "## Unjudged sides", *errs]+ return "\n".join(out) + "\n"+++# ----------------------------------------------------------------------------- main+def run(batteries: list[Path], gallery: Path, bench_out: Path, out: Path, *, ids: set[str], theirs_only: bool, force: bool) -> list[Row]:+ from codeverse.cost import run_ledger+ from codeverse.judges.vlm_judge import VlmJudge++ judge = VlmJudge(rubric=RUBRIC, model_id=JUDGE_MODEL, n_samples=N_SAMPLES)+ rows: list[Row] = []+ out.mkdir(parents=True, exist_ok=True)+ with run_ledger(out, run="h2h_brilliana_v1"):+ for bpath in batteries:+ battery = Battery.load(bpath)+ runs_dir = bench_out / str(battery.language) / "runs"+ for item in battery.prompts:+ if ids and item.id not in ids:+ continue+ slug, spec, edir = slug_of(item), build_spec(battery, item), out / "eval" / item.id+ theirs = cached_eval(their_side(gallery, slug), spec, edir / "theirs", judge, force=force)+ ours = Side(source="3dcodeverse", status="skipped") if theirs_only else \+ cached_eval(our_side(runs_dir, item.id), spec, edir / "ours", judge, force=force)+ row = Row(id=item.id, slug=slug, language=str(spec.language), prompt=item.prompt, theirs=theirs, ours=ours)+ if theirs.score is not None and ours.score is not None:+ row.delta = round(ours.score - theirs.score, 4)+ if theirs.sheet or ours.sheet:+ row.side_by_side = side_by_side(theirs, ours, out / "pairs" / f"{item.id}.png", slug)+ rows.append(row)+ print(f"{item.id:<24} theirs={theirs.score} ours={ours.score} Δ={row.delta} "+ f"gates t/o={len(theirs.gate_errors)}/{len(ours.gate_errors)} {theirs.error or ours.error}")+ with (out / "h2h.jsonl").open("w") as fh:+ for r in rows:+ fh.write(r.model_dump_json() + "\n")+ (out / "h2h_summary.md").write_text(summary_md(rows))+ print(summary_md(rows))+ return rows+++def main() -> None:+ here = Path(__file__).resolve().parent+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n", 1)[0])+ ap.add_argument("batteries", nargs="+", type=Path)+ ap.add_argument("--gallery", type=Path, default=Path("/home/yipeng/projects/astra3d-brilliana/gallery"))+ ap.add_argument("--bench-out", type=Path, default=here / "out" / "h2h_brilliana_v1",+ help="root holding <lang>/runs/<id>/ (one `3dcv bench run --out <root>/<lang>` per battery)")+ ap.add_argument("--out", type=Path, default=None, help="where h2h.jsonl / pairs/ / h2h_summary.md go (default: --bench-out)")+ ap.add_argument("--id", action="append", default=[], help="only these prompt ids")+ ap.add_argument("--theirs-only", action="store_true", help="judge only the gallery GLBs (proof of the judge path)")+ ap.add_argument("--force", action="store_true", help="ignore cached verdicts under <out>/eval/")+ a = ap.parse_args()+ run(a.batteries, a.gallery, a.bench_out, a.out or a.bench_out, ids=set(a.id), theirs_only=a.theirs_only, force=a.force)+++if __name__ == "__main__":+ main()diff --git a/harness/bench/h2h_scene.py b/harness/bench/h2h_scene.pynew file mode 100644index 00000000..cc287384--- /dev/null+++ b/harness/bench/h2h_scene.py@@ -0,0 +1,299 @@+"""Head-to-head SCENE judge: this harness's ``scene`` track vs the owner's previous+harnesses (scene_multifile / scene_multifile_graphics), one fixed judge for both sides.++Protocol+--------+* Prompts: ``bench/prompts/h2h_scene_v1.yaml`` — each prompt is the other harness's+ ``outputs/<name>/prompts/input.md`` verbatim, ``must_have`` empty (no checklist either+ side never saw). Tags ``[h2h, <source_repo>, <name>]`` bind a row to its origin.+* THEIRS: the delivered renders at ``app/artifacts/best_parts/_assembly/object_render/``+ — authored cameras (``view_cam_*``) first, then the overview rig (``view_overview_*``),+ capped at ``MAX_VIEWS``; zone/probe frames are never shown. Their own judge score,+ wall time and cost come from ``run_report.json`` / ``trajectories/*/score.json``.+* OURS: the best round of ``bench/out/h2h_scene_v1/runs/<id>/`` (``record.best_round`` →+ ``rounds/rNN.json`` renders): the ``t=0`` views the scene judge saw (per-view ``judge``+ flag, authored cameras first), capped at ``MAX_VIEWS`` — stills only, so both sides are+ judged blind to animation in the same way.+* Judge: ONE ``VlmJudge(rubric=scene_v1, gemini-3.1-pro-preview, n_samples=2)`` fed a+ ``JudgeInput(spec, RenderSet)`` with no gates, no measurement, no acceptance items and+ the same ``extra_context`` for both sides. Verdicts are cached per (id, side) under+ ``out/judge/`` so re-runs never re-pay.+* Output: ``h2h.jsonl`` (one row per prompt), ``sheets/<id>.png`` (their strip over our+ strip), ``h2h_summary.md`` (paired delta mean/sd, exact sign test, time + cost).++Usage: ``python bench/h2h_scene.py [--ids a,b] [--theirs-only] [--n-samples 2]``+"""++from __future__ import annotations++import argparse+import json+import math+import statistics+import sys+from datetime import datetime+from pathlib import Path+from typing import Any++from PIL import Image, ImageDraw+from pydantic import BaseModel++sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) # `python bench/h2h_scene.py` from the repo root++from bench.run_bench import Battery, BenchPrompt # noqa: E402+from codeverse.contracts.artifacts import RenderSet, RenderView # noqa: E402+from codeverse.contracts.common import Language, Track # noqa: E402+from codeverse.contracts.spec import Spec # noqa: E402++HERE = Path(__file__).resolve().parent+BATTERY = HERE / "prompts" / "h2h_scene_v1.yaml"+OUT = HERE / "out" / "h2h_scene_v1"+REPOS = {"scene_multifile": Path("/home/yipeng/projects/scene_multifile"),+ "scene_multifile_graphics": Path("/home/yipeng/projects/scene_multifile_graphics")}+THEIR_RENDERS = Path("app/artifacts/best_parts/_assembly/object_render")+JUDGE_MODEL = "gemini:gemini-3.1-pro-preview"+RUBRIC = "scene_v1"+MAX_VIEWS = 10+OVERVIEW_ORDER = ("overview_front_right", "overview_back_left", "overview_top", "overview_front", "overview_right", "overview_back", "overview_left")+EXTRA_CONTEXT = ("STILLS ONLY: every view is a single frame at one time and NO motion measurement exists for this "+ "evaluation — answer nothing_moves=false and grade animation_life only from visible motion cues "+ "(wakes, particles, blur). The same rule applies to every scene in this comparison.")+++# ----------------------------------------------------------------------------- rows+class TheirSide(BaseModel):+ score: float+ score_uncapped: float | None = None+ defect_penalty: float = 0.0+ their_own_score: float | None = None+ their_final_score: float | None = None+ duration_s: float = 0.0+ cost_usd: float = 0.0+ n_views: int = 0+ views: list[str] = []+++class OurSide(BaseModel):+ score: float+ score_uncapped: float | None = None+ defect_penalty: float = 0.0+ harness_score: float | None = None+ rounds: int = 0+ best_round: int = 0+ cost_usd: float = 0.0+ minutes: float = 0.0+ n_views: int = 0+ status: str = ""+ views: list[str] = []+++class Row(BaseModel):+ id: str+ source_repo: str+ name: str+ theirs: TheirSide+ ours: OurSide | None = None+ delta: float | None = None+++def origin(item: BenchPrompt) -> tuple[str, str]:+ repo = next(t for t in item.tags if t in REPOS)+ return repo, item.tags[-1]+++# ----------------------------------------------------------------------------- theirs+def their_frames(out_dir: Path) -> list[Path]:+ """Authored cameras first (sorted), then the overview rig in a fixed order; cap MAX_VIEWS."""+ rdir = out_dir / THEIR_RENDERS+ cams = sorted(rdir.glob("view_cam_*.png"))+ over = {p.stem[len("view_"):]: p for p in rdir.glob("view_overview_*.png")}+ ordered = [over[n] for n in OVERVIEW_ORDER if n in over] + [p for n, p in sorted(over.items()) if n not in OVERVIEW_ORDER]+ return (cams + ordered)[:MAX_VIEWS]+++def their_meta(out_dir: Path) -> dict[str, Any]:+ rep = json.loads((out_dir / "run_report.json").read_text())+ cost = rep.get("cost") or {}+ scores: list[tuple[int, float]] = []+ for f in sorted(out_dir.glob("trajectories/09_tool_judge_iter*/score.json")):+ s = json.loads(f.read_text()).get("overall_score")+ if isinstance(s, (int, float)):+ scores.append((int(f.parent.name.rsplit("iter", 1)[1]), float(s)))+ scores.sort()+ return {"duration_s": float(rep.get("duration_s") or 0.0),+ "cost_usd": float(cost.get("total_usd_all_iters") or cost.get("total_usd_last_iter") or 0.0),+ "their_own_score": max((s for _, s in scores), default=None), # best_snapshot ships the best round+ "their_final_score": scores[-1][1] if scores else None}+++# ----------------------------------------------------------------------------- ours+def our_frames(run_dir: Path) -> tuple[list[RenderView], dict[str, Any]] | None:+ rec_path = run_dir / "record.json"+ if not rec_path.is_file():+ return None+ rec = json.loads(rec_path.read_text())+ best = int(rec.get("best_round") or 0)+ rnd_path = run_dir / "rounds" / f"r{best:02d}.json"+ if not rnd_path.is_file():+ return None+ rnd = json.loads(rnd_path.read_text())+ views = [RenderView.model_validate(v) for v in (rnd.get("renders") or {}).get("views", [])]+ stills = [v for v in views if (v.time_s or 0.0) == 0.0 and v.mode == "shaded" and Path(v.path).is_file()]+ flagged = [v for v in stills if v.judge] or stills+ chosen = flagged[:MAX_VIEWS]+ minutes = None+ for line in (run_dir.parent.parent / "results.jsonl").read_text().splitlines() if (run_dir.parent.parent / "results.jsonl").is_file() else []:+ try:+ r = json.loads(line)+ except json.JSONDecodeError:+ continue+ if r.get("id") == run_dir.name:+ minutes = float(r.get("minutes") or 0.0)+ if minutes is None and rec.get("started_at") and rec.get("finished_at"):+ t0, t1 = (datetime.fromisoformat(rec[k]) for k in ("started_at", "finished_at"))+ minutes = (t1 - t0).total_seconds() / 60+ meta = {"harness_score": rec.get("final_score"), "rounds": len(rec.get("rounds") or []), "best_round": best,+ "cost_usd": float((rec.get("total_usage") or {}).get("cost_usd") or 0.0), "minutes": round(minutes or 0.0, 2),+ "status": str(rec.get("status") or "")}+ return [RenderView(name=v.name, path=v.path, mode="shaded", width=v.width, height=v.height) for v in chosen], meta+++# ----------------------------------------------------------------------------- judge+def render_set(views: list[RenderView]) -> RenderSet:+ return RenderSet(views=views, renderer="h2h_stills")+++def views_from_paths(paths: list[Path]) -> list[RenderView]:+ return [RenderView(name=p.stem[len("view_"):] if p.stem.startswith("view_") else p.stem, path=str(p), mode="shaded") for p in paths]+++def spec_for(item: BenchPrompt) -> Spec:+ return Spec(id=f"h2h_scene_v1/{item.id}", track=Track.SCENE, language=Language.SCENE_THREEJS, prompt=item.prompt, tags=list(item.tags))+++def judge_side(judge: Any, spec: Spec, views: list[RenderView], cache: Path) -> dict[str, Any]:+ """One fixed-judge verdict, cached as JSON (re-runs never re-pay)."""+ from codeverse.judges.base import JudgeInput++ if cache.is_file():+ return json.loads(cache.read_text())+ inp = JudgeInput(spec=spec, renders=render_set(views), gates=[], acceptance=[], round_index=0, extra_context=EXTRA_CONTEXT)+ j = judge.judge(inp)+ cache.parent.mkdir(parents=True, exist_ok=True)+ cache.write_text(j.model_dump_json(indent=1))+ return json.loads(cache.read_text())+++def uncapped(verdict: dict[str, Any]) -> dict[str, Any]:+ """The weighted mean BEFORE defect penalties/caps (scene_v1 penalties can floor a bad scene at 0)."""+ raw = json.loads(verdict.get("raw") or "{}")+ return {"score_uncapped": raw.get("overall_uncapped"), "defect_penalty": float(raw.get("defect_penalty") or 0.0)}+++# ----------------------------------------------------------------------------- sheet+def sheet(row_id: str, theirs: list[Path], ours: list[Path], out_png: Path, thumb_h: int = 180) -> None:+ def strip(paths: list[Path], label: str) -> Image.Image:+ thumbs = []+ for p in paths:+ with Image.open(p) as im:+ im = im.convert("RGB")+ thumbs.append(im.resize((max(1, int(im.width * thumb_h / im.height)), thumb_h)))+ w = sum(t.width for t in thumbs) + 4 * max(1, len(thumbs) - 1) if thumbs else 400+ canvas = Image.new("RGB", (w, thumb_h + 22), (20, 20, 20))+ ImageDraw.Draw(canvas).text((4, 4), label, fill=(255, 255, 255))+ x = 0+ for t, p in zip(thumbs, paths, strict=True):+ canvas.paste(t, (x, 22))+ ImageDraw.Draw(canvas).text((x + 3, 24), p.stem[:34], fill=(255, 255, 0))+ x += t.width + 4+ return canvas++ a, b = strip(theirs, f"{row_id} — THEIRS (authored cams + overview)"), strip(ours, f"{row_id} — OURS (best round, t=0 judge views)")+ out = Image.new("RGB", (max(a.width, b.width), a.height + b.height + 6), (60, 60, 60))+ out.paste(a, (0, 0))+ out.paste(b, (0, a.height + 6))+ out_png.parent.mkdir(parents=True, exist_ok=True)+ out.save(out_png)+++# ----------------------------------------------------------------------------- summary+def sign_test(deltas: list[float]) -> tuple[int, int, float]:+ """(n_nonzero, n_positive, two-sided exact binomial p) for ours − theirs."""+ nz = [d for d in deltas if d != 0]+ n, k = len(nz), sum(1 for d in nz if d > 0)+ if n == 0:+ return 0, 0, 1.0+ cdf = lambda m: sum(math.comb(n, i) for i in range(m + 1)) / 2 ** n # noqa: E731+ p = min(1.0, 2 * min(cdf(k), 1 - cdf(k - 1)))+ return n, k, p+++def summary_md(rows: list[Row]) -> str:+ done = [r for r in rows if r.ours is not None and r.delta is not None]+ lines = ["# h2h_scene_v1 — scene track vs scene_multifile(_graphics)", "",+ f"Fixed judge: `{JUDGE_MODEL}` rubric `{RUBRIC}` n=2, stills only, no gates, no acceptance items; "+ f"≤ {MAX_VIEWS} views per side (theirs: view_cam_* then view_overview_*; ours: best-round t=0 judge views).", "",+ "| id | repo | theirs (fixed) | uncapped | their own | ours (fixed) | uncapped | harness | Δ ours−theirs | their min / $ | our min / $ | views t/o |",+ "|---|---|---|---|---|---|---|---|---|---|---|---|"]+ for r in rows:+ t, o = r.theirs, r.ours+ lines.append(f"| {r.id} | {r.source_repo} | {t.score:.3f} | {t.score_uncapped} | {t.their_own_score if t.their_own_score is not None else '—'} | "+ f"{f'{o.score:.3f}' if o else 'pending'} | {o.score_uncapped if o else '—'} | {o.harness_score if o else '—'} | {f'{r.delta:+.3f}' if r.delta is not None else '—'} | "+ f"{t.duration_s / 60:.1f} / {t.cost_usd:.2f} | {f'{o.minutes:.1f} / {o.cost_usd:.2f}' if o else '—'} | {t.n_views}/{o.n_views if o else 0} |")+ if done:+ d = [r.delta for r in done if r.delta is not None]+ n, k, p = sign_test(d)+ sd = statistics.stdev(d) if len(d) > 1 else 0.0+ lines += ["", f"**Paired (n={len(d)})**: mean Δ = {statistics.mean(d):+.3f}, sd = {sd:.3f}, "+ f"sign test: ours better on {k}/{n} (two-sided p = {p:.3f}).",+ f"Mean minutes/scene: theirs {statistics.mean(r.theirs.duration_s for r in done) / 60:.1f}, ours {statistics.mean(r.ours.minutes for r in done if r.ours):.1f}; "+ f"mean $/scene: theirs {statistics.mean(r.theirs.cost_usd for r in done):.2f}, ours {statistics.mean(r.ours.cost_usd for r in done if r.ours):.2f}."]+ else:+ lines += ["", "No completed OUR runs yet — theirs judged only."]+ return "\n".join(lines) + "\n"+++# ----------------------------------------------------------------------------- main+def main() -> None:+ ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])+ ap.add_argument("--ids", default="", help="comma list of prompt ids (default all)")+ ap.add_argument("--theirs-only", action="store_true", help="judge only their side (proof mode)")+ ap.add_argument("--n-samples", type=int, default=2)+ ap.add_argument("--out", type=Path, default=OUT)+ ns = ap.parse_args()+ from codeverse.judges.vlm_judge import VlmJudge++ judge = VlmJudge(rubric=RUBRIC, model_id=JUDGE_MODEL, n_samples=ns.n_samples, label="h2h")+ battery = Battery.load(BATTERY)+ want = {s for s in ns.ids.split(",") if s}+ rows: list[Row] = []+ for item in battery.prompts:+ if want and item.id not in want:+ continue+ repo, name = origin(item)+ out_dir = REPOS[repo] / "outputs" / name+ spec = spec_for(item)+ tf = their_frames(out_dir)+ tj = judge_side(judge, spec, views_from_paths(tf), ns.out / "judge" / f"{item.id}_theirs.json")+ theirs = TheirSide(score=tj["overall"], n_views=len(tf), views=[p.name for p in tf], **uncapped(tj), **their_meta(out_dir))+ ours: OurSide | None = None+ of: list[Path] = []+ got = None if ns.theirs_only else our_frames(ns.out / "runs" / item.id)+ if got is not None:+ views, meta = got+ oj = judge_side(judge, spec, views, ns.out / "judge" / f"{item.id}_ours.json")+ ours = OurSide(score=oj["overall"], n_views=len(views), views=[v.name for v in views], **uncapped(oj), **meta)+ of = [Path(v.path) for v in views]+ row = Row(id=item.id, source_repo=repo, name=name, theirs=theirs, ours=ours,+ delta=round(ours.score - theirs.score, 4) if ours else None)+ rows.append(row)+ sheet(item.id, tf, of, ns.out / "sheets" / f"{item.id}.png")+ print(f"{item.id}: theirs {theirs.score:.3f} (own {theirs.their_own_score}) | ours {ours.score if ours else 'pending'} | Δ {row.delta}")+ ns.out.mkdir(parents=True, exist_ok=True)+ (ns.out / "h2h.jsonl").write_text("".join(r.model_dump_json() + "\n" for r in rows))+ (ns.out / "h2h_summary.md").write_text(summary_md(rows))+ print(summary_md(rows))+++if __name__ == "__main__":+ main()diff --git a/harness/bench/prompts/fancy_v1_blender.yaml b/harness/bench/prompts/fancy_v1_blender.yamlnew file mode 100644index 00000000..d20e853a--- /dev/null+++ b/harness/bench/prompts/fancy_v1_blender.yaml@@ -0,0 +1,286 @@+# fancy_v1 — blender slice (10 prompts). Complex, picture-worthy static objects, every+# prompt written from how the real object is actually built: load-bearing parts, how they+# attach, proportions in metres, where materials change, and the 2-4 details that make it+# read as THAT object. Objects chosen for a distinctive silhouette, real internal structure,+# repeats-and-mirrors (spokes, slats, teeth, fins) and at least one hollow. Blender slice+# carries the organic and bevelled forms. All hard tier; ids fancy_bl_<snake>.+# Sibling files: fancy_v1_cadquery.yaml, fancy_v1_threejs.yaml.+name: fancy_v1_blender+track: static_object+language: blender+description: >+ fancy_v1 blender slice: 10 hard static objects with real construction described the way+ a product designer would (Windsor chair, harp, ship's wheel, carousel horse, orrery ...),+ each with a countable falsifiable must_have list and realistic overall dimensions.+prompts:+ # Steam-bent bow socketed into a saddled seat, turned spindles and splayed legs: organic+ # carving plus a large count of thin repeated parts that must all land in the seat.+ - id: fancy_bl_windsor_chair+ tier: hard+ category: furniture+ tags: [fancy_v1, hard]+ prompt: >+ a sack-back Windsor armchair in the traditional construction: a thick elm seat plank,+ about 0.55 m wide and 0.05 m thick, carved into a saddle with a raised pommel at the front; a steam-bent ash bow of round section about 0.02 m+ thick rising in a continuous arch whose two ends socket down into the seat behind the+ sitter; a flat steam-bent arm rail wrapping around at elbow height whose ends terminate+ in small hand rests, supported at the front by a turned arm post on each side; seven+ tapered spindles passing through holes in the arm rail up into the bow, plus four+ shorter spindles under each arm; four turned legs with baluster and ring profiles+ raked outward and splayed to the sides, socketed into the underside of the seat, tied+ by an H-stretcher of three turned rungs. Milk-paint black-green, worn through to pale wood on the arm tops.+ must_have:+ - "seat plank about 0.55 m wide with a visibly scooped saddle, not a flat slab"+ - "a continuous round-section bow arching over the back and entering the seat at exactly two points"+ - "a flat arm rail at about 0.68 m above the floor wrapping around both sides of the sitter"+ - "at least 7 long spindles pass through the arm rail and continue up into the bow"+ - "at least 4 short spindles under each arm between arm rail and seat"+ - "four turned legs raked outward so the feet sit wider than the seat"+ - "all four feet touch the ground plane"+ - "paint worn through to pale wood on the arm tops as a second material"+ dimensions_m: {width: 0.62, depth: 0.58, height: 1.02}+ # A concert harp: a real triangular load path (pillar, neck, soundboard-in-body) and 47+ # graduated strings in a plane, with coloured C and F strings and a hollow resonator.+ - id: fancy_bl_concert_harp+ tier: hard+ category: instruments+ tags: [fancy_v1, hard]+ prompt: >+ a concert pedal harp built as the real triangle: a fluted gilded column (the pillar)+ standing about 1.75 m tall at the front, a hollow tapered spruce sound body at the+ back, its rounded staved back closed and its flat soundboard facing the player,+ widening from about 0.10 m at the top to 0.50 m at the base; a curved maple neck+ arching from the top of the column down to the top of the body with the brass action+ plate running along its side carrying a row of tuning pins; 47 strings, all in one+ plane, strung from pins on the neck down to a straight rib on the soundboard centre,+ graduating from about 0.08 m long at the treble to 1.50 m long at the bass; every+ seventh string red (the Cs) and one in four blue (the Fs), the others natural gut colour; a base plate with seven pedals in a row and+ two rear feet; gold-leaf ornament on the column capital and the crown.+ must_have:+ - "a fluted front pillar about 1.75 m tall, standing vertically at the front"+ - "a hollow sound body at the back that widens toward the base and shows a rounded staved back"+ - "a curved neck joining the pillar top to the body top, forming a closed triangle"+ - "at least 40 strings, all lying in one plane, each attached at both ends"+ - "strings graduate in length from short at the treble end to long at the bass end"+ - "some strings coloured red and some blue among natural-coloured ones"+ - "seven pedals visible on the base plate"+ - "gold-coloured ornament on the column capital distinct from the wood body"+ dimensions_m: {width: 0.55, depth: 1.0, height: 1.85}+ # Ship's wheel on a binnacle: turned spokes through a laminated rim, a hub with a brass+ # boss, the wheel mounted on a pedestal that is itself a hollow box with a compass bowl.+ - id: fancy_bl_ships_wheel+ tier: hard+ category: vehicles+ tags: [fancy_v1, hard]+ prompt: >+ a ship's steering wheel on its binnacle: a mahogany rim about 1.20 m across built from+ a laminated ring of round section about 0.05 m thick, through which pass eight turned+ spokes; each spoke runs from the central hub, through the rim, and out beyond it as a+ turned handle with a bulbous knob, so the handles sit about 0.14 m proud of the rim;+ the hub is a thick disc with a domed brass boss at its centre; the wheel is mounted+ vertically on a horizontal brass axle that runs back into a hollow teak binnacle+ pedestal about 1.10 m tall, square in plan with chamfered corners, brass bands top+ and bottom; on top of the binnacle a brass compass bowl under a glazed hemispherical+ hood with a hinged lamp housing on the side; a brass grab rail around the pedestal top.+ must_have:+ - "a circular rim about 1.20 m in diameter with a round cross-section"+ - "exactly 8 spokes spaced evenly, each passing through the rim and continuing outward as a handle"+ - "each handle ends in a bulbous turned knob outside the rim"+ - "a thick hub disc at the centre with a domed brass boss"+ - "the wheel stands vertically in front of a square-plan pedestal about 1.10 m tall"+ - "a hemispherical glazed compass hood on top of the pedestal"+ - "brass bands and boss distinct in colour from the dark wood rim and spokes"+ - "the pedestal base sits flat on the ground plane"+ dimensions_m: {width: 1.35, depth: 0.75, height: 1.75}+ # Carousel horse: organic sculpted body in a gallop pose with a brass pole through it,+ # carved tack, glass jewels, a decorated saddle; the pole is the hard rigid reference.+ - id: fancy_bl_carousel_horse+ tier: hard+ category: toys+ tags: [fancy_v1, hard]+ prompt: >+ a carousel jumper horse in the full-gallop carving pose: the body about 1.50 m from+ nose to tail root, front legs tucked up under the chest, hind legs stretched straight+ back, the head turned slightly to the outside (the romance side) with an open mouth+ and flared nostrils, a carved flowing mane falling to one side and a long swept tail;+ a polished brass pole about 0.045 m thick passing vertically through the body just+ behind the withers and exiting under the belly, continuing down to a round base plate;+ carved tack in relief: a saddle with a raised cantle and a saddle blanket with a+ scalloped trailing edge, a breast strap, a bridle with a browband; the romance side+ dressed with at least six faceted glass jewels set in gilded rosettes along the saddle+ blanket and breast strap; painted a dapple white body with a gold-and-red saddle, a+ black hoof on each leg and a horseshoe on each hoof.+ must_have:+ - "a horse body about 1.50 m long with both front legs tucked up and both hind legs stretched back"+ - "no hoof touches the ground; the horse is held up only by the pole"+ - "a vertical brass pole passes through the body behind the withers and exits under the belly"+ - "the pole continues down to a round base plate on the ground"+ - "a saddle with a raised cantle and a blanket with a scalloped rear edge"+ - "at least 6 jewel-like faceted bosses along the saddle blanket or breast strap"+ - "a flowing mane and a long tail carved as separate masses from the body"+ - "at least 3 distinct paint colours: pale body, red or gold tack, black hooves"+ dimensions_m: {width: 0.55, depth: 1.6, height: 1.85}+ # Brass orrery: nested concentric arms at different heights, gear stack under the base,+ # spheres on stalks with a moon sub-arm, a scalloped skirt, hollow base with visible gears.+ - id: fancy_bl_orrery+ tier: hard+ category: instruments+ tags: [fancy_v1, hard]+ prompt: >+ a Georgian-style brass orrery: a round mahogany base about 0.45 m in diameter with a+ turned edge, carrying a brass calendar ring engraved with the zodiac around its rim on+ twelve small turned pillars; under the ring, in the hollow between base and ring, a+ visible stack of brass spur gears of decreasing size driving a central vertical shaft;+ at the top of the shaft a gilt sun ball about 0.03 m across on a short stalk; six planet+ arms of flat brass strip radiating at six different heights on nested concentric+ sleeves around the shaft, each arm ending in a polished sphere on a small vertical+ stalk, lengths increasing from 0.06 m for Mercury to 0.22 m for Saturn; the Earth arm+ carries a small sub-arm with a tiny moon and a tilted brass ring around the Earth ball;+ Saturn wears a thin flat ring; a crank handle on the side of the base drives the gears.+ must_have:+ - "a round wooden base about 0.45 m in diameter"+ - "a brass ring around the rim supported on at least 12 small pillars"+ - "at least 4 visible spur gears of different sizes in the hollow under the ring"+ - "exactly 6 radial arms at six different heights, each ending in a sphere on a stalk"+ - "arm lengths increase outward so the outermost sphere is farthest from the shaft"+ - "one arm carries a small sub-arm with a tiny moon beside its planet"+ - "the outermost sphere has a thin flat ring around it"+ - "brass parts distinct in colour from the dark wood base"+ dimensions_m: {width: 0.5, depth: 0.5, height: 0.42}+ # A pipe organ facade: a carved case with a hollow impost, graduated speaking pipes in+ # mitred flats and towers, a keyboard console; a hard count-and-graduation object.+ - id: fancy_bl_chamber_organ+ tier: hard+ category: instruments+ tags: [fancy_v1, hard]+ prompt: >+ a chamber pipe organ in an oak case about 2.20 m wide and 3.20 m tall: a lower case+ with two panelled doors, a projecting keydesk with two manuals of 56 keys each (the+ upper set back from the lower), a music stand and eight stop knobs on each side jamb; above a moulded impost, the facade of speaking pipes arranged as a central+ round tower of seven pipes in a semicircle, a flat of nine pipes on each side, and an+ outer tower of five pipes on each side, the towers standing proud of the flats; all+ facade pipes are polished tin cylinders with conical feet standing in a toe-board,+ a mouth with a cut-up and upper lip cut in each one about a fifth of the way up, and+ pipe lengths graduated symmetrically from tallest at the centre of each tower to+ shortest at the flat ends; carved pierced pipe shades filling the arch above each+ tower and flat; a crown cornice with a carved centre finial.+ must_have:+ - "an oak case about 2.20 m wide and 3.20 m tall standing on the ground plane"+ - "a central tower of pipes standing proud of two flanking flats"+ - "an outer tower of pipes at each end, making 5 pipe groups in a left-right mirror"+ - "at least 30 facade pipes in total, all polished tin colour"+ - "pipe heights within each group graduate symmetrically about the group centre"+ - "each pipe has a conical foot and a visible mouth notch in its lower fifth"+ - "two keyboards visible on a projecting keydesk, the upper set back from the lower"+ - "at least 8 stop knobs in a column on each side of the keyboards"+ dimensions_m: {width: 2.2, depth: 1.1, height: 3.2}+ # Victorian cast-iron street lamp: a fluted tapered column, a hollow four-sided lantern+ # with glazed panes and a finial, ladder bar, acanthus base; architectural detail object.+ - id: fancy_bl_gas_street_lamp+ tier: hard+ category: architecture+ tags: [fancy_v1, hard]+ prompt: >+ a Victorian cast-iron gas street lamp about 4.2 m tall: a square stepped plinth at+ the base about 0.45 m across, an octagonal pedestal with a cast acanthus-leaf collar+ at its top, a fluted tapered column of 16 flutes narrowing from 0.20 m to 0.12 m over+ its height with two moulded astragal rings, a short horizontal ladder bar with a+ ball at each end just below the lantern for the lamplighter; the lantern is a hollow+ four-sided tapered box, wider at the top, with a glazed pane in each face held by+ thin glazing bars, a sloped four-sided pyramidal roof with a vented cap and a pointed+ finial, and a copper gas-mantle burner visible inside the glass; the iron painted+ gloss black with the acanthus collar and finial picked out in gold leaf; the lantern+ glass slightly frosted.+ must_have:+ - "a stepped square plinth at the base sitting on the ground plane"+ - "a tapered column with at least 12 visible flutes"+ - "a cast leaf collar at the top of the pedestal, gold-coloured"+ - "a horizontal ladder bar with a ball at each end just below the lantern"+ - "a four-sided lantern that is wider at the top than at the bottom"+ - "a glazed pane in each of the four lantern faces"+ - "a pyramidal roof on the lantern with a finial at its apex"+ - "a burner element visible inside the lantern"+ dimensions_m: {width: 0.55, depth: 0.55, height: 4.2}+ # Brass microscope: a hollow drawtube, triple nosepiece with objectives, rack-and-pinion+ # focus, a mirror on a gimbal under a stage with clips, a horseshoe foot; optics object.+ - id: fancy_bl_brass_microscope+ tier: hard+ category: optics+ tags: [fancy_v1, hard]+ prompt: >+ a late-Victorian brass compound microscope: a heavy horseshoe-shaped foot, two+ trunnion pillars carrying a pivoted limb so the whole body tilts back, a square stage+ about 0.09 m across with two spring stage clips and a central aperture, beneath it a+ concave mirror about 0.04 m across on a gimbal fork that swings under the stage;+ above the stage a curved limb carrying the coarse focus rack, with a pair of large+ knurled coarse-focus knobs on a shaft either side and a smaller fine-focus knob on top+ of the limb; the body tube about 0.03 m in diameter and 0.16 m long, with an inner+ drawtube telescoped out of its top ending in an eyepiece cap; at the bottom of the+ body tube a revolving nosepiece carrying three objectives of different lengths in a+ rotating triple; lacquered polished brass throughout with black japanned foot and+ the limb, silvered mirror, and a black eyepiece cap.+ must_have:+ - "a horseshoe-shaped foot sitting flat on the ground plane"+ - "the body is pivoted between two pillars rising from the foot"+ - "a square stage with two stage clips on its top surface"+ - "a round mirror on a fork below the stage"+ - "a vertical body tube with a narrower drawtube extending from its top"+ - "exactly 3 objectives of different lengths hanging from a rotating nosepiece"+ - "two large matching knurled focus knobs on a common shaft either side of the limb"+ - "brass body distinct in colour from the black foot and the black eyepiece cap"+ dimensions_m: {width: 0.15, depth: 0.2, height: 0.36}+ # Espresso lever machine: a chrome dome boiler, a spring-lever group with a long handle,+ # portafilter locked in, a drip tray grille, gauge, eagle finial; appliance in curves.+ - id: fancy_bl_lever_espresso+ tier: hard+ category: appliances+ tags: [fancy_v1, hard]+ prompt: >+ a classic Italian lever espresso machine of the domestic kind: a polished chrome+ boiler cylinder about 0.16 m in diameter and 0.30 m tall standing on a cast alloy+ base with four rubber feet; a domed lid on the boiler with a brass eagle finial on+ top and a round pressure gauge with a white dial set into the front of the boiler; a+ brass group head cast into the front of the boiler near its base, with a long+ cylindrical spring-lever housing rising above it and a lever arm about 0.30 m long+ with a black bakelite knob angled up and back; a portafilter with a black handle+ locked into the group with two spouts pointing down at a cup; a steam wand of thin+ pipe with a black tap knob on the side of the boiler; a pull-out drip tray with a+ slotted chrome grille under the group; a sight glass tube on the boiler side showing+ water level.+ must_have:+ - "a vertical cylindrical boiler about 0.16 m in diameter with a domed lid"+ - "a finial on the top of the dome"+ - "a round gauge with a pale dial set into the boiler front"+ - "a group head on the boiler front near its base with a vertical spring housing above it"+ - "a lever arm at least 0.25 m long with a black knob angled up and back from the group"+ - "a portafilter locked into the group with two spouts pointing down"+ - "a drip tray with a slotted grille under the group"+ - "chrome boiler, brass group head and black knobs as three distinct materials"+ dimensions_m: {width: 0.24, depth: 0.32, height: 0.55}+ # Orbital shaker-incubator: a radiused housing with a hinged clear lid on gas struts, a+ # perforated platform, six clamped flasks with liquid; lab equipment with transparency.+ - id: fancy_bl_lab_orbital_shaker+ tier: hard+ category: lab_equipment+ tags: [fancy_v1, hard]+ prompt: >+ a benchtop orbital shaker-incubator as used in a microbiology lab: a squat white+ powder-coated steel housing about 0.60 m wide, 0.55 m deep and 0.45 m tall with+ radiused vertical corners and a recessed front control panel carrying a small dark+ display, a speed knob, a temperature knob and two rocker switches; a clear hinged+ acrylic lid on the top, propped open at about 60 degrees on two gas struts, revealing+ the platform inside: a flat aluminium tray on the orbital drive with a grid of holes+ and two rows of spring-wire flask clamps, each clamp a ring of curved spring fingers,+ holding six 250 ml conical Erlenmeyer flasks with orange screw caps and pale broth+ inside; a stainless handle on the lid front edge; four levelling feet; a louvred+ vent strip on each side of the housing; a coiled black mains lead at the back.+ must_have:+ - "a white boxy housing about 0.60 m wide with rounded vertical corners"+ - "a transparent lid hinged at the back, propped open on two struts"+ - "a flat platform tray inside with a visible grid of holes"+ - "exactly 6 conical flasks standing on the platform in two rows"+ - "each flask is held by a ring of spring fingers around its base"+ - "each flask has an orange cap and a visible liquid level inside"+ - "a front control panel with two knobs and a small dark display"+ - "the housing stands on four feet on the ground plane"+ dimensions_m: {width: 0.62, depth: 0.58, height: 0.9}diff --git a/harness/bench/prompts/fancy_v1_cadquery.yaml b/harness/bench/prompts/fancy_v1_cadquery.yamlnew file mode 100644index 00000000..5a3e10f5--- /dev/null+++ b/harness/bench/prompts/fancy_v1_cadquery.yaml@@ -0,0 +1,97 @@+# fancy_v1 — cadquery slice (3 prompts). Machined, turned and cast objects that suit a+# B-rep kernel: fillets, bores, bolt circles, gear teeth, knurls and threads. Every prompt+# names the real construction of the object; must_have items are single falsifiable+# clauses with counts. All hard tier; ids fancy_cq_<snake>.+# Sibling files: fancy_v1_blender.yaml, fancy_v1_threejs.yaml.+name: fancy_v1_cadquery+track: static_object+language: cadquery+description: >+ fancy_v1 cadquery slice: 3 hard machined/cast objects (Jacobs chuck on an arbor, a+ cast-iron handwheel gate valve, a turbocharger housing) with bores, bolt circles, knurls+ and fillets that a CAD kernel can express exactly.+prompts:+ # Jacobs chuck: three jaws on a scroll in a tapered body, a knurled sleeve, a key with a+ # pinion, the arbor behind — turned parts with a knurl and radial repeats at 120 degrees.+ - id: fancy_cq_jacobs_chuck+ tier: hard+ category: tools+ tags: [fancy_v1, hard]+ prompt: >+ a keyed Jacobs drill chuck on a Morse-taper arbor, as a machined assembly: a steel+ chuck body about 0.045 m in diameter and 0.075 m long, turned with a shallow taper+ toward the nose; over its middle a rotating knurled sleeve about 0.052 m in diameter+ with straight knurling of at least 60 ribs and a chamfered front edge; at the nose,+ three hardened jaws set at 120 degrees in angled slots, each jaw a rectangular bar+ with a ground gripping face, protruding about 0.012 m and open around a 0.008 m gap+ holding a twist drill bit about 0.09 m long with two helical flutes; on the rear+ of the sleeve a ring of bevel gear teeth, at least 24 teeth, into which a chuck key+ with a matching bevel pinion and a T-bar handle is engaged in one of three key holes+ drilled into the body at 120 degrees; behind the body a tapered arbor about 0.10 m+ long with a flat tang at its end; fillets at every shoulder.+ must_have:+ - "a turned chuck body with a knurled sleeve of at least 60 straight ribs around it"+ - "exactly 3 jaws at 120 degree spacing at the nose, angled inward toward the axis"+ - "a drill bit with two helical flutes gripped between the three jaws, coaxial with the body"+ - "a ring of at least 24 bevel gear teeth on the rear face of the sleeve"+ - "a chuck key with a bevel pinion engaged into a hole in the body, its T-bar handle outside"+ - "a tapered arbor behind the body ending in a flat tang"+ - "body, sleeve and arbor are all coaxial"+ - "visible fillets at the shoulders between arbor and body"+ dimensions_m: {width: 0.11, depth: 0.09, height: 0.27}+ # Cast-iron gate valve: flanged body with bolt circles, a bonnet with its own bolt ring,+ # a yoke, a rising stem with thread, a spoked handwheel; castings plus machined faces.+ - id: fancy_cq_gate_valve+ tier: hard+ category: architecture+ tags: [fancy_v1, hard]+ prompt: >+ a DN100 cast-iron rising-stem gate valve as installed in a pipe run: a bulbous cast+ body with a horizontal bore, a raised-face flange at each end about 0.22 m in+ diameter and 0.024 m thick with eight bolt holes on a 0.18 m pitch circle, each hole+ fitted with a hex bolt and nut;+ a bonnet flange on top about 0.16 m across with six bolts on its own circle, the+ bonnet rising as a domed casting into a yoke of two curved arms that meet at a+ threaded stem nut boss; a rising stem about 0.025 m in diameter passing up through+ the yoke, its upper part visibly threaded with at least 10 turns showing above the+ handwheel; a cast handwheel about 0.30 m in diameter with five curved spokes, a+ dished rim of round section and a hub with a square drive and a retaining nut; a gland with two studs where the stem enters the bonnet; castings dark blue-grey,+ flange faces bright, handwheel red.+ must_have:+ - "a horizontal through-bore body with a flange at each end"+ - "exactly 8 bolt holes on each end flange, each fitted with a bolt and nut"+ - "a bonnet flange on top with exactly 6 bolts on its own circle"+ - "a two-armed yoke rising from the bonnet meeting at a central boss"+ - "a vertical stem passing through the boss with at least 10 thread turns visible above the handwheel"+ - "a handwheel about 0.30 m in diameter with exactly 5 spokes"+ - "the handwheel red, the flange faces bright metal, the body a dark cast colour"+ - "the body, bonnet, yoke, stem and handwheel share one vertical axis"+ dimensions_m: {width: 0.35, depth: 0.32, height: 0.62}+ # Turbocharger: two cast volutes, a machined centre bearing housing, a finned compressor+ # wheel and turbine wheel visible in their inlets, V-band and bolt flanges, an actuator.+ - id: fancy_cq_turbocharger+ tier: hard+ category: vehicles+ tags: [fancy_v1, hard]+ prompt: >+ an automotive turbocharger as a machined and cast assembly: a snail-shaped aluminium+ compressor volute about 0.16 m across whose scroll grows in section around the axis+ to a tangential outlet spigot, and+ an axial inlet bore about 0.055 m across in which the compressor wheel is visible: a hub with 12 thin curved blades; a+ turbine housing on the other side, a cast-iron volute about 0.14 m across with a+ square inlet flange carrying four bolt holes, and a round outlet with a V-band+ flange; between the volutes a cylindrical centre bearing housing about 0.07 m in+ diameter with a boss for the oil feed banjo bolt on top and a drain flange with two+ studs underneath, joined to each housing by a ring of six clamp bolts; a wastegate+ actuator can on a bracket on the compressor housing, its rod running to a lever on the+ turbine housing; fillets at every casting junction.+ must_have:+ - "two snail-shaped volutes on a common axis with a cylindrical bearing housing between them"+ - "the compressor volute has a tangential outlet spigot whose scroll grows in section around the axis"+ - "a compressor wheel with at least 10 curved blades visible inside the axial inlet bore"+ - "a square inlet flange on the turbine housing with exactly 4 bolt holes"+ - "a V-band flange on the turbine outlet"+ - "a ring of at least 6 bolts where each volute meets the centre housing"+ - "a round actuator can on a bracket with a rod running to a lever on the turbine housing"+ - "aluminium-coloured compressor housing distinct from the dark iron turbine housing"+ dimensions_m: {width: 0.28, depth: 0.22, height: 0.2}diff --git a/harness/bench/prompts/fancy_v1_threejs.yaml b/harness/bench/prompts/fancy_v1_threejs.yamlnew file mode 100644index 00000000..227f3fdb--- /dev/null+++ b/harness/bench/prompts/fancy_v1_threejs.yaml@@ -0,0 +1,99 @@+# fancy_v1 — threejs slice (3 prompts). Objects that read through colour separation and+# instancing of repeated parts (keys, blades, slats, tines): a good fit for procedural+# three.js meshes with per-part materials. Every prompt names the real construction;+# must_have items are single falsifiable clauses with counts. All hard tier; ids+# fancy_tj_<snake>. Sibling files: fancy_v1_blender.yaml, fancy_v1_cadquery.yaml.+name: fancy_v1_threejs+track: static_object+language: threejs+description: >+ fancy_v1 threejs slice: 3 hard static objects built from many repeated coloured parts+ (a Wurlitzer-style jukebox, a Dutch windmill with lattice sails, a xylophone-style+ marimba) that reward instancing and clean material separation.+prompts:+ # Jukebox: arched cabinet with bubble tubes, a chrome grille, a visible record carousel+ # behind glass, a row of selector buttons — emissive colour bands plus repeated parts.+ - id: fancy_tj_bubbler_jukebox+ tier: hard+ category: appliances+ tags: [fancy_v1, hard]+ prompt: >+ a 1940s bubbler-style jukebox about 1.50 m tall: a wooden cabinet with a rounded arch+ top, its front built as concentric arches of translucent coloured plastic panels+ (yellow, red and green from the outside in) lit from behind, with two clear bubble+ tubes following the outer arch; inside the arch a curved glass window showing the+ record mechanism: a carousel of 24 vertical 78 rpm records on edge in a slotted+ rack, with a chrome tonearm and a turntable in front; below the window a sloped+ title strip holder with two columns of 12 title cards each behind a glass strip,+ flanked by a row of 24 ivory selector buttons in two banks; the lower front a+ chrome pierced speaker grille of at least eight vertical bars over a red cloth+ backing, with two chrome coin-slot plates; four short cabinet feet; the cabinet+ sides in dark walnut with a chrome trim strip up each front corner.+ must_have:+ - "a cabinet about 1.50 m tall with a rounded arched top"+ - "at least 3 concentric coloured arch bands, distinct hues, on the front"+ - "two bubble tubes following the outer arch on each side"+ - "a curved window inside the arch through which at least 20 records are visible standing on edge"+ - "two columns of title cards behind a glass strip below the window"+ - "at least 20 selector buttons in two banks"+ - "a speaker grille of at least 8 vertical chrome bars over a red backing on the lower front"+ - "the coloured arch bands emissive so they read as lit"+ dimensions_m: {width: 0.85, depth: 0.65, height: 1.52}+ # Dutch smock windmill: an octagonal thatched body on a brick base, a rotating cap, four+ # lattice sails with dozens of instanced slats, a tail pole and a stage gallery.+ - id: fancy_tj_smock_windmill+ tier: hard+ category: architecture+ tags: [fancy_v1, hard]+ prompt: >+ a Dutch smock windmill about 18 m tall: a tapered octagonal tower, the lower 5 m in+ red brick with a door and two arched windows, the upper part thatched over a timber+ frame with eight corner posts; a stage+ gallery ringing the tower at the brick-to-thatch line, its deck on radial joists+ with a railing of at least 40 balusters; a boat-shaped rotating cap on top, its+ plank cladding laid horizontally, carrying the windshaft at a slight upward tilt; four+ common sails fixed at 90 degrees on a cast-iron cross, each sail a long whip+ about 12 m from the shaft with a lattice of at least 18 sail bars across it, the+ lattice on one side of the whip only with a leading board on the other, the sails+ set in the X position; a tail pole angling down from the back of the cap to a wheel+ on the stage; sail lattices white,+ the cap tarred black, the thatch grey-brown.+ must_have:+ - "an octagonal tapered tower that is brick below and thatch above"+ - "a gallery deck ringing the tower at the material change with at least 40 balusters"+ - "a rotating cap on top with horizontal plank cladding"+ - "exactly 4 sails on a central cross set at 90 degree spacing"+ - "each sail about 12 m from the shaft with at least 18 lattice bars"+ - "a tail pole from the back of the cap running down to the gallery"+ - "white sails, black cap and brown thatch as three distinct colours"+ - "the tower base sits on the ground plane and no sail tip reaches the ground"+ dimensions_m: {width: 26.0, depth: 26.0, height: 18.5}+ # Concert marimba: 49 graduated rosewood bars in two rows on a frame, a resonator tube+ # under each bar graduated in length, a wheeled frame; instancing with per-bar scaling.+ - id: fancy_tj_concert_marimba+ tier: hard+ category: instruments+ tags: [fancy_v1, hard]+ prompt: >+ a concert marimba with a 4-octave range: 49 rosewood bars laid out like a piano+ keyboard on a wooden frame about 2.10 m long and 0.92 m high, the naturals in a+ front row of 29 bars and the accidentals in a raised rear row of 20 bars offset+ behind the gaps, the accidental row set back and about 0.03 m higher; bars+ graduated in both length and width from about 0.45 m long and 0.075 m wide at the+ bass end to 0.15 m long and 0.04 m wide at the treble, each bar resting on a cord through+ nodal holes strung between posts on the rails; beneath every bar a vertical golden-coloured+ aluminium resonator tube whose length matches the bar's pitch, longest under the+ bass bars and stepping down toward the treble, so the resonator array forms a curved+ wedge; the bass end of the frame taller than the treble end;+ four legs on rubber-tyred casters; two mallets with yarn heads resting across the+ bass bars.+ must_have:+ - "a front row of at least 25 bars and a raised rear row of at least 18 bars"+ - "the rear row is offset behind the gaps of the front row and sits higher"+ - "bars graduate in length from long at one end to short at the other"+ - "a vertical resonator tube under every bar"+ - "resonator tube lengths step down from the bass end to the treble end"+ - "bars are a rosewood colour and resonators a golden metal colour"+ - "four legs on casters, all touching the ground plane"+ - "overall length about 2.10 m"+ dimensions_m: {width: 2.15, depth: 0.85, height: 0.95}diff --git a/harness/bench/prompts/h2h_brilliana_v1_blender.yaml b/harness/bench/prompts/h2h_brilliana_v1_blender.yamlnew file mode 100644index 00000000..41998037--- /dev/null+++ b/harness/bench/prompts/h2h_brilliana_v1_blender.yaml@@ -0,0 +1,39 @@+name: h2h_brilliana_v1_blender+track: static_object+language: blender+description: >+ Head-to-head vs the astra3d-brilliana curated gallery (showcase_tier=confirmed,+ template=blender_baseline). Prompts are THEIR prompts verbatim, must_have left+ empty on purpose so the brief is identical to what their run saw. Both GLBs are+ then judged by bench/h2h_glb.py with one fixed judge.+prompts:+ - id: h2h_microscope_x1b+ tier: medium+ category: instruments+ prompt: a laboratory optical microscope with stage, eyepiece and focus knobs+ must_have: []+ tags: [h2h, brilliana, microscope-x1b]+ - id: h2h_deskfan_v2b+ tier: medium+ category: appliances+ prompt: a retro desk fan with wire cage and tilting head+ must_have: []+ tags: [h2h, brilliana, deskfan-v2b]+ - id: h2h_espresso_bl+ tier: medium+ category: appliances+ prompt: a chrome espresso machine with portafilter, steam wand and cup tray+ must_have: []+ tags: [h2h, brilliana, espresso-bl]+ - id: h2h_office_chair_lr+ tier: medium+ category: furniture+ prompt: a modern ergonomic office chair with five caster wheels+ must_have: []+ tags: [h2h, brilliana, office-chair-lr]+ - id: h2h_street_lamp_bl+ tier: medium+ category: lighting+ prompt: a Victorian cast-iron street lamp with three frosted globes+ must_have: []+ tags: [h2h, brilliana, street-lamp-bl]diff --git a/harness/bench/prompts/h2h_brilliana_v1_cadquery.yaml b/harness/bench/prompts/h2h_brilliana_v1_cadquery.yamlnew file mode 100644index 00000000..3aed0980--- /dev/null+++ b/harness/bench/prompts/h2h_brilliana_v1_cadquery.yaml@@ -0,0 +1,32 @@+name: h2h_brilliana_v1_cadquery+track: static_object+language: cadquery+description: >+ Head-to-head vs the astra3d-brilliana curated gallery (showcase_tier=confirmed,+ template=cadquery_baseline). Prompts verbatim, must_have empty on purpose.+ (tlr-camera was skipped: its stored prompt is truncated at 200 chars.)+prompts:+ - id: h2h_gate_valve_lr+ tier: medium+ category: mechanical+ prompt: a gate valve with a handwheel and bolted flanges+ must_have: []+ tags: [h2h, brilliana, gate-valve-lr]+ - id: h2h_telescope+ tier: medium+ category: instruments+ prompt: a brass refractor telescope on a wooden tripod, a long cylindrical tube with focus knobs, an eyepiece, a small finder scope, an adjustable altazimuth mount, antique scientific instrument+ must_have: []+ tags: [h2h, brilliana, telescope]+ - id: h2h_c_clamp_mv+ tier: medium+ category: tools+ prompt: a C-clamp with a threaded screw and swivel pad+ must_have: []+ tags: [h2h, brilliana, c-clamp-mv]+ - id: h2h_pipe_tee_c5+ tier: medium+ category: mechanical+ prompt: a pipe tee fitting with bolted flanges on all three ends+ must_have: []+ tags: [h2h, brilliana, pipe-tee-c5]diff --git a/harness/bench/prompts/h2h_brilliana_v1_threejs.yaml b/harness/bench/prompts/h2h_brilliana_v1_threejs.yamlnew file mode 100644index 00000000..7a8ce70d--- /dev/null+++ b/harness/bench/prompts/h2h_brilliana_v1_threejs.yaml@@ -0,0 +1,25 @@+name: h2h_brilliana_v1_threejs+track: static_object+language: threejs+description: >+ Head-to-head vs the astra3d-brilliana curated gallery (showcase_tier=confirmed,+ template=react_threejs / threejs). Prompts verbatim, must_have empty on purpose.+prompts:+ - id: h2h_desk_lamp_q2+ tier: medium+ category: lighting+ prompt: a vintage brass desk lamp with an articulated arm and a green glass shade+ must_have: []+ tags: [h2h, brilliana, desk-lamp-q2]+ - id: h2h_clock_q4+ tier: medium+ category: furniture+ prompt: an antique grandfather clock with a brass pendulum and glass door+ must_have: []+ tags: [h2h, brilliana, clock-q4]+ - id: h2h_lighthouse_1+ tier: medium+ category: buildings+ prompt: a red-and-white striped lighthouse with a lantern room and gallery railing+ must_have: []+ tags: [h2h, brilliana, lighthouse-1]diff --git a/harness/bench/prompts/h2h_scene_v1.yaml b/harness/bench/prompts/h2h_scene_v1.yamlnew file mode 100644index 00000000..1cf94c68--- /dev/null+++ b/harness/bench/prompts/h2h_scene_v1.yaml@@ -0,0 +1,41 @@+name: h2h_scene_v1+track: scene+language: scene_threejs+description: >+ Head-to-head SCENE battery: 5 prompts taken VERBATIM from the owner's previous+ harnesses (scene_multifile x4, scene_multifile_graphics x1; prompts/input.md of+ each output, whole file, nothing stripped). must_have is deliberately EMPTY so+ neither side is scored against a checklist the other never saw; the fixed judge+ is bench/h2h_scene.py (scene_v1, gemini-3.1-pro-preview, n=2) over both sides'+ authored-camera stills.+prompts:+ - id: h2h_bb1_bigben+ tier: hard+ category: landmark+ tags: [h2h, scene_multifile, bb1_bigben]+ prompt: |-+ Westminster at golden hour seen from the south bank of the Thames: Big Ben's clock tower rising over the Houses of Parliament with its full gothic riverfront facade, Westminster Bridge crossing the foreground with red double-decker buses and black cabs in traffic, the London Eye downstream catching the light, river boats mid-crossing, wrought-iron lamp posts and crowds of tourists along both embankments, the river alive with reflections, pigeons wheeling over the water.+ - id: h2h_co1_colosseum+ tier: hard+ category: landmark+ tags: [h2h, scene_multifile, co1_colosseum]+ prompt: |-+ The Roman Colosseum at midday, seen whole from the Piazza del Colosseo: the full elliptical amphitheatre with its four tiers, arched arcades ringing every level, the broken upper ring exposing the inner wall, travertine gleaming, the hypogeum passages visible through the open arena floor, tour groups and street vendors around the base, horse carriages and scooters on the cobbled piazza, umbrella pines and the Arch of Constantine to one side, hard Mediterranean shadows.+ - id: h2h_ct2_x_bookstore+ tier: easy+ category: interior+ tags: [h2h, scene_multifile, ct2_x_bookstore]+ prompt: |-+ A cozy bookstore interior with warm lighting, tall shelves of books, and a reading nook+ - id: h2h_ct2_wg_cyberpunk+ tier: easy+ category: urban+ tags: [h2h, scene_multifile, ct2_wg_cyberpunk]+ prompt: |-+ A neon-lit cyberpunk street with rain reflections+ - id: h2h_b01_neon_alley+ tier: medium+ category: urban+ tags: [h2h, scene_multifile_graphics, b01_neon_alley]+ prompt: |-+ A narrow city alley at night full of neon signs, their light thrown onto the wet road and the facing wall, steam from a vent, a few people walking.