Official Codebase of 3DCodeVerse
Python
prompts: python-built prompt and tool text states no limits — frame header, zone window, IoU aim, skeleton tri cap, low-fps hint
gaoypengfc0a37d3c7ba
diff --git a/harness/codeverse3d/languages/blender/__init__.py b/harness/codeverse3d/languages/blender/__init__.pyindex eb884ed5..bffc0f17 100644--- a/harness/codeverse3d/languages/blender/__init__.py+++ b/harness/codeverse3d/languages/blender/__init__.py@@ -588,7 +588,7 @@ CONTRACT (the harness runs this file in an EMPTY scene with `blender -b --factoreach TOP-LEVEL (never parented under an Empty — that merges them into ONE measured part).{layout} * Materials: Principled BSDF (Base Color / Roughness / Metallic). GLB keeps flat PBR + imagetextures only (procedural node textures are NOT exported) — rely on geometry + flat PBR.- * Modifiers may stay unapplied (the exporter applies them). Keep < {MAX_TRIS_OBJECT // 1000}k triangles.+ * Modifiers may stay unapplied (the exporter applies them).* NEVER: cameras, lights, world, render settings, export/import, file IO, bpy.ops.wm.*.* Only bpy / bmesh / mathutils / math / random (seeded). No other imports.diff --git a/harness/codeverse3d/spatial/frame_metrics.py b/harness/codeverse3d/spatial/frame_metrics.pyindex a1f67a9e..ff9b69e8 100644--- a/harness/codeverse3d/spatial/frame_metrics.py+++ b/harness/codeverse3d/spatial/frame_metrics.py@@ -469,7 +469,7 @@ def frame_summary_text(metrics: dict[str, Any], *, max_rows: int = 12) -> str:if name in flagged:bits.append("— " + ", ".join(flagged[name]))rows.append(" ".join(bits))- head = f"frame checks ({'ok' if report.passed else 'FAILED'}; mean_lum ≥ 0.15, dark ≤ 35 %, blown ≤ 20 %, establishing content ≥ 20 %):"+ head = f"frame checks ({'ok' if report.passed else 'FAILED'}):"motion = motion_summary_text(stored_motion(metrics))body = "\n".join([head, *rows]) if rows else "frame checks: no camera_checks in metrics"return body + ("\n\n" + motion if motion else "")diff --git a/harness/codeverse3d/spatial/render_scene.py b/harness/codeverse3d/spatial/render_scene.pyindex 05a1a7d8..3277aeff 100644--- a/harness/codeverse3d/spatial/render_scene.py+++ b/harness/codeverse3d/spatial/render_scene.py@@ -286,17 +286,17 @@ def _store_motion(out_dir: Path, metrics: dict[str, Any]) -> None:def perf_detail(rs: RenderSet) -> str:- """`` — 5028 draw calls (budget 200), 191k triangles`` from a render's own instruments.+ """`` — 5028 draw calls, 191k triangles`` from a render's own instruments.The number is what makes a low-fps finding actionable: "low fps" is a mood, "5028 draw- calls against a budget of 200" names the fix. ``""`` when the instruments are missing."""+ calls" names the fix. ``""`` when the instruments are missing."""try:path = metrics_path_for(rs)if path is None:return ""fps = (json.loads(path.read_text()).get("fps") or {})calls, tris = fps.get("draw_calls"), fps.get("triangles")- bits = [f"{int(calls)} draw calls (budget 200)" if isinstance(calls, (int, float)) else "",+ bits = [f"{int(calls)} draw calls" if isinstance(calls, (int, float)) else "",f"{int(tris) / 1000:.0f}k triangles" if isinstance(tris, (int, float)) else ""]inner = ", ".join(b for b in bits if b)return f" — {inner}" if inner else ""diff --git a/harness/codeverse3d/tracks/prompting.py b/harness/codeverse3d/tracks/prompting.pyindex 2a892dce..52c5a3aa 100644--- a/harness/codeverse3d/tracks/prompting.py+++ b/harness/codeverse3d/tracks/prompting.py@@ -408,7 +408,7 @@ def reference_note(ctx: RunContext) -> str:lines = [f"REFERENCE IMAGES ({len(refs)}): match their silhouette, proportions and visible details — they ""outrank the text when the two disagree. A harness measures the front-view outline IoU against the "- "target reference; aim for IoU ≥ 0.6."+ "target reference."]for i, r in enumerate(refs, 1):lines.append(f"- reference {i} ({r.role}): `{r.path}`" + (f" — {r.note}" if r.note else ""))diff --git a/harness/codeverse3d/tracks/scene.py b/harness/codeverse3d/tracks/scene.pyindex 6477ba9f..bc42184e 100644--- a/harness/codeverse3d/tracks/scene.py+++ b/harness/codeverse3d/tracks/scene.py@@ -127,7 +127,7 @@ class ScenePipeline:if renders.hardware_fps is not None and renders.hardware_fps < 20:findings.append(GateFinding(gate="render_console", severity=Severity.WARN, target="overall",message=f"low frame rate {renders.hardware_fps:.0f} fps" + perf_detail(renders),- fix_hint="the budget is <= 200 draw calls and <= 2 M triangles: merge static geometry "+ fix_hint="merge static geometry ""(BufferGeometryUtils.mergeGeometries) and put anything repeated > 5x in ONE ""InstancedMesh per material — a per-object mesh loop is what costs the frame rate"))out = [GateReport.of("render_console", findings)]@@ -361,14 +361,13 @@ class SceneTrack(BaseTrack):if len(batch) == 1:prompt, label = briefs[0], f"zone_{to_snake(names[0])}"else:- window_min = ctx.budget.timeout_s(ZONE_TIMEOUT_S * len(batch), floor_s=180) // 60header = (f"# {len(batch)} zone modules in ONE session — write ALL of: {', '.join(files)}\n\n"f"You own exactly these files and nothing else. {len(batch)} complete zone briefs follow, ""separated by a horizontal rule; implement each one in its own file exactly as its brief says. "+ "These are EVERY zone of the scene and you are its one author: keep scale, materials and ""placement coherent across them — nothing floats, nothing interpenetrates a neighbour, every ""content at the plan's size, and the zones meet at their shared edges as one place. "- f"This session's window is {len(batch)} zones' worth ({window_min} min): build EACH zone to "+ f"This session covers {len(batch)} zones: build EACH zone to ""its brief's full density counts and dressing before you finish — one author measured ""2026-09-08 finished four zones in 5 minutes as a block-out (\"missing stove\", \"shelves ""missing\", \"primitive tools\") and scored 0.32 where the brief-by-brief fan-out reached 0.60. "diff --git a/harness/tests/orchestrator_tracks/test_one_world_session.py b/harness/tests/orchestrator_tracks/test_one_world_session.pyindex cc2b39fa..4be612a9 100644--- a/harness/tests/orchestrator_tracks/test_one_world_session.py+++ b/harness/tests/orchestrator_tracks/test_one_world_session.py@@ -30,4 +30,4 @@ def test_a_whole_world_batch_owns_every_zone_file_and_gets_a_window_per_zone(tmpassert whole.files_hint == [zone_file(z.name) for z in plan.zones] and whole.edit_onlyassert whole.timeout_s == ZONE_TIMEOUT_S * len(plan.zones)assert "you are its one author" in whole.prompt and "nothing floats" in whole.prompt- assert f"window is {len(plan.zones)} zones' worth ({ZONE_TIMEOUT_S * len(plan.zones) // 60} min)" in whole.prompt+ assert f"This session covers {len(plan.zones)} zones:" in whole.prompt and " min)" not in whole.prompt # no time window