Official Codebase of 3DCodeVerse
Python
runtime_js: delete dead options, duplicated helpers and unread fields (−108 lines)
gaoypengd6fe17f01998
diff --git a/harness/codeverse3d/languages/scene_threejs/starter/src/lib/shader.js b/harness/codeverse3d/languages/scene_threejs/starter/src/lib/shader.jsindex 53c5a103..944372a5 100644--- a/harness/codeverse3d/languages/scene_threejs/starter/src/lib/shader.js+++ b/harness/codeverse3d/languages/scene_threejs/starter/src/lib/shader.js@@ -9,9 +9,8 @@* 1. a renderer with `logarithmicDepthBuffer: true` DISCARDS a custom* shader without the four depth chunks behind opaque geometry* (`depthWrite: false` does not save it). THIS harness's renderer- * (runtime_js/lib/browser/renderer.js) leaves log depth OFF by- * default — the chunks then compile to nothing — but `--log-depth`- * is a host option for km-scale scenes, so they are always injected;+ * (runtime_js/lib/browser/renderer.js) leaves log depth OFF, so the+ * chunks compile to nothing here; they are injected anyway, at no cost;* 1b. every scene here sets `scene.fog`, and fog reaches a shader ONLY* through its chunks — without them the effect keeps full contrast* while the world around it recedes, which is the sticker look;diff --git a/harness/codeverse3d/prompts/scene_threejs/effects_catalog.md b/harness/codeverse3d/prompts/scene_threejs/effects_catalog.mdindex 3ea11dd6..5bf2abc1 100644--- a/harness/codeverse3d/prompts/scene_threejs/effects_catalog.md+++ b/harness/codeverse3d/prompts/scene_threejs/effects_catalog.md@@ -138,9 +138,8 @@ round has to read.* Tone mapping is ACES at exposure **1.0** and output is sRGB. Non-emissivealbedos belong in **0.02–0.8** linear: a pure black albedo renders as void and apure white one blows out (the `dark_frame` / `blown` gates read both).-* `logarithmicDepthBuffer` is OFF by default, so the library's log-depth chunks- compile to nothing here. They cost nothing and `--log-depth` is a host- option, so leave them alone.+* `logarithmicDepthBuffer` is OFF in this harness, so the library's log-depth chunks+ compile to nothing here. They cost nothing; leave them alone.* Everything reads `scene.environment` and the sun direction. Do not hardcode alight colour inside an effect; pass `sunDir` / the rig.diff --git a/harness/codeverse3d/prompts/threejs/contract.md b/harness/codeverse3d/prompts/threejs/contract.mdindex 52d3c0a1..5081ac27 100644--- a/harness/codeverse3d/prompts/threejs/contract.md+++ b/harness/codeverse3d/prompts/threejs/contract.md@@ -60,7 +60,7 @@ on that `null` fails the build.`WebSocket`, `require()`, `process.`, `eval`, `TextureLoader` / `ImageLoader` / `FileLoader`,`WebGLRenderer`, `requestAnimationFrame`. Lint WARNs, ignored at export: a camera, a light(exported as extras, not used by the harness lighting), a `Scene` in place of a Group.-* Not linted: the exporter replaces `Math.random` with a seeded generator (`--seed`), so its+* Not linted: the exporter replaces `Math.random` with a seeded generator, so itsdraws repeat from build to build; the clock (`Date.now()`, `performance.now()`) does not, andgeometry that depends on it changes between the builds the harness measures and renders.diff --git a/harness/codeverse3d/skills/c3d-threejs-shader-traps/SKILL.md b/harness/codeverse3d/skills/c3d-threejs-shader-traps/SKILL.mdindex eec4b434..d88e23ea 100644--- a/harness/codeverse3d/skills/c3d-threejs-shader-traps/SKILL.md+++ b/harness/codeverse3d/skills/c3d-threejs-shader-traps/SKILL.md@@ -98,11 +98,9 @@ Use the marker, do not fight the warning.Verified against this runtime on 2026-08-25 — believing them costs a repair round:1. **"Always add the `logdepthbuf_*` chunks or your effect vanishes behind geometry."**- `runtime_js/lib/browser/renderer.js` takes `logDepth` and it **defaults to false**; the only- switch is `render_scene.mjs --log-depth`, and nothing in `codeverse3d/` ever passes it. So the- logarithmic depth buffer is **off in every harness render**. Keep the chunks- `makeShaderMaterial` injects — they compile to nothing without `USE_LOGDEPTHBUF` and would be- needed if it were ever turned on — but they can never be the cause of what you are looking at.+ The logarithmic depth buffer is **off in every harness render** (`runtime_js/lib/browser/renderer.js`+ never enables it). Keep the chunks `makeShaderMaterial` injects — they compile to nothing+ without `USE_LOGDEPTHBUF` — but they can never be the cause of what you are looking at.Do not spend a round there.2. **"Guard against the GTAO / post-processing pass overriding your material."**Object renders go straight to the canvas, but scene renders go through a post chaindiff --git a/harness/runtime_js/README.md b/harness/runtime_js/README.mdindex 2dea505c..5d4f928d 100644--- a/harness/runtime_js/README.md+++ b/harness/runtime_js/README.md@@ -23,7 +23,7 @@ thread) instead of the in-thread `module.registerHooks`; the resolutions areidentical. The python side refuses to spawn an older node with an actionablemessage (`codeverse3d.spatial.node.NODE_MIN`, mirrored by `3dcode doctor`'s `node`row), and `tests/core/test_portability.py` pins the two declarations together.-The floor is exercised, not assumed: the 93 `node`-marked tests all pass on node+The floor is exercised, not assumed: the 139 `node`-marked tests all pass on node20.19.5 (`C3D_BINARIES__NODE=/path/to/node20 pytest tests -m "node and not live and not blender"`).```bash@@ -74,7 +74,7 @@ lib/resolve_three.mjs node --import hook: bare 'three' / 'three/addons/*' resolvfrom runtime_js/node_modules for modules anywhere on disk (NODE_PATH is CJS-only);module.registerHooks on node >= 22.15, module.register + lib/resolve_three_async.mjson the 20.6 floor. Redirect rule stated once in lib/three_redirect.mjs-lib/node_polyfills.mjs FileReader/self shims so GLTFExporter writes binary GLB without a DOM+lib/node_polyfills.mjs FileReader shim so GLTFExporter writes binary GLB without a DOMlib/census.mjs NaN/Infinity check naming mesh + part, world boxes, geometry triangles (node + browser)lib/instances.mjs bakeInstancedMeshes(THREE, root): InstancedMesh → sibling plain meshes Name_0.. in its placelib/stack.mjs Error → {type,message,file,line,frames} with workspace-relative src/ paths@@ -88,8 +88,12 @@ lib/browser/*.js page-side ESM (served through /__runtime/): renderer.js (TsRGB + ACES + PCF shadows + pixel ratio 1, used by the object rig AND the scene host),camera_fit.js (azimuth/elevation → tight bbox fit; the distance math itself islib/orbit.mjs::fitDistance, shared with the scene orbit rig), studio.js- (RoomEnvironment PMREM + key/fill/rim, shadow catcher, render modes; re-exports- renderer.js), render_rig.js (load GLB, isolate/explode/anim, views)+ (softbox PMREM + key/fill/rim, shadow catcher, render modes), render_rig.js+ (load GLB, isolate/explode/anim, views)+lib/browser/studio_env.js procedural softbox environment, backdrop and contact-shadow textures of the+ object rig (v2): generated from constants, so a render is byte-reproducible+lib/browser/post.js THE scene post chain (object renders stay raw): RenderPass → finite clamp → GTAO →+ glow bloom → grade (scene.userData.grade) → OutputPass; `--no-post` / C3D_POST=0 skips itprobe_scene.mjs scene build gate: boot src/scene.js, census, update(t,dt), first-camera checks;--compile folds the full shader preflight into the SAME boot (shader_report);@@ -97,9 +101,19 @@ probe_scene.mjs scene build gate: boot src/scene.js, census, update(t,dt),check_shaders.mjs the effect-library tests' compile driver: the same preflight as probe_scene --compile,plus --module to scope the static audit to one fixture filerender_scene.mjs authored cameras + orbit rig renders at times, metrics.json/views.json+fit_orbit.mjs the same framingBox + fitOrbitCameras on a census.json WITHOUT a browser (scene_blender)lib/host_env.mjs ESM adapters over gpu_launch.cjs + serve.cjs (launchBrowser, serveWorkspace)-lib/host_page.mjs node-side page driver: serve ws, launch, boot scene, collect errors, releaseBrowser+lib/host_page.mjs node-side page driver: serve ws, launch, boot scene, collect errors, release the browserlib/scene_host.mjs page-side host (window.__c3v): boot/renderAt/census/compileAll/fps/cameraChecks+lib/glb_scene.mjs the createScene the host boots for an OFFLINE scene (`--glb`, scene_blender): hoists the+ census GLB's root nodes + extras.c3d_cameras — the same census and placement code+lib/host_compile.mjs page-side compile machinery: capture every custom material's final GLSL, attribute+ compiler errors to materials by source line, audit runtime materials (fog/uTime)+lib/host_shader_errors.mjs renderer.debug.onShaderError hook: every `ERROR: n:m` with its assembled source line+lib/host_placement.mjs placementTable(scene): does every placed asset sit on something (feet columns, gaps,+ sunk, water, interpenetration; time-budgeted) + the boot-time settle+lib/placement_words.json the seated-vocabulary both the settle and spatial/scene_placement.py read+lib/update_hooks.mjs observeUpdateHooks: which userData.update hooks the sampled update interval never calledlib/orbit.mjs THE camera-fit owner: fitDistance (exact per-corner frustum fit — also used by theobject rig through lib/browser/camera_fit.js), fitOverviewCamera, fitZoneCamera(eye level), fitOrbitCameras, framingBoxdiff --git a/harness/runtime_js/browser_daemon.cjs b/harness/runtime_js/browser_daemon.cjsindex 6a273149..a0b4e79e 100644--- a/harness/runtime_js/browser_daemon.cjs+++ b/harness/runtime_js/browser_daemon.cjs@@ -24,13 +24,8 @@ const POLL_MS = 15 * 1000;// a value that is not a positive number keeps the default (NaN would never reap a page)const PAGE_TTL_MS = Number(process.env.C3D_PAGE_TTL_MS) > 0 ? Number(process.env.C3D_PAGE_TTL_MS) : 8 * 60 * 1000;-function arg(name, dflt) {- const i = process.argv.indexOf(`--${name}`);- return i >= 0 && process.argv[i + 1] ? process.argv[i + 1] : dflt;-}-async function main() {- const backend = arg('backend', 'cpu');+ const { values: { backend = 'cpu' } } = require('node:util').parseArgs({ options: { backend: { type: 'string' } } });if (!['gpu', 'cpu'].includes(backend)) throw new Error(`--backend must be gpu|cpu, got ${backend}`);const puppeteer = _internal.loadPuppeteer();const epPath = _internal.endpointPath(backend);diff --git a/harness/runtime_js/export_glb.mjs b/harness/runtime_js/export_glb.mjsindex f1c95155..12becfbb 100644--- a/harness/runtime_js/export_glb.mjs+++ b/harness/runtime_js/export_glb.mjs@@ -7,7 +7,7 @@// Runs in plain node (no browser). The agent module must `export function build(THREE)`// returning a THREE.Group (or a Promise of one); an optional `export function// selfcheck(THREE, root)` is called on the built group and fails the build when it-// throws. `Math.random` is seeded (--seed, default 0), like `random` in the Blender and CadQuery+// throws. `Math.random` is seeded, like `random` in the Blender and CadQuery// wrappers, so a rebuild of the same source measures the same object. InstancedMesh objects are baked into sibling plain meshes `Name_0..`// (lib/instances.mjs) so trimesh-based gates see every copy as an instance. The object is exported exactly where the// source put it: an off-ground / off-centre build only WARNS (census.placement_offset),@@ -38,7 +38,7 @@ const PLACEMENT_THRESHOLD_M = 0.01;function cli() {const values = parseCli({ws: {}, entry: { default: 'src/object.js' }, out: { default: 'artifacts/object.glb' },- census: { default: 'artifacts/census.json' }, seed: { default: '0' },+ census: { default: 'artifacts/census.json' },});if (!values.ws) throw new Error('--ws <workspace dir> is required');const ws = path.resolve(values.ws);@@ -48,7 +48,6 @@ function cli() {entry: abs(values.entry),out: abs(values.out),census: abs(values.census),- seed: Number(values.seed) >>> 0,};}@@ -85,11 +84,7 @@ async function loadBuild(entry) {throw e;}const mod = await import(pathToFileURL(entry).href);- if (typeof mod.build !== 'function') {- const e = new Error(`${path.basename(entry)} must 'export function build(THREE)' (got ${typeof mod.build})`);- e.name = 'ContractError';- throw e;- }+ if (typeof mod.build !== 'function') fail(`${path.basename(entry)} must 'export function build(THREE)' (got ${typeof mod.build})`);return mod;}@@ -185,7 +180,7 @@ async function main() {const warnings = [];captureWarnings(warnings);installExporterPolyfills();- seedMathRandom(args.seed);+ seedMathRandom(0);const THREE = await import('three');const { GLTFExporter } = await import('three/addons/exporters/GLTFExporter.js');diff --git a/harness/runtime_js/gpu_launch.cjs b/harness/runtime_js/gpu_launch.cjsindex 11edbb78..2b4eb143 100644--- a/harness/runtime_js/gpu_launch.cjs+++ b/harness/runtime_js/gpu_launch.cjs@@ -35,7 +35,7 @@ const NEGATIVE_TTL_MS = 20 * 60 * 1000; // how long a "no GPU" verdict is trusteconst PROTOCOL_TIMEOUT_MS = 15 * 60 * 1000; // big frame batches exceed puppeteer's 180 s defaultconst DAEMON_WAIT_MS = 25000; // max wait for a spawned daemon to advertise its endpointconst CANARY_TIMEOUT_MS = 6000; // a healthy browser answers pages() in ~5 ms-const MAX_SHARED_PAGES = 12; // more open pages than any sane moment = leaked pages piling up // max wait for a spawned daemon to advertise its endpoint+const MAX_SHARED_PAGES = 12; // more open pages than any sane moment = leaked pages piling upconst SPAWN_LOCK_STALE_MS = 30000;const BASE_ARGS = ['--no-sandbox', '--disable-setuid-sandbox', '--enable-webgl', '--ignore-gpu-blocklist'];@@ -342,10 +342,7 @@ async function launchBrowser(opts = {}) {}module.exports = {- launchBrowser, rendererInfo, GPU_ARGS, CPU_ARGS, GPU_ENV, CACHE_PATH,+ launchBrowser, rendererInfo,// internals shared with browser_daemon.cjs (not a public surface)- _internal: {- launchCpu, tryGpu, loadPuppeteer, readJson, endpointPath, daemonFailPath, spawnLockPath,- CACHE_DIR, RUNTIME_KEY, SOFTWARE_RE,- },+ _internal: { launchCpu, tryGpu, loadPuppeteer, readJson, endpointPath, daemonFailPath, spawnLockPath, CACHE_DIR },};diff --git a/harness/runtime_js/lib/browser/camera_fit.js b/harness/runtime_js/lib/browser/camera_fit.jsindex 07338397..369c303f 100644--- a/harness/runtime_js/lib/browser/camera_fit.js+++ b/harness/runtime_js/lib/browser/camera_fit.js@@ -29,13 +29,13 @@ function screenUp(elevationDeg) {/*** Place `camera` along (azimuth, elevation) from the box centre so that the- * projected bbox corners fill `fill` of the half-frame (both axes) — or at an explicit+ * projected bbox corners fill `fill` (0.90) of the half-frame (both axes) — or at an explicit* `distance` instead of the fitted one. Returns {position, lookAt, distance}.*/-export function fitCameraToBox(camera, box, azimuthDeg, elevationDeg, { fill = 0.85, margin = 1.0, distance = null } = {}) {+export function fitCameraToBox(camera, box, azimuthDeg, elevationDeg, { fill = 0.90, distance = null } = {}) {const center = box.getCenter(new THREE.Vector3());const size = box.getSize(new THREE.Vector3());- const radius = Math.max(size.length() / 2, 1e-3) * margin; // near/far scale only+ const radius = Math.max(size.length() / 2, 1e-3); // near/far scale onlyconst dir = viewDirection(azimuthDeg, elevationDeg);const up = screenUp(elevationDeg);camera.up.set(up[0], up[1], up[2]);diff --git a/harness/runtime_js/lib/browser/post.js b/harness/runtime_js/lib/browser/post.jsindex 82ad7dc9..eb45dcb3 100644--- a/harness/runtime_js/lib/browser/post.js+++ b/harness/runtime_js/lib/browser/post.js@@ -494,25 +494,20 @@ export function makePostChain(renderer, scene, { width, height, options = {} } =let gtao = null;if (opt.ao > 0) {- try {- // GTAOPass reads projection flags at construction; the real camera is- // swapped in before every render (its uniforms refresh per frame).- const aoCam = new THREE.PerspectiveCamera(50, width / height, 0.1, 1000);- gtao = new GTAOPass(scene, aoCam, width, height);- gtao.updateGtaoMaterial({- radius: opt.aoRadius,- distanceExponent: opt.aoDistanceExponent,- thickness: opt.aoThickness,- scale: 1.0,- samples: opt.aoSamples,- });- gtao.updatePdMaterial({ rings: opt.aoDenoiseRings, samples: opt.aoDenoiseSamples });- gtao.blendIntensity = opt.ao;- composer.addPass(gtao);- } catch (e) {- gtao = null;- warnings.push(`GTAO unavailable: ${String((e && e.message) || e).slice(0, 200)}`);- }+ // GTAOPass reads projection flags at construction; the real camera is+ // swapped in before every render (its uniforms refresh per frame).+ const aoCam = new THREE.PerspectiveCamera(50, width / height, 0.1, 1000);+ gtao = new GTAOPass(scene, aoCam, width, height);+ gtao.updateGtaoMaterial({+ radius: opt.aoRadius,+ distanceExponent: opt.aoDistanceExponent,+ thickness: opt.aoThickness,+ scale: 1.0,+ samples: opt.aoSamples,+ });+ gtao.updatePdMaterial({ rings: opt.aoDenoiseRings, samples: opt.aoDenoiseSamples });+ gtao.blendIntensity = opt.ao;+ composer.addPass(gtao);}let glow = null;diff --git a/harness/runtime_js/lib/browser/render_rig.js b/harness/runtime_js/lib/browser/render_rig.jsindex a33b0261..d0465edf 100644--- a/harness/runtime_js/lib/browser/render_rig.js+++ b/harness/runtime_js/lib/browser/render_rig.js@@ -2,12 +2,13 @@// camera per view, return PNGs as base64. Driven by render_glb.mjs via puppeteer.//// import { renderGlbViews } from '/__runtime/lib/browser/render_rig.js';-// const result = await renderGlbViews({ glbUrl, views, mode, width, height, isolate, explode, background, animTime, shadow, fill });+// const result = await renderGlbViews({ glbUrl, views, mode, width, height, isolate, explode, background, animTime, shadow });import * as THREE from 'three';import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';import { fitCameraToBox } from './camera_fit.js';-import { makeRenderer, buildStudio, applyMode, aimStudio, rendererString, RIG_VERSION } from './studio.js';+import { makeRenderer, rendererString } from './renderer.js';+import { buildStudio, applyMode, aimStudio, RIG_VERSION } from './studio.js';const FOV_DEG = 35;/** Views steeper than this fit themselves (a plan view of a tall object needs a very@@ -79,11 +80,11 @@ function visibleBox(root) {}/** The largest self-fit distance over the orbit-band views (null when there are none). */-function uniformDistance(camera, box, views, fill) {+function uniformDistance(camera, box, views) {let best = null;for (const v of views) {if (Math.abs(v.elevation) > UNIFORM_FRAMING_MAX_ELEVATION) continue;- const d = fitCameraToBox(camera, box, v.azimuth, v.elevation, { fill }).distance;+ const d = fitCameraToBox(camera, box, v.azimuth, v.elevation).distance;best = best == null ? d : Math.max(best, d);}return best;@@ -96,12 +97,10 @@ function uniformDistance(camera, box, views, fill) {export async function renderGlbViews(cfg) {const t0 = performance.now();const warnings = [];- const width = cfg.width || 768;- const height = cfg.height || 768;- const mode = cfg.mode || 'shaded';- const background = mode === 'silhouette' ? 'white' : cfg.background || 'studio';+ const { width, height, mode } = cfg;+ const background = mode === 'silhouette' ? 'white' : cfg.background;- const canvas = document.getElementById('c') || document.createElement('canvas');+ const canvas = document.getElementById('c');canvas.width = width;canvas.height = height;const renderer = makeRenderer(canvas, width, height, { transparent: background === 'transparent' });@@ -116,13 +115,13 @@ export async function renderGlbViews(cfg) {if (cfg.animTime != null && gltf.animations && gltf.animations.length) {const mixer = new THREE.AnimationMixer(gltf.scene);for (const clip of gltf.animations) mixer.clipAction(clip).play();- mixer.update(Number(cfg.animTime));+ mixer.update(cfg.animTime);}if (cfg.isolate && cfg.isolate.length) {const missing = isolate(root, cfg.isolate);if (missing.length) warnings.push(`isolate: no node named ${missing.join(', ')}`);}- if (cfg.explode) explode(root, Number(cfg.explode));+ if (cfg.explode) explode(root, cfg.explode);const look = applyMode(root, mode);const box = visibleBox(root);@@ -130,14 +129,13 @@ export async function renderGlbViews(cfg) {const rig = buildStudio(renderer, scene, box, { background, shadow: look.shadow && cfg.shadow !== false, lights: look.lights });const camera = new THREE.PerspectiveCamera(FOV_DEG, width / height, 0.01, 100);- const fill = cfg.fill || 0.90;- const uniform = uniformDistance(camera, box, cfg.views, fill);+ const uniform = uniformDistance(camera, box, cfg.views);const views = [];for (const v of cfg.views) {- let fit = fitCameraToBox(camera, box, v.azimuth, v.elevation, { fill });+ let fit = fitCameraToBox(camera, box, v.azimuth, v.elevation);if (uniform != null && Math.abs(v.elevation) <= UNIFORM_FRAMING_MAX_ELEVATION && uniform > fit.distance) {fit = fitCameraToBox(camera, box, v.azimuth, v.elevation,- { fill, distance: Math.min(uniform, fit.distance * UNIFORM_FRAMING_MAX_PULLBACK) });+ { distance: Math.min(uniform, fit.distance * UNIFORM_FRAMING_MAX_PULLBACK) });}aimStudio(rig, v.azimuth, v.elevation);renderer.render(scene, camera);diff --git a/harness/runtime_js/lib/browser/renderer.js b/harness/runtime_js/lib/browser/renderer.jsindex c8f81e12..566c2085 100644--- a/harness/runtime_js/lib/browser/renderer.js+++ b/harness/runtime_js/lib/browser/renderer.js@@ -10,18 +10,16 @@ import * as THREE from 'three';/*** WebGLRenderer on `canvas` sized width x height (device pixel ratio 1).- * @param {{transparent?: boolean, logDepth?: boolean}} opts+ * @param {{transparent?: boolean}} opts* transparent - alpha buffer (transparent background renders)- * logDepth - logarithmic depth buffer (huge scenes)*/-export function makeRenderer(canvas, width, height, { transparent = false, logDepth = false } = {}) {+export function makeRenderer(canvas, width, height, { transparent = false } = {}) {const renderer = new THREE.WebGLRenderer({canvas,antialias: true,alpha: transparent,preserveDrawingBuffer: true,powerPreference: 'high-performance',- logarithmicDepthBuffer: !!logDepth,});renderer.setPixelRatio(1);renderer.setSize(width, height, false);diff --git a/harness/runtime_js/lib/browser/studio.js b/harness/runtime_js/lib/browser/studio.jsindex 4ef7855b..57dbec73 100644--- a/harness/runtime_js/lib/browser/studio.js+++ b/harness/runtime_js/lib/browser/studio.js@@ -3,7 +3,7 @@// shadow-casting key + a soft ambient contact shadow, and the shared renderer// factory (renderer.js: ACES tone mapping, sRGB output, PCF shadows).//-// import { makeRenderer, buildStudio, applyMode, RIG_VERSION } from '/__runtime/lib/browser/studio.js';+// import { buildStudio, applyMode, RIG_VERSION } from '/__runtime/lib/browser/studio.js';//// RIG v1 (up to 2026-08-23) was `RoomEnvironment` + three white directionals on a// flat #e9e9ec clear colour. It lit geometry fine but told the judge nothing@@ -15,13 +15,8 @@import * as THREE from 'three';import { viewDirection } from './camera_fit.js';-import { makeRenderer, rendererString } from './renderer.js';import { backdropTexture, contactShadowTexture, softboxEnvironment } from './studio_env.js';-// the renderer factory lives in renderer.js (shared with the scene host); it is-// re-exported here because studio.js is the object rig's one-stop import-export { makeRenderer, rendererString };-/** Bumped whenever the look changes. Recorded in views.json so a sheet can be dated. */export const RIG_VERSION = 2;@@ -138,7 +133,7 @@ export function aimStudio(rig, azimuthDeg, elevationDeg = 0) {export function buildStudio(renderer, scene, box, { background = 'studio', shadow = true, lights = true } = {}) {const bg = BACKGROUNDS[background];if (bg === undefined) throw new Error(`unknown background '${background}' (studio|white|transparent)`);- renderer.toneMappingExposure = EXPOSURE[background] ?? 1.0;+ renderer.toneMappingExposure = EXPOSURE[background];if (bg === null) {renderer.setClearColor(0x000000, 0);} else if (background === 'studio' && lights) {@@ -228,7 +223,6 @@ export function applyMode(root, mode) {if (mode === 'clay' || mode === 'wire') m.material = CLAY;else if (mode === 'normals') m.material = NORMALS;else if (mode === 'silhouette') m.material = SILHOUETTE;- else throw new Error(`unknown mode '${mode}' (shaded|clay|wire|normals|silhouette)`);}if (mode === 'wire') {for (const m of meshes) {diff --git a/harness/runtime_js/lib/census.mjs b/harness/runtime_js/lib/census.mjsindex 13a6e94b..09aa2919 100644--- a/harness/runtime_js/lib/census.mjs+++ b/harness/runtime_js/lib/census.mjs@@ -41,10 +41,6 @@ export function geometryInstances(object) {return Number.isFinite(count) ? Math.max(0, Math.floor(count)) : 0;}-function isMeshLike(obj) {- return !!(obj.isMesh || obj.isSkinnedMesh || obj.isInstancedMesh);-}-/** World-space AABB of a subtree as [[minx,miny,minz],[maxx,maxy,maxz]] or null if empty. */export function worldBox(THREE, root) {root.updateWorldMatrix(true, true);@@ -72,7 +68,7 @@ function geometryHasNonFinite(geometry) {*/export function findNonFinitePositions(root) {const visit = (o, path) => {- if (isMeshLike(o) && geometryHasNonFinite(o.geometry)) {+ if (o.isMesh && geometryHasNonFinite(o.geometry)) {const below = path.slice(1); // ancestors strictly below root, nearest lastconst named = below.filter((a) => a.name);return {diff --git a/harness/runtime_js/lib/cli.mjs b/harness/runtime_js/lib/cli.mjsindex 1a24b5b9..3156e877 100644--- a/harness/runtime_js/lib/cli.mjs+++ b/harness/runtime_js/lib/cli.mjs@@ -42,8 +42,7 @@ export function readJsonArg(value, label) {try {return JSON.parse(value);} catch (e) {- if (fs.existsSync(value)) return JSON.parse(fs.readFileSync(value, 'utf8'));- throw new Error(`--${label} is neither JSON nor a file: ${String(e.message)}`);+ throw new Error(`--${label} is not JSON: ${String(e.message)}`);}}diff --git a/harness/runtime_js/lib/host_census.mjs b/harness/runtime_js/lib/host_census.mjsindex 374e8435..8c30fbfe 100644--- a/harness/runtime_js/lib/host_census.mjs+++ b/harness/runtime_js/lib/host_census.mjs@@ -8,7 +8,7 @@import { classifyBackdrop, drawableBox, splitInstance } from './backdrop.mjs';import { geometryTriangles as triCount, geometryInstances } from './census.mjs';-import { placementTable } from './host_placement.mjs';+import { boxJson, placementTable } from './host_placement.mjs';export function isCustomShader(mat, THREE) {if (!mat) return false;@@ -17,14 +17,7 @@ export function isCustomShader(mat, THREE) {return mat.onBeforeCompile !== THREE.Material.prototype.onBeforeCompile;}-function boxToJson(box) {- if (!box || box.isEmpty()) return null;- return {- min: [box.min.x, box.min.y, box.min.z].map((v) => +v.toFixed(3)),- max: [box.max.x, box.max.y, box.max.z].map((v) => +v.toFixed(3)),- size: [box.max.x - box.min.x, box.max.y - box.min.y, box.max.z - box.min.z].map((v) => +v.toFixed(3)),- };-}+const boxToJson = (box) => (!box || box.isEmpty() ? null : boxJson(box.min.toArray(), box.max.toArray()));const STAMP_MIN = 8; // copies before a family's ring / size statistics are worth reportingconst STAMPS_PER_GROUP = 6;diff --git a/harness/runtime_js/lib/host_metrics.mjs b/harness/runtime_js/lib/host_metrics.mjsindex 89128786..22a0d28e 100644--- a/harness/runtime_js/lib/host_metrics.mjs+++ b/harness/runtime_js/lib/host_metrics.mjs@@ -103,11 +103,6 @@ export const BLOCKED_M = 1.5;/** A ground-classified mesh at least this wide is terrain, not a floor a shot may sit under. */export const TERRAIN_SPAN_M = 40;-/** Does the name carry a ground word? CamelCase split first: `HeadlandTerrain` is a terrain. */-export function groundNamed(name) {- return GROUND_NAME_RE.test(nameText(name));-}-/*** The lowest terrain-scale ground surface straight above `eye`, or null. Cast DOWN from* 500 m up and take the last hit above the eye: a FrontSide terrain is back faces to a ray@@ -163,9 +158,10 @@ export function nearGeometry(scene, camera, THREE, limitM = 0.3, lookAt = null)const s = box.getSize(new THREE.Vector3());// terrain overhead must also be NAMED as ground: a 40 m 'Ceiling' is ground-shaped to the// classifier, and loop 25's cathedral read "camera 17.8 m under Ceiling" on every interior- // camera (2026-09-09) — a lens under a roof is a shot, a lens under a terrain is a bug+ // camera (2026-09-09) — a lens under a roof is a shot, a lens under a terrain is a bug.+ // nameText splits CamelCase first: `HeadlandTerrain` is a terrainif (Math.max(s.x, s.z) >= TERRAIN_SPAN_M && classifyBackdrop(o, box) === 'ground'- && groundNamed(o.name || o.parent?.name || '')) groundMeshes.push(o);+ && GROUND_NAME_RE.test(nameText(o.name || o.parent?.name || ''))) groundMeshes.push(o);if (Math.max(s.x, s.y, s.z) > 60 || Math.min(s.x, s.y, s.z) < 0.05) continue; // ground/sky/flat decals// The bbox is the cheap pre-filter; the verdict is the mesh's own volume. A windmill's// 22 m lattice sails own a 22 x 22 m bbox that is nearly all air: measured 2026-09-07diff --git a/harness/runtime_js/lib/host_page.mjs b/harness/runtime_js/lib/host_page.mjsindex 50a1493c..3cf53806 100644--- a/harness/runtime_js/lib/host_page.mjs+++ b/harness/runtime_js/lib/host_page.mjs@@ -53,7 +53,7 @@ export function requestFailureLine(url, base, hasResponse, errorText) {* the scene module is imported and createScene() runs (probe_scene.mjs: the watchdog's phase, D111).* @returns {Promise<{page, browser, base, gpu, renderer, errors, boot, close}>}*/-export async function openHost(wsRoot, { width = 1024, height = 576, gpu = 'auto', logDepth = false, sceneRel = 'src/scene.js', createSceneTimeoutMs = 0, settle = true, cameraRepair = false, post = true, postOptions = null, glb = null, onBoot = null } = {}) {+export async function openHost(wsRoot, { width = 1024, height = 576, gpu = 'auto', sceneRel = 'src/scene.js', createSceneTimeoutMs = 0, settle = true, cameraRepair = false, post = true, postOptions = null, glb = null, onBoot = null } = {}) {wsRoot = path.resolve(wsRoot);// an offline scene (`glb`: its census GLB) boots the harness adapter, never a workspace moduleconst sceneFile = glb || path.join(wsRoot, sceneRel);@@ -103,20 +103,20 @@ export async function openHost(wsRoot, { width = 1024, height = 576, gpu = 'autoif (onBoot) onBoot();const boot = await page.evaluate((o) => window.__c3v.boot(o),- { sceneUrl, width, height, logDepth, createSceneTimeoutMs, settle, cameraRepair, post, postOptions },+ { sceneUrl, width, height, createSceneTimeoutMs, settle, cameraRepair, post, postOptions },);const close = async () => {// page first, then release: a SHARED browser (connect-first reuse) must get// its pages closed by us and be disconnected, never closed. Each step is// time-bounded: the result is already in hand when close() runs.await bounded(page.close(), 3000);- await bounded(releaseBrowser(launched), 3000);+ await bounded(launched.release(), 3000);await bounded(srv.close(), 2000);};return { page, browser: launched.browser, base: srv.base, gpu: launched.gpu, renderer: launched.renderer, errors, boot, close };} catch (e) {if (page) await page.close().catch(() => {});- if (launched && launched.browser) await releaseBrowser(launched).catch(() => {});+ if (launched?.browser) await launched.release().catch(() => {});await srv.close();throw e;}@@ -133,13 +133,6 @@ export function bounded(work, ms) {]).finally(() => { if (timer) clearTimeout(timer); });}-/** Release a launchBrowser handle: release() when present (shared-aware), else close(). */-export async function releaseBrowser(launched) {- if (!launched || !launched.browser) return;- if (typeof launched.release === 'function') await launched.release();- else await launched.browser.close().catch(() => {});-}-/** Flatten the collected errors into the summary shape used by all drivers. */export function errorSummary(errors, boot) {const consoleErrors = [...errors.console, ...errors.page.map((p) => `pageerror: ${p}`)];diff --git a/harness/runtime_js/lib/host_placement.mjs b/harness/runtime_js/lib/host_placement.mjsindex cd114548..0db2b215 100644--- a/harness/runtime_js/lib/host_placement.mjs+++ b/harness/runtime_js/lib/host_placement.mjs@@ -199,7 +199,7 @@ class ColumnIndex {}}-function boxJson(min, max) {+export function boxJson(min, max) {return { min: min.map(r3), max: max.map(r3), size: [max[0] - min[0], max[1] - min[1], max[2] - min[2]].map(r3) };}@@ -568,8 +568,8 @@ export function placementTable(scene, THREE, opts = {}) {const exempt = {};for (const r of rows) if (r.exempt) exempt[r.exempt] = (exempt[r.exempt] || 0) + 1;return {- version: 1, assets: rows, interpenetrations: inter, total, checked: checked.length,- truncated: total > assets.length || timeCut, truncated_by_time: timeCut, exempt,+ assets: rows, interpenetrations: inter, total, checked: checked.length,+ truncated: total > assets.length || timeCut, exempt,// the roots outside every marked zone (D111): measured as nothing, listed so nothing is silentscenery: { n: scenery.length, names: scenery.slice(0, MAX_SCENERY_NAMES).map((o) => o.name || o.type) },thresholds: { contact_m: CONTACT_TOL_M, floating_m: FLOATING_M, sunk_m: SUNK_M, overlap_min: OVERLAP_MIN_FRAC },diff --git a/harness/runtime_js/lib/host_shader_errors.mjs b/harness/runtime_js/lib/host_shader_errors.mjsindex 8a55d925..8a8d388a 100644--- a/harness/runtime_js/lib/host_shader_errors.mjs+++ b/harness/runtime_js/lib/host_shader_errors.mjs@@ -8,7 +8,7 @@const ERR_RE = /ERROR:\s*(\d+):(\d+):\s*([^\n]*)/g;-function stageErrors(gl, shader, stage, materialInfo) {+function stageErrors(gl, shader, stage) {let log = '';try { log = (gl.getShaderInfoLog(shader) || '').trim(); } catch (e) { log = ''; }if (!log) return [];@@ -25,28 +25,25 @@ function stageErrors(gl, shader, stage, materialInfo) {assembled_line: ln,source_line: (lines[ln - 1] || '').trim(),context: lines.slice(Math.max(0, ln - 3), ln + 2).map((s) => s.trim()),- ...materialInfo,});}- if (!out.length) out.push({ stage, message: log.slice(0, 400), assembled_line: null, source_line: '', context: [], ...materialInfo });+ if (!out.length) out.push({ stage, message: log.slice(0, 400), assembled_line: null, source_line: '', context: [] });return out;}-/** Install the hook; errors are appended to `sink` (array) and deduped. */+/** Install the hook; errors are appended to `sink` (array) and deduped. `material` /+ * `material_type` are attributed later by host_compile.mjs::attributeErrors. */export function installShaderErrorHook(renderer, sink) {+ const seen = new Set();renderer.debug.checkShaderErrors = true;renderer.debug.onShaderError = (gl, program, glVS, glFS) => {- let matInfo = { material: '', material_type: '' };- try {- // three keeps the material name/type in the program's cacheKey; parse defensively- const pl = gl.getProgramInfoLog(program) || '';- matInfo.program_log = pl.trim().slice(0, 300);- } catch (e) { /* ignore */ }- const errs = [...stageErrors(gl, glVS, 'vertex', matInfo), ...stageErrors(gl, glFS, 'fragment', matInfo)];- if (!errs.length) errs.push({ stage: 'program', message: matInfo.program_log || 'program not valid', assembled_line: null, source_line: '', context: [] });+ let programLog = '';+ try { programLog = (gl.getProgramInfoLog(program) || '').trim().slice(0, 300); } catch (e) { /* ignore */ }+ const errs = [...stageErrors(gl, glVS, 'vertex'), ...stageErrors(gl, glFS, 'fragment')];+ if (!errs.length) errs.push({ stage: 'program', message: programLog || 'program not valid', assembled_line: null, source_line: '', context: [] });for (const e of errs) {const key = `${e.stage}|${e.assembled_line}|${e.message}|${e.source_line}`;- if (!sink.some((s) => s._key === key)) sink.push({ ...e, _key: key });+ if (!seen.has(key)) { seen.add(key); sink.push(e); }}};}diff --git a/harness/runtime_js/lib/node_polyfills.mjs b/harness/runtime_js/lib/node_polyfills.mjsindex 6a899c73..5e7aaf48 100644--- a/harness/runtime_js/lib/node_polyfills.mjs+++ b/harness/runtime_js/lib/node_polyfills.mjs@@ -1,48 +1,16 @@-// Minimal browser-API shims so three's GLTFExporter can write a binary GLB in-// plain node (no DOM). Node 18+ already has Blob/TextEncoder/URL; the exporter-// additionally reads Blobs back through FileReader. We do NOT shim canvases:-// texture images are stripped by the exporter wrapper (with a warning) so the-// exporter never reaches the canvas path.+// FileReader shim so three's GLTFExporter can write a binary GLB in plain node (no DOM):+// the exporter reads its Blobs back through readAsArrayBuffer + onloadend, nothing else.+// Canvases are not shimmed: export_glb.mjs strips texture images before exporting.//// import { installExporterPolyfills } from './node_polyfills.mjs';class FileReaderShim {- constructor() {- this.result = null;- this.onload = null;- this.onloadend = null;- this.onerror = null;- }-- _finish(result) {- this.result = result;- if (typeof this.onload === 'function') this.onload({ target: this });- if (typeof this.onloadend === 'function') this.onloadend({ target: this });- }-- _fail(err) {- if (typeof this.onerror === 'function') this.onerror(err);- else throw err;- }-readAsArrayBuffer(blob) {- blob.arrayBuffer().then((buf) => this._finish(buf), (e) => this._fail(e));- }-- readAsDataURL(blob) {- blob.arrayBuffer().then((buf) => {- const b64 = Buffer.from(buf).toString('base64');- this._finish(`data:${blob.type || 'application/octet-stream'};base64,${b64}`);- }, (e) => this._fail(e));- }-- readAsText(blob) {- blob.text().then((t) => this._finish(t), (e) => this._fail(e));+ blob.arrayBuffer().then((buf) => { this.result = buf; this.onloadend?.({ target: this }); });}}-/** Install the shims once (idempotent). */+/** Install the shim once (idempotent). */export function installExporterPolyfills() {- if (typeof globalThis.self === 'undefined') globalThis.self = globalThis;- if (typeof globalThis.FileReader === 'undefined') globalThis.FileReader = FileReaderShim;+ globalThis.FileReader ??= FileReaderShim;}diff --git a/harness/runtime_js/lib/orbit.mjs b/harness/runtime_js/lib/orbit.mjsindex ff191a89..dd731564 100644--- a/harness/runtime_js/lib/orbit.mjs+++ b/harness/runtime_js/lib/orbit.mjs@@ -17,6 +17,7 @@*/const DEG = Math.PI / 180;+const FIT_MARGIN = 1.05; // overview fit: the bbox corners stay 5 % inside the frameconst BOUNDS_SPRAWL = 1.1; // a content group wider than 110 % of the plan bounds is scatter, not a zoneconst BOUNDS_CLAMP = 1.1; // framing box is clamped to the plan bounds grown by 10 %@@ -167,14 +168,14 @@ export function fitContactCamera(bbox, { azimuth = 20, floor = null, fov = 50 }* a bounding-sphere fit). THE owner of the overview fit.* @returns {{position:number[], lookAt:number[], fov:number}}*/-export function fitOverviewCamera(bbox, { azimuth = 45, elevation = 30, fov = 50, aspect = 16 / 9, groundY = null, margin = 1.05 } = {}) {+export function fitOverviewCamera(bbox, { azimuth = 45, elevation = 30, fov = 50, aspect = 16 / 9, groundY = null } = {}) {const g = boxGeom(bbox, groundY);const el = Math.max(3, Math.min(89, elevation));const d = orbitDirection(azimuth, el);const tanV = Math.tan((fov * DEG) / 2);const tanH = tanV * aspect;const minDist = Math.max(1.5, 0.35 * Math.hypot(g.size[0], g.size[1], g.size[2]));- const dist = Math.max(minDist, fitDistance(bbox, g.center, d, tanH, tanV, margin));+ const dist = Math.max(minDist, fitDistance(bbox, g.center, d, tanH, tanV, FIT_MARGIN));const eye = g.center.map((c, i) => c + d[i] * dist);if (eye[1] < g.floor + 0.5) eye[1] = g.floor + 0.5;return round3({ position: eye, lookAt: g.center.slice(), fov });@@ -187,7 +188,7 @@ export function fitOverviewCamera(bbox, { azimuth = 45, elevation = 30, fov = 50* contact views are pictures of the place as lit.* @returns {Array<{name, position, lookAt, fov, kind:'orbit'}>}*/-export function fitOrbitCameras(bbox, views, { fov = 50, aspect = 16 / 9, groundY = null, margin = 1.05 } = {}) {+export function fitOrbitCameras(bbox, views, { fov = 50, aspect = 16 / 9, groundY = null } = {}) {if (!bbox || !bbox.min || !bbox.max) return [];const out = [];for (const v of views) {@@ -196,7 +197,7 @@ export function fitOrbitCameras(bbox, views, { fov = 50, aspect = 16 / 9, ground? fitContactCamera(bbox, { azimuth: v.azimuth, floor: groundY, fov }): el <= 20? fitZoneCamera(bbox, { azimuth: v.azimuth, floor: groundY, fov })- : fitOverviewCamera(bbox, { azimuth: v.azimuth, elevation: el, fov, aspect, groundY, margin });+ : fitOverviewCamera(bbox, { azimuth: v.azimuth, elevation: el, fov, aspect, groundY });out.push({ name: v.name, ...fit, kind: 'orbit', noFog: el > 20 });}return out;diff --git a/harness/runtime_js/lib/resolve_three.mjs b/harness/runtime_js/lib/resolve_three.mjsindex 2b0c55d9..7325c38b 100644--- a/harness/runtime_js/lib/resolve_three.mjs+++ b/harness/runtime_js/lib/resolve_three.mjs@@ -28,10 +28,6 @@ if (typeof module.registerHooks === 'function') {return nextResolve(specifier, context);},});-} else if (typeof module.register === 'function') {- module.register('./resolve_three_async.mjs', import.meta.url);} else {- throw new Error(- `3dcodeverse needs node >= 20.6.0 for module loader hooks; this is ${process.version}`,- );+ module.register('./resolve_three_async.mjs', import.meta.url);}diff --git a/harness/runtime_js/lib/scene_host.mjs b/harness/runtime_js/lib/scene_host.mjsindex 9d1b88aa..f67e6d84 100644--- a/harness/runtime_js/lib/scene_host.mjs+++ b/harness/runtime_js/lib/scene_host.mjs@@ -77,13 +77,13 @@ function runUpdate(t, dt) {}/** Host canvas + the shared harness renderer (lib/browser/renderer.js). */-function makeHostRenderer(width, height, opts) {+function makeHostRenderer(width, height) {const canvas = document.createElement('canvas');canvas.width = width;canvas.height = height;canvas.id = '3dcode-canvas';document.body.appendChild(canvas);- return { renderer: makeRenderer(canvas, width, height, { logDepth: !!opts.logDepth }), canvas };+ return { renderer: makeRenderer(canvas, width, height), canvas };}/** The authored cameras, and each problem as {severity, text}: the severity is decided HERE,@@ -140,14 +140,6 @@ function makeLoaders(manager) {return { gltf, texture, cube, manager };}-/** Per loaded GLB: did any of its geometry reach the rendered scene?- *- * `Object3D.clone()` SHARES BufferGeometry (Mesh.copy assigns the same reference), so an- * asset used via clone still matches — which is how the scene track normally places a- * hero. A procedural rebuild allocates its own geometry and matches nothing, which is- * exactly the case this exists to catch. A deep `geometry.clone()` would read as unused;- * that is why the finding is a WARN and says "no geometry from it", not "not used".- *//** geometry uuid -> world box of every mesh drawing it (the GLB bookkeeping's one traversal). */function geometryBoxes(scene) {const used = new Map();@@ -224,6 +216,9 @@ function glbInstanceBoxes(scene, g) {return [...boxes.values()].filter((b) => !b.isEmpty());}+/** Per loaded GLB: did any of its geometry reach the rendered scene? `Object3D.clone()` SHARES+ * BufferGeometry, so a cloned asset still matches; a deep `geometry.clone()` reads as unused —+ * hence a WARN that says "no geometry from it", not "not used". */function glbUsage(scene) {let used;try { used = geometryBoxes(scene); } catch { return []; }@@ -265,11 +260,10 @@ function waitForLoads(manager, timeoutMs) {/*** Boot the host: renderer → import module → createScene → wait loads.- * @param {{sceneUrl:string,width?:number,height?:number,logDepth?:boolean}} opts+ * @param {{sceneUrl:string,width?:number,height?:number}} opts*/async function boot(opts) {- const t0 = performance.now();- const info = { ok: false, stage: 'init', error: '', cameras: [], camera_problems: [], shape: {}, timings_ms: {}, renderer: '' };+ const info = { ok: false, stage: 'init', error: '', cameras: [], camera_problems: [], renderer: '' };state.bootInfo = info;try {loadedGlbs = [];@@ -280,18 +274,14 @@ async function boot(opts) {state.height = opts.height || 576;window.requestAnimationFrame = () => { state.rafCalls += 1; return 0; };window.cancelAnimationFrame = () => {};- const { renderer, canvas } = makeHostRenderer(state.width, state.height, opts);+ const { renderer, canvas } = makeHostRenderer(state.width, state.height);state.renderer = renderer;state.canvas = canvas;installShaderErrorHook(renderer, state.shaderErrors);- try {- info.renderer = rendererString(renderer);- } catch (e) { info.renderer = 'unknown'; }+ info.renderer = rendererString(renderer);info.stage = 'import';- const tImp = performance.now();const mod = await import(opts.sceneUrl);- info.timings_ms.import = Math.round(performance.now() - tImp);if (typeof mod.createScene !== 'function') {throw new Error(`src/scene.js must export function createScene({THREE, renderer, loaders}); exports found: [${Object.keys(mod).join(', ')}]`);}@@ -304,16 +294,9 @@ async function boot(opts) {manager.onError = (url) => { const m = `failed to load ${url}`; if (!state.loadErrors.includes(m)) state.loadErrors.push(m); };trackPendingLoads(manager);const loaders = makeLoaders(manager);- const tCs = performance.now();const result = await raceCreateScene(mod, { THREE, renderer, loaders }, opts.createSceneTimeoutMs || CREATE_SCENE_TIMEOUT_MS);- info.timings_ms.create_scene = Math.round(performance.now() - tCs);if (!result || typeof result !== 'object') throw new Error('createScene() must return {scene, cameras, update}');- info.shape = {- has_scene: !!(result.scene && result.scene.isScene),- has_cameras: Array.isArray(result.cameras),- has_update: typeof result.update === 'function',- };- if (!info.shape.has_scene) throw new Error('createScene().scene is not a THREE.Scene');+ if (!(result.scene && result.scene.isScene)) throw new Error('createScene().scene is not a THREE.Scene');const { cameras, problems } = validateCameras(result.cameras);info.cameras = cameras;info.camera_problems = problems;@@ -323,10 +306,8 @@ async function boot(opts) {if (!state.update) info.camera_problems.push({ severity: 'warn', text: 'createScene().update(t, dt) is not a function (scene will be static)' });info.stage = 'loads';- const tLd = performance.now();- info.load_wait = await waitForLoads(manager, LOAD_IDLE_TIMEOUT_MS);- info.timings_ms.loads = Math.round(performance.now() - tLd);- if (info.load_wait === 'timeout') state.hostWarnings.push('asset loads still pending after timeout');+ const loadWait = await waitForLoads(manager, LOAD_IDLE_TIMEOUT_MS);+ if (loadWait === 'timeout') state.hostWarnings.push('asset loads still pending after timeout');info.stage = 'first_update';runUpdate(0, 0);@@ -385,7 +366,6 @@ async function boot(opts) {} catch (e) {info.error = formatError(e);}- info.timings_ms.total = Math.round(performance.now() - t0);info.raf_calls = state.rafCalls;info.load_errors = state.loadErrors.slice();info.host_warnings = state.hostWarnings.slice();@@ -576,7 +556,7 @@ function renderAt(spec, t) {}const ms = Math.round(performance.now() - t0);// the camera actually used: differs from spec.position when camera repair fired- return { dataUrl: state.canvas.toDataURL('image/png'), ms, sim_time: state.simTime,+ return { dataUrl: state.canvas.toDataURL('image/png'), ms,position: [cam.position.x, cam.position.y, cam.position.z] };}diff --git a/harness/runtime_js/lib/shader_report.mjs b/harness/runtime_js/lib/shader_report.mjsindex 04d32f39..afdd9ccf 100644--- a/harness/runtime_js/lib/shader_report.mjs+++ b/harness/runtime_js/lib/shader_report.mjs@@ -120,8 +120,7 @@ export async function compileIntoReport(report, files, host) {}return result;}, errors.some((e) => e.kind === 'undeclared_uniform'));- const shaderErrors = comp.shader_errors.map(({ _key, ...e }) => e);- for (const e of shaderErrors) {+ for (const e of comp.shader_errors) {const loc = locateSourceLine(files, e.source_line);errors.push({file: loc.file || (e.material ? `(material ${e.material})` : '(assembled shader)'),@@ -134,7 +133,7 @@ export async function compileIntoReport(report, files, host) {(a.severity === 'error' ? errors : warnings).push({ file: '(runtime material)', line: null, kind: a.kind, material: a.material, message: a.message, fix_hint: a.severity === 'error' ? a.message : '' });}report.compile = { ms: comp.compile_ms, programs: comp.programs, custom_materials: comp.custom_materials, renderer: boot.renderer, gpu: host.gpu };- if (comp.programs > 0 && shaderErrors.length === 0) {+ if (comp.programs > 0 && comp.shader_errors.length === 0) {const declarationFiles = verifiedDeclarations(files, comp.evaluated_sources || []);for (let i = errors.length - 1; i >= 0; i--) {const e = errors[i];diff --git a/harness/runtime_js/lib/stack.mjs b/harness/runtime_js/lib/stack.mjsindex d2f339b1..f9e6998b 100644--- a/harness/runtime_js/lib/stack.mjs+++ b/harness/runtime_js/lib/stack.mjs@@ -2,12 +2,12 @@// python side can route "file:line" to the repair agent.//// import { errorRecord } from './stack.mjs';-// errorRecord(err, wsDir) -> { type, message, file, line, column, frames: [{file,line,column,fn}], stack }+// errorRecord(err, wsDir) -> { type, message, file, line, frames: [{file,line,fn}], stack }import path from 'node:path';import { fileURLToPath } from 'node:url';-const FRAME_RE = /^\s*at\s+(?:(.*?)\s+\()?((?:file:\/\/|\/|[A-Za-z]:\\)[^:)]+):(\d+):(\d+)\)?\s*$/;+const FRAME_RE = /^\s*at\s+(?:(.*?)\s+\()?((?:file:\/\/|\/|[A-Za-z]:\\)[^:)]+):(\d+)(?::\d+)\)?\s*$/;function relativeTo(file, wsDir) {let p = file;@@ -25,13 +25,13 @@ function relativeTo(file, wsDir) {return p;}-/** Parse V8 stack frames into {file,line,column,fn}, workspace-relative where possible. */+/** Parse V8 stack frames into {file,line,fn}, workspace-relative where possible. */export function parseFrames(stack, wsDir, maxFrames = 12) {const frames = [];for (const line of String(stack || '').split('\n')) {const m = FRAME_RE.exec(line);if (!m) continue;- frames.push({ fn: m[1] || '', file: relativeTo(m[2], wsDir), line: Number(m[3]), column: Number(m[4]) });+ frames.push({ fn: m[1] || '', file: relativeTo(m[2], wsDir), line: Number(m[3]) });if (frames.length >= maxFrames) break;}return frames;@@ -50,14 +50,13 @@ export function errorRecord(err, wsDir) {// Node reports ESM syntax errors as "file:///abs/path.js:LINE\n<code>\n ^^^\nSyntaxError: ..."if (!src && e.stack) {const m = /^(file:\/\/\S+?|\/\S+?):(\d+)\s*$/m.exec(e.stack);- if (m) src = { fn: '', file: relativeTo(m[1], wsDir), line: Number(m[2]), column: 0 };+ if (m) src = { fn: '', file: relativeTo(m[1], wsDir), line: Number(m[2]) };}return {type: e.name || e.constructor.name || 'Error',message: e.message,file: src ? src.file : '',line: src ? src.line : null,- column: src ? src.column : null,frames,stack: String(e.stack || '').split('\n').slice(0, 20).join('\n'),};diff --git a/harness/runtime_js/lib/syntax_check.mjs b/harness/runtime_js/lib/syntax_check.mjsindex 5ceff040..c7c98a9a 100644--- a/harness/runtime_js/lib/syntax_check.mjs+++ b/harness/runtime_js/lib/syntax_check.mjs@@ -2,7 +2,7 @@// (vm.SourceTextModule: compiled, never linked or run). That parse error has no line, so// only a file that fails pays a second process, `node --input-type=module --check`.// node --experimental-vm-modules lib/syntax_check.mjs FILE... → {"bad": [{file, line, message, stderr}]}-// import { findSyntaxError, listJsFiles } from './syntax_check.mjs';+// import { findSyntaxError, listSourceFiles } from './syntax_check.mjs';import fs from 'node:fs';import path from 'node:path';@@ -54,15 +54,10 @@ export function listSourceFiles(dir, suffixes = new Set(['.js', '.mjs'])) {return out.sort();}-/** Only JavaScript is passed to the ES module syntax parser. */-export function listJsFiles(dir) {- return listSourceFiles(dir);-}-/** First file under srcDir that fails to parse, or null (one child process for all of them:* vm modules need the flag this process was not started with). */export function findSyntaxError(srcDir) {- const r = spawnSync(process.execPath, ['--experimental-vm-modules', SELF, ...listJsFiles(srcDir)], { encoding: 'utf8', timeout: 60000 });+ const r = spawnSync(process.execPath, ['--experimental-vm-modules', SELF, ...listSourceFiles(srcDir)], { encoding: 'utf8', timeout: 60000 });try {return JSON.parse((r.stdout || '').trim().split('\n').pop()).bad[0] || null;} catch (_e) {diff --git a/harness/runtime_js/lib/update_hooks.mjs b/harness/runtime_js/lib/update_hooks.mjsindex b93620af..c68d3d0d 100644--- a/harness/runtime_js/lib/update_hooks.mjs+++ b/harness/runtime_js/lib/update_hooks.mjs@@ -44,8 +44,7 @@ export function observeUpdateHooks(scene, exercise) {for (let current = object; current && current !== scene; current = current.parent) {path.unshift(current.name || current.type || 'Object3D');}- const row = { path: path.join('/') || scene.name || 'Scene', zone: path[0] || '', calls: 0,- instrumented: !!(descriptor && descriptor.writable && descriptor.value === original) };+ const row = { path: path.join('/') || scene.name || 'Scene', zone: path[0] || '', calls: 0, instrumented: !!descriptor.writable };row.empty = EMPTY_FN_RE.test(String(original).trim());rows.push(row);if (!row.instrumented) return;@@ -68,6 +67,5 @@ export function observeUpdateHooks(scene, exercise) {for (const undo of restore.reverse()) undo();}for (const [row, [object, state]] of before) row.moved = stateOf(object) !== state;- return { hooks: rows, unobserved: rows.filter(row => row.instrumented && row.calls === 0 && !row.moved && !row.empty),- limitation: 'Only property-dispatched hooks during the sampled update interval are observed. Captured callback references and delayed animations can be unobserved; inspect the parent forwarding before changing code.' };+ return { hooks: rows, unobserved: rows.filter(row => row.instrumented && row.calls === 0 && !row.moved && !row.empty) };}diff --git a/harness/runtime_js/probe_scene.mjs b/harness/runtime_js/probe_scene.mjsindex ebacada6..ffb6e622 100644--- a/harness/runtime_js/probe_scene.mjs+++ b/harness/runtime_js/probe_scene.mjs@@ -37,10 +37,6 @@ import { compileIntoReport, staticShaderReport } from './lib/shader_report.mjs';const args = parseCli({'no-settle': { type: 'boolean', default: false },'camera-repair': { 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- // flag parses (drivers share a switch list) and changes nothing.- 'no-post': { type: 'boolean', default: false },ws: {}, out: {}, gpu: { default: process.env.C3D_RENDER_GPU || 'auto' }, 'timeout-ms': { default: '60000' },scene: { default: 'src/scene.js' }, glb: { default: '' },compile: { type: 'boolean', default: false }, 'shaders-out': { default: '' }, 'sun-azimuth': { default: '' },@@ -134,7 +130,7 @@ async function main() {phase = 'report';// Probe truth is snapshotted BEFORE any forced compile: the probe gate sees// exactly what a standalone probe would; the preflight below sees everything.- result.shader_errors = (await page.evaluate(() => window.__c3v.shaderErrors())).map(({ _key, ...e }) => e);+ result.shader_errors = await page.evaluate(() => window.__c3v.shaderErrors());Object.assign(result, errorSummary(host.errors, boot));result.ok = boot.ok && result.update_ok === true && result.console_errors.length === 0 && result.shader_errors.length === 0;diff --git a/harness/runtime_js/render_glb.mjs b/harness/runtime_js/render_glb.mjsindex f82294d8..5375c199 100644--- a/harness/runtime_js/render_glb.mjs+++ b/harness/runtime_js/render_glb.mjs@@ -19,7 +19,7 @@ import path from 'node:path';import { ensureDir, finish, parseCli, writeJson } from './lib/cli.mjs';import { launchBrowser, importMapHtml, RUNTIME_MOUNT, serveDirs } from './lib/host_env.mjs';-import { bounded, releaseBrowser } from './lib/host_page.mjs';+import { bounded } from './lib/host_page.mjs';const MODES = ['shaded', 'wire', 'normals', 'silhouette', 'clay'];@@ -132,7 +132,7 @@ async function main() {step('cleanup');if (page) await bounded(page.close(), 3000);step('page.closed');- await bounded(releaseBrowser(launched), 3000);+ if (launched?.browser) await bounded(launched.release(), 3000);step('released');await bounded(srv.close(), 2000);step('srv.closed');diff --git a/harness/runtime_js/render_scene.mjs b/harness/runtime_js/render_scene.mjsindex ab417109..cac4961e 100644--- a/harness/runtime_js/render_scene.mjs+++ b/harness/runtime_js/render_scene.mjs@@ -38,7 +38,7 @@ const args = parseCli({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.C3D_RENDER_GPU || 'auto' }, 'fps-seconds': { default: '2' },- 'timeout-ms': { default: '240000' }, 'log-depth': { type: 'boolean', default: false },+ 'timeout-ms': { default: '240000' },scene: { default: 'src/scene.js' }, 'external-frames': { default: '' },glb: { default: '' }, // scene_blender: the census GLB, booted through lib/glb_scene.mjs (D102)});@@ -84,7 +84,7 @@ async function main() {let host;try {host = await openHost(args.ws, {- width, height, gpu: args.gpu, logDepth: args['log-depth'], sceneRel: args.scene.replace(/^\.?\//, ''),+ width, height, gpu: args.gpu, sceneRel: args.scene.replace(/^\.?\//, ''),glb: args.glb ? path.resolve(args.glb) : null,createSceneTimeoutMs: createTimeoutMs(timeoutMs),settle: !args['no-settle'],@@ -169,7 +169,7 @@ async function main() {const post = await page.evaluate(() => window.__c3v.post());if (post && metrics.census) metrics.census.post = post;} catch (e) { sceneErr('post readback failed', e); }- metrics.shader_errors = (await page.evaluate(() => window.__c3v.shaderErrors())).map(({ _key, ...e }) => e);+ metrics.shader_errors = await page.evaluate(() => window.__c3v.shaderErrors());metrics.update_errors = await page.evaluate(() => window.__c3v.updateErrors());// the whole run's, not boot's: coverage failures are pushed while camera checks runmetrics.host_warnings = await page.evaluate(() => window.__c3v.hostWarnings());diff --git a/harness/tests/prompts/manifest.json b/harness/tests/prompts/manifest.jsonindex 032c6666..48317212 100644--- a/harness/tests/prompts/manifest.json+++ b/harness/tests/prompts/manifest.json@@ -449,7 +449,7 @@"job:asset_bollard@r00/prompt": {"bytes": 5182, "sha256": "eb2371d5d91daf0664ea4155eed95618b5798277e9b8e5cd118e48181aa499a3"},"job:asset_bollard@r00/scope": {"bytes": 357, "sha256": "450d659126efa73cdfe3371f18464e6ab40230af78367de6994d4712c9a8aaaf"},"job:asset_bollard@r00/system": {"bytes": 997, "sha256": "20d72b3bb074ab09ce4b2b6656b8bd0fcffef4fd3d437f2c171cb3efd96d475c"},- "job:env@r00/prompt": {"bytes": 43448, "sha256": "1164ffe0334e8a194b523a848b0ab4001325df7919c87e8e8b6567f7dd25143e"},+ "job:env@r00/prompt": {"bytes": 43413, "sha256": "7ef4021041fe74bcab2a6235390553c1673e50a46648263698434a3460d2106c"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"job:refine_quay@r01/prompt": {"bytes": 10092, "sha256": "7424fa604c576ccaa58bb104174f27b1ff6b38ea9682f3335170b1d821e73bd0"},@@ -464,7 +464,7 @@"job:refine_water@r02/prompt": {"bytes": 10096, "sha256": "99d6e0866d9bc4a9475f55db3e6b6efc7166bcb74b0bd80dd8157fa319086045"},"job:refine_water@r02/scope": {"bytes": 354, "sha256": "cbf41e8b42c1c64671a237a42d06bd8188616fd533a767c716e64758d211f737"},"job:refine_water@r02/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:zones_quay_water@r00/prompt": {"bytes": 49403, "sha256": "49852823f06091b44f3e8a993529183dd622d60cf1c1cf9122442f51a8d3705e"},+ "job:zones_quay_water@r00/prompt": {"bytes": 49368, "sha256": "6376c1139592edc6e6937b2c6781d259b570692940460b358eb3b2fd651260c0"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3690, "sha256": "5e7031f1c8d724681399e545e6adf0af8e6a8da6cae4364c7220a15b41f0744b"},@@ -535,10 +535,10 @@"job:asset_crate@r00/prompt": {"bytes": 18032, "sha256": "27dfd5f4bedcc036f93c844230347401da2c4c4f8b1d300bfaece147b704c3fc"},"job:asset_crate@r00/scope": {"bytes": 430, "sha256": "3c4b45fd7cc847cc6a6a5f3b83784cddab99440be445d61f924f56b834cd1476"},"job:asset_crate@r00/system": {"bytes": 3716, "sha256": "6068eff7b8c36b4edcc5d64ead79bd3de7386e0bbaf4fb141210883fb34f8518"},- "job:env@r00/prompt": {"bytes": 43448, "sha256": "1164ffe0334e8a194b523a848b0ab4001325df7919c87e8e8b6567f7dd25143e"},+ "job:env@r00/prompt": {"bytes": 43413, "sha256": "7ef4021041fe74bcab2a6235390553c1673e50a46648263698434a3460d2106c"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:zones_quay_water@r00/prompt": {"bytes": 49583, "sha256": "89372b540939bb9cba1c787aecb7943bd7e4c2f1674546bde5f4d00172ddcf76"},+ "job:zones_quay_water@r00/prompt": {"bytes": 49548, "sha256": "6a131737cde4664b3b56a91cea3933eee53d3394a55975cfcba433ec6da3fbfb"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"judge:asset:runs/run/_assets/crate/artifacts/renders/r00/assets/crate/input": {"bytes": 3759, "sha256": "d3507d23f5a84d828cef7b6b6f9b2c5df3795a2c300ee7aaeb038af59267fc30"},@@ -579,10 +579,10 @@"chat:planner:planner/sampling": {"bytes": 8047, "sha256": "ac5eba7173d30fcdfc0682ff102fc65e9f4325a5a4f1fbdaca4b0dcd4547d4b1"},"chat:planner:planner/system": {"bytes": 26758, "sha256": "aab6253b3d1b9716c2e6e1786d07b89bd8efabb1f2476f5f9c10e18b3fe6ae8f"},"context:runs/run/files": {"bytes": 55674, "sha256": "b13f8fe30cb373f4e8eae10b376ba430710b7c28fc71b830f63a35fefae4eb36"},- "job:env@r00/prompt": {"bytes": 43448, "sha256": "1164ffe0334e8a194b523a848b0ab4001325df7919c87e8e8b6567f7dd25143e"},+ "job:env@r00/prompt": {"bytes": 43413, "sha256": "7ef4021041fe74bcab2a6235390553c1673e50a46648263698434a3460d2106c"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:zones_quay_water@r00/prompt": {"bytes": 48730, "sha256": "0c4385a64285a8527856475a914c1cc15e53ddcac9660ddc16f5cb35808f690d"},+ "job:zones_quay_water@r00/prompt": {"bytes": 48695, "sha256": "69d9b51d3d241fd0a71bcd11b36734233dd13f4eb139b1c06d70073ae97147bf"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3690, "sha256": "ebaaf972b6033176defee1013c1eb8b83843caef8172efe2dba99ccfb339a33f"},@@ -623,7 +623,7 @@"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},"context:runs/run/files": {"bytes": 55674, "sha256": "b13f8fe30cb373f4e8eae10b376ba430710b7c28fc71b830f63a35fefae4eb36"},- "job:env@r00/prompt": {"bytes": 43448, "sha256": "1164ffe0334e8a194b523a848b0ab4001325df7919c87e8e8b6567f7dd25143e"},+ "job:env@r00/prompt": {"bytes": 43413, "sha256": "7ef4021041fe74bcab2a6235390553c1673e50a46648263698434a3460d2106c"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"job:r00_baseline_repair1@r00/prompt": {"bytes": 3261, "sha256": "d6f7ee211ced016d303fba6017d6c0d86148b201135f6b9e659220f797bcc967"},@@ -641,7 +641,7 @@"job:rebuild@r01/prompt": {"bytes": 10049, "sha256": "aa103063270f75b7b12d2f4e9d0795c02c69651ae119a3ee404e2e59391260a1"},"job:rebuild@r01/scope": {"bytes": 382, "sha256": "6ea60c37d5ea2360a24a236ed77174ca29ebdcb1ed8331da08e68fc494305dc9"},"job:rebuild@r01/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:zones_quay_water@r00/prompt": {"bytes": 49403, "sha256": "49852823f06091b44f3e8a993529183dd622d60cf1c1cf9122442f51a8d3705e"},+ "job:zones_quay_water@r00/prompt": {"bytes": 49368, "sha256": "6376c1139592edc6e6937b2c6781d259b570692940460b358eb3b2fd651260c0"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"skills:runs/run:baseline@r00/routed": {"bytes": 156, "sha256": "cae5ab46c39f9f4efb7ae3c4758b05d768025f93d525d5e13812b916a583fd30"},@@ -680,7 +680,7 @@"chat:planner:zone-layout#2/sampling": {"bytes": 3397, "sha256": "160445a83ede28afc0191547fd42d9341e694ef70aaad380bebf60ead0a65c49"},"chat:planner:zone-layout#2/system": {"bytes": 3326, "sha256": "494acec302dd23fa2fc6ee1eb6d48e873d6cf0ad98bad413e27578cf062313d4"},"context:runs/run/files": {"bytes": 55674, "sha256": "b13f8fe30cb373f4e8eae10b376ba430710b7c28fc71b830f63a35fefae4eb36"},- "job:env@r00/prompt": {"bytes": 43448, "sha256": "1164ffe0334e8a194b523a848b0ab4001325df7919c87e8e8b6567f7dd25143e"},+ "job:env@r00/prompt": {"bytes": 43413, "sha256": "7ef4021041fe74bcab2a6235390553c1673e50a46648263698434a3460d2106c"},"job:env@r00/scope": {"bytes": 334, "sha256": "b94c09720c9e481759ea0408d7ef708c4d5a3e47b1c2b28a8d901a7c77d7c66b"},"job:env@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"job:refine_quay@r01/prompt": {"bytes": 10092, "sha256": "7424fa604c576ccaa58bb104174f27b1ff6b38ea9682f3335170b1d821e73bd0"},@@ -689,7 +689,7 @@"job:refine_water@r01/prompt": {"bytes": 10097, "sha256": "2af3470e4b4cf5e411e22cc5402886696b2adc9eaf0460a7b934b5351ccb73e0"},"job:refine_water@r01/scope": {"bytes": 354, "sha256": "5c7aa29b996f768b637082248e69fbe65f7ed49d9f5abff27c464da564365b74"},"job:refine_water@r01/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},- "job:zones_quay_water@r00/prompt": {"bytes": 49403, "sha256": "49852823f06091b44f3e8a993529183dd622d60cf1c1cf9122442f51a8d3705e"},+ "job:zones_quay_water@r00/prompt": {"bytes": 49368, "sha256": "6376c1139592edc6e6937b2c6781d259b570692940460b358eb3b2fd651260c0"},"job:zones_quay_water@r00/scope": {"bytes": 379, "sha256": "5b1def419a1370ab2d9f2345bc4a5232ef3c793d4e4f1e01bd5ab9a3a8e88a7d"},"job:zones_quay_water@r00/system": {"bytes": 5614, "sha256": "b23b5fa6365b226f94f9cf4e9f3f7235628d22c1bee3ca22c6f44406ce518cdb"},"judge:scene:runs/run/artifacts/renders/r00/input": {"bytes": 3690, "sha256": "5e7031f1c8d724681399e545e6adf0af8e6a8da6cae4364c7220a15b41f0744b"},@@ -729,7 +729,7 @@"chat:model:asset_fishing_boat:r00/messages": {"bytes": 3365, "sha256": "583f9c5888c4ff1567e3cbb2d9e3e8701e31169fd30f295d89dae16e046e55cc"},"chat:model:asset_fishing_boat:r00/sampling": {"bytes": 92, "sha256": "08e72af1b4fb249378c5a151e019ded70a1014eafa4d50f70927bb225f695678"},"chat:model:asset_fishing_boat:r00/system": {"bytes": 3483, "sha256": "79f9f153926a1b9edee34e0fbc13767ff419319c18575fc0ad2bb553d9e6f3ad"},- "chat:model:env:r00/messages": {"bytes": 46387, "sha256": "c4b540046974c278989f9361925e006c1825d93fdf544c8eab922676b7a72165"},+ "chat:model:env:r00/messages": {"bytes": 46351, "sha256": "c130b3dc17e9fdbd5b3ab768be7a001322de0d137af4af17cc38001306d7c7e8"},"chat:model:env:r00/sampling": {"bytes": 92, "sha256": "08e72af1b4fb249378c5a151e019ded70a1014eafa4d50f70927bb225f695678"},"chat:model:env:r00/system": {"bytes": 7632, "sha256": "2c187b396badbf62b604234f29d488679bf5a0446f67f0cfacb703509fc1e8ea"},"chat:model:refine_quay:r01/messages": {"bytes": 12521, "sha256": "7f839ae609b083385bc8a1c2d960e0d9c31842cac9e3c95f2c74d2afea73de17"},@@ -738,7 +738,7 @@"chat:model:refine_water:r01/messages": {"bytes": 12527, "sha256": "c7684c66aed9311a614b682e72e5698a373e6b8ac81f7669eda75389f8157fa4"},"chat:model:refine_water:r01/sampling": {"bytes": 92, "sha256": "2a36044e5c117fc288123a5937c6e3cb5845f040b4de69f9c2440f623956c381"},"chat:model:refine_water:r01/system": {"bytes": 7632, "sha256": "2c187b396badbf62b604234f29d488679bf5a0446f67f0cfacb703509fc1e8ea"},- "chat:model:zones_quay_water:r00/messages": {"bytes": 52203, "sha256": "83aabee30c7a9fee9aaaa749b37c1ff8fcaaefebd079834cfce1d03f9a1bb82c"},+ "chat:model:zones_quay_water:r00/messages": {"bytes": 52167, "sha256": "1ec086c228a94517243c0bec4e7227a51e7dcf5ce72c1170dd6ef4d3be0c1c86"},"chat:model:zones_quay_water:r00/sampling": {"bytes": 92, "sha256": "08e72af1b4fb249378c5a151e019ded70a1014eafa4d50f70927bb225f695678"},"chat:model:zones_quay_water:r00/system": {"bytes": 7632, "sha256": "2c187b396badbf62b604234f29d488679bf5a0446f67f0cfacb703509fc1e8ea"},"chat:planner:planner/messages": {"bytes": 204, "sha256": "b91c27cbf7a8071bf320a68a6113bd25896bf0422f92b9087fb155bad18dbdc1"},@@ -866,9 +866,9 @@"chat:planner:planner-brief/system": {"bytes": 3133, "sha256": "a66f0fe3b4610d21d0969a732e8d15f208a1147fe6a0ec6ce97606e400142580"},"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},- "chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "context:runs/run/files": {"bytes": 41718, "sha256": "91c41f64049da39d2cf5cef06cf18c9cece087e66f0e0b5852c80f11a9bdb11b"},- "job:baseline@r00/prompt": {"bytes": 17709, "sha256": "5a683ed53fc41f4b652ede3f8e8ef2c43ee1dff7815212407d0b4947267a9218"},+ "chat:planner:planner/system": {"bytes": 18287, "sha256": "0e78778a5c81b420699c7148ee039722877c818cea9844f793d543fccc8ef97b"},+ "context:runs/run/files": {"bytes": 41696, "sha256": "f4e6cba8ba386a1b16c68fdd363eb5633e7622c2cd5357238ede92b7f1b19aec"},+ "job:baseline@r00/prompt": {"bytes": 17698, "sha256": "f39ab241b54cdce8db4eda26ba44d4664b8869ec13e57b8b5e863fb9d982b459"},"job:baseline@r00/scope": {"bytes": 432, "sha256": "b7970aa82707a446f41764e551d45617767914f38d6861453d2d61991d48ed05"},"job:baseline@r00/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},"job:refine@r01/prompt": {"bytes": 7175, "sha256": "afdc25db6e97a95734a0b81c66b094fe15756d9ae4526ba46df4fc8ca439ce45"},@@ -905,9 +905,9 @@"chat:planner:planner-brief/system": {"bytes": 3133, "sha256": "a66f0fe3b4610d21d0969a732e8d15f208a1147fe6a0ec6ce97606e400142580"},"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},- "chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "context:runs/run/files": {"bytes": 41718, "sha256": "91c41f64049da39d2cf5cef06cf18c9cece087e66f0e0b5852c80f11a9bdb11b"},- "job:baseline@r00/prompt": {"bytes": 17678, "sha256": "f770776e04e5d37aca258b971db6eee596f72af5d25575f028cab8c45fbda98f"},+ "chat:planner:planner/system": {"bytes": 18287, "sha256": "0e78778a5c81b420699c7148ee039722877c818cea9844f793d543fccc8ef97b"},+ "context:runs/run/files": {"bytes": 41696, "sha256": "f4e6cba8ba386a1b16c68fdd363eb5633e7622c2cd5357238ede92b7f1b19aec"},+ "job:baseline@r00/prompt": {"bytes": 17667, "sha256": "92e0968c790d93dcd7b2237f826f314fbbc2f0b82977552f8b5875df7eb1c18c"},"job:baseline@r00/scope": {"bytes": 648, "sha256": "eed11065615f36b3d1b869300d16518bd4ec6e258630c204fdeff14e676cc2d8"},"job:baseline@r00/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},"job:refine@r01/prompt": {"bytes": 8861, "sha256": "40ce1992b720f3a98f57dedeab35b70590f3f9a49ef111a544a300896fa39a35"},@@ -936,9 +936,9 @@"chat:planner:planner-brief/system": {"bytes": 3133, "sha256": "a66f0fe3b4610d21d0969a732e8d15f208a1147fe6a0ec6ce97606e400142580"},"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},- "chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},- "context:runs/run/files": {"bytes": 41718, "sha256": "91c41f64049da39d2cf5cef06cf18c9cece087e66f0e0b5852c80f11a9bdb11b"},- "job:baseline@r00/prompt": {"bytes": 17709, "sha256": "5a683ed53fc41f4b652ede3f8e8ef2c43ee1dff7815212407d0b4947267a9218"},+ "chat:planner:planner/system": {"bytes": 18287, "sha256": "0e78778a5c81b420699c7148ee039722877c818cea9844f793d543fccc8ef97b"},+ "context:runs/run/files": {"bytes": 41696, "sha256": "f4e6cba8ba386a1b16c68fdd363eb5633e7622c2cd5357238ede92b7f1b19aec"},+ "job:baseline@r00/prompt": {"bytes": 17698, "sha256": "f39ab241b54cdce8db4eda26ba44d4664b8869ec13e57b8b5e863fb9d982b459"},"job:baseline@r00/scope": {"bytes": 432, "sha256": "b7970aa82707a446f41764e551d45617767914f38d6861453d2d61991d48ed05"},"job:baseline@r00/system": {"bytes": 3208, "sha256": "e24e99f321231e5587cae7f4fbbbcc50fbd254768f4f4c860c4dfa8f83804810"},"job:refine@r01/prompt": {"bytes": 7012, "sha256": "9db3905eac671203349cd349d93748e1abadf89a9f584948cf3e64f0527abbcd"},@@ -962,12 +962,12 @@},"static_object.threejs.single_shot.repair": {"payloads": {- "chat:model:baseline:r00/messages": {"bytes": 24978, "sha256": "95c6c4e648e5751c926da6b005ca4c5537c0d9aef80c273362073daf1f021c78"},+ "chat:model:baseline:r00/messages": {"bytes": 24967, "sha256": "7ebfb3cabaf99743922328a4dff9f9f8167187120d66b78dc4ce6e4f05daab3f"},"chat:model:baseline:r00/sampling": {"bytes": 92, "sha256": "08e72af1b4fb249378c5a151e019ded70a1014eafa4d50f70927bb225f695678"},"chat:model:baseline:r00/system": {"bytes": 5516, "sha256": "4f39c82bc5c139cb7564823120ed18ae1a9ed94b84bdf99563292d0860394e3f"},"chat:model:r00_baseline_repair1:r00/messages": {"bytes": 2019, "sha256": "d7fd178860643c0fb77bd83a729b0229baece14da27ce07517f81a2e7a0c14db"},"chat:model:r00_baseline_repair1:r00/sampling": {"bytes": 92, "sha256": "1ce73c4d8b7c06d8e295413591db369fae9570968bd051ceb1eb70d0402a26ca"},- "chat:model:r00_baseline_repair1:r00/system": {"bytes": 14882, "sha256": "cf2354ea9acba5921cbdb586a5c28662910a629a2135239ec8ea1dad215e9372"},+ "chat:model:r00_baseline_repair1:r00/system": {"bytes": 14871, "sha256": "424eba16dd8730f5ab1a13e13a5aa2ccadfc38323c964570bd180d4f121011af"},"chat:model:refine:r01/messages": {"bytes": 13654, "sha256": "81fe85d485acfc5ad1e84dc16abbc49e1b20144a12ba98131a796707d50753e2"},"chat:model:refine:r01/sampling": {"bytes": 92, "sha256": "2a36044e5c117fc288123a5937c6e3cb5845f040b4de69f9c2440f623956c381"},"chat:model:refine:r01/system": {"bytes": 5516, "sha256": "4f39c82bc5c139cb7564823120ed18ae1a9ed94b84bdf99563292d0860394e3f"},@@ -976,7 +976,7 @@"chat:planner:planner-brief/system": {"bytes": 3133, "sha256": "a66f0fe3b4610d21d0969a732e8d15f208a1147fe6a0ec6ce97606e400142580"},"chat:planner:planner/messages": {"bytes": 1354, "sha256": "5b1a589e27562a3668649aed4be4857a34804a2acdc140eb8fb3630d970f71a6"},"chat:planner:planner/sampling": {"bytes": 6272, "sha256": "04dbfbbd42d8b93a12571a1908beacc7eb471e6f2c0fc077371aa86e2a99fb40"},- "chat:planner:planner/system": {"bytes": 18298, "sha256": "0483e07168e1b18aeb18cda38887e719a4c3993161c600c61da469ff2fccd4f4"},+ "chat:planner:planner/system": {"bytes": 18287, "sha256": "0e78778a5c81b420699c7148ee039722877c818cea9844f793d543fccc8ef97b"},"judge:static_object:runs/run/artifacts/renders/r00/input": {"bytes": 9060, "sha256": "9db5de7f375d60e4e56f9677affd8c4fbe4261f62d0111d1c021f08dcd5690bf"},"judge:static_object:runs/run/artifacts/renders/r00/messages": {"bytes": 6699, "sha256": "6e3964ce3478de892b3c5dde9eb3154e9a54c2a669315a8e6f4b808c15dd930c"},"judge:static_object:runs/run/artifacts/renders/r00/sampling": {"bytes": 11368, "sha256": "d689cdebe9d63a438597fd51e16228f8d5fed5d5693c736223ce782f62a12242"},diff --git a/harness/tests/scene_runtime/test_driver_flags.py b/harness/tests/scene_runtime/test_driver_flags.pyindex 3a44c004..43fad666 100644--- a/harness/tests/scene_runtime/test_driver_flags.py+++ b/harness/tests/scene_runtime/test_driver_flags.py@@ -11,14 +11,18 @@ from tests.scene_runtime.conftest import needs_nodepytestmark = [pytest.mark.node, needs_node]-FLAGS = ["--no-settle", "--camera-repair", "--no-post"]+# the probe is a raw geometry instrument: it has no post chain to switch off+FLAGS = {+ "render_scene.mjs": ["--no-settle", "--camera-repair", "--no-post"],+ "probe_scene.mjs": ["--no-settle", "--camera-repair"],+}[email protected]("driver", ["render_scene.mjs", "probe_scene.mjs"])[email protected]("driver", sorted(FLAGS))def test_every_documented_flag_parses(driver):s = get_settings()node = s.binaries.node or "node"- out = subprocess.run([node, str(s.runtime_js_dir() / driver), *FLAGS],+ out = subprocess.run([node, str(s.runtime_js_dir() / driver), *FLAGS[driver]],capture_output=True, text=True, timeout=60)blob = out.stdout + out.stderrassert "ERR_PARSE_ARGS" not in blob, blob[-400:]