Skip to content

Official Codebase of 3DCodeVerse

Python

graphics calibration: replay what the in-run judge saw; v2 defect ids match the gl_frames cap rules

gaoypenge0ee44813595
diff --git a/harness/bench/judge_calib_graphics.py b/harness/bench/judge_calib_graphics.py
index 428174b1..7aa62465 100644
--- a/harness/bench/judge_calib_graphics.py
+++ b/harness/bench/judge_calib_graphics.py
@@ -32,7 +32,10 @@ from typing import Any
from codeverse.contracts.artifacts import GateReport, RenderSet
from codeverse.contracts.spec import Spec
from codeverse.judges.base import JudgeInput
+from codeverse.judges.replay_input import plan_digest
from codeverse.judges.vlm_judge import VlmJudge
+from codeverse.tracks.graphics_steps import frame_stats_text
+from codeverse.workspace import Workspace
OUT_ROOT = Path(__file__).resolve().parent / "out"
@@ -74,7 +77,19 @@ def judge_one(run: Path, rubric: str, model: str, n: int) -> dict[str, Any]:
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 []]
- inp = JudgeInput(spec=spec, renders=renders, gates=gates, round_index=int(rnd.get("index", 0)))
+ # what the in-run judge also saw: the plan digest and the measured frame metrics (the metrics
+ # file is the LAST build's; it is only quoted when the best round is the last one, else the
+ # judge is told so — without it, pro called four moving effects "static" in the first pass)
+ ws = Workspace(run)
+ plan_path = run / "plan.json"
+ plan_summary = plan_digest(json.loads(plan_path.read_text())) if plan_path.is_file() else ""
+ last_index = max((int(f.stem[1:]) for f in run.glob("rounds/r*.json")), default=0)
+ if int(rnd.get("index", 0)) == last_index:
+ extra = "FRAME METRICS (harness-measured):\n" + frame_stats_text(ws)
+ else:
+ extra = "FRAME METRICS: not available for this round (an earlier round than the last build); judge motion from the frames."
+ inp = JudgeInput(spec=spec, renders=renders, gates=gates, round_index=int(rnd.get("index", 0)),
+ plan_summary=plan_summary, extra_context=extra)
judge = VlmJudge(rubric=rubric, model_id=model, n_samples=n)
v = judge.judge(inp)
raw = v.raw if isinstance(v.raw, dict) else json.loads(v.raw or "{}")
diff --git a/harness/codeverse/judges/rubrics/shader_v2.yaml b/harness/codeverse/judges/rubrics/shader_v2.yaml
index a11cfb31..43006a8b 100644
--- a/harness/codeverse/judges/rubrics/shader_v2.yaml
+++ b/harness/codeverse/judges/rubrics/shader_v2.yaml
@@ -171,6 +171,10 @@ caps:
them while looking better than anything else in the battery); the cap is 0.7, not 0.6
defects:
+ # black_or_blown / static_frames / flicker share their id with the gl_frames cap rule above on
+ # purpose: a PASSED gate (measured motion, measured exposure) vetoes the checklist claim
+ # (judges/caps.measured_absent) — in the first calibration pass pro called four moving effects
+ # static from five stills
- id: wrong_subject
text: The frames do not depict the subject of the brief (an unrelated abstract pattern, or nothing recognisable).
cap: 0.40
@@ -197,15 +201,15 @@ defects:
- id: candy_saturation
text: Colours are uniformly candy-saturated or pastel with no neutral or dark counterweight.
penalty: 0.06
- - id: black_or_blown_frame
+ - id: black_or_blown
text: At least one sampled frame is essentially solid black or blown-out white.
penalty: 0.10
cap: 0.50
- - id: static_effect
+ - id: static_frames
text: The sampled frames are visually identical although the brief implies motion.
penalty: 0.10
cap: 0.50
- - id: flicker_or_strobe
+ - id: flicker
text: Consecutive samples are unrelated (hard cuts, strobing, random per-frame colours) rather than continuous motion.
penalty: 0.08
cap: 0.70