Skip to content

Official Codebase of 3DCodeVerse

Python

spatial: check_shaders(module=) was never passed; plan_bounds reads through read_json_or_none

gaoypenga60dcc8905c8
diff --git a/harness/codeverse3d/spatial/probes.py b/harness/codeverse3d/spatial/probes.py
index 743d96a9..8ad7b84b 100644
--- a/harness/codeverse3d/spatial/probes.py
+++ b/harness/codeverse3d/spatial/probes.py
@@ -187,14 +187,12 @@ def _census_findings(c: dict[str, Any]) -> list[GateFinding]:
return out
-def check_shaders(ws: Workspace, *, module: str | None = None, timeout_s: float = 90.0) -> GateReport:
+def check_shaders(ws: Workspace, *, timeout_s: float = 90.0) -> GateReport:
"""Static GLSL audits + GPU compile preflight with file:line mapped errors."""
t0 = time.time()
gate = SHADER_GATE
out_json = ws.artifacts / "shader_preflight.json"
args = ["--ws", str(ws.root), "--out", str(out_json), "--timeout-ms", str(int(timeout_s * 1000))]
- if module:
- args += ["--module", module]
findings: list[GateFinding] = []
try:
res = run_scene_script("check_shaders.mjs", args, timeout_s=timeout_s + 20)
diff --git a/harness/codeverse3d/spatial/render_scene.py b/harness/codeverse3d/spatial/render_scene.py
index 0d15969c..296d74fb 100644
--- a/harness/codeverse3d/spatial/render_scene.py
+++ b/harness/codeverse3d/spatial/render_scene.py
@@ -164,13 +164,10 @@ def _bounds_json(bounds: BBox) -> str:
def plan_bounds(ws: Workspace) -> BBox | None:
"""Scene bounds from the workspace's ``plan.json`` (None when absent/invalid)."""
- p = ws.plan_path
- if not p.is_file():
- return None
+ raw = (read_json_or_none(ws.plan_path) or {}).get("bounds")
try:
- raw = json.loads(p.read_text()).get("bounds")
return BBox.model_validate(raw) if raw else None
- except (OSError, ValueError):
+ except ValueError:
return None