Skip to content

Official Codebase of 3DCodeVerse

Python

"no output" and "the scene did not boot" are different statements

ziyaobfedbcc591a9
diff --git a/harness/codeverse/spatial/probes.py b/harness/codeverse/spatial/probes.py
index 7cd8ccf0..1b6d69d8 100644
--- a/harness/codeverse/spatial/probes.py
+++ b/harness/codeverse/spatial/probes.py
@@ -92,6 +92,21 @@ def probe_report(summary: dict[str, Any], *, duration_ms: int = 0) -> tuple[Gate
findings: list[GateFinding] = []
s = summary
boot = s.get("boot") or {}
+ if "boot" not in s:
+ # NO boot record at all is not a verdict about the scene: `probe_scene.mjs` always
+ # carries `boot` in its summary, so an absent one means the driver produced no
+ # parsable summary line — its stdout tail was dropped (`proc._ABANDONED`), or it
+ # died in a way `run_scene_script` let through with exit 0. Saying "scene did not
+ # boot" here hands the agent a defect that does not exist and names nothing it can
+ # fix: on desert_canyon (bench/out/scene_baseline, 2026-09-05) the run spent three
+ # repair attempts on `[?] scene did not boot` with an identical signature, while the
+ # driver's own artifacts/scene_probe.json recorded `ok: true, boot.ok: true,
+ # stage: ready` — and the workspace boots in 600 ms today, unchanged.
+ findings.append(_f(gate, Severity.ERROR, "scene probe produced no result (driver output lost)",
+ target="src/scene.js",
+ hint="this is a harness/driver failure, not your code; retry or report",
+ harness_failure=True))
+ return GateReport(gate=gate, passed=False, findings=findings, duration_ms=duration_ms), {}
if not boot.get("ok"):
stage = boot.get("stage", "?")
msg = boot.get("error") or "scene did not boot"
diff --git a/harness/codeverse/spatial/render_scene.py b/harness/codeverse/spatial/render_scene.py
index 8bdef187..a8dc14ae 100644
--- a/harness/codeverse/spatial/render_scene.py
+++ b/harness/codeverse/spatial/render_scene.py
@@ -86,10 +86,20 @@ def run_scene_script(script: str, args: Sequence[str], *, timeout_s: float, cwd:
raise SceneRenderError(f"{script} could not run: {e}") from e
r = attempt(env_extra)
- if _driver_failed(r) and browser_was_lost(r.summary.get("error", "")):
+ lost_browser = _driver_failed(r) and browser_was_lost(r.summary.get("error", ""))
+ # Every scene driver ends with a JSON summary line (`lib/cli.finish` / `fail`), so a run
+ # that produced none had its stdout tail dropped — `proc._ABANDONED`, which a loaded box
+ # makes routine. That is transient and worth one more attempt; without it the empty
+ # summary reaches `probes.probe_report`, which used to render it as "[?] scene did not
+ # boot" and spend the round's repair budget on a defect that was never there
+ # (desert_canyon, bench/out/scene_baseline, 2026-09-05).
+ lost_output = not lost_browser and not r.summary
+ if lost_browser or lost_output:
log.warning(
- "%s lost its browser (%s); retrying once on an owned browser",
- script, str(r.summary.get("error"))[:200],
+ "%s %s; retrying once on an owned browser",
+ script,
+ f"lost its browser ({str(r.summary.get('error'))[:200]})" if lost_browser
+ else f"exited {r.rc} with no summary line (output lost)",
)
r = attempt({**env_extra, **OWN_BROWSER_ENV})
summary = r.summary
diff --git a/harness/docs/RUNBOOK.md b/harness/docs/RUNBOOK.md
index 9d6abfa1..be89657d 100644
--- a/harness/docs/RUNBOOK.md
+++ b/harness/docs/RUNBOOK.md
@@ -183,7 +183,14 @@ its own cache dir passed 787/787. Check `uptime` and `free -g` before believing
browser test. One test is flaky by construction under CPU contention and is NOT to be
"fixed" by weakening it: `test_studio_render_is_reproducible_and_stamps_the_rig_version`
compares two renders byte for byte, and SwiftShader is not bit-reproducible when the box
-is busy — it failed 2 runs in 3 on an unmodified tree at load 129.
+is busy — it failed 2 runs in 3 on an unmodified tree at load 129. A second one behaves
+the same way: `test_example_scene_passes_frame_gate_and_judge_subset` asserts that a
+frame's content / ground / sky coverage fractions sum to 1 +- 0.02, and at `-n 4` under
+load ~100 it fails on `content 0.644 + ground 0.000 + sky 0.549 = 1.193`. An interleaved
+A/B — six runs each, alternating so both arms see the same load — gave **5/6 failures on
+the unmodified tree and 4/6 with the branch's changes**, i.e. the box, not the code. What
+produces a ground fraction of exactly zero on a scene that has a ground is an open
+question; it needs an idle machine to look at, not a guess.
**Two arms at once still want separate `CV3D_CACHE_DIR`, though the browser no longer
depends on it.** Until 2026-09-05 the daemon advertised its endpoint at
diff --git a/harness/tests/scene_gates/test_software_fps.py b/harness/tests/scene_gates/test_software_fps.py
index ee97ba5c..20a57fef 100644
--- a/harness/tests/scene_gates/test_software_fps.py
+++ b/harness/tests/scene_gates/test_software_fps.py
@@ -79,3 +79,24 @@ def test_the_judge_is_told_a_cpu_number_is_not_the_scene() -> None:
gpu = view_rig_section(RenderSet(renderer=GPU, fps=11.5), [], scene=True)
assert "CPU rasteriser" in cpu and "do not raise a performance issue" in cpu
assert "measured 12 fps." in gpu and "CPU rasteriser" not in gpu
+
+
+def test_a_probe_with_no_boot_record_is_a_harness_failure_not_a_verdict() -> None:
+ """`probe_scene.mjs` always carries `boot` in its summary, so an absent one means the
+ driver produced no parsable output — not that the scene failed to boot. desert_canyon
+ (bench/out/scene_baseline, 2026-09-05) spent three repair attempts on
+ "[?] scene did not boot" with an identical signature while its own
+ artifacts/scene_probe.json recorded `ok: true, boot.ok: true, stage: ready`, and the
+ workspace boots in 600 ms today, unchanged."""
+ from codeverse.spatial.probes import probe_report
+
+ report, census = probe_report({})
+ assert not report.passed and census == {}
+ assert len(report.findings) == 1
+ f = report.findings[0]
+ assert "no result" in f.message and "did not boot" not in f.message
+ assert f.data.get("harness_failure") is True
+
+ # a REAL boot failure still reads as one, with its stage
+ real, _ = probe_report({"boot": {"ok": False, "stage": "createScene", "error": "TypeError: x"}})
+ assert not real.passed and "[createScene] TypeError: x" in real.findings[0].message
diff --git a/harness/tests/scene_runtime/test_scene_driver_retry.py b/harness/tests/scene_runtime/test_scene_driver_retry.py
index 2f58c98e..c5a98b33 100644
--- a/harness/tests/scene_runtime/test_scene_driver_retry.py
+++ b/harness/tests/scene_runtime/test_scene_driver_retry.py
@@ -70,3 +70,26 @@ def test_a_retry_that_loses_the_browser_again_raises(monkeypatch):
with pytest.raises(SceneRenderError, match="detached Frame"):
run_scene_script("render_scene.mjs", ["--ws", "x"], timeout_s=10)
assert len(envs) == 2, "exactly one retry — a box out of memory stays out of memory"
+
+
+def test_a_driver_that_exits_0_with_no_summary_is_retried(monkeypatch):
+ """Every scene driver ends with a JSON summary line, so a run that produced none had
+ its stdout tail dropped (`proc._ABANDONED`) — transient, and worth one more attempt.
+ Without the retry the empty summary reached `probes.probe_report`, which rendered it
+ as "[?] scene did not boot"; desert_canyon then spent all three repair attempts on a
+ defect that was never there, while its own artifacts recorded `boot.ok: true`."""
+ envs = _record(monkeypatch, [
+ _result(0, None),
+ _result(0, {"ok": True, "boot": {"ok": True, "stage": "ready"}}),
+ ])
+ r = run_scene_script("probe_scene.mjs", ["--ws", "x"], timeout_s=10)
+ assert r.summary["boot"]["ok"] is True
+ assert len(envs) == 2 and envs[1]["CV3D_BROWSER_REUSE"] == "off"
+
+
+def test_a_driver_that_answered_is_not_retried_for_a_failing_verdict(monkeypatch):
+ """Exit 1 WITH a summary is a scene that failed — a verdict, and complete."""
+ envs = _record(monkeypatch, [_result(1, {"ok": False, "boot": {"ok": False, "stage": "createScene",
+ "error": "TypeError: x is not a function"}})])
+ r = run_scene_script("probe_scene.mjs", ["--ws", "x"], timeout_s=10)
+ assert r.summary["boot"]["stage"] == "createScene" and len(envs) == 1