Skip to content

Official Codebase of 3DCodeVerse

Python

scene_probe: the first camera's lens and exposure are scene_frames' findings alone

gaoypeng8db83a5c67c0
diff --git a/harness/codeverse3d/spatial/probes.py b/harness/codeverse3d/spatial/probes.py
index 406f2f76..188ee829 100644
--- a/harness/codeverse3d/spatial/probes.py
+++ b/harness/codeverse3d/spatial/probes.py
@@ -165,14 +165,8 @@ def probe_report(summary: dict[str, Any], *, duration_ms: int = 0) -> tuple[Gate
target="src/scene.js", hint="delete your own render loop; the host drives update()"))
census = s.get("census") or {}
findings.extend(_census_findings(census))
- cam0 = s.get("first_camera") or {}
- if cam0.get("camera_in_geometry"):
- findings.append(_f(gate, Severity.WARN,
- f"camera '{cam0.get('name')}' is inside/too close to geometry (nearest hit {cam0.get('nearest_hit_m')} m, inside {cam0.get('inside_mesh_bbox')})",
- target=str(cam0.get("name")), hint="move the eye ≥ 0.5 m away from surfaces and above ground"))
- if cam0 and cam0.get("dark_frac", 0) > 0.85:
- findings.append(_f(gate, Severity.WARN, f"camera '{cam0.get('name')}' frame is {cam0['dark_frac']:.0%} black — no lights or nothing in view?",
- target=str(cam0.get("name")), hint="add a DirectionalLight + HemisphereLight in env, aim the camera at the content"))
+ # the first camera's lens and exposure are scene_frames' (frame_metrics) — one camera, one
+ # gate; `first_camera` stays in the probe summary (scene_probe.json)
return GateReport.of(gate, findings, duration_ms=duration_ms), census
diff --git a/harness/tests/scene_gates/test_frame_metrics.py b/harness/tests/scene_gates/test_frame_metrics.py
index b179a2ad..981c12ff 100644
--- a/harness/tests/scene_gates/test_frame_metrics.py
+++ b/harness/tests/scene_gates/test_frame_metrics.py
@@ -31,6 +31,13 @@ def test_camera_in_geometry_and_near_hit():
_chk("Close", nearest_hit_m=0.3)))
assert [(k, s) for k, s, _ in _kinds(rep)] == [("camera_in_geometry", Severity.ERROR)] * 2
assert "Tower" in rep.findings[0].message and "0.5 m" in rep.findings[0].fix_hint
+ # one camera, one gate (audit 2026-09-24 N11): the build's scene_probe used to judge the first
+ # camera again (WARN at 0.3 m / 85 % dark) beside these ERRORs (0.5 m / 35 %) in the same round
+ from codeverse3d.spatial.probes import probe_report
+
+ cam0 = _chk("Buried", camera_in_geometry=True, inside_mesh_bbox=["Tower"], nearest_hit_m=0.1, dark_frac=0.9)
+ probe, _ = probe_report({"boot": {"ok": True, "stage": "ready"}, "update_ok": True, "first_camera": cam0})
+ assert not [f for f in probe.findings if f.target == "Buried"], [f.message for f in probe.findings]
def test_a_lens_whose_sight_rays_end_within_reach_is_blocked():