Skip to content

Official Codebase of 3DCodeVerse

Python

eval fixed judge: its payload is the harness's round_input — clay views, the GLB for D48 slices, connectivity in the author's frame

gaoypeng2f3d62aa4534
diff --git a/eval/bench/_fixed_eval.py b/eval/bench/_fixed_eval.py
index a983b52e..347ce981 100644
--- a/eval/bench/_fixed_eval.py
+++ b/eval/bench/_fixed_eval.py
@@ -1,13 +1,14 @@
"""The fixed evaluator shared by every arm of ``bench/compare_backends.py``.
-``FixedEvaluator.evaluate(ws, spec)``: the cell's runtime lint + build → ``measure_glb``
-→ connectivity gate → 14-view ``render_glb`` (articulated: + joint sweep + pose sheet;
-graphics: the frame sheet; scene: authored cameras + orbit rig at two times + the
-scene_frames gate) → ``judge_for(spec)`` — the class the loop would use
-(``vlm_judge.judge_for``) on ``rubric_for(spec)``, the track's ``TRACK_INFO``
-rubric, the ONE track→rubric mapping of the compare bench. The judge's acceptance checklist is the brief's
-``must_have`` list (``acceptance_from_spec``) so harness and one-shot arms are
-scored against exactly the same checklist — never the harness's plan.
+``FixedEvaluator.evaluate(ws, spec)``: the cell's runtime lint + build → the track's evidence
+(objects: ``glb_evidence`` — measure, connectivity in the author's frame, 14-view render, clay
+views; articulated: + joint sweep + pose sheet; graphics: the frame sheet; scene: authored
+cameras + orbit rig at two times + the scene_frames gate) → ``fixed_input`` — the harness's
+``round_input``, so the payload is the in-run judge's for the same round → ``judge_for(spec)``
+— the class the loop would use (``vlm_judge.judge_for``) on ``rubric_for(spec)``, the track's
+``TRACK_INFO`` rubric, the ONE track→rubric mapping of the compare bench. The judge's
+acceptance checklist is the brief's ``must_have`` list (``acceptance_from_spec``) so harness
+and one-shot arms are scored against exactly the same checklist — never the harness's plan.
"""
from __future__ import annotations
@@ -27,8 +28,10 @@ from codeverse3d.contracts.artifacts import (
)
from codeverse3d.contracts.common import TRACK_INFO, Language, Track
from codeverse3d.contracts.plan import AcceptanceItem
+from codeverse3d.contracts.run import RoundRecord
from codeverse3d.contracts.spec import Spec
from codeverse3d.conventions import OBJECT_VIEWS
+from codeverse3d.judges.base import SLICE_TRACKS, JudgeInput, judged_subset, round_input
from codeverse3d.workspace import Workspace
RUBRIC = "static_object_v1"
@@ -143,74 +146,73 @@ class FixedEvaluator:
return build, lint
def evaluate(self, ws: Workspace, spec: Spec) -> EvalOutcome:
- from codeverse3d.judges.base import JudgeInput
- from codeverse3d.spatial.connectivity import check_connectivity
- from codeverse3d.spatial.measure import measure_glb
- from codeverse3d.spatial.render import render_glb
+ """build → the track's evidence (articulated: the sweep reads the built URDF, no plan, so
+ every arm is swept alike; the build's own gates last, as in ``steps._run_round``) → judge."""
+ from codeverse3d.tracks import get_track
build, lint = self.build(ws, spec.language)
out = EvalOutcome(build=build, lint=lint, gates=[lint])
- if build.ok and spec.track is Track.GRAPHICS:
- return self._evaluate_frames(ws, spec, out)
- if build.ok and spec.track is Track.SCENE:
- return self._evaluate_scene(ws, spec, out)
- if not build.ok or not build.glb_path:
+ if not build.ok or (spec.track.value in SLICE_TRACKS and not build.glb_path):
return out
+ geometry = None
try:
- glb = Path(build.glb_path)
- out.measurement = measure_glb(glb)
- out.gates.append(check_connectivity(glb))
- r = self.settings.render
- out.renders = render_glb(glb, ws.renders_dir(0), views=list(OBJECT_VIEWS), width=r.width, height=r.height, sheet=True)
- if spec.track is Track.ARTICULATED_OBJECT:
- # the same deterministic articulation evidence the track gives its judge: the
- # joint sweep (collisions over every joint's range) and the pose sheet / pose
- # tiles, read straight from the built URDF — no plan, so every arm is treated alike
- from codeverse3d.tracks.articulated_object import default_joint_sweep
-
- sweep, pose_views = default_joint_sweep(ws, None, ws.renders_dir(0) / "poses")
- out.gates.append(sweep)
- if pose_views:
+ if spec.track is Track.GRAPHICS:
+ from codeverse3d.tracks.graphics import frames_render_set
+
+ out.renders = frames_render_set(ws, build, 0)
+ elif spec.track is Track.SCENE:
+ from codeverse3d.spatial.frame_metrics import frame_gate_from_renders
+ from codeverse3d.spatial.render_scene import render_scene
+
+ out.renders = render_scene(ws, ws.renders_dir(0), orbit=True, times=(0.0, 1.5), sheet=True)
+ out.gates.append(frame_gate_from_renders(ws.renders_dir(0)))
+ else:
+ out.measurement, gate, out.renders, geometry = glb_evidence(
+ Path(build.glb_path), ws.renders_dir(0), spec.language, self.settings)
+ out.gates.append(gate)
+ if spec.track is Track.ARTICULATED_OBJECT:
+ from codeverse3d.tracks.articulated_object import default_joint_sweep
+
+ sweep, pose_views = default_joint_sweep(ws, None, ws.renders_dir(0) / "poses")
+ out.gates.append(sweep)
out.renders.views = list(out.renders.views) + pose_views
- inp = JudgeInput(spec=spec, renders=out.renders, measurement=out.measurement, gates=out.gates,
- acceptance=acceptance_from_spec(spec), round_index=0)
+ out.gates.extend(build.gates)
+ extra = get_track(spec.track).make_pipeline().judge_context(ws, None, 0, build, out.gates)
+ inp = fixed_input(spec, renders=out.renders, gates=out.gates, measurement=out.measurement,
+ geometry_views=geometry, glb_path=build.glb_path, extra_context=extra)
out.judgment = self.judge_for(spec).judge(inp)
except Exception as e: # noqa: BLE001 — recorded per cell, never kills the matrix
out.error = f"{type(e).__name__}: {e}"
return out
- def _evaluate_scene(self, ws: Workspace, spec: Spec, out: EvalOutcome) -> EvalOutcome:
- """Scene: the authored cameras plus the orbit rig at t = 0 and 1.5 s, the scene_frames gate,
- the scene rubric — the pictures the loop's judge sees, minus the loop's plan (2026-09-07:
- the compare bench had no scene branch, so a scene cell built, then returned unjudged)."""
- from codeverse3d.judges.base import JudgeInput
- from codeverse3d.spatial.frame_metrics import frame_gate_from_renders
- from codeverse3d.spatial.render_scene import render_scene
- try:
- out.renders = render_scene(ws, ws.renders_dir(0), orbit=True, times=(0.0, 1.5), sheet=True)
- out.gates.append(frame_gate_from_renders(ws.renders_dir(0)))
- inp = JudgeInput(spec=spec, renders=out.renders, gates=out.gates, acceptance=acceptance_from_spec(spec),
- round_index=0)
- out.judgment = self.judge_for(spec).judge(inp)
- except Exception as e: # noqa: BLE001 — recorded per cell, never kills the matrix
- out.error = f"{type(e).__name__}: {e}"
- return out
-
- def _evaluate_frames(self, ws: Workspace, spec: Spec, out: EvalOutcome) -> EvalOutcome:
- """Graphics: the judged frames + the gl_frames gate + the frame metrics, as the loop does."""
- from codeverse3d.judges.base import JudgeInput
- from codeverse3d.tracks.graphics import frame_stats_text, frames_render_set
-
- try:
- out.renders = frames_render_set(ws, out.build, 0)
- out.gates.extend(out.build.gates) # the build's own gl_frames gate (BuildResult.gates, D82)
- inp = JudgeInput(spec=spec, renders=out.renders, gates=out.gates, acceptance=acceptance_from_spec(spec),
- round_index=0, extra_context="FRAME METRICS (harness-measured):\n" + frame_stats_text(ws))
- out.judgment = self.judge_for(spec).judge(inp)
- except Exception as e: # noqa: BLE001 — recorded per cell, never kills the matrix
- out.error = f"{type(e).__name__}: {e}"
- return out
-
-
-__all__ = ["RUBRIC", "EvalOutcome", "FixedEvaluator", "acceptance_from_spec", "rubric_for"]
+def glb_evidence(glb: Path, renders_dir: Path, language: Language | str,
+ settings: Settings) -> tuple[Measurement, GateReport, RenderSet, RenderSet | None]:
+ """``ObjectPipeline``'s measure / connectivity (author's frame) / render / clay views for a GLB
+ with no plan, through the same ``Services`` calls; clay ``None`` when it fails, as in the loop."""
+ from codeverse3d.tracks.common import Services
+ from codeverse3d.tracks.static_object import GEOMETRY_VIEWS
+
+ svc, r = Services(), settings.render
+ measurement = svc.measure(glb)
+ gate = svc.connectivity(glb, str(language))
+ renders = svc.render_object(glb, renders_dir, views=OBJECT_VIEWS, width=r.width, height=r.height)
+ try:
+ geometry = svc.render_geometry(glb, renders_dir / "clay", views=GEOMETRY_VIEWS)
+ except Exception: # noqa: BLE001 — optional judge context, never fatal (ObjectPipeline.geometry_views)
+ geometry = None
+ return measurement, gate, renders, geometry
+
+
+def fixed_input(spec: Spec, *, renders: RenderSet, gates: list[GateReport], measurement: Measurement | None = None,
+ geometry_views: RenderSet | None = None, glb_path: str | None = None,
+ extra_context: str = "") -> JudgeInput:
+ """``round_input`` (the in-run judge's builder) for a round 0 with no plan and no previous verdict;
+ the ONE deliberate difference: the checklist is the brief's ``must_have``, never a plan's (N83)."""
+ inp = round_input(spec, None, RoundRecord(index=0, kind="baseline", measurement=measurement),
+ renders=judged_subset(renders), gates=gates, previous=None, extra_context=extra_context,
+ geometry_views=geometry_views, glb_path=glb_path)
+ return inp.model_copy(update={"acceptance": acceptance_from_spec(spec)})
+
+
+__all__ = ["RUBRIC", "EvalOutcome", "FixedEvaluator", "acceptance_from_spec", "fixed_input", "glb_evidence", "rubric_for"]
diff --git a/eval/bench/h2h_glb.py b/eval/bench/h2h_glb.py
index c368de8e..a52f0910 100644
--- a/eval/bench/h2h_glb.py
+++ b/eval/bench/h2h_glb.py
@@ -11,12 +11,12 @@ Protocol (one fixed judge, one renderer, one gate set, for BOTH sides):
(``select.round_file`` — ``artifacts/rNN/object.glb``, or ``artifacts/object.glb`` of a run
recorded before rounds kept their own, only for the round it rebuilt there); a picked round
with none is an error, never the last build's GLB in its place.
-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
+3. Both GLBs go through the object path of ``bench/_fixed_eval.FixedEvaluator``:
+ ``glb_evidence`` (measure, connectivity in the prompt's language frame, 14-view render,
+ clay views) → ``fixed_input`` (the harness's ``round_input``: clay montage + the GLB for the
+ D48 slice channel) → ``VlmJudge(static_object_v1, gemini-3.1-pro-preview, n_samples=2)``
+ with a ``Spec`` built from the prompt, so an EMPTY acceptance list. No build step: 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,
@@ -45,7 +45,7 @@ from pydantic import BaseModel, Field
for _p in (Path(__file__).resolve().parents[2] / "harness", Path(__file__).resolve().parents[1]):
sys.path.insert(0, str(_p)) # this tree's codeverse3d (harness/) + the `bench` package (eval/)
-from bench._fixed_eval import RUBRIC # noqa: E402
+from bench._fixed_eval import RUBRIC, fixed_input, glb_evidence # noqa: E402
from bench.run_bench import Battery, BenchPrompt # noqa: E402
from bench.stats import sign_test # noqa: E402
from codeverse3d.addons import select # noqa: E402
@@ -57,6 +57,7 @@ JUDGE_MODEL = "gemini:gemini-3.1-pro-preview"
N_SAMPLES = 2
IN_PROGRESS = {"planning", "generating", "refining"} # RunStatus values of a run that has not stopped
_H2H_TAGS = {"h2h", "brilliana"}
+PAYLOAD = "round_input" # the judge input a cached verdict was bought on (hand-built before 2026-09-24, N83)
class Side(BaseModel):
@@ -81,6 +82,7 @@ class Side(BaseModel):
minutes: float | None = None
status: str = ""
gallery_score: float | None = None # their own judge; reference only
+ payload: str = "" # PAYLOAD once judged on fixed_input; a cached verdict without it predates N83
class Row(BaseModel):
@@ -142,27 +144,19 @@ def build_spec(battery: Battery, item: BenchPrompt) -> Any:
def evaluate(side: Side, spec: Any, out_dir: Path, judge: Any) -> Side:
- """measure → connectivity → render → judge, exactly the FixedEvaluator order."""
+ """``glb_evidence`` → ``fixed_input`` → judge: the FixedEvaluator's object path, on a GLB with no workspace."""
from codeverse3d.config import get_settings
- from codeverse3d.conventions import OBJECT_VIEWS
- from codeverse3d.judges.base import JudgeInput
- from codeverse3d.spatial.connectivity import check_connectivity
- from codeverse3d.spatial.measure import measure_glb
- from codeverse3d.spatial.render import render_glb
if side.error or not side.glb:
return side
try:
- glb = Path(side.glb)
- m = measure_glb(glb)
+ m, gate, renders, clay = glb_evidence(Path(side.glb), out_dir / "renders", spec.language, get_settings())
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.sheet, side.payload = renders.contact_sheet or "", PAYLOAD
+ inp = fixed_input(spec, renders=renders, gates=[gate], measurement=m, geometry_views=clay, glb_path=side.glb)
+ j = judge.judge(inp)
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))
# Perception only: the gallery GLBs are merged, un-welded exports whose "floating"
@@ -170,7 +164,7 @@ def evaluate(side: Side, spec: Any, out_dir: Path, judge: Any) -> Side:
# sits 22 mm from its arm in the mesh but looks attached), so a judge that reads
# the gate text in its context caps them for what the eye cannot see. The
# visual number is the fair headline; the gated one is what the harness would say.
- jv = judge.judge(JudgeInput(spec=spec, renders=renders, measurement=m, gates=[], acceptance=[], round_index=0))
+ jv = judge.judge(inp.model_copy(update={"gates": []}))
side.visual_score = jv.overall
(out_dir / "judgment_visual.json").write_text(jv.model_dump_json(indent=2))
except Exception as e: # noqa: BLE001 — one bad GLB must not kill the battery
@@ -182,7 +176,7 @@ def cached_eval(side: Side, spec: Any, out_dir: Path, judge: Any, *, force: bool
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.visual_score is not None and prev.glb == side.glb:
+ if prev.score is not None and prev.visual_score is not None and prev.glb == side.glb and prev.payload == PAYLOAD:
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)
diff --git a/eval/bench/judge_calib_graphics.py b/eval/bench/judge_calib_graphics.py
index 63e99846..ed23e8e0 100644
--- a/eval/bench/judge_calib_graphics.py
+++ b/eval/bench/judge_calib_graphics.py
@@ -12,9 +12,9 @@ person sees → revise) never ran for graphics. This script is that loop's meas
* ``eye.json``: ``{run_dir: score}`` — a person's 0–1 reading of the SAME sheets ("would a
curator screenshot it / does it look like the thing"). The ground truth this calibrates to.
-For every run and every rubric it rebuilds the JudgeInput the loop used (spec, the picked round's
-RenderSet and gates; no planner acceptance items, so the rubric is measured on its own) and
-judges it with a fresh ``VlmJudge`` (n samples, pro). Output per rubric: ``<rubric>.jsonl`` (one
+For every run and every rubric it rebuilds the JudgeInput the loop used — ``build_judge_input``,
+the ``3dcode judge`` payload (the picked round's judged views, gates, plan digest and acceptance
+list, previous verdict, frame metrics) — and judges it with a fresh ``VlmJudge`` (n samples, pro). Output per rubric: ``<rubric>.jsonl`` (one
row per run: overall, per-criterion, defects present, caps) and one ``summary.md`` with
Spearman(judge, eye), mean judge vs mean eye, the biggest disagreements, and defect firing rates.
Judging only; nothing under the runs is modified.
@@ -31,48 +31,30 @@ from typing import Any
from codeverse3d.addons import select
from codeverse3d.addons.calibration import spearman
-from codeverse3d.contracts.artifacts import GateReport, RenderSet
-from codeverse3d.contracts.plan import GraphicsPlan
-from codeverse3d.contracts.spec import Spec
-from codeverse3d.judges.base import JudgeInput, plan_summary
+from codeverse3d.cli._judge import build_judge_input, load_round
from codeverse3d.judges.vlm_judge import VlmJudge
-from codeverse3d.record.record import RecordError
-from codeverse3d.tracks.graphics import frame_stats_text
+from codeverse3d.record.record import RecordError, load_record
from codeverse3d.workspace import Workspace
OUT_ROOT = Path(__file__).resolve().parent / "out"
-def picked_round(run: Path) -> dict[str, Any] | None:
- """The round ``codeverse3d.addons.select`` picks, as its rounds/rNN.json (None: nothing judged)."""
+def judge_one(run: Path, rubric: str, model: str, n: int) -> dict[str, Any]:
+ """Re-judge the round ``codeverse3d.addons.select`` picks on the payload ``3dcode judge`` builds
+ (``build_judge_input``: the harness's ``round_input`` from disk), with ``rubric`` swapped in."""
+ ws = Workspace(run)
try:
- idx = select.pick(run)
+ rec = load_record(ws)
+ idx = select.pick(run, record=rec)
except RecordError:
- return None
- path = run / "rounds" / f"r{idx:02d}.json" if idx is not None else None
- return json.loads(path.read_text()) if path is not None and path.is_file() else None
-
-
-def judge_one(run: Path, rubric: str, model: str, n: int) -> dict[str, Any]:
- spec = Spec.model_validate(json.loads((run / "spec.json").read_text()))
- rnd = picked_round(run)
+ return {"run": str(run), "error": "no judged round"}
+ rnd = load_round(ws, rec, idx) if idx is not None else None
if rnd is None:
return {"run": str(run), "error": "no judged round"}
- renders = RenderSet.model_validate(rnd["renders"])
- gates = [GateReport.model_validate(g) for g in rnd.get("gates") or []]
- # what the in-run judge also saw: the plan digest and the round's measured frame metrics
- # (frame_stats_text: its own copy, never a later build's — without them, pro called four
- # moving effects "static" in the first pass)
- plan_path = run / "plan.json"
- digest = plan_summary(GraphicsPlan.model_validate_json(plan_path.read_text()), spec.language) if plan_path.is_file() else ""
- extra = "FRAME METRICS (harness-measured):\n" + frame_stats_text(Workspace(run), int(rnd.get("index", 0)))
- inp = JudgeInput(spec=spec, renders=renders, gates=gates, round_index=int(rnd.get("index", 0)),
- plan_summary=digest, extra_context=extra)
- judge = VlmJudge(rubric=rubric, model_id=model, n_samples=n)
- v = judge.judge(inp)
+ v = VlmJudge(rubric=rubric, model_id=model, n_samples=n).judge(build_judge_input(ws, rec, rnd))
raw = v.raw if isinstance(v.raw, dict) else json.loads(v.raw or "{}")
return {
- "run": str(run), "rubric": rubric, "overall": v.overall, "loop_overall": (rnd.get("judgment") or {}).get("overall"),
+ "run": str(run), "rubric": rubric, "overall": v.overall, "loop_overall": rnd.score,
"scores": v.scores, "uncapped": raw.get("overall_uncapped"),
"defects": [d for d, on in (raw.get("defects") or {}).items() if on],
"caps": [c.get("rule") for c in (raw.get("caps") or {}).get("caps_applied", [])],
diff --git a/eval/docs/EVAL.md b/eval/docs/EVAL.md
index 5027dc01..2b9db692 100644
--- a/eval/docs/EVAL.md
+++ b/eval/docs/EVAL.md
@@ -123,8 +123,13 @@ Arms:
the CLI dies before printing stats.
Every arm ends with a `src/model.py` copied into a fresh eval workspace and scored by
-the same `FixedEvaluator` (`BlenderRuntime` lint+build → measure → connectivity →
-14-view render → `VlmJudge(static_object_v1, --judge, n_samples=2)`). Then a pairwise
+the same `FixedEvaluator` (the cell's runtime lint+build → measure → connectivity →
+14-view render + clay views → `VlmJudge(static_object_v1, --judge, n_samples=2)`). Its payload
+is the harness's `round_input` (`_fixed_eval.fixed_input`), so it is the in-run judge's for the
+same round — clay montage, the GLB for the D48 slice channel, connectivity in the author's frame —
+except the checklist, the brief's `must_have`. (N83, 2026-09-24: before that it was hand-built
+without clay views or GLB; a fixed-judge score from before then is not comparable with one after —
+re-judge a baseline before comparing.) Then a pairwise
arena runs every harness arm against every one-shot arm per prompt (both orderings).
Output under `--out`: `matrix.json`, `results.jsonl` (cells, resume source),
`pairwise.jsonl`, `cells/<prompt>/<arm>/{run,gen,eval}`, `report.md`, `report.html`.
@@ -615,7 +620,7 @@ sides. Sheets: `bench/out/h2h_brilliana_v1/pairs/`, `bench/out/h2h_scene_v1/she
`overall_uncapped` — the rubric-weighted mean of the seven criteria, before any defect penalty or
cap — gives theirs 0.848 against ours 0.843: **Δ = −0.005, 6 W / 6 L**. So the +0.105 above is
produced *entirely* by the binary defect checklist (their mean penalty −0.192, ours −0.082), and the
-checklist is perception, not our gates — `h2h_glb.py:170` judges the visual pass with `gates=[]`.
+checklist is perception, not our gates — `h2h_glb.evaluate` judges the visual pass with `gates=[]`.
Its dominant term is `wrong_orientation`: theirs 4/12, ours 0/12, because `conventions.py`
pins a front axis per language and their pipeline pins only up-axis. Per criterion we lead
intent_fidelity +0.042 / structure +0.029 / proportions +0.025 and trail assembly_fit −0.069 /
diff --git a/eval/tests/test_articulated_compare.py b/eval/tests/test_articulated_compare.py
index ca306bca..b9fa2a2f 100644
--- a/eval/tests/test_articulated_compare.py
+++ b/eval/tests/test_articulated_compare.py
@@ -123,7 +123,7 @@ def test_articulated_cells_add_the_joint_sweep_and_the_pose_sheet(monkeypatch, t
ev._runtimes[Language.URDF_BLENDER] = SimpleNamespace(lint=lambda ws: GateReport(gate="lint", passed=True),
build=lambda ws, timeout_s: build)
monkeypatch.setattr(meas, "measure_glb", lambda p: None)
- monkeypatch.setattr(conn, "check_connectivity", lambda p: GateReport(gate="connectivity", passed=True))
+ monkeypatch.setattr(conn, "check_connectivity", lambda p, **k: GateReport(gate="connectivity", passed=True))
monkeypatch.setattr(rend, "render_glb", lambda p, d, **k: RenderSet(views=[RenderView(name="front", path=str(glb))], renderer="fake"))
sweep = GateReport(gate="joint_sweep", passed=True)
pose = RenderView(name="articulation_sheet", path=str(glb))
diff --git a/eval/tests/test_fixed_eval_language.py b/eval/tests/test_fixed_eval_language.py
index c2bf68c7..8a603fcc 100644
--- a/eval/tests/test_fixed_eval_language.py
+++ b/eval/tests/test_fixed_eval_language.py
@@ -2,6 +2,8 @@
from __future__ import annotations
+from pathlib import Path
+
from codeverse3d.contracts.common import Language
@@ -46,7 +48,7 @@ def test_graphics_cells_are_judged_on_their_frames(monkeypatch, tmp_path):
import codeverse3d.tracks.graphics as gs
monkeypatch.setattr(gs, "frames_render_set", lambda ws, b, i: RenderSet(views=[RenderView(name="t=0s", path=str(png))], renderer="fake"))
- monkeypatch.setattr(gs, "frame_stats_text", lambda ws: "frames=1")
+ monkeypatch.setattr(gs, "frame_stats_text", lambda ws, i=None: "frames=1")
seen: dict[str, object] = {}
class _J:
@@ -102,3 +104,78 @@ def test_scene_cells_are_judged_on_their_cameras_and_orbit_frames(monkeypatch, t
assert seen["kw"]["orbit"] is True and tuple(seen["kw"]["times"]) == (0.0, 1.5)
assert [g.gate for g in seen["inp"].gates] == ["lint", "scene_frames"]
assert [a.text for a in seen["inp"].acceptance] == ["boats"]
+
+
+def test_the_fixed_judge_reads_the_in_run_payload_for_the_same_round(monkeypatch, tmp_path):
+ """N83 (audit 2026-09-24): the fixed judge built its JudgeInput by hand — no clay views, no
+ GLB (so no D48 slices on a floating-part cell), connectivity without the language. It is now
+ ``round_input``: for one built GLB the fixed payload equals the in-run judge's
+ (``steps._judge`` over ``ObjectPipeline``, no plan) except the acceptance list, the brief's
+ ``must_have`` by design."""
+ from types import SimpleNamespace
+
+ import codeverse3d.spatial.connectivity as conn
+ import codeverse3d.spatial.measure as meas
+ import codeverse3d.spatial.render as rend
+ from bench._fixed_eval import FixedEvaluator, acceptance_from_spec
+ from codeverse3d.contracts.artifacts import (
+ BuildResult,
+ GateFinding,
+ GateReport,
+ Measurement,
+ RenderSet,
+ RenderView,
+ Severity,
+ )
+ from codeverse3d.contracts.common import Track
+ from codeverse3d.contracts.run import RoundRecord
+ from codeverse3d.contracts.spec import Constraints, Spec
+ from codeverse3d.tracks import steps
+ from codeverse3d.tracks.common import Services
+ from codeverse3d.tracks.static_object import ObjectPipeline
+ from codeverse3d.workspace import Workspace
+
+ ws = Workspace(tmp_path / "run").create()
+ glb = ws.root / "artifacts" / "object.glb"
+ glb.parent.mkdir(parents=True, exist_ok=True)
+ glb.write_bytes(b"glTF")
+ m = Measurement(bbox_min=(0, 0, 0), bbox_max=(1, 1, 1), extents=(1, 1, 1), center=(0.5, 0.5, 0.5),
+ tri_count=100, n_meshes=2, n_islands=2)
+ monkeypatch.setattr(meas, "measure_glb", lambda p: m)
+ monkeypatch.setattr(conn, "check_connectivity", lambda p, language="", planned_edges=(): GateReport(
+ gate="connectivity", passed=False, findings=[GateFinding(gate="connectivity", severity=Severity.ERROR,
+ target="Leg", message=f"Leg is floating ({language})")]))
+ monkeypatch.setattr(rend, "render_glb", lambda p, d, *, views, mode="color", **k: RenderSet(
+ views=[RenderView(name=v.name, path=str(Path(d) / f"view_{v.name}.png"), mode=mode) for v in views], renderer="fake"))
+ build = BuildResult(ok=True, language="blender", glb_path=str(glb))
+ lint = GateReport(gate="lint", passed=True)
+ spec = Spec(id="t/stool", track=Track.STATIC_OBJECT, language=Language.BLENDER, prompt="a three-legged stool",
+ constraints=Constraints(must_have=["three legs"]))
+ seen: list = []
+
+ class _Spy:
+ def judge(self, inp):
+ seen.append(inp)
+ raise RuntimeError("captured")
+
+ ev = FixedEvaluator("fake:judge", n_samples=1)
+ ev._runtimes[Language.BLENDER] = SimpleNamespace(lint=lambda ws: lint, build=lambda ws, timeout_s: build)
+ monkeypatch.setattr(FixedEvaluator, "judge_for", lambda self, spec: _Spy())
+ ev.evaluate(ws, spec)
+
+ # the loop's round 0 over the same build: steps._run_round's gate order, then steps._judge
+ ctx = SimpleNamespace(spec=spec, plan=None, ws=ws, services=Services(), settings=ev.settings, language=Language.BLENDER,
+ judge=_Spy(), events=SimpleNamespace(emit=lambda *a, **k: None))
+ pipe = ObjectPipeline()
+ rec = RoundRecord(index=0, kind="baseline", build=build, measurement=pipe.measure(ctx, build))
+ gates = [lint, *pipe.gates(ctx, 0, build, rec.measurement), *build.gates]
+ rec.renders = pipe.render(ctx, 0, build, rec.measurement)
+ steps._judge(ctx, pipe, 0, build, gates, rec, None, [])
+
+ fixed, in_run = seen
+ assert fixed.acceptance == acceptance_from_spec(spec) and in_run.acceptance == []
+ assert fixed.model_dump(exclude={"acceptance"}) == in_run.model_dump(exclude={"acceptance"})
+ # what the hand-built payload lacked
+ assert fixed.geometry_views is not None and {v.mode for v in fixed.geometry_views.views} == {"clay"}
+ assert fixed.glb_path == str(glb)
+ assert "(blender)" in fixed.gates[1].errors[0].message
diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.md
index 4421c98c..7d849c5d 100644
--- a/harness/docs/INTERFACES.md
+++ b/harness/docs/INTERFACES.md
@@ -421,10 +421,10 @@ from codeverse3d.judges.base import round_input, plan_summary
round_input(spec, plan, rnd, *, renders, gates, previous, extra_context, geometry_views, glb_path) -> JudgeInput
# THE payload of one round: tracks/steps._judge builds it from the round in hand, cli/_judge.build_judge_input
# (`3dcode judge`, addons/calibration) from the stored one — acceptance + digest + part_names from the plan, glb_path only on
- # SLICE_TRACKS. Δ 2026-09-22: replays used a dict digest of plan.json (a Z-up object read W×D×H, a shader lost
+ # SLICE_TRACKS; eval's fixed judge (eval/bench/_fixed_eval.fixed_input, plan=None, acceptance = the brief's must_have) too. Δ 2026-09-22: replays used a dict digest of plan.json (a Z-up object read W×D×H, a shader lost
# style / passes / key visuals / motion); cli/_judge.stored_plan types plan.json when record.json has no plan
plan_summary(plan, language) -> str # the digest for every track (object: "Overall W×H×D m" in the GLB frame);
- # also the texture gate's (texturing/generate.judge_gate) and eval/bench/judge_calib_graphics.py's
+ # also the texture gate's (texturing/generate.judge_gate)
from codeverse3d.judges.prompt_builder import plan_montages, render_montage, Montage # ≤5 2×2 montages (shaded/geometry/poses) + ≤2 detail
# crops @≤1024px replace the sheet + the 14-view rig (D47); clay/normals views (RenderView.mode) auto-route to the GEOMETRY montage
from codeverse3d.judges.prompt_builder import build_judge_messages, connectivity_error_pairs, PROVENANCE_ELICITATION