Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Add render-pick suite task and measure branches on it (Part of #67)

Nguyen Xuan An7bda02a9ab7a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 824b65e1..35740fe0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Unreleased
+- Add the suite task `render-pick` and measure branches on it (part of issue #67, which stays open). A gallery with a pillar and a spotlight offered at three places; the `litPainting` check traces rays from the exported light to 15 painting points against the pillar, so it grades the pick and not the method. 10 runs (Haiku 3 and Sonnet 2, branches on and off) all passed, none called `branch`, and calls did not drop (Haiku 4 to 6 on, 4 to 5 off; Sonnet 3 either way). With `best-of-three` that is 22 runs on two tasks with no measured gain from branches. `npm run smoke:agent-branches` passes on SwiftShader. Bench only; core did not change.
+
- Add walking routes over terrain with holes (part of issue #64; splat layers stay at four, see `docs/terrain.md`). `addons/navmesh` builds a walkable grid from triangles (slope limit, agent radius, holes, obstacle footprints) and `findPath` runs A* with line-of-sight string pulling, deterministic, with cell and search budgets that throw a `RangeError` naming what to raise. `scene_inspect` takes `path: { ground, from, to, avoid, ... }` and returns keyframes for a node translation track, described in `scene_capabilities` `navigation`; the `scene_capabilities` result grew by 624 bytes and the `scene_inspect` schema by one record field. The suite gets `terrain-path-walk` (two holes and a rock) and records `pathQueries`; the `walkPath` check takes several openings and `avoidNodes`. Size: `entry:navmesh` 3,257 B gzip, `agent-scene+lazy` +4.5 KB, core entries unchanged.
- Darken the automatic floor and measure the default look with a blind pairwise judge (part of issue #53). `bench/agent-modeling/default-judge.mjs` draws the six cold recipes under two defaults from the three-quarter view and the recipe camera (what `scene_look` draws), shows a Sonnet judge both in a seeded random order and reports wins with an exact binomial p. The current default beats no floor 18 of 18 (p 0.0000076, 9 of 9 in each position); the control, one image against itself, picks "first" 17 of 18, so a tie goes to the first. The floor colour goes from 0.6, 0.6, 0.58 to 0.22, 0.22, 0.21 because the judge named a floor too close to the backdrop: it beats the old floor 18 of 18, while 0.38 won 13 of 18 (p 0.096) and was dropped. Only recipes that get the automatic floor change; the judge spend was $4.50, above its $4 plan. Core did not change.
diff --git a/bench/agent-modeling/README.md b/bench/agent-modeling/README.md
index c1336378..8b3905c5 100644
--- a/bench/agent-modeling/README.md
+++ b/bench/agent-modeling/README.md
@@ -264,6 +264,21 @@ Every note names the same gap: the three-quarter view shows a surface and a shad
Result: agents ignored branches in all 12 runs. Sonnet wrote the right shade in its first `scene_apply` and exported (3 calls, with or without branches). Haiku varied from 3 to 7 calls either way, with no sign of an effect. Calls did not drop, so the issue's first done condition is not met. The task is too easy to need a comparison: the goal is arithmetic on sizes the prompt states. A task where the right variant can only be told from a render, or where a wrong pick costs a long repair, is the next try. Until then branches have no measured benefit on this suite.
+## Best of three, picked from a shadow (2026-11-01, issue #67)
+
+`render-pick` starts from a gallery: a floor, a back wall, a painting on it, a pillar 1.5 m in front of the painting and one shadow-casting spotlight at [-1.8, 2.4, 1.5], aimed at the painting. The prompt offers two more places, [0, 2.4, 1.5] and [1.8, 2.4, 1.5], and asks for the one from which the whole painting is lit with no pillar shadow on it. It gives no shadow geometry and does not mention branches. The check `litPainting` reads the exported recipe and traces rays itself: exactly one spot light, at an offered place, aimed at the painting's centre (0.05 rad), a cone that reaches every corner (at most 0.9 rad), shadows on, and none of 15 points on the painting's front face is hit by a ray-to-box test against the pillar. Computed over the 15 points, the pillar hides 6 from the first place, 6 from the second and none from the third, so only the third place passes. The pillar, painting, wall and floor must stay put. `tests/agent-modeling-suite.test.js` grades the reference and each shortcut (a shadowed place, shadows off, a light off the offered places, two lights, a moved pillar). The wall and floor are not graded beyond part count.
+
+| Model | Branches | Pass | Calls (runs) | Errors | Cost | `branch` calls | `scene_look` calls |
+| --- | --- | --- | --- | --- | --- | --- | --- |
+| Haiku | on | 3/3 | 6, 5, 4 | 0 | $0.06 | 0 | 3 |
+| Haiku | off | 3/3 | 5, 4, 5 | 0 | $0.06 | 0 | 3 |
+| Sonnet | on | 2/2 | 3, 3 | 0 | $0.62 | 0 | 0 |
+| Sonnet | off | 2/2 | 3, 3 | 0 | $0.61 | 0 | 0 |
+
+Result (measured): all 10 runs passed and none used branches. Sonnet picked the right place in its first `scene_apply` without looking (3 calls: `scene_create`, `scene_apply`, `scene_export_recipe`, plus one `ToolSearch`), which means it traced the pillar's shadow in its head; the layout is simple enough that this works. Haiku also chose right in its first apply, then called `scene_look` once to confirm, so a render was used as a check, not as the way to choose. Calls with branches on and off are within a call of each other. The issue's condition, a suite task that picks the best of three variants in fewer calls than now, is not met: calls did not drop, and the task did not make agents fork. Together with `best-of-three` (12 runs, no branch calls), that is 22 runs on two tasks where branches earned nothing measurable. What this does not show: a scene where tracing by hand is out of reach (many occluders, a bounced light, a colour or exposure judgement) or where the first guess is wrong and costs a long repair. I did not build one, and I did not reword this task until branches won.
+
+The other half of the issue, `npm run smoke:agent-branches` on SwiftShader: passed (fork, shared snapshot, review, labels, keep, hostile names), including the label check.
+
## A walk around two holes and a rock (2026-11-01, issue #64)
`terrain-path-walk` builds 40 m of hills with two round openings (radius 3 m at the origin, 2.5 m at [9, 9]) and a 3 m by 2 m by 3 m `rock` at [-8, -8], then walks a `walker` node from [-15, -15] to [15, 15] in 10 s. The check on the exported recipe samples 41 times: the position stays within 1.5 m of the ground height, at least 0.3 m outside both openings and at least 0.3 m from the rock's footprint, and starts and ends within 0.75 m of the two points. The `through` check confirms both openings are cut clean through. The robot GLB cannot stand on a recipe terrain (asset scenes hold no recipe geometry), so the character is a box node, like `terrain-hole-walk`. The prompt does not mention the path query: agents find it in the `scene_inspect` schema (`path`) and in `scene_capabilities` `navigation`. `pathQueries` in each record counts `scene_inspect` calls that passed `path`.
diff --git a/bench/agent-modeling/check.mjs b/bench/agent-modeling/check.mjs
index 34c9921f..efcc34ff 100644
--- a/bench/agent-modeling/check.mjs
+++ b/bench/agent-modeling/check.mjs
@@ -101,6 +101,71 @@ function checkShell(check, measures) {
return { pass: problems.length === 0, detail: problems.join('; ') || `${check.node} between ${round(nearest)} and ${round(farthest)} m of the centre` };
}
+const PAINTING_SAMPLES_ACROSS = 5;
+const PAINTING_SAMPLES_UP = 3;
+const AIM_TOLERANCE = 0.05;
+const POSITION_TOLERANCE = 0.05;
+
+/** Whether the straight segment between two points passes through an axis-aligned box (slab test). */
+function segmentHitsBox(from, to, boxMin, boxMax) {
+ let enter = 0;
+ let leave = 1;
+ for (let axis = 0; axis < 3; axis++) {
+ const travel = to[axis] - from[axis];
+ if (Math.abs(travel) < 1e-9) {
+ if (from[axis] < boxMin[axis] || from[axis] > boxMax[axis]) return false;
+ continue;
+ }
+ const near = (boxMin[axis] - from[axis]) / travel;
+ const far = (boxMax[axis] - from[axis]) / travel;
+ enter = Math.max(enter, Math.min(near, far));
+ leave = Math.min(leave, Math.max(near, far));
+ if (enter > leave) return false;
+ }
+ return true;
+}
+
+const angleBetween = (first, second) => {
+ const dot = first.reduce((total, value, axis) => total + value * second[axis], 0);
+ return Math.acos(Math.min(1, dot / (Math.hypot(...first) * Math.hypot(...second))));
+};
+
+// The one spotlight must sit at an offered place, aim at the painting with a cone that reaches all of it and cast
+// shadows, and no ray from it to the front face of the painting may meet the blocker.
+function checkLitPainting(check, measures) {
+ const painting = measures.nodeBounds(check.painting);
+ const blocker = measures.nodeBounds(check.blocker);
+ if (!painting || !blocker) return { pass: false, detail: `no drawn node ${check.painting} or ${check.blocker}` };
+ const lights = measures.spotLights;
+ if (lights.length !== 1) return { pass: false, detail: `${lights.length} spot lights, need exactly 1` };
+ const [light] = lights;
+ const placeIndex = check.positions.findIndex(place => Math.hypot(...place.map((value, axis) => value - light.position[axis])) <= POSITION_TOLERANCE);
+ if (placeIndex < 0) return { pass: false, detail: `light at ${light.position.map(round).join(', ')} is not an offered place` };
+ const frontZ = painting.max[2];
+ const centre = [(painting.min[0] + painting.max[0]) / 2, (painting.min[1] + painting.max[1]) / 2, frontZ];
+ const towardCentre = centre.map((value, axis) => value - light.position[axis]);
+ const aimError = angleBetween(light.direction, towardCentre);
+ const corners = [painting.min, painting.max].flatMap(low => [painting.min, painting.max].map(high => [low[0], high[1], frontZ]));
+ const reach = Math.max(...corners.map(corner => angleBetween(towardCentre, corner.map((value, axis) => value - light.position[axis]))));
+ const problems = [];
+ if (aimError > AIM_TOLERANCE) problems.push(`aimed ${round(aimError)} rad off the centre`);
+ if (light.angle < reach || light.angle > check.maxAngle) problems.push(`cone ${round(light.angle)} rad, needs ${round(reach)} to ${check.maxAngle}`);
+ if (light.castShadow !== true) problems.push('shadows are off');
+ let shadowed = 0;
+ for (let across = 0; across < PAINTING_SAMPLES_ACROSS; across++) {
+ for (let up = 0; up < PAINTING_SAMPLES_UP; up++) {
+ const point = [
+ painting.min[0] + (painting.max[0] - painting.min[0]) * across / (PAINTING_SAMPLES_ACROSS - 1),
+ painting.min[1] + (painting.max[1] - painting.min[1]) * up / (PAINTING_SAMPLES_UP - 1),
+ frontZ,
+ ];
+ if (segmentHitsBox(light.position, point, blocker.min, blocker.max)) shadowed++;
+ }
+ }
+ if (shadowed > 0) problems.push(`${shadowed} of ${PAINTING_SAMPLES_ACROSS * PAINTING_SAMPLES_UP} painting points are in shadow`);
+ return { pass: problems.length === 0, detail: problems.join('; ') || `place ${placeIndex + 1}, no shadow on the painting` };
+}
+
function checkOne(check, measures) {
switch (check.kind) {
case 'lint':
@@ -190,6 +255,8 @@ function checkOne(check, measures) {
}
case 'walkPath':
return checkWalkPath(check, measures);
+ case 'litPainting':
+ return checkLitPainting(check, measures);
case 'shell':
return checkShell(check, measures);
case 'bendsToward': {
diff --git a/bench/agent-modeling/gallery.mjs b/bench/agent-modeling/gallery.mjs
new file mode 100644
index 00000000..76c27215
--- /dev/null
+++ b/bench/agent-modeling/gallery.mjs
@@ -0,0 +1,57 @@
+// A gallery wall with a painting, a pillar in front of it and one spotlight. Three positions are offered for the light.
+// The pillar stands near the wall, so from two of the positions its shadow falls on part of the painting, and from the
+// third it does not. The prompt gives positions, not shadow geometry: the pick is told from a render (scene_look) or by
+// tracing rays past the pillar. The check on the exported recipe traces those rays itself, so it grades the result of
+// the pick and not the method.
+
+export const GALLERY_LIGHT_POSITIONS = [[-1.8, 2.4, 1.5], [0, 2.4, 1.5], [1.8, 2.4, 1.5]];
+const PAINTING_CENTRE = [0, 1.5, -1.98];
+const SPOT_ANGLE = 0.45;
+
+function aimedAt(position, target) {
+ const offset = target.map((value, axis) => value - position[axis]);
+ const length = Math.hypot(...offset);
+ return offset.map(value => Number((value / length).toFixed(4)));
+}
+
+function galleryRecipe(lightPosition) {
+ const parts = [
+ { id: 'floor', geometry: 'block', scale: [6, 0.05, 6], translation: [0, -0.025, 0] },
+ { id: 'wall', geometry: 'block', scale: [6, 3, 0.1], translation: [0, 1.5, -2.05] },
+ { id: 'painting', geometry: 'block', scale: [1, 0.7, 0.04], translation: PAINTING_CENTRE },
+ { id: 'pillar', geometry: 'block', scale: [0.4, 2.6, 0.4], translation: [-0.3, 1.3, -0.5] },
+ ];
+ return {
+ format: '67js.scene', schemaVersion: 1,
+ geometries: [{ id: 'block', type: 'box', bevel: 0 }],
+ materials: [{ id: 'plaster', color: [0.8, 0.78, 0.72] }],
+ nodes: parts.map(part => ({ material: 'plaster', ...part })),
+ environment: {
+ spotLights: [{
+ position: lightPosition, direction: aimedAt(lightPosition, PAINTING_CENTRE),
+ angle: SPOT_ANGLE, intensity: 40, castShadow: true,
+ }],
+ },
+ };
+}
+
+/** The gallery as the task starts: the spotlight at the first position, where the pillar shadows the painting. */
+export const GALLERY_START = galleryRecipe(GALLERY_LIGHT_POSITIONS[0]);
+
+/** The right pick: the third position, from which no ray to the painting meets the pillar. */
+export const GALLERY_SOLUTION = galleryRecipe(GALLERY_LIGHT_POSITIONS[2]);
+
+export const GALLERY_PROMPT = `The gallery scene below has a floor, a back wall, a painting on the wall and a pillar standing between the painting and the
+room. One spotlight with shadows on lights the painting; it is at [-1.8, 2.4, 1.5] and aimed at the painting's centre.
+Two other places could hold it: [0, 2.4, 1.5] and [1.8, 2.4, 1.5]. Keep the spotlight at the one place from which the
+painting is lit all over, with no part of it in the pillar's shadow. Leave it aimed at the painting's centre, with shadows
+on and its cone wide enough to reach the whole painting. Leave the floor, wall, painting and pillar as they are, and keep
+this one light.`;
+
+export const GALLERY_CHECKS = [
+ { kind: 'lint' },
+ { kind: 'parts', min: 4, max: 4 },
+ { kind: 'centreAt', node: 'pillar', position: [-0.3, 1.3, -0.5] },
+ { kind: 'centreAt', node: 'painting', position: PAINTING_CENTRE },
+ { kind: 'litPainting', painting: 'painting', blocker: 'pillar', positions: GALLERY_LIGHT_POSITIONS, maxAngle: 0.9 },
+];
diff --git a/bench/agent-modeling/measure.mjs b/bench/agent-modeling/measure.mjs
index 688b334d..7f503841 100644
--- a/bench/agent-modeling/measure.mjs
+++ b/bench/agent-modeling/measure.mjs
@@ -420,6 +420,7 @@ export async function measureRecipe(recipe) {
nodes: geometries.length,
physics,
physicsSeekStable,
+ spotLights: recipe.environment?.spotLights ?? [],
rig: recipe.armatures ? measureRig(scene, recipe.motion?.duration ?? 0) : null,
patternTypes: scene.exportRecipe().materials.filter(material => material.pattern).map(material => material.pattern.type),
patternMappings: scene.exportRecipe().materials.filter(material => material.pattern).map(material => material.pattern.mapping ?? 'box'),
diff --git a/bench/agent-modeling/references.mjs b/bench/agent-modeling/references.mjs
index c2b9a3a7..b5f4ec8b 100644
--- a/bench/agent-modeling/references.mjs
+++ b/bench/agent-modeling/references.mjs
@@ -8,6 +8,7 @@ const PEBBLE_SIZE = [0.08, 0.03, 0.05];
import { walkerRecipe } from './walker.mjs';
import { KETTLE_RESIZED, KETTLE_RESIZED_PLAIN } from './kettle.mjs';
import { LAMP_SOLUTION } from './lamp.mjs';
+import { GALLERY_SOLUTION } from './gallery.mjs';
import { DESK_FINAL, DESK_FINAL_PLAIN } from './desk.mjs';
const material = [{ id: 'paint', color: [0.6, 0.55, 0.5] }];
@@ -165,6 +166,7 @@ function robotArmSolver(root, middle, end, target) {
export const REFERENCES = {
'best-of-three': LAMP_SOLUTION,
+ 'render-pick': GALLERY_SOLUTION,
'kettle-resize': KETTLE_RESIZED,
'kettle-resize-plain': KETTLE_RESIZED_PLAIN,
'desk-resize': DESK_FINAL,
diff --git a/bench/agent-modeling/results/2026-11-01-07-54-haiku-render-pick-branches-on.json b/bench/agent-modeling/results/2026-11-01-07-54-haiku-render-pick-branches-on.json
new file mode 100644
index 00000000..ae589400
--- /dev/null
+++ b/bench/agent-modeling/results/2026-11-01-07-54-haiku-render-pick-branches-on.json
@@ -0,0 +1,191 @@
+{
+ "run": "2026-11-01-07-54-haiku-render-pick-branches-on",
+ "model": "claude-haiku-5-5",
+ "date": "2026-11-01T07:57:48.130Z",
+ "skill": false,
+ "branches": "on",
+ "runsPerTask": 3,
+ "passed": 3,
+ "tasks": 3,
+ "toolCalls": 15,
+ "costUsd": 0.06,
+ "byModel": {
+ "claude-haiku-5-5": {
+ "runs": 3,
+ "passed": 3,
+ "successRate": 1,
+ "toolCalls": 15,
+ "toolErrors": 0,
+ "inputTokens": 1431594,
+ "outputTokens": 14737,
+ "costUsd": 0.06,
+ "tasks": {
+ "render-pick": {
+ "runs": 3,
+ "passed": 3,
+ "successRate": 1,
+ "toolCalls": 15,
+ "toolErrors": 0,
+ "inputTokens": 1431594,
+ "outputTokens": 14737,
+ "costUsd": 0.06
+ }
+ }
+ }
+ },
+ "records": [
+ {
+ "task": "render-pick",
+ "attempt": 1,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-haiku-5-5",
+ "toolCalls": 6,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_capabilities": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_look": 1,
+ "scene_export_recipe": 1,
+ "scene_dispose": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/1/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/1/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/1/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 8,
+ "costUsd": 0.0232447,
+ "inputTokens": 595693,
+ "outputTokens": 4941,
+ "wallSeconds": 59,
+ "exitCode": 0,
+ "stopped": "success"
+ },
+ {
+ "task": "render-pick",
+ "attempt": 2,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-haiku-5-5",
+ "toolCalls": 5,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_look": 1,
+ "scene_export_recipe": 1,
+ "scene_dispose": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/2/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/2/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/2/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 7,
+ "costUsd": 0.02089959,
+ "inputTokens": 464117,
+ "outputTokens": 5616,
+ "wallSeconds": 46,
+ "exitCode": 0,
+ "stopped": "success"
+ },
+ {
+ "task": "render-pick",
+ "attempt": 3,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-haiku-5-5",
+ "toolCalls": 4,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_look": 1,
+ "scene_export_recipe": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/3/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/3/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-07-54-haiku-render-pick-branches-on/look/3/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 6,
+ "costUsd": 0.019001200000000003,
+ "inputTokens": 371784,
+ "outputTokens": 4180,
+ "wallSeconds": 41,
+ "exitCode": 0,
+ "stopped": "success"
+ }
+ ]
+}
diff --git a/bench/agent-modeling/results/2026-11-01-07-58-haiku-render-pick-branches-off.json b/bench/agent-modeling/results/2026-11-01-07-58-haiku-render-pick-branches-off.json
new file mode 100644
index 00000000..0e6d3427
--- /dev/null
+++ b/bench/agent-modeling/results/2026-11-01-07-58-haiku-render-pick-branches-off.json
@@ -0,0 +1,190 @@
+{
+ "run": "2026-11-01-07-58-haiku-render-pick-branches-off",
+ "model": "claude-haiku-5-5",
+ "date": "2026-11-01T08:02:17.534Z",
+ "skill": false,
+ "branches": "off",
+ "runsPerTask": 3,
+ "passed": 3,
+ "tasks": 3,
+ "toolCalls": 14,
+ "costUsd": 0.06,
+ "byModel": {
+ "claude-haiku-5-5": {
+ "runs": 3,
+ "passed": 3,
+ "successRate": 1,
+ "toolCalls": 14,
+ "toolErrors": 0,
+ "inputTokens": 1303125,
+ "outputTokens": 17121,
+ "costUsd": 0.06,
+ "tasks": {
+ "render-pick": {
+ "runs": 3,
+ "passed": 3,
+ "successRate": 1,
+ "toolCalls": 14,
+ "toolErrors": 0,
+ "inputTokens": 1303125,
+ "outputTokens": 17121,
+ "costUsd": 0.06
+ }
+ }
+ }
+ },
+ "records": [
+ {
+ "task": "render-pick",
+ "attempt": 1,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-haiku-5-5",
+ "toolCalls": 5,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_look": 1,
+ "scene_export_recipe": 1,
+ "scene_dispose": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/1/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/1/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/1/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 7,
+ "costUsd": 0.02182153,
+ "inputTokens": 471088,
+ "outputTokens": 6858,
+ "wallSeconds": 56,
+ "exitCode": 0,
+ "stopped": "success"
+ },
+ {
+ "task": "render-pick",
+ "attempt": 2,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-haiku-5-5",
+ "toolCalls": 4,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_look": 1,
+ "scene_export_recipe": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/2/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/2/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/2/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 6,
+ "costUsd": 0.01971768,
+ "inputTokens": 369135,
+ "outputTokens": 5433,
+ "wallSeconds": 75,
+ "exitCode": 0,
+ "stopped": "success"
+ },
+ {
+ "task": "render-pick",
+ "attempt": 3,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-haiku-5-5",
+ "toolCalls": 5,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_look": 1,
+ "scene_export_recipe": 1,
+ "scene_dispose": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/3/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/3/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-07-58-haiku-render-pick-branches-off/look/3/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 7,
+ "costUsd": 0.02030824,
+ "inputTokens": 462902,
+ "outputTokens": 4830,
+ "wallSeconds": 61,
+ "exitCode": 0,
+ "stopped": "success"
+ }
+ ]
+}
diff --git a/bench/agent-modeling/results/2026-11-01-08-02-sonnet-render-pick-branches-on.json b/bench/agent-modeling/results/2026-11-01-08-02-sonnet-render-pick-branches-on.json
new file mode 100644
index 00000000..a5575d20
--- /dev/null
+++ b/bench/agent-modeling/results/2026-11-01-08-02-sonnet-render-pick-branches-on.json
@@ -0,0 +1,136 @@
+{
+ "run": "2026-11-01-08-02-sonnet-render-pick-branches-on",
+ "model": "claude-sonnet-5-5",
+ "date": "2026-11-01T08:04:33.184Z",
+ "skill": false,
+ "branches": "on",
+ "runsPerTask": 2,
+ "passed": 2,
+ "tasks": 2,
+ "toolCalls": 6,
+ "costUsd": 0.62,
+ "byModel": {
+ "claude-sonnet-5-5": {
+ "runs": 2,
+ "passed": 2,
+ "successRate": 1,
+ "toolCalls": 6,
+ "toolErrors": 0,
+ "inputTokens": 707274,
+ "outputTokens": 4263,
+ "costUsd": 0.62,
+ "tasks": {
+ "render-pick": {
+ "runs": 2,
+ "passed": 2,
+ "successRate": 1,
+ "toolCalls": 6,
+ "toolErrors": 0,
+ "inputTokens": 707274,
+ "outputTokens": 4263,
+ "costUsd": 0.62
+ }
+ }
+ }
+ },
+ "records": [
+ {
+ "task": "render-pick",
+ "attempt": 1,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-sonnet-5-5",
+ "toolCalls": 3,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_export_recipe": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-08-02-sonnet-render-pick-branches-on/look/1/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-08-02-sonnet-render-pick-branches-on/look/1/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-08-02-sonnet-render-pick-branches-on/look/1/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 5,
+ "costUsd": 0.3065676,
+ "inputTokens": 353370,
+ "outputTokens": 2066,
+ "wallSeconds": 56,
+ "exitCode": 0,
+ "stopped": "success"
+ },
+ {
+ "task": "render-pick",
+ "attempt": 2,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-sonnet-5-5",
+ "toolCalls": 3,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_export_recipe": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-08-02-sonnet-render-pick-branches-on/look/2/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-08-02-sonnet-render-pick-branches-on/look/2/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-08-02-sonnet-render-pick-branches-on/look/2/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 5,
+ "costUsd": 0.30860180000000004,
+ "inputTokens": 353904,
+ "outputTokens": 2197,
+ "wallSeconds": 50,
+ "exitCode": 0,
+ "stopped": "success"
+ }
+ ]
+}
diff --git a/bench/agent-modeling/results/2026-11-01-08-04-sonnet-render-pick-branches-off.json b/bench/agent-modeling/results/2026-11-01-08-04-sonnet-render-pick-branches-off.json
new file mode 100644
index 00000000..b3d1f38c
--- /dev/null
+++ b/bench/agent-modeling/results/2026-11-01-08-04-sonnet-render-pick-branches-off.json
@@ -0,0 +1,136 @@
+{
+ "run": "2026-11-01-08-04-sonnet-render-pick-branches-off",
+ "model": "claude-sonnet-5-5",
+ "date": "2026-11-01T08:06:50.799Z",
+ "skill": false,
+ "branches": "off",
+ "runsPerTask": 2,
+ "passed": 2,
+ "tasks": 2,
+ "toolCalls": 6,
+ "costUsd": 0.61,
+ "byModel": {
+ "claude-sonnet-5-5": {
+ "runs": 2,
+ "passed": 2,
+ "successRate": 1,
+ "toolCalls": 6,
+ "toolErrors": 0,
+ "inputTokens": 705391,
+ "outputTokens": 4067,
+ "costUsd": 0.61,
+ "tasks": {
+ "render-pick": {
+ "runs": 2,
+ "passed": 2,
+ "successRate": 1,
+ "toolCalls": 6,
+ "toolErrors": 0,
+ "inputTokens": 705391,
+ "outputTokens": 4067,
+ "costUsd": 0.61
+ }
+ }
+ }
+ },
+ "records": [
+ {
+ "task": "render-pick",
+ "attempt": 1,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-sonnet-5-5",
+ "toolCalls": 3,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_export_recipe": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-08-04-sonnet-render-pick-branches-off/look/1/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-08-04-sonnet-render-pick-branches-off/look/1/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-08-04-sonnet-render-pick-branches-off/look/1/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 5,
+ "costUsd": 0.304841,
+ "inputTokens": 352577,
+ "outputTokens": 1982,
+ "wallSeconds": 38,
+ "exitCode": 0,
+ "stopped": "success"
+ },
+ {
+ "task": "render-pick",
+ "attempt": 2,
+ "pass": true,
+ "passed": 5,
+ "total": 5,
+ "failed": [],
+ "model": "claude-sonnet-5-5",
+ "toolCalls": 3,
+ "toolErrors": 0,
+ "toolsByName": {
+ "ToolSearch": 1,
+ "scene_create": 1,
+ "scene_apply": 1,
+ "scene_export_recipe": 1
+ },
+ "branchCalls": 0,
+ "pathQueries": 0,
+ "features": {
+ "geometryTypes": [
+ "box"
+ ],
+ "meshOperations": [],
+ "motionIk": [],
+ "motionTracks": 0
+ },
+ "look": {
+ "silhouette": {
+ "views": {
+ "front": 1,
+ "side": 1,
+ "three-quarter": 1
+ },
+ "mean": 1
+ },
+ "images": [
+ "artifacts/agent-modeling/2026-11-01-08-04-sonnet-render-pick-branches-off/look/2/render-pick-front.png",
+ "artifacts/agent-modeling/2026-11-01-08-04-sonnet-render-pick-branches-off/look/2/render-pick-side.png",
+ "artifacts/agent-modeling/2026-11-01-08-04-sonnet-render-pick-branches-off/look/2/render-pick-three-quarter.png"
+ ]
+ },
+ "turns": 5,
+ "costUsd": 0.3061872,
+ "inputTokens": 352814,
+ "outputTokens": 2085,
+ "wallSeconds": 52,
+ "exitCode": 0,
+ "stopped": "success"
+ }
+ ]
+}
diff --git a/bench/agent-modeling/tasks.mjs b/bench/agent-modeling/tasks.mjs
index 5de2bad5..4c9aa6f6 100644
--- a/bench/agent-modeling/tasks.mjs
+++ b/bench/agent-modeling/tasks.mjs
@@ -5,6 +5,7 @@ import { REFERENCES } from './references.mjs';
import { KETTLE_START, KETTLE_START_PLAIN } from './kettle.mjs';
import { DESK_START, DESK_START_PLAIN, DESK_CHECKS } from './desk.mjs';
import { LAMP_START, LAMP_PROMPT, LAMP_CHECKS } from './lamp.mjs';
+import { GALLERY_START, GALLERY_PROMPT, GALLERY_CHECKS } from './gallery.mjs';
import { TERRAIN_TASKS } from './terrain.mjs';
export const PROMPT_PREAMBLE = `You are modeling with the 67js MCP tools. Build the object described below as a procedural recipe scene:
@@ -549,6 +550,7 @@ exported recipe is what gets graded.`,
],
},
{ id: 'best-of-three', startRecipe: LAMP_START, prompt: LAMP_PROMPT, checks: LAMP_CHECKS },
+ { id: 'render-pick', startRecipe: GALLERY_START, prompt: GALLERY_PROMPT, checks: GALLERY_CHECKS },
...KETTLE_TASKS,
...DESK_TASKS,
{
diff --git a/docs/parity.md b/docs/parity.md
index 504feace..77053043 100644
--- a/docs/parity.md
+++ b/docs/parity.md
@@ -248,4 +248,4 @@ The goal also needs this work, and no page in the Blender manual covers it.
| Rendering backend | missing | WebGL2 only. WebGPU was measured with three.js as a proxy and was slower on the RTX 3060 and on SwiftShader; decision: wait. See [webgpu-decision](webgpu-decision.md). | #56 |
| Terrain and navigation | partial | Terrain has round holes (`addons/terrain` `holes`, recipe geometry `terrain`), still with 4 splat layers (more would need a shader change and 136 MiB at 8 layers of 1K). `addons/navmesh` builds a walkable grid from triangles with a slope limit, agent radius, holes and obstacle footprints, A* with string pulling and budgets; `scene_inspect` `path` returns walking keyframes. Evidence: tests/terrain-holes.test.js, tests/navmesh.test.js, suite tasks terrain-hole-walk and terrain-path-walk. | #64 |
| Tool cost and errors | partial | Lint and errors exist. No budget limits schema size, and not every error is checked. | #65, #66 |
-| Branches and labelled images | partial | `scene_apply` `branch` forks a variant over a deduplicated snapshot store (8 branches, scene and revision untouched), `scene_review` shots take a `branch`, `scene_restore` `branch` keeps one. `labels: true` on `scene_look` and `scene_review` prints part names, tags and lint problems and returns them with pixel positions. Procedural scenes only; no suite task yet measures calls. | #67 |
+| Branches and labelled images | partial | `scene_apply` `branch` forks a variant over a deduplicated snapshot store (8 branches, scene and revision untouched), `scene_review` shots take a `branch`, `scene_restore` `branch` keeps one. `labels: true` on `scene_look` and `scene_review` prints part names, tags and lint problems and returns them with pixel positions. Procedural scenes only; two suite tasks (`best-of-three`, `render-pick`) measured 22 runs and agents never called `branch`, so no call saving is shown. | #67 |
diff --git a/tests/agent-modeling-suite.test.js b/tests/agent-modeling-suite.test.js
index ec8fc13c..2ffe9917 100644
--- a/tests/agent-modeling-suite.test.js
+++ b/tests/agent-modeling-suite.test.js
@@ -3,6 +3,7 @@ import test from 'node:test';
import { gradeRecipe } from '../bench/agent-modeling/check.mjs';
import { TASKS, taskById, taskPrompt } from '../bench/agent-modeling/tasks.mjs';
import { REFERENCES } from '../bench/agent-modeling/references.mjs';
+import { GALLERY_LIGHT_POSITIONS } from '../bench/agent-modeling/gallery.mjs';
const failedKinds = grade => grade.results.filter(result => !result.pass).map(result => result.label ?? result.kind);
@@ -186,3 +187,36 @@ test('the path walk passes its reference and fails a walk through the second ope
throughRock.motion.tracks[0].keyframes = [{ time: 0, value: [-15, 0.5, -15] }, { time: 2, value: [-8, 0.5, -8] }, { time: 3, value: [-6, 0.5, -3] }, { time: 5.5, value: [5, 0.5, -5] }, { time: 7, value: [5, 0.5, 13] }, { time: 10, value: [15, 0.5, 15] }];
assert.deepEqual(failedKinds(await gradeRecipe(task, throughRock)), ['walkPath']);
});
+
+test('the render pick passes the unshadowed light and fails the two shadowed places and shortcuts', async () => {
+ const task = taskById('render-pick');
+ assert.deepEqual(failedKinds(await gradeRecipe(task, structuredClone(REFERENCES['render-pick']))), []);
+
+ for (const place of GALLERY_LIGHT_POSITIONS.slice(0, 2)) {
+ const shadowed = structuredClone(REFERENCES['render-pick']);
+ const [light] = shadowed.environment.spotLights;
+ light.position = place;
+ const toCentre = [0 - place[0], 1.5 - place[1], -1.96 - place[2]];
+ const length = Math.hypot(...toCentre);
+ light.direction = toCentre.map(value => value / length);
+ const grade = await gradeRecipe(task, shadowed);
+ assert.deepEqual(failedKinds(grade), ['litPainting']);
+ assert.match(grade.results.at(-1).detail, /in shadow/);
+ }
+
+ const shadowsOff = structuredClone(REFERENCES['render-pick']);
+ shadowsOff.environment.spotLights[0].castShadow = false;
+ assert.deepEqual(failedKinds(await gradeRecipe(task, shadowsOff)), ['litPainting']);
+
+ const offeredPlaceMissed = structuredClone(REFERENCES['render-pick']);
+ offeredPlaceMissed.environment.spotLights[0].position = [2.5, 2.4, 1.5];
+ assert.deepEqual(failedKinds(await gradeRecipe(task, offeredPlaceMissed)), ['litPainting']);
+
+ const twoLights = structuredClone(REFERENCES['render-pick']);
+ twoLights.environment.spotLights.push(structuredClone(twoLights.environment.spotLights[0]));
+ assert.deepEqual(failedKinds(await gradeRecipe(task, twoLights)), ['litPainting']);
+
+ const movedPillar = structuredClone(REFERENCES['render-pick']);
+ movedPillar.nodes.find(node => node.id === 'pillar').translation = [3, 1.3, -0.5];
+ assert.ok(failedKinds(await gradeRecipe(task, movedPillar)).includes('centreAt'));
+});