Skip to content

Official Codebase of 3DCodeVerse

Python

spatial/runtime_js: delete driver flags, host surface and parameters nothing passes

gaoypengbd592c38c205
diff --git a/harness/codeverse/spatial/ablation.py b/harness/codeverse/spatial/ablation.py
index af9e7094..87a4c435 100644
--- a/harness/codeverse/spatial/ablation.py
+++ b/harness/codeverse/spatial/ablation.py
@@ -30,13 +30,11 @@ from __future__ import annotations
import json
import time
-from collections.abc import Sequence
from pathlib import Path
from typing import Any
from pydantic import BaseModel, Field
-from codeverse.contracts.plan import CameraPlan
from codeverse.proc import read_json_or_none
from codeverse.spatial.render_scene import SceneRenderError, run_scene_script
from codeverse.workspace import Workspace
@@ -60,8 +58,6 @@ class CameraAblation(BaseModel):
camera: str
changed_frac: float = Field(description="fraction of pixels the custom shaders change")
- mean_abs: float = 0.0
- pixels: int = 0
class MaterialAblation(BaseModel):
@@ -89,9 +85,6 @@ class AblationReport(BaseModel):
per_material_measured: bool = False
per_material_cameras: list[str] = Field(default_factory=list)
time_s: float = DEFAULT_TIME_S
- sim_time: float | None = None
- threshold: int = 8
- grid: list[int] = Field(default_factory=list, description="[w, h] of the diff readback")
images: list[str] = Field(default_factory=list, description="authored/ablated PNG pairs (absolute paths)")
console_errors: list[str] = Field(default_factory=list)
error: str = ""
@@ -150,23 +143,12 @@ class AblationReport(BaseModel):
return lines
-def _cameras_arg(cameras: Sequence[CameraPlan] | None) -> str:
- if not cameras:
- return "authored"
- return json.dumps([{"name": c.name, "position": list(c.position), "lookAt": list(c.look_at), "fov": c.fov}
- for c in cameras])
-
-
def ablate_scene(
ws: Workspace,
*,
out_dir: Path | None = None,
- cameras: Sequence[CameraPlan] | None = None,
time_s: float = DEFAULT_TIME_S,
- width: int = 512,
- height: int = 288,
frames: bool = True,
- max_materials: int = MAX_MATERIALS,
timeout_s: float = 120.0,
) -> AblationReport:
"""Measure how much of the frame the workspace's custom shaders paint.
@@ -182,9 +164,7 @@ def ablate_scene(
out.mkdir(parents=True, exist_ok=True)
args = [
"--ws", str(ws.root), "--out", str(out), "--t", f"{time_s:g}",
- "--width", str(width), "--height", str(height),
- "--max-materials", str(max_materials),
- "--cameras", _cameras_arg(cameras),
+ "--max-materials", str(MAX_MATERIALS),
"--timeout-ms", str(int(timeout_s * 1000)),
]
if frames:
@@ -201,7 +181,6 @@ def _report(summary: dict[str, Any], out_dir: Path, *, duration_ms: int = 0) ->
p = out_dir / str(f.get(key) or "")
if f.get(key) and p.is_file():
images.append(str(p))
- grid = list(summary.get("grid") or [])
return AblationReport(
ok=bool(summary.get("ok")),
custom_materials=int(summary.get("custom_materials") or 0),
@@ -212,9 +191,6 @@ def _report(summary: dict[str, Any], out_dir: Path, *, duration_ms: int = 0) ->
per_material_measured=bool(summary.get("per_material_measured")),
per_material_cameras=[str(c) for c in summary.get("per_material_cameras") or []],
time_s=float(summary.get("time_s") or DEFAULT_TIME_S),
- sim_time=summary.get("sim_time"),
- threshold=int(summary.get("threshold") or 8),
- grid=[int(v) for v in grid[:2]],
images=images,
console_errors=[str(e)[:400] for e in (summary.get("console_errors") or [])][:10],
error=str(summary.get("error") or ""),
diff --git a/harness/codeverse/spatial/joints_export.py b/harness/codeverse/spatial/joints_export.py
index a617562f..6742689d 100644
--- a/harness/codeverse/spatial/joints_export.py
+++ b/harness/codeverse/spatial/joints_export.py
@@ -11,7 +11,6 @@ Non-root link nodes carry ``extras.joint`` and the scene carries
from __future__ import annotations
-import sys
from collections.abc import Sequence
from pathlib import Path
from typing import Any
@@ -54,7 +53,7 @@ def robot_node_name(robot: Robot) -> str:
return name
-def robot_scene(robot: Robot, pose: dict[str, float] | None = None, *, joint_extras_on: bool = True) -> trimesh.Scene:
+def robot_scene(robot: Robot, pose: dict[str, float] | None = None) -> trimesh.Scene:
"""Build the trimesh.Scene (hierarchical, Y-up) for ``robot`` at ``pose``."""
fk(robot, pose or {}) # validates joint names
# the RESOLVED pose: a <mimic> follower moves with its driver in the export too, not
@@ -64,10 +63,8 @@ def robot_scene(robot: Robot, pose: dict[str, float] | None = None, *, joint_ext
scene = trimesh.Scene(base_frame=SCENE_BASE_FRAME) # never a link name (a link 'world' would close a cycle)
robot_node = robot_node_name(robot)
meta = {"links": robot.link_order(), "frame": "y_up_pos_z_front", "pose": dict(pose), "units": "meters"}
- if joint_extras_on:
- meta["joints"] = [joint_extras(j) for j in robot.joints.values()]
- scene.graph.update(frame_to=robot_node, frame_from=scene.graph.base_frame, matrix=ZUP_TO_YUP,
- metadata=meta if joint_extras_on else None)
+ meta["joints"] = [joint_extras(j) for j in robot.joints.values()]
+ scene.graph.update(frame_to=robot_node, frame_from=scene.graph.base_frame, matrix=ZUP_TO_YUP, metadata=meta)
for name in robot.link_order():
link = robot.links[name]
j = robot.parent_joint(name)
@@ -75,7 +72,7 @@ def robot_scene(robot: Robot, pose: dict[str, float] | None = None, *, joint_ext
parent_node, local = robot_node, np.eye(4)
else:
parent_node, local = j.parent, j.origin @ j.motion(float(pose.get(j.name, 0.0)))
- extras = {"joint": joint_extras(j)} if (j is not None and joint_extras_on) else None
+ extras = {"joint": joint_extras(j)} if j is not None else None
pieces = link.submeshes or ([link.mesh] if link.mesh is not None else [])
if len(pieces) == 1:
scene.add_geometry(pieces[0].copy(), node_name=name, geom_name=name, parent_node_name=parent_node,
@@ -89,11 +86,11 @@ def robot_scene(robot: Robot, pose: dict[str, float] | None = None, *, joint_ext
return scene
-def urdf_to_glb(robot: Robot, out_glb: Path | str, pose: dict[str, float] | None = None, *, joint_extras: bool = True) -> Path:
+def urdf_to_glb(robot: Robot, out_glb: Path | str, pose: dict[str, float] | None = None) -> Path:
"""Write the canonical hierarchical GLB for ``robot`` at ``pose`` (default rest)."""
out = Path(out_glb)
out.parent.mkdir(parents=True, exist_ok=True)
- scene = robot_scene(robot, pose, joint_extras_on=joint_extras)
+ scene = robot_scene(robot, pose)
out.write_bytes(scene.export(file_type="glb"))
return out
@@ -107,7 +104,6 @@ def render_poses(
views: Sequence[ViewPreset] | None = None,
width: int = 512,
height: int = 512,
- sheet_view: str | None = None,
) -> list[tuple[str, RenderSet]]:
"""Export one GLB per pose, render ``views`` for each (default: 3 quick views)
and write ``out_dir/articulation_sheet.png`` (rest / each joint at lower & upper
@@ -123,13 +119,6 @@ def render_poses(
rs = render_glb(glb, out_dir / f"pose_{safe}", views=views, width=width, height=height, sheet=False)
results.append((label, rs))
for v in rs.views:
- if sheet_view is None or v.name == sheet_view:
- tiles.append((f"{label} · {v.name}", Path(v.path)))
- contact_sheet(tiles, out_dir / ARTICULATION_SHEET_NAME, cols=len(views) if sheet_view is None else 4)
+ tiles.append((f"{label} · {v.name}", Path(v.path)))
+ contact_sheet(tiles, out_dir / ARTICULATION_SHEET_NAME, cols=len(views))
return results
-
-
-if __name__ == "__main__": # tiny manual CLI: python -m codeverse.spatial.joints_export robot.urdf out.glb
- from codeverse.spatial.joints_model import load_urdf
-
- urdf_to_glb(load_urdf(sys.argv[1]), sys.argv[2])
diff --git a/harness/codeverse/spatial/joints_sweep.py b/harness/codeverse/spatial/joints_sweep.py
index b1f24a2b..b95137f4 100644
--- a/harness/codeverse/spatial/joints_sweep.py
+++ b/harness/codeverse/spatial/joints_sweep.py
@@ -94,7 +94,6 @@ def sweep_collisions(
*,
tol_m: float = 0.002,
contact_gap_m: float = CONTACT_GAP_M,
- allow_pairs: tuple[tuple[str, str], ...] = (),
volumes: bool = True,
hinge_clearance_m: float = 0.01,
) -> SweepReport:
@@ -105,7 +104,6 @@ def sweep_collisions(
if not names:
raise UrdfError("sweep_collisions: robot has no link meshes")
bodies = {n: collide.LinkBody(n, robot.links[n].mesh) for n in names} # type: ignore[arg-type]
- allowed = {tuple(sorted(p)) for p in allow_pairs}
per_pose: list[PoseReport] = []
islands = {n: len(bodies[n].islands) for n in names}
# links joined only by fixed joints never move relative to each other: their overlap is
@@ -134,7 +132,7 @@ def sweep_collisions(
dist = 0.0
if rigid and idx != rigid_pose:
pass # structural overlap, already measured in pose ``rigid_pose``
- elif tuple(sorted((a, b))) not in allowed:
+ else:
depth, approx = collide.penetration(ba, bb)
if round(depth, 4) > tol_m: # 0.1 mm: float32 mesh coordinates carry no finer meaning
overlaps.append(
diff --git a/harness/codeverse/spatial/probes.py b/harness/codeverse/spatial/probes.py
index 2ce2b3f7..9e5196d0 100644
--- a/harness/codeverse/spatial/probes.py
+++ b/harness/codeverse/spatial/probes.py
@@ -69,7 +69,7 @@ def _f(gate: str, sev: Severity, msg: str, *, target: str | None = None, hint: s
return GateFinding(gate=gate, severity=sev, target=target, message=msg, fix_hint=hint, data=data)
-def probe_scene(ws: Workspace, *, timeout_s: float = 60.0, write_census: bool = True) -> SceneProbeResult:
+def probe_scene(ws: Workspace, *, timeout_s: float = 60.0) -> SceneProbeResult:
"""Import-only probe: module loads, shape valid, cameras valid, update runs, census."""
t0 = time.time()
gate = PROBE_GATE
@@ -86,7 +86,7 @@ def probe_scene(ws: Workspace, *, timeout_s: float = 60.0, write_census: bool =
return _result(GateReport(gate=gate, passed=False, findings=findings, duration_ms=int((time.time() - t0) * 1000)), census,
driver_failure=f"scene probe could not run: {e}"[:800])
report, census = probe_report(res.summary, duration_ms=int((time.time() - t0) * 1000))
- if write_census and census:
+ if census:
ws.artifacts.mkdir(parents=True, exist_ok=True)
(ws.artifacts / "census.json").write_text(json.dumps(census, indent=1))
return _result(report, census)
diff --git a/harness/codeverse/spatial/render.py b/harness/codeverse/spatial/render.py
index 16ee8bcb..4d3513cd 100644
--- a/harness/codeverse/spatial/render.py
+++ b/harness/codeverse/spatial/render.py
@@ -141,7 +141,7 @@ def render_glb(
try:
record = _run_render(glb, out_dir, params, gpu=gpu, timeout_s=timeout_s)
except RenderError as e:
- if not _transient(e):
+ if not transient_failure(e):
raise
# compare_art_v4 (2026-08-28): under 12 concurrent cells the browser took 7.5 s to
# open a page and the viewer's wait expired ("Waiting failed"); the cell lost its
@@ -188,10 +188,6 @@ def render_glb(
RETRY_PAUSE_S = 3.0
-def _transient(e: Exception) -> bool:
- return transient_failure(e)
-
-
def _run_render(
glb: Path, out_dir: Path, params: dict[str, Any], *, gpu: str, timeout_s: float, own_browser: bool = False
) -> dict[str, Any]:
diff --git a/harness/codeverse/spatial/render_scene.py b/harness/codeverse/spatial/render_scene.py
index e680631b..932b13cd 100644
--- a/harness/codeverse/spatial/render_scene.py
+++ b/harness/codeverse/spatial/render_scene.py
@@ -188,14 +188,13 @@ def render_scene(
fps_seconds: float = 2.0,
timeout_s: float | None = None,
bounds: BBox | None = None,
- sheet_max_views: int = JUDGE_MAX_VIEWS,
) -> RenderSet:
"""Render authored (+ orbit) views at ``times``; returns a RenderSet.
``cameras=None`` uses the cameras authored in ``createScene()``. ``bounds``
(default: the workspace plan's bounds) guards the orbit framing against
scatter that sprawls past the plan. The contact sheet holds at most
- ``sheet_max_views`` tiles (the ``select_judge_views`` subset; 0 = all). A
+ ``JUDGE_MAX_VIEWS`` tiles (the ``select_judge_views`` subset). A
scene that fails to boot yields an empty RenderSet whose ``console_errors``
say why (the build gate normally catches that earlier); a driver failure
raises ``SceneRenderError``.
@@ -252,7 +251,7 @@ def render_scene(
out_dir=str(out_dir),
)
# stamp the judge subset ONCE (select_judge_views stays a pure function)
- chosen = select_judge_views(rs, max_n=sheet_max_views or len(views), orbit_names=[v.name for v in orbit_views])
+ chosen = select_judge_views(rs, max_n=JUDGE_MAX_VIEWS, orbit_names=[v.name for v in orbit_views])
keep = {id(v) for v in chosen.views} # same objects, so identity is exact
for v in rs.views:
v.judge = id(v) in keep
diff --git a/harness/codeverse/spatial/scene_placement.py b/harness/codeverse/spatial/scene_placement.py
index 5efaaee2..71832c92 100644
--- a/harness/codeverse/spatial/scene_placement.py
+++ b/harness/codeverse/spatial/scene_placement.py
@@ -24,7 +24,6 @@ posts 0.97 m into the pond bed — a naive "> 0.10 m" rule flagged all of them
from __future__ import annotations
import logging
-import time
from collections.abc import Sequence
from typing import Any
@@ -258,11 +257,11 @@ def _cap_per_kind(findings: list[GateFinding]) -> list[GateFinding]:
return out
-def placement_findings(table: dict[str, Any] | PlacementTable, *, indoor: bool = False, duration_ms: int = 0) -> GateReport:
+def placement_findings(table: dict[str, Any] | PlacementTable, *, indoor: bool = False) -> GateReport:
"""The ``scene_placement`` GateReport for one census placement table (pure)."""
t = table if isinstance(table, PlacementTable) else PlacementTable.model_validate(table or {})
if t.error:
- return GateReport(gate=GATE, passed=True, duration_ms=duration_ms, findings=[
+ return GateReport(gate=GATE, passed=True, findings=[
_f(Severity.WARN, f"placement probe failed: {t.error[:300]}", target="scene", kind="probe_failed",
hint="harness instrumentation, not your code; the placement check was skipped this round")])
floating_m = FLOATING_INDOOR_M if indoor else FLOATING_OUTDOOR_M
@@ -278,7 +277,7 @@ def placement_findings(table: dict[str, Any] | PlacementTable, *, indoor: bool =
findings.insert(0, _f(Severity.INFO, summary, target="scene", kind="summary", counts=counts, checked=t.checked, total=t.total,
exempt=t.exempt, truncated=t.truncated))
passed = not any(f.severity == Severity.ERROR for f in findings)
- return GateReport(gate=GATE, passed=passed, findings=findings, duration_ms=duration_ms)
+ return GateReport(gate=GATE, passed=passed, findings=findings)
# --------------------------------------------------------------------------- plan-aware checks
@@ -593,15 +592,6 @@ def setting_text(plan: Any) -> str:
return " ".join(str(getattr(plan, k, "") or "") for k in ("setting", "environment", "title"))
-def check_placement(ws: Workspace, *, indoor: bool | None = None, force_probe: bool = False, timeout_s: float = 60.0) -> GateReport:
- """Gate ``scene_placement`` for a workspace (census of the last build, or a fresh probe)."""
- t0 = time.time()
- census = placement_census(ws, force_probe=force_probe, timeout_s=timeout_s)
- if indoor is None:
- indoor = is_interior(read_json_or_none(ws.plan_path))
- return placement_findings(census.get("placement") or {}, indoor=indoor, duration_ms=int((time.time() - t0) * 1000))
-
-
def placement_gate_safe(census: dict[str, Any] | None, *, plan: Any = None,
layouts: dict[str, Any] | None = None, unavailable: Sequence[str] = ()) -> GateReport | None:
"""Round-gate entry: ``None`` when the census has no placement table (scene did not
diff --git a/harness/codeverse/spatial/sections.py b/harness/codeverse/spatial/sections.py
index 28f94492..9b47c35d 100644
--- a/harness/codeverse/spatial/sections.py
+++ b/harness/codeverse/spatial/sections.py
@@ -5,9 +5,6 @@ projects the resulting loops onto the two remaining axes and rasterises them
with PIL — one colour per part, a scale bar, axis labels and a legend. The
numbers use shapely (even-odd fill) so a hollow tube reports its hollow ratio.
-``slices_sheet`` tiles ``n`` evenly spaced sections along an axis into one grid
-image — the cheap way to inspect interiors along a whole object.
-
``judge_slices`` (D48) renders the judge's conditional interior evidence: two
vertical centre slices with per-part fills, where ONLY connectivity-gate-ERROR
part pairs get a red hatch, written with a typed :class:`SliceManifest`.
@@ -27,7 +24,7 @@ from pydantic import BaseModel, Field
from codeverse.spatial.measure import GlbLoadError, merged_mesh, solid_parts
from codeverse.spatial.registry import Observation
-from codeverse.spatial.sheet import contact_sheet, load_font
+from codeverse.spatial.sheet import load_font
_AXIS_INDEX = {"x": 0, "y": 1, "z": 2}
#: which two axes are drawn (horizontal, vertical) for a slicing axis
@@ -113,7 +110,7 @@ def compute_section(parts: dict[str, trimesh.Trimesh], axis: str, at_m: float) -
return data
-def draw_section(data: SectionData, out_png: Path, *, size: int = 512, title: str = "") -> Path:
+def draw_section(data: SectionData, out_png: Path, *, size: int = 512) -> Path:
"""Rasterise ``data`` to a labelled PNG (plane axes, scale bar, legend)."""
h_ax, v_ax = _PLANE_AXES[data.axis]
hi, vi = _AXIS_INDEX[h_ax], _AXIS_INDEX[v_ax]
@@ -156,7 +153,7 @@ def draw_section(data: SectionData, out_png: Path, *, size: int = 512, title: st
if len(legend) > 12:
d.text((20, y), f"… +{len(legend) - 12} parts", fill=(20, 20, 20), font=small)
# title + axes
- ttl = title or f"section {data.axis} = {data.at_m:.3f} m"
+ ttl = f"section {data.axis} = {data.at_m:.3f} m"
d.text((size - 6 - d.textlength(ttl, font=font), 6), ttl, fill=(0, 0, 0), font=font)
d.text((size - 16, size / 2 - 8), h_ax, fill=(120, 0, 0), font=font)
d.text((size / 2 - 4, 20), v_ax, fill=(0, 90, 0), font=font)
@@ -231,37 +228,6 @@ def cross_section(
return Observation(ok=True, text=text, numbers=numbers, images=[str(out)])
-def slices_sheet(glb: Path | str, axis: str, n: int, out_png: Path | str, *, parts: Sequence[str] | None = None, tile: int = 320) -> Observation:
- """``n`` evenly spaced sections along ``axis`` tiled into one labelled grid
- (``sheet.contact_sheet``; each tile carries its own title, so no sheet labels)."""
- axis = axis.lower()
- if axis not in _AXIS_INDEX:
- return Observation.error(f"axis must be one of x|y|z, got {axis!r}")
- n = int(max(1, min(n, 12)))
- try:
- sel = _load_parts(glb, parts)
- except (GlbLoadError, KeyError) as e:
- return Observation.error(f"slices_sheet: {e}")
- if not sel:
- return Observation.error("slices_sheet: no mesh parts in the GLB")
- out = Path(out_png)
- numbers: dict[str, object] = {"axis": axis, "n": n, "slices": []}
- tiles: list[tuple[str, Path]] = []
- for i in range(n):
- frac = (i + 0.5) / n
- at_m = _resolve_at(sel, axis, frac, False)
- data = compute_section(sel, axis, at_m)
- tmp = out.with_name(f"{out.stem}_{i}.png")
- tiles.append((f"{axis}={at_m:.3f}", draw_section(data, tmp, size=tile, title=f"{axis}={at_m:.3f} m ({frac:.2f})")))
- numbers["slices"].append({"at_m": round(at_m, 4), "n_loops": data.n_loops, # type: ignore[attr-defined]
- "area_m2": round(data.total_area_m2, 6), "hollow_ratio": round(data.hollow_ratio, 3)})
- contact_sheet(tiles, out, cols=min(n, 4), tile=tile, label=False)
- for _, tmp in tiles:
- tmp.unlink(missing_ok=True)
- summary = "; ".join(f"{s['at_m']:.3f}m: {s['n_loops']} loops, hollow {s['hollow_ratio']:.0%}" for s in numbers["slices"]) # type: ignore[index]
- return Observation(ok=True, text=f"{n} sections along {axis}: {summary}", numbers=numbers, images=[str(out)])
-
-
# ===================================================================== judge slices (D48)
#: the two centre planes the judge slice channel cuts (name → plane-normal axis index,
#: horizontal axis index, human title, axes note). Vertical is always Y (up).
diff --git a/harness/codeverse/spatial/tools.py b/harness/codeverse/spatial/tools.py
index c80bcf45..6b6c7a6d 100644
--- a/harness/codeverse/spatial/tools.py
+++ b/harness/codeverse/spatial/tools.py
@@ -365,13 +365,13 @@ class RenderViewsArgs(BaseModel):
size: int = Field(default=512, ge=128, le=_MAX_SIZE, description="image size in px (square)")
-def _render(ctx: ToolContext, tool_name: str, *, views: list[str], mode: str, isolate: list[str], explode: float, size: int, sheet: bool = True, note: str = "") -> Observation:
+def _render(ctx: ToolContext, *, views: list[str], mode: str, isolate: list[str], explode: float, size: int, note: str = "") -> Observation:
# a missing renderer raises ToolUnavailable → ToolDef.call turns it into the
# "tool <name> unavailable" Observation (one error boundary for every tool)
glb = glb_path(ctx)
presets = resolve_views(views)
check_mode(mode)
- rs = cached_render_glb(ctx, glb, views=presets, mode=mode, size=size, isolate=isolate or None, explode=explode, sheet=sheet)
+ rs = cached_render_glb(ctx, glb, views=presets, mode=mode, size=size, isolate=isolate or None, explode=explode)
return render_observation(rs, ctx.workspace.root, note=note)
@@ -379,7 +379,7 @@ def _render(ctx: ToolContext, tool_name: str, *, views: list[str], mode: str, is
tracks=_OBJECT_TRACKS, cost_hint="slow")
def render_views(ctx: ToolContext, args: RenderViewsArgs) -> Observation:
note = f"{args.mode} render" + (f", isolate={args.isolate}" if args.isolate else "") + (f", explode={args.explode:g}" if args.explode else "")
- return _render(ctx, "render_views", views=args.views, mode=args.mode, isolate=args.isolate, explode=args.explode, size=args.size, note=note)
+ return _render(ctx, views=args.views, mode=args.mode, isolate=args.isolate, explode=args.explode, size=args.size, note=note)
class RenderSheetArgs(BaseModel):
@@ -389,7 +389,7 @@ class RenderSheetArgs(BaseModel):
@tool("render_sheet", RenderSheetArgs, "One labelled 14-view contact sheet of the built object (all canonical views).",
tracks=_OBJECT_TRACKS, cost_hint="slow")
def render_sheet(ctx: ToolContext, args: RenderSheetArgs) -> Observation:
- obs = _render(ctx, "render_sheet", views=[v.name for v in OBJECT_VIEWS], mode=args.mode, isolate=[], explode=0.0, size=512,
+ obs = _render(ctx, views=[v.name for v in OBJECT_VIEWS], mode=args.mode, isolate=[], explode=0.0, size=512,
note=f"{args.mode} 14-view sheet")
if obs.ok and obs.images:
obs.images = obs.images[:1] # the sheet alone is the deliverable here
@@ -413,7 +413,7 @@ def isolate(ctx: ToolContext, args: IsolateArgs) -> Observation:
if args.part not in names:
raise ToolUsageError(f"unknown part {args.part!r}; available: {names}", f"isolate(part='{names[0] if names else 'Seat'}')")
row = m.model_copy(update={"parts": [p for p in m.parts if p.name == args.part]})
- obs = _render(ctx, "isolate", views=args.views, mode="shaded", isolate=[args.part], explode=0.0, size=512,
+ obs = _render(ctx, views=args.views, mode="shaded", isolate=[args.part], explode=0.0, size=512,
note=f"isolated part '{args.part}'")
if not obs.ok and not obs.images:
return obs
@@ -660,7 +660,7 @@ def _runtime(ctx: ToolContext):
return get_runtime(lang)
-def _run_build(ctx: ToolContext, *, times: list[float], preview: bool, width: int = 0, height: int = 0) -> tuple[Observation | None, BuildResult | None, list[str]]:
+def _run_build(ctx: ToolContext, *, times: list[float], width: int = 0, height: int = 0) -> tuple[Observation | None, BuildResult | None, list[str]]:
"""Lint → build; returns (error observation | None, build, lint warnings).
A missing runtime raises ToolUnavailable — ``ToolDef.call`` reports it.
@@ -670,7 +670,7 @@ def _run_build(ctx: ToolContext, *, times: list[float], preview: bool, width: in
refused, warns = _lint_gate(ctx, rt, verb="rendering")
if refused is not None:
return refused, None, warns
- kw = {"times": times, "preview": preview}
+ kw = {"times": times, "preview": False}
if width and height:
kw.update(width=width, height=height)
br: BuildResult = rt.build(ws, **kw)
@@ -680,20 +680,15 @@ def _run_build(ctx: ToolContext, *, times: list[float], preview: bool, width: in
return None, br, warns
-def _stats_text(ctx: ToolContext) -> tuple[str, dict]:
- """Frame stats + gate findings as (text, numbers) — shared formatter."""
- lines, numbers, _ok = gl_metrics_summary(ctx.workspace)
- return "\n".join(lines), numbers
-
-
@tool("gl_probe", GlProbeArgs, "Compile the shader / import the program and render ONE frame (default t=1 s): errors with src line numbers, or the frame + its stats. Call after every edit.",
languages=GRAPHICS_LANGS, cost_hint="slow")
def gl_probe(ctx: ToolContext, args: GlProbeArgs) -> Observation:
- err, br, warns = _run_build(ctx, times=[args.t], preview=False)
+ err, br, warns = _run_build(ctx, times=[args.t])
if err is not None:
return err
assert br is not None
- text, numbers = _stats_text(ctx)
+ stats, numbers, _ok = gl_metrics_summary(ctx.workspace)
+ text = "\n".join(stats)
frames = sorted(Path(br.extra_paths["frames"]).glob("f*_t*.png")) if br.extra_paths.get("frames") else []
lines = _gl_gate_verdict(numbers) + [f"PROBE OK ({br.duration_ms} ms, {br.census.get('renderer', 'GL')}) — frame at t={args.t:g}s", text]
if warns:
@@ -708,11 +703,12 @@ def gl_probe(ctx: ToolContext, args: GlProbeArgs) -> Observation:
def gl_frames(ctx: ToolContext, args: GlFramesArgs) -> Observation:
if not args.times or len(args.times) > MAX_FRAMES:
raise ToolUsageError(f"times must hold 1..{MAX_FRAMES} values", "gl_frames(times=[0, 1, 2.5, 4, 6])")
- err, br, warns = _run_build(ctx, times=sorted(set(float(t) for t in args.times)), preview=False, width=args.width, height=args.height)
+ err, br, warns = _run_build(ctx, times=sorted(set(float(t) for t in args.times)), width=args.width, height=args.height)
if err is not None:
return err
assert br is not None
- text, numbers = _stats_text(ctx)
+ stats, numbers, _ok = gl_metrics_summary(ctx.workspace)
+ text = "\n".join(stats)
out_dir = tool_out_dir(ctx, f"gl_{int(time.time()) % 100000}")
images: list[str] = []
sheet = br.extra_paths.get("sheet")
diff --git a/harness/docs/INTERFACES.md b/harness/docs/INTERFACES.md
index 07beb254..dc029150 100644
--- a/harness/docs/INTERFACES.md
+++ b/harness/docs/INTERFACES.md
@@ -253,7 +253,7 @@ render_glb(glb, out_dir, *, views=None, mode="shaded|wire|normals|silhouette|cla
timeout_s=None, use_cache=True) -> RenderSet
from codeverse.spatial.render_scene import render_scene
render_scene(ws, out_dir, *, cameras=None, orbit=True, times=(0.0, 1.5), width=1024, height=576, sheet=True,
- bounds=None, sheet_max_views=10) -> RenderSet
+ bounds=None) -> RenderSet
# Δ bounds default from ws plan.json → orbit rig frustum-fits the CONTENT box (not ground/sky);
# contact sheet = judge subset only; views.json entries get judge: true|false
from codeverse.spatial.render_scene import select_judge_views, JUDGE_MAX_VIEWS, read_metrics, plan_bounds
@@ -298,8 +298,8 @@ from codeverse.spatial.contract import check_contract # frame of fix h
from codeverse.spatial.measure import measure_glb, world_transform, node_name_findings # (Δ 2026-08-30) world frames are composed
# by walking the graph's edge matrices (trimesh's get() dropped a root pivot's rotation); a GLB with duplicate / unnamed nodes
# lands a finding in Measurement.extra["findings"] — trimesh re-parents renamed nodes and the numbers are approximate
-from codeverse.spatial.scene_placement import check_placement, placement_findings, placement_gate_safe, placement_census, placement_table_text
-check_placement(ws, *, indoor=None, force_probe=False) -> GateReport # gate "scene_placement"; data.kind ∈ floating | sunken |
+from codeverse.spatial.scene_placement import placement_findings, placement_gate_safe, placement_census, placement_table_text
+placement_findings(table, *, indoor=False) -> GateReport # gate "scene_placement"; data.kind ∈ floating | sunken |
# unsupported | interpenetration | summary | probe_failed; target "Zone/Asset" (routes to src/zones/<zone>.js);
# messages carry the scene_v1 floating_part cap words; reads artifacts/census.json["placement"] (host_placement.mjs)
placement_gate_safe(census, *, plan=None, layouts=None, unavailable=()) -> GateReport | None # round gate: None without a table, WARN on failure, never raises; `unavailable` = assets the stage could not build (not "missing planned contents")
diff --git a/harness/runtime_js/README.md b/harness/runtime_js/README.md
index f7785676..32835563 100644
--- a/harness/runtime_js/README.md
+++ b/harness/runtime_js/README.md
@@ -65,7 +65,7 @@ export_glb.mjs node --import lib/resolve_three.mjs export_glb.mjs --ws <w
{ok:false,error:{type,message,file,line,frames,part?}}
render_glb.mjs --glb --out --views '[{name,azimuth,elevation}]' [--mode shaded|wire|normals|silhouette|clay]
[--width --height] [--isolate A,B] [--explode 0.3] [--background studio|white|transparent]
- [--anim-time t] [--gpu auto|on|off] [--shadow 0|1] [--fill 0.85]
+ [--anim-time t] [--gpu auto|on|off] [--shadow 0|1]
writes view_<name>.png + views.json; last stdout line = JSON record. Thin entry:
args/JSON protocol from lib/cli.mjs, browser + server from lib/host_env.mjs,
browser release from lib/host_page.mjs, everything visual from lib/browser/
diff --git a/harness/runtime_js/ablate_scene.mjs b/harness/runtime_js/ablate_scene.mjs
index 1210d6bf..dd540fe0 100644
--- a/harness/runtime_js/ablate_scene.mjs
+++ b/harness/runtime_js/ablate_scene.mjs
@@ -27,7 +27,7 @@ const args = parseCli({
ws: {}, out: { default: '' }, cameras: { default: 'authored' }, t: { default: '1.5' },
width: { default: '512' }, height: { default: '288' }, 'max-materials': { default: '8' },
frames: { type: 'boolean', default: false }, gpu: { default: process.env.CV3D_RENDER_GPU || 'auto' },
- 'timeout-ms': { default: '120000' }, 'create-timeout-ms': { default: '' },
+ 'timeout-ms': { default: '120000' },
});
async function main() {
@@ -44,7 +44,7 @@ async function main() {
try {
host = await openHost(args.ws, {
width, height, gpu: args.gpu,
- createSceneTimeoutMs: createTimeoutMs(args['create-timeout-ms'], timeoutMs),
+ createSceneTimeoutMs: createTimeoutMs(timeoutMs),
});
} catch (e) {
return fail(`host failed: ${e.message}`);
diff --git a/harness/runtime_js/check_shaders.mjs b/harness/runtime_js/check_shaders.mjs
index ecc99dec..92882034 100644
--- a/harness/runtime_js/check_shaders.mjs
+++ b/harness/runtime_js/check_shaders.mjs
@@ -24,7 +24,7 @@ import { compileIntoReport, staticShaderReport } from './lib/shader_report.mjs';
const args = parseCli({
ws: {}, module: {}, out: {}, gpu: { default: process.env.CV3D_RENDER_GPU || 'auto' },
- 'timeout-ms': { default: '90000' }, 'no-compile': { type: 'boolean', default: false },
+ 'timeout-ms': { default: '90000' },
});
async function main() {
@@ -35,16 +35,14 @@ async function main() {
const { report, files } = staticShaderReport(ws, args.module || null);
const { errors, warnings } = report;
- if (!args['no-compile']) {
- let host = null;
- try {
- host = await openHost(ws, { width: 256, height: 144, gpu: args.gpu });
- await compileIntoReport(report, files, host);
- await host.close();
- } catch (e) {
- if (host) await host.close().catch(() => {});
- return fail(`compile preflight failed: ${e.message}`, { errors, warnings });
- }
+ let host = null;
+ try {
+ host = await openHost(ws, { width: 256, height: 144, gpu: args.gpu });
+ await compileIntoReport(report, files, host);
+ await host.close();
+ } catch (e) {
+ if (host) await host.close().catch(() => {});
+ return fail(`compile preflight failed: ${e.message}`, { errors, warnings });
}
report.ok = errors.length === 0;
report.duration_ms = Date.now() - t0;
diff --git a/harness/runtime_js/lib/browser/studio.js b/harness/runtime_js/lib/browser/studio.js
index 474977f4..9bd5e413 100644
--- a/harness/runtime_js/lib/browser/studio.js
+++ b/harness/runtime_js/lib/browser/studio.js
@@ -89,12 +89,6 @@ function environmentTexture(renderer) {
return _envTexture;
}
-/** Test seam: drop the cached PMREM texture (a fresh renderer needs a fresh env). */
-export function resetStudioCache() {
- if (_envTexture) _envTexture.dispose();
- _envTexture = null;
-}
-
function addContactShadow(scene, center, box, radius) {
const size = box.getSize(new THREE.Vector3());
const spread = Math.max(size.x, size.z, radius * 0.5) * CONTACT_SPREAD;
diff --git a/harness/runtime_js/lib/browser/studio_env.js b/harness/runtime_js/lib/browser/studio_env.js
index fd4f0925..bffc2927 100644
--- a/harness/runtime_js/lib/browser/studio_env.js
+++ b/harness/runtime_js/lib/browser/studio_env.js
@@ -151,5 +151,3 @@ export function contactShadowTexture(size = 128, { power = 2.4 } = {}) {
tex.needsUpdate = true;
return tex;
}
-
-export const ENV_CONSTANTS = { DOME_STOPS, SOFTBOXES };
diff --git a/harness/runtime_js/lib/cli.mjs b/harness/runtime_js/lib/cli.mjs
index ddef386f..6cefba7a 100644
--- a/harness/runtime_js/lib/cli.mjs
+++ b/harness/runtime_js/lib/cli.mjs
@@ -12,19 +12,6 @@ export function parseCli(spec, argv = process.argv.slice(2)) {
return values;
}
-/**
- * Boolean env switch with a default: '0'/'off'/'false'/'no' are OFF,
- * '1'/'on'/'true'/'yes' are ON, anything else (including unset) keeps `fallback`.
- * THE spelling for every driver env flag, so `CV3D_POST=0` reads the same way
- * `CV3D_RENDER_GPU=off` does.
- */
-export function envFlag(name, fallback) {
- const raw = String(process.env[name] ?? '').trim().toLowerCase();
- if (raw === '0' || raw === 'off' || raw === 'false' || raw === 'no') return false;
- if (raw === '1' || raw === 'on' || raw === 'true' || raw === 'yes') return true;
- return fallback;
-}
-
/**
* Print the final JSON summary as the LAST stdout line and exit.
*
diff --git a/harness/runtime_js/lib/host_coverage.mjs b/harness/runtime_js/lib/host_coverage.mjs
index 10ea4dee..796150aa 100644
--- a/harness/runtime_js/lib/host_coverage.mjs
+++ b/harness/runtime_js/lib/host_coverage.mjs
@@ -14,8 +14,6 @@
import { classifyBackdrop, nonSolid } from './backdrop.mjs';
import { sampleFrame } from './host_metrics.mjs';
-export { classifyBackdrop }; // re-export: this module used to own the classifier
-
function collectDrawables(scene, THREE, contentSpan) {
const out = [];
diff --git a/harness/runtime_js/lib/host_page.mjs b/harness/runtime_js/lib/host_page.mjs
index 97a4290b..2ddc5520 100644
--- a/harness/runtime_js/lib/host_page.mjs
+++ b/harness/runtime_js/lib/host_page.mjs
@@ -26,14 +26,11 @@ function clean(s) {
}
/**
- * createScene() boot timeout for a driver: an explicit --create-timeout-ms
- * wins, else 60% of the driver budget capped at 20 s — always below the
- * watchdog so a hung boot is an agent-attributed scene failure (exit 1 with
- * boot.stage = 'createScene'), never a watchdog kill (exit 3).
+ * createScene() boot timeout for a driver: 60% of the driver budget capped at
+ * 20 s — always below the watchdog so a hung boot is an agent-attributed scene
+ * failure (exit 1 with boot.stage = 'createScene'), never a watchdog kill (exit 3).
*/
-export function createTimeoutMs(flagValue, driverTimeoutMs) {
- const flag = parseInt(flagValue || '', 10);
- if (Number.isFinite(flag) && flag > 0) return flag;
+export function createTimeoutMs(driverTimeoutMs) {
return Math.min(20000, Math.max(1000, Math.round(0.6 * driverTimeoutMs)));
}
diff --git a/harness/runtime_js/lib/orbit.mjs b/harness/runtime_js/lib/orbit.mjs
index 4b0dcc3b..45eb2438 100644
--- a/harness/runtime_js/lib/orbit.mjs
+++ b/harness/runtime_js/lib/orbit.mjs
@@ -154,7 +154,7 @@ export function fitOverviewCamera(bbox, { azimuth = 45, elevation = 30, fov = 50
* fitOverviewCamera above 20°, fitZoneCamera at eye level.
* @returns {Array<{name, position, lookAt, fov, kind:'orbit'}>}
*/
-export function fitOrbitCameras(bbox, views, { fov = 50, aspect = 16 / 9, groundY = null, margin = 1.05, noFog = true } = {}) {
+export function fitOrbitCameras(bbox, views, { fov = 50, aspect = 16 / 9, groundY = null, margin = 1.05 } = {}) {
if (!bbox || !bbox.min || !bbox.max) return [];
const out = [];
for (const v of views) {
@@ -162,7 +162,7 @@ export function fitOrbitCameras(bbox, views, { fov = 50, aspect = 16 / 9, ground
const fit = el <= 20
? fitZoneCamera(bbox, { azimuth: v.azimuth, floor: groundY, fov })
: fitOverviewCamera(bbox, { azimuth: v.azimuth, elevation: el, fov, aspect, groundY, margin });
- out.push({ name: v.name, ...fit, kind: 'orbit', noFog: !!noFog && el > 20 });
+ out.push({ name: v.name, ...fit, kind: 'orbit', noFog: el > 20 });
}
return out;
}
diff --git a/harness/runtime_js/lib/scene_host.mjs b/harness/runtime_js/lib/scene_host.mjs
index 2d578501..bf158868 100644
--- a/harness/runtime_js/lib/scene_host.mjs
+++ b/harness/runtime_js/lib/scene_host.mjs
@@ -708,18 +708,9 @@ window.__c3v = {
placement,
ablation,
fps,
- setViewport(w, h) {
- state.width = w; state.height = h;
- state.renderer.setSize(w, h, false);
- if (state.post) state.post.setSize(w, h);
- },
post: () => (state.postInfo ? { ...state.postInfo } : null),
shaderErrors: () => state.shaderErrors.slice(),
- loadErrors: () => state.loadErrors.slice(),
updateErrors: () => state.updateErrors.slice(),
cameras: () => state.cameras.slice(),
- simTime: () => state.simTime,
- THREE,
- get scene() { return state.scene; },
};
window.__c3v_ready = true;
diff --git a/harness/runtime_js/probe_scene.mjs b/harness/runtime_js/probe_scene.mjs
index f09219cf..f3fe7bec 100644
--- a/harness/runtime_js/probe_scene.mjs
+++ b/harness/runtime_js/probe_scene.mjs
@@ -33,11 +33,10 @@ const args = parseCli({
'auto-exposure': { type: 'boolean', default: false },
// The probe is a 320x180 GEOMETRY instrument, never a judged picture: it runs raw
// so its shader report names the scene's own programs and nothing of ours. The
- // flags parse (drivers share a switch list) but only `--post` turns the chain on.
+ // flag parses (drivers share a switch list) and changes nothing.
'no-post': { type: 'boolean', default: false },
- post: { type: 'boolean', default: false },
ws: {}, out: {}, gpu: { default: process.env.CV3D_RENDER_GPU || 'auto' }, 'timeout-ms': { default: '60000' },
- 'create-timeout-ms': { default: '' }, 'update-steps': { default: '10' }, scene: { default: 'src/scene.js' },
+ scene: { default: 'src/scene.js' },
compile: { type: 'boolean', default: false }, 'shaders-out': { default: '' }, 'sun-azimuth': { default: '' },
});
@@ -63,11 +62,11 @@ async function main() {
try {
host = await openHost(args.ws, {
width: 320, height: 180, gpu: args.gpu, sceneRel: args.scene.replace(/^\.?\//, ''),
- createSceneTimeoutMs: createTimeoutMs(args['create-timeout-ms'], timeoutMs),
+ createSceneTimeoutMs: createTimeoutMs(timeoutMs),
settle: !args['no-settle'],
cameraRepair: !!args['camera-repair'],
autoExposure: !!args['auto-exposure'],
- post: !!args.post && !args['no-post'],
+ post: false,
});
} catch (e) {
return fail(`host failed: ${e.message}`);
@@ -85,7 +84,6 @@ async function main() {
result.census.placement = { error: String((e && e.message) || e).slice(0, 400) };
}
// exercise update() for a few fixed steps and one tiny render (lazy programs compile)
- const steps = parseInt(args['update-steps'], 10);
const upd = await page.evaluate((n) => {
try {
const cam = window.__c3v.cameras()[0];
@@ -94,7 +92,7 @@ async function main() {
} catch (e) {
return { ok: false, error: String((e && e.stack) || e).slice(0, 800) };
}
- }, steps);
+ }, 10);
result.update_ok = upd.ok;
result.update_error = upd.error || '';
result.first_render_ms = upd.ms;
diff --git a/harness/runtime_js/render_glb.mjs b/harness/runtime_js/render_glb.mjs
index 31c13e30..8d2aef4a 100644
--- a/harness/runtime_js/render_glb.mjs
+++ b/harness/runtime_js/render_glb.mjs
@@ -4,7 +4,7 @@
// node runtime_js/render_glb.mjs --glb <path> --out <dir> --views '<json [{name,azimuth,elevation}]>'
// [--mode shaded|wire|normals|silhouette|clay] [--width 768] [--height 768]
// [--isolate Name1,Name2] [--explode 0.3] [--background studio|white|transparent]
-// [--anim-time t] [--gpu auto|on|off] [--shadow 1|0] [--fill 0.90] [--timeout-s 240]
+// [--anim-time t] [--gpu auto|on|off] [--shadow 1|0] [--timeout-s 240]
//
// Writes <out>/view_<name>.png for every view + <out>/views.json, and prints one JSON
// line last on stdout: {ok, renderer, gpu, views:[{name,path,camera_position,look_at,fov,...}],
@@ -28,7 +28,7 @@ function config() {
glb: {}, out: {}, views: {},
mode: { default: 'shaded' }, width: { default: '768' }, height: { default: '768' },
isolate: { default: '' }, explode: { default: '0' }, background: { default: 'studio' },
- 'anim-time': {}, gpu: { default: 'auto' }, shadow: { default: '1' }, fill: { default: '0.90' },
+ 'anim-time': {}, gpu: { default: 'auto' }, shadow: { default: '1' },
'timeout-s': { default: '240' },
});
if (!values.glb || !values.out || !values.views) throw new Error('--glb, --out and --views are required');
@@ -52,7 +52,6 @@ function config() {
animTime: values['anim-time'] != null ? Number(values['anim-time']) : null,
gpu: values.gpu,
shadow: values.shadow !== '0',
- fill: Number(values.fill) || 0.90,
timeoutMs: Number(values['timeout-s']) * 1000,
};
}
diff --git a/harness/runtime_js/render_scene.mjs b/harness/runtime_js/render_scene.mjs
index d89509e6..6ad5a7af 100644
--- a/harness/runtime_js/render_scene.mjs
+++ b/harness/runtime_js/render_scene.mjs
@@ -16,7 +16,7 @@
*/
import path from 'node:path';
-import { armWatchdog, dataUrlToPng, ensureDir, envFlag, fail, finish, parseCli, readJsonArg, safeName, writeJson } from './lib/cli.mjs';
+import { armWatchdog, dataUrlToPng, ensureDir, fail, finish, parseCli, readJsonArg, safeName, writeJson } from './lib/cli.mjs';
import { createTimeoutMs, errorSummary, openHost } from './lib/host_page.mjs';
import { fitOrbitCameras, framingBox } from './lib/orbit.mjs';
@@ -24,15 +24,14 @@ const args = parseCli({
'no-settle': { type: 'boolean', default: false },
'camera-repair': { type: 'boolean', default: false },
'auto-exposure': { type: 'boolean', default: false },
- // post chain (GTAO + soft bloom + grade): ON for scene pictures, `--no-post` /
- // CV3D_POST=0 to render raw. Object renders never come through here.
+ // post chain (GTAO + soft bloom + grade): ON for scene pictures, `--no-post` (python
+ // emits it for CV3D_POST=0) to render raw. Object renders never come through here.
'no-post': { type: 'boolean', default: false },
'post-options': { default: '' },
ws: {}, out: {}, cameras: { default: 'authored' }, 'orbit-views': { default: 'none' }, bounds: { default: 'none' },
times: { default: '0,1.5' }, width: { default: '1024' }, height: { default: '576' },
gpu: { default: process.env.CV3D_RENDER_GPU || 'auto' }, 'fps-seconds': { default: '2' },
- 'timeout-ms': { default: '240000' }, 'create-timeout-ms': { default: '' }, 'log-depth': { type: 'boolean', default: false },
- 'orbit-fog': { type: 'boolean', default: false },
+ 'timeout-ms': { default: '240000' }, 'log-depth': { type: 'boolean', default: false },
});
function tag(t) {
@@ -60,11 +59,11 @@ async function main() {
try {
host = await openHost(args.ws, {
width, height, gpu: args.gpu, logDepth: args['log-depth'],
- createSceneTimeoutMs: createTimeoutMs(args['create-timeout-ms'], timeoutMs),
+ createSceneTimeoutMs: createTimeoutMs(timeoutMs),
settle: !args['no-settle'],
cameraRepair: !!args['camera-repair'],
autoExposure: !!args['auto-exposure'],
- post: args['no-post'] ? false : envFlag('CV3D_POST', true),
+ post: !args['no-post'],
postOptions: readJsonArg(args['post-options'], 'post-options'),
});
} catch (e) {
@@ -90,7 +89,7 @@ async function main() {
const bounds = args.bounds && args.bounds !== 'none' ? readJsonArg(args.bounds, 'bounds') : null;
const bbox = framingBox(metrics.census, bounds); // content only: never the ground plane / sky dome
metrics.framing_bbox = bbox;
- cams.push(...fitOrbitCameras(bbox, views, { aspect: width / height, groundY: metrics.census.ground_y, noFog: !args['orbit-fog'] }));
+ cams.push(...fitOrbitCameras(bbox, views, { aspect: width / height, groundY: metrics.census.ground_y }));
}
// camera names become filenames: reject path tricks before composing any output path
for (const c of cams) c.name = safeName(c.name, 'camera name');
diff --git a/harness/tests/scene_gates/test_placement.py b/harness/tests/scene_gates/test_placement.py
index 84d27a05..1c6eb664 100644
--- a/harness/tests/scene_gates/test_placement.py
+++ b/harness/tests/scene_gates/test_placement.py
@@ -16,7 +16,6 @@ from codeverse.judges.rubrics import apply_caps, load_rubric
from codeverse.orchestrator import build_refine_instructions
from codeverse.spatial.scene_placement import (
GATE,
- check_placement,
infer_indoor,
placement_findings,
placement_gate_safe,
@@ -164,15 +163,16 @@ def test_pipeline_gates_append_placement_after_census_and_never_raise():
def test_check_placement_reads_the_last_census_and_the_table_text(tmp_path):
+ from codeverse.spatial.registry import ToolContext, get_tool
from codeverse.workspace import Workspace
ws = Workspace(tmp_path / "run").create()
ws.artifacts.mkdir(parents=True, exist_ok=True)
table = _table(_row("Lantern", gap=0.3), _row("Rock", sunk=0.3, into="Terrain", h=1.0))
(ws.artifacts / "census.json").write_text(json.dumps({"totals": {}, "placement": table}))
- ws.plan_path.write_text(json.dumps({"setting": "a cabin interior", "environment": "", "title": "x"}))
- r = check_placement(ws)
- assert not r.passed and "indoor tolerance 2 cm" in r.findings[0].message
+ ws.plan_path.write_text(_contract_plan().model_copy(update={"setting": "a cabin interior"}).model_dump_json())
+ obs = get_tool("check_placement").call(ToolContext(workspace=ws, language=Language.SCENE_THREEJS.value), {})
+ assert not obs.ok and "indoor tolerance 2 cm" in obs.text
text = placement_table_text(table)
assert "Yard/Lantern | +0.300 | Ground | 0.000 | - | - | -" in text and "Yard/Rock | +0.000 | Ground | 0.300 | Terrain" in text
diff --git a/harness/tests/scene_runtime/test_ablation.py b/harness/tests/scene_runtime/test_ablation.py
index 80be23ca..8ab88969 100644
--- a/harness/tests/scene_runtime/test_ablation.py
+++ b/harness/tests/scene_runtime/test_ablation.py
@@ -310,7 +310,7 @@ def test_summary_names_the_shader_that_is_not_in_the_frame() -> None:
r = AblationReport(
ok=True, custom_materials=2, per_material_measured=True,
max_changed_frac=0.21, content_changed_frac=0.21, per_material_cameras=["front"],
- cameras=[{"camera": "front", "changed_frac": 0.21, "mean_abs": 0.03, "pixels": 100}],
+ cameras=[{"camera": "front", "changed_frac": 0.21}],
materials=[{"material": "rain", "kind": "ShaderMaterial", "changed_frac": 0.21, "meshes": 1, "camera": "front"},
{"material": "glow", "kind": "onBeforeCompile", "changed_frac": 0.0, "meshes": 2}],
)
diff --git a/harness/tests/scene_runtime/test_render_scene.py b/harness/tests/scene_runtime/test_render_scene.py
index 90492399..0d57611d 100644
--- a/harness/tests/scene_runtime/test_render_scene.py
+++ b/harness/tests/scene_runtime/test_render_scene.py
@@ -210,15 +210,14 @@ def test_request_failure_line_filters_phantom_aborts():
" responded: requestFailureLine('http://x/assets/a.glb', 'http://x', true, 'net::ERR_FAILED'),\n"
" real: requestFailureLine('http://x/assets/a.glb', 'http://x', false, 'net::ERR_CONNECTION_REFUSED'),\n"
" offsite: requestFailureLine('http://cdn/other.js', 'http://x', false, 'net::ERR_FAILED'),\n"
- " cs_default: createTimeoutMs('', 240000),\n"
- " cs_flag: createTimeoutMs('3000', 240000),\n"
- " cs_small_budget: createTimeoutMs('', 10000),\n"
+ " cs_default: createTimeoutMs(240000),\n"
+ " cs_small_budget: createTimeoutMs(10000),\n"
"}));\n"
)
assert res["phantom"] is None and res["aborted"] is None and res["responded"] is None
assert res["real"] == "request failed: /assets/a.glb (net::ERR_CONNECTION_REFUSED)"
assert res["offsite"] is None
- assert res["cs_default"] == 20000 and res["cs_flag"] == 3000 and res["cs_small_budget"] == 6000
+ assert res["cs_default"] == 20000 and res["cs_small_budget"] == 6000
# ---------------------------------------------------------------- env flags (review-3 S4)
diff --git a/harness/tests/spatial_tools/test_sections.py b/harness/tests/spatial_tools/test_sections.py
index 30676f5f..c1ce2461 100644
--- a/harness/tests/spatial_tools/test_sections.py
+++ b/harness/tests/spatial_tools/test_sections.py
@@ -6,7 +6,7 @@ import pytest
import trimesh
from PIL import Image
-from codeverse.spatial.sections import SliceManifest, cross_section, judge_slices, slices_sheet
+from codeverse.spatial.sections import SliceManifest, cross_section, judge_slices
def test_cross_section_stool(stool_glb: Path, tmp_path: Path) -> None:
@@ -40,13 +40,6 @@ def test_bad_inputs(stool_glb: Path, tmp_path: Path) -> None:
assert not cross_section(tmp_path / "missing.glb", "y", 0.5, tmp_path / "x.png").ok
-def test_slices_sheet(stool_glb: Path, tmp_path: Path) -> None:
- out = tmp_path / "slices.png"
- o = slices_sheet(stool_glb, "y", 5, out)
- assert o.ok and out.is_file() and len(o.numbers["slices"]) == 5
- assert all(s["n_loops"] == 4 for s in o.numbers["slices"][:4])
-
-
# ===================================================================== judge slices (D48)
def _two_boxes(path: Path, *, overlap_x: float = 0.05, dy: float = 0.0) -> Path:
"""Box A (0.3³ at origin, resting on y=0) + box B shifted so they overlap by