Skip to content

Official Codebase of 3DCodeVerse

Python

scene: one author for the whole world — every zone in ONE session (CV3D_ONE_WORLD_SESSION, on by default; D70)

gaoypengc2da433c5c3b
diff --git a/harness/codeverse/config.py b/harness/codeverse/config.py
index f9370aaa..01afbfa0 100644
--- a/harness/codeverse/config.py
+++ b/harness/codeverse/config.py
@@ -178,6 +178,10 @@ SEED_RECIPES_ENV = "CV3D_SEED_RECIPES"
#: pack description in both prompts). OFF by default: it adds an image-model call per
#: run, and whether it earns that is a measurement nobody has made yet.
SCENE_TEXTURES_ENV = "CV3D_SCENE_TEXTURES"
+#: ONE session authors every zone of a scene (the whole world, one author) instead of the
+#: two-small-zones-per-session fan-out. ON by default since the loop-17 measurement (D70);
+#: `off` is the fan-out control.
+ONE_WORLD_SESSION_ENV = "CV3D_ONE_WORLD_SESSION"
_TRUE_WORDS = frozenset({"1", "on", "true", "yes", "y"})
_FALSE_WORDS = frozenset({"0", "off", "false", "no", "n"})
@@ -228,6 +232,27 @@ def scene_textures_enabled() -> bool:
return env_flag(SCENE_TEXTURES_ENV, False)
+def one_world_session_enabled() -> bool:
+ """Do all of a scene's zones go to ONE session? ``$CV3D_ONE_WORLD_SESSION``, else ON.
+
+ Measured 2026-09-08 under one fixed judge (gemini-3.1-pro-preview, n=2, the brief's
+ must_have list), both sides ``codex:gpt-6-astra@low``: a bare one-file scene — one author,
+ no plan, no lib, no assets — scored 0.894 on the clockmaker's workshop and 0.82 on the boat
+ workshop, while the harness's round 0 of the same briefs, its zones written by separate
+ sessions of at most two small zones each, sat at 0.17 and 0.30–0.57 ("not enclosed",
+ "stove 3.6 m instead of 1.15", "skiff floating 1.2 m above its trestles") and needed two
+ refine rounds to reach 0.60–0.93. The day's tally over 43 judged rounds put floating /
+ scale / interpenetration (28), missing planned content (23) and cameras (21) at the top —
+ the defects that appear between authors, not within one. With this on, every zone brief
+ goes to one session that owns every zone file (the env, the assets and the heroes keep
+ their own stages), with a session window scaled to the zone count. Measured on the
+ same three briefs (loop 17, in-loop judge): round 0 0.17 → 0.69, 0.51 → 0.58, 0.44 →
+ 0.43; best round 0.75 → 0.82 PASS, 0.73 → 0.60, 0.60 → 0.77 PASS — so ON by default,
+ and ``off`` is the fan-out control while the fixed-judge confirmation runs.
+ """
+ return env_flag(ONE_WORLD_SESSION_ENV, True)
+
+
def seed_recipes_enabled() -> bool:
"""Is recipe seeding (``tracks/graphics.py:seed_recipes``) on for THIS call? ``$CV3D_SEED_RECIPES``
when it is set, else ``Settings.limits.seed_recipes`` (default ON)."""
diff --git a/harness/codeverse/tracks/scene.py b/harness/codeverse/tracks/scene.py
index 262b9b70..59e9d0a7 100644
--- a/harness/codeverse/tracks/scene.py
+++ b/harness/codeverse/tracks/scene.py
@@ -26,7 +26,7 @@ import time
from collections.abc import Sequence
from typing import Any
-from codeverse.config import scene_textures_enabled
+from codeverse.config import one_world_session_enabled, scene_textures_enabled
from codeverse.contracts.artifacts import (
BuildResult,
GateFinding,
@@ -353,7 +353,8 @@ class SceneTrack(BaseTrack):
def _zones_stage(self, ctx: RunContext) -> dict[str, Any]:
plan: ScenePlan = ctx.plan # type: ignore[assignment]
t0 = time.time()
- batches = plan_zone_batches(list(plan.zones))
+ # one author for the whole world (config.one_world_session_enabled) or the fan-out
+ batches = [list(plan.zones)] if one_world_session_enabled() else plan_zone_batches(list(plan.zones))
if any(len(b) > 1 for b in batches):
ctx.events.emit("zones.batched", batches=[[z.name for z in b] for b in batches])
@@ -412,17 +413,23 @@ class SceneTrack(BaseTrack):
if len(batch) == 1:
prompt, label = briefs[0], f"zone_{to_snake(names[0])}"
else:
+ whole = len(batch) == len(plan.zones)
header = (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. "
- "They are small neighbouring zones, so keep their styling consistent and do not build into each other. "
- "The recipes printed in the first brief apply to every zone in this session.\n")
+ + ("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. "
+ if whole else
+ "They are small neighbouring zones, so keep their styling consistent and do not build into each other. ")
+ + "The recipes printed in the first brief apply to every zone in this session.\n")
prompt = header + "\n\n---\n\n".join(briefs)
label = "zones_" + "_".join(to_snake(n) for n in names)
# the batch exclusively owns its zone files; env/scene/asset files belong to other sessions
+ # the window grows with the batch: one author writing four zones is four zones of work
return GenerationTask(label=label, prompt=prompt, system=self.system_prompt(ctx), files_hint=files,
round=0, kind="zone", temperature=0.5, edit_only=True,
- timeout_s=ctx.budget.timeout_s(ZONE_TIMEOUT_S, floor_s=180))
+ timeout_s=ctx.budget.timeout_s(ZONE_TIMEOUT_S * max(1, len(batch)), floor_s=180))
def _assemble_stage(self, ctx: RunContext) -> dict[str, Any]:
try:
diff --git a/harness/docs/DECISIONS.md b/harness/docs/DECISIONS.md
index 19d2896b..89c17a45 100644
--- a/harness/docs/DECISIONS.md
+++ b/harness/docs/DECISIONS.md
@@ -1113,6 +1113,29 @@ written) that were accepted because the code works that way and the tests pin it
grounds anything (L7): harness-owned starter geometry, like `worldShell` (D51), that the
agent edits.
+* **D70 One author for the whole world — `CV3D_ONE_WORLD_SESSION`, ON by default since its
+ measurement (2026-09-08).** Under one fixed judge (gemini-3.1-pro-preview, n=2, the brief's
+ must_have list) and one model on both sides (`codex:gpt-6-astra@low`), a bare one-file scene
+ — one author, no plan, no lib, no assets, no tools — scored 0.894 on the clockmaker's
+ workshop and 0.82 on the boat workshop; the harness's round 0 of the same briefs, its zones
+ written by separate sessions of at most two small zones each (`MAX_ZONES_PER_BATCH = 2`,
+ `SMALL_ZONE_CONTENTS = 3`), sat at 0.17 and 0.30–0.57 and needed two refine rounds to reach
+ 0.60–0.93. Over four scene prompts the harness still led on mean (0.54 vs 0.36: the bare
+ model's windmill and lighthouse died on a null merged geometry the build gate would have
+ repaired), but where it lost, it lost on what appears BETWEEN authors: the day's tally over
+ 43 judged rounds put floating / scale / interpenetration (28), missing planned content (23)
+ and cameras (21) at the top. With the switch on, every zone brief goes to ONE session that
+ owns every zone file — the env, the assets and the Blender heroes keep their own stages, the
+ gates and rounds are unchanged — with the session window scaled by the zone count and the
+ batch header saying whose coherence it is. A boolean, not a batch size: the hypothesis is
+ "one author", and a bench arm sets it after Settings is cached (`env_flag`, as
+ `CV3D_SCENE_TEXTURES` does). **Measured (loop 17, the same three briefs, in-loop judge):**
+ round 0 clockmaker 0.17 → 0.69, boat 0.51 → 0.58, NYC 0.44 → 0.43; best round 0.75 → 0.82
+ PASS, 0.73 → 0.60, 0.60 → 0.77 PASS — two passes where the fan-out had none, and the
+ interior's round 0 four times higher. The default is ON; `off` keeps the fan-out as the
+ control until the fixed-judge confirmation (harness-with-switch vs the bare model on the
+ same briefs) is in, after which the two batching constants go.
+
## Rejected / deferred
* A versioned `Spec`/`RunRecord`/`RunState` load-normaliser (rejected 2026-08-30: of the seven
diff --git a/harness/tests/orchestrator_tracks/test_one_world_session.py b/harness/tests/orchestrator_tracks/test_one_world_session.py
new file mode 100644
index 00000000..873b4a1d
--- /dev/null
+++ b/harness/tests/orchestrator_tracks/test_one_world_session.py
@@ -0,0 +1,44 @@
+"""D70: one author for the whole world — `CV3D_ONE_WORLD_SESSION` sends every zone to ONE
+session whose window scales with the zone count (2026-09-08).
+
+Measured under one fixed judge with codex:gpt-6-astra@low on both sides: a bare one-file
+scene scored 0.894 (clockmaker) and 0.82 (boat) while the harness's round 0, its zones
+written by separate sessions of at most two small zones, sat at 0.17 and 0.30-0.57.
+"""
+from __future__ import annotations
+
+from codeverse.config import one_world_session_enabled
+from codeverse.contracts.common import Language, Track
+from codeverse.contracts.plan import ScenePlan
+from codeverse.orchestrator import RunState
+from codeverse.proc import EventLog
+from codeverse.tracks.planner import plan_example
+from codeverse.tracks.scene import ZONE_TIMEOUT_S, SceneTrack, zone_file
+from codeverse.workspace import Workspace
+from tests.orchestrator_tracks.conftest import make_spec
+from tests.orchestrator_tracks.fakes import FakeRuntime, FakeServices
+
+
+def test_the_switch_is_read_at_call_time_and_on_by_default(monkeypatch):
+ monkeypatch.delenv("CV3D_ONE_WORLD_SESSION", raising=False)
+ assert one_world_session_enabled() is True # since loop 17 (D70): the measured default
+ monkeypatch.setenv("CV3D_ONE_WORLD_SESSION", "off")
+ assert one_world_session_enabled() is False # the fan-out control
+ monkeypatch.setenv("CV3D_ONE_WORLD_SESSION", "garbage")
+ assert one_world_session_enabled() is False # a typo in a bench command is the control, never a crash
+
+
+def test_a_whole_world_batch_owns_every_zone_file_and_gets_a_window_per_zone(tmp_path, settings):
+ base = ScenePlan.model_validate(plan_example(Track.SCENE))
+ # three zones: a pair is then NOT the whole world (the example plan has two)
+ plan = base.model_copy(update={"zones": [*base.zones, base.zones[0].model_copy(update={"name": "Extra"})]})
+ ws = Workspace(tmp_path / "runs" / "s").create()
+ track = SceneTrack(services=FakeServices(), settings=settings, runtime=FakeRuntime(Language.SCENE_THREEJS))
+ ctx = track.build_context(make_spec(Track.SCENE, Language.SCENE_THREEJS, max_minutes=600.0), ws, EventLog(ws.events_path), RunState())
+ ctx.plan = plan
+ whole = track._zone_task(ctx, list(plan.zones))
+ pair = track._zone_task(ctx, list(plan.zones[:2]))
+ assert whole.files_hint == [zone_file(z) for z in plan.zones] and whole.edit_only
+ assert whole.timeout_s == ZONE_TIMEOUT_S * len(plan.zones) and pair.timeout_s == ZONE_TIMEOUT_S * 2
+ assert "you are its one author" in whole.prompt and "nothing floats" in whole.prompt
+ assert "one author" not in pair.prompt and "small neighbouring zones" in pair.prompt
diff --git a/harness/tests/skills/test_delivery_reaches_the_session.py b/harness/tests/skills/test_delivery_reaches_the_session.py
index 9138c2d2..fb3c09e4 100644
--- a/harness/tests/skills/test_delivery_reaches_the_session.py
+++ b/harness/tests/skills/test_delivery_reaches_the_session.py
@@ -38,6 +38,9 @@ def scene_run(tmp_path, monkeypatch):
from tests.orchestrator_tracks.test_tracks import _planner, _scene_writer
monkeypatch.setenv("CV3D_SKILLS", "1")
+ # this run PROVES the fan-out is skill-safe (one attach serving two zone sessions), so it
+ # runs the fan-out — the default since D70 (2026-09-08) is one session for every zone
+ monkeypatch.setenv("CV3D_ONE_WORLD_SESSION", "off")
plan = ScenePlan.model_validate(plan_example(Track.SCENE))
plan.assets = [a for a in plan.assets if a.kind == "threejs"]
for z in plan.zones: