Skip to content

Official Codebase of 3DCodeVerse

Python

show: the relocated-run path fix reached `status` but not `show`

gaoypeng1dab6ba04850
diff --git a/harness/codeverse/cli/layout_cmd.py b/harness/codeverse/cli/layout_cmd.py
index 0b7a6a3a..2d14eac7 100644
--- a/harness/codeverse/cli/layout_cmd.py
+++ b/harness/codeverse/cli/layout_cmd.py
@@ -125,7 +125,12 @@ def print_evidence(ws: Workspace, record: RunRecord) -> None:
rows["acceptance"] = f"{sum(1 for v in acc.values() if v)}/{len(acc)} met" if acc else "-"
rows["judge summary"] = j.summary[:300]
if rnd is not None and rnd.renders is not None and rnd.renders.contact_sheet:
- rows["contact sheet"] = rnd.renders.contact_sheet
+ # rebase, never print the stored string: record.json holds the ABSOLUTE path the
+ # renderer wrote, so an archived / rsynced / moved run made `3dcv show` print a
+ # sheet under the ORIGINAL root — a path that is not there, next to an object.glb
+ # that resolved correctly (it is recomputed from the workspace), which is what
+ # made the breakage silent and partial. ``_fmt`` does the same for `3dcv status`.
+ rows["contact sheet"] = ws.rebase(rnd.renders.contact_sheet)
if rnd is not None and rnd.measurement is not None:
mm = rnd.measurement
rows["measured"] = (f"extents {tuple(round(v, 3) for v in mm.extents)} m · {mm.tri_count} tris · "
diff --git a/harness/codeverse/cli/texture_cmd.py b/harness/codeverse/cli/texture_cmd.py
index 5b12044d..f3a85b87 100644
--- a/harness/codeverse/cli/texture_cmd.py
+++ b/harness/codeverse/cli/texture_cmd.py
@@ -52,7 +52,7 @@ def pass_(
rep = texture_pass(ws, spec, plan, model_id=model or spec.backends.planner,
image_model=_image_model(image_model), judge=judge,
judge_model_id=judge_model, size=size)
- _print_report(rep)
+ _print_report(rep, ws)
@texture_app.command("show")
@@ -64,16 +64,18 @@ def show(slug: str, runs_dir: RunsDirOpt = None) -> None:
rep = load_report(ws)
except FileNotFoundError as e:
raise C.CliError(str(e)) from e
- _print_report(rep)
+ _print_report(rep, ws)
-def _print_report(rep) -> None:
+def _print_report(rep, ws) -> None:
plan_table = C.lazy("codeverse.texturing.plan", "plan_table")
console.print(plan_table(rep.plan))
rows = {tid: f"{Path(a.path).name} seam={a.seam_score:.3f} (raw {a.seam_score_raw:.3f}) cached={a.cached}"
+ (f" ERROR {a.error}" if a.error else "") for tid, a in rep.textures.textures.items()}
console.print(kv_table("textures", rows or {"-": "none"}))
s = rep.summary()
+ if s.get("glb_out"):
+ s["glb_out"] = str(ws.rebase(str(s["glb_out"]))) # stored absolute; see print_evidence
if rep.gate is not None and rep.gate.overall_before is not None:
s.update({"before": f"{rep.gate.overall_before:.3f}", "after": f"{rep.gate.overall_after:.3f}",
"materials": f"{rep.gate.materials_before:.3f} → {rep.gate.materials_after:.3f}"})
diff --git a/harness/tests/core/test_run_layout.py b/harness/tests/core/test_run_layout.py
index 62f93ad6..297888fc 100644
--- a/harness/tests/core/test_run_layout.py
+++ b/harness/tests/core/test_run_layout.py
@@ -195,3 +195,46 @@ def test_a_stale_index_lock_names_the_remedy(tmp_path):
# still a CalledProcessError, so existing handlers keep working, and stderr is kept
assert isinstance(ei.value, subprocess.CalledProcessError)
assert "index.lock" in (ei.value.stderr or "")
+
+
+def test_show_itself_prints_the_relocated_sheet_not_the_stored_one(tmp_path):
+ """Sign-off follow-up to SMOKE2. The reported command was `3dcv show`, but the fix
+ landed in ``cli/_fmt.py`` (which backs `3dcv status`) — ``cli/layout_cmd.py``'s
+ print_evidence still assigned ``rows["contact sheet"] = rnd.renders.contact_sheet``,
+ the raw stored ABSOLUTE path, so `3dcv show` on a moved run still printed a sheet
+ under the original root while ``object.glb`` beside it resolved correctly. Verified
+ on the real e2e_chair_blender run before this line existed."""
+ import shutil
+
+ from codeverse.cli._fmt import console
+ from codeverse.cli.layout_cmd import print_evidence
+ from codeverse.contracts.artifacts import RenderSet
+ from codeverse.contracts.common import Backends, Language, Track
+ from codeverse.contracts.run import RoundRecord, RunRecord, RunStatus
+ from codeverse.contracts.spec import Spec
+ from codeverse.workspace import Workspace
+
+ a = tmp_path / "A" / "run1"
+ (a / "artifacts" / "renders" / "r01").mkdir(parents=True)
+ sheet_a = a / "artifacts" / "renders" / "r01" / "sheet.png"
+ sheet_a.write_bytes(b"PNG")
+
+ spec = Spec(id="run1", track=Track.STATIC_OBJECT, language=Language.BLENDER,
+ prompt="a wooden chair", backends=Backends(generator="api-agent:gemini:x"))
+ rec = RunRecord(spec=spec, workspace=str(a), status=RunStatus.PASSED, best_round=0,
+ rounds=[RoundRecord(index=0, kind="generate",
+ renders=RenderSet(views=[], contact_sheet=str(sheet_a)))])
+
+ b = tmp_path / "B" / "run1"
+ b.parent.mkdir(parents=True)
+ shutil.move(str(a), str(b))
+
+ old_width, console.width = console.width, 400
+ try:
+ with console.capture() as cap:
+ print_evidence(Workspace(b), rec)
+ finally:
+ console.width = old_width
+ out = cap.get()
+ assert str(b / "artifacts" / "renders" / "r01" / "sheet.png") in out
+ assert str(a) not in out, "`3dcv show` must not print a path under the old root"