Canonical URL: https://sunfield.dev/blog/3d-agents-spatial-feedback-loop
Published: 2026-11-21 | Category: AI Agents | Reading time: 4 min
Hero Render: https://sunfield.dev/blog/gallery-marble-og.jpg

# Why one-shot bpy scripts silently fail (and how a sub-second inspect loop fixes it)

Ask a coding agent to write a 150-line `bpy` script in one shot. Most of the time Python exits with code `0`, and the render has a chair half-buried in the floor or the top of the subject clipped off by the camera.

Syntax checks do not catch geometry bugs. Code review barely catches them either.

## The half-height bug in our own SDK example

While running our own robotics randomisation example (`examples/robotics_domain_rand.py`), we placed scaled Blender cubes and cylinders at `z = 0.5 * scale`. That looks reasonable on paper, right? Except Blender's default primitives span `[-1, +1]`, so their half-height is `1.0 * scale`, not `0.5 * scale`.

Nobody spotted it reading the diff. The first `inspect()` call flagged **`4 to 6` floor penetrations per frame** with exact penetration depths in metres. Switching to `z = scale + 0.002` plus non-overlapping XY circle packing took collisions and floating objects to `0` across `5/5` samples in under two minutes.

## Why stateless render farms are the wrong abstraction for agents

A traditional render farm assumes a human artist already sat in front of a viewport, orbited the camera, fixed the clipping, and uploaded a finished `.blend`. An agent has no viewport unless the runtime gives it a fast feedback loop.

An agent needs four primitives:

- Keep Python state alive between `exec()` calls, so fixing a light or shifting `z` takes milliseconds instead of rebuilding the whole scene from scratch.
- Return `camera`, `top`, `front`, and `iso_3q` previews alongside `BVHTree` penetration depths, floating-object flags, and frustum coverage in a single `inspect()` call (think `~300 ms` warm on the worker, `~795 ms` cold over HTTPS).
- Allow cheap `fork()` branching so an agent can compare two lighting or material setups side by side instead of clobbering a working scene.
- Gate path-tracing behind `estimate_render()` and a hard `max_cost_usd` cap so a bad loop or accidental 4,096-sample setting fails loud instead of draining an account.

## Live `SunfieldBench v0.1` numbers

We ran all 8 tasks in the open `SunfieldBench v0.1` suite (studio staging, tabletop grounding, shader swaps, framing checks, and Cycles OptiX final renders) over HTTPS against `https://sunfield.dev`:

| Metric | Measured result (`SunfieldBench v0.1`) |
| :--- | ---: |
| Tasks passed | **`8 / 8` (`100%`)** |
| Total wall time for all 8 scenes | **`33 s`** |
| Median cold first `inspect()` over HTTPS | **`795 ms`** |
| Total Cycles OptiX GPU time (8 scenes) | **`6.543 GPU-s`** |
| Total Cycles render spend | **`$0.0026`** |

Note what this does *not* test: `SunfieldBench v0.1` covers staging, grounding, materials, and framing, not organic character sculpting. If your agent needs custom organic meshes, generate the geometry with an image-to-3D model and use Blender for lighting, look-dev, and rendering.

## Try it from Claude Code or `uv`

```bash
# Connect Claude Code over Remote MCP (OAuth 2.1)
claude mcp add --transport http sunfield https://sunfield.dev/mcp

# Or run the open benchmark suite yourself
git clone https://github.com/Strange-Metal/sunfield-sdk
cd sunfield-sdk
uv run --with sunfield python benchmarks/sunfield_bench.py
```
---

Sign in or connect Remote MCP (`https://sunfield.dev/mcp`) at https://sunfield.dev/login. All posts: https://sunfield.dev/blog
