Official Codebase of 3DCodeVerse
Python
rounds: a render that fails (timeout under load) degrades the round — build and gates stand, the judge is skipped, the best round is delivered
gaoypeng3c8edf87e9c9
diff --git a/harness/codeverse/tracks/steps.py b/harness/codeverse/tracks/steps.pyindex a4003d81..4212904e 100644--- a/harness/codeverse/tracks/steps.py+++ b/harness/codeverse/tracks/steps.py@@ -34,6 +34,7 @@ from codeverse.contracts.plan import AcceptanceItem, Planfrom codeverse.contracts.run import RoundRecordfrom codeverse.fanout import fan_outfrom codeverse.orchestrator.budget import usage_delta+from codeverse.spatial.render import RenderErrorfrom codeverse.tracks import skills_hookfrom codeverse.tracks.common import RunContextfrom codeverse.tracks.generation import GenerationResult, GenerationTask, generate@@ -226,7 +227,18 @@ def _run_round(if outcome.build.ok:rec.measurement = pipeline.measure(ctx, outcome.build)gates.extend(pipeline.gates(ctx, index, outcome.build, rec.measurement))- rec.renders = pipeline.render(ctx, index, outcome.build, rec.measurement)+ try:+ rec.renders = pipeline.render(ctx, index, outcome.build, rec.measurement)+ except RenderError as e:+ # A render that times out (measured 2026-08-26, art_verify camera_tripod: the+ # refine round built in 1.2 s, then render_glb.mjs hit its 330 s timeout with+ # three articulated runs and two readouts sharing the browser) used to raise+ # out of the round and record the whole run `failed` -- with a judged round 0+ # already on disk. The round is kept: build, measurement and gates stand, the+ # judge is skipped (no renders), and the loop delivers the best round so far.+ rec.renders = None+ notes.append(f"render failed: {str(e)[:200]}")+ ctx.events.emit("render.failed", round=index, error=str(e)[:400])post = getattr(pipeline, "post_render_gates", None)if callable(post) and rec.renders is not None:gates.extend(post(ctx, index, rec.renders))diff --git a/harness/tests/orchestrator_tracks/test_tracks.py b/harness/tests/orchestrator_tracks/test_tracks.pyindex 9f628c5f..4b5a10c3 100644--- a/harness/tests/orchestrator_tracks/test_tracks.py+++ b/harness/tests/orchestrator_tracks/test_tracks.py@@ -249,3 +249,30 @@ def test_scene_track_deterministic_assembler_and_resume(tmp_path, settings):def test_get_track_dispatch():assert isinstance(get_track("static_object"), StaticObjectTrack)assert isinstance(get_track(Track.SCENE), SceneTrack)+++def test_a_render_timeout_degrades_the_round_instead_of_failing_the_run(tmp_path, chair_plan, settings):+ """Measured 2026-08-26 (art_verify camera_tripod): the refine round built in 1.2 s, then+ render_glb.mjs hit its 330 s timeout under load and the run was recorded `failed` with a+ judged round 0 on disk. The round keeps build/gates, skips the judge, and the run+ delivers its best round."""+ from codeverse.spatial.render import RenderError++ class _Services(FakeServices):+ def render_object(self, glb, out_dir, *, views, width, height):+ if "r00" not in str(out_dir):+ raise RenderError("render_glb failed: node script render_glb.mjs timed out after 330s")+ return super().render_object(glb, out_dir, views=views, width=width, height=height)++ spec = make_spec(max_rounds=3)+ ws = Workspace(tmp_path / "runs" / "chair")+ track = StaticObjectTrack(services=_Services(contract_errors=1), judge=FakeJudge(scores=(0.55, 0.7, 0.85)),+ agent=FakeAgent(_agent_writer), planner_model=_planner(chair_plan.model_dump(mode="json")),+ settings=settings, runtime=FakeRuntime(Language.THREEJS))+ rec = track.run(spec, ws)+ assert rec.status is not RunStatus.FAILED and rec.best_round == 0 and rec.final_score == pytest.approx(0.55)+ r1 = rec.rounds[1]+ assert r1.build is not None and r1.build.ok and r1.renders is None and r1.judgment is None+ assert "render failed" in r1.notes+ kinds = [e["event"] for e in EventLog(ws.events_path).read()]+ assert "render.failed" in kinds and "run.done" in kinds and "run.failed" not in kinds