Code4Scene: Benchmarking Coding Agents for Constructing and Editing 3D Scenes
Organizations: UC San Diego · UC Berkeley
Abstract
Frontier coding agents can now write and execute code that authors 3D environments, but whether they reliably understand 3D structure and precisely control scene state remains unclear. The generated 3D scene is a persistent, executable artifact: a convincing render can hide incorrect spatial relations, intersecting objects, or unintended modifications. We introduce Code4Scene, a benchmark of 190 Unreal Engine cases built from human-assembled scenes that evaluates coding agents on two complementary settings under a shared execution interface. Construction tests scene-level spatial reasoning from open-ended language specifications, where many realizations are valid; editing tests precise control of scene state, where the agent must recover the target scene from reference images while preserving everything else. Rather than scoring code or rendered views, Code4Scene evaluates the generated engine-native scene for task fulfillment, artifact integrity, and static physical validity, with edits additionally compared against withheld ground truth. Across 14 coding-agent configurations on the 95-case public set, construction and editing performance are strongly correlated but not interchangeable (Spearman ): Claude Fable 5.1 leads construction, Gemini 3.8 Flash leads editing, and GPT-6 Astra narrowly leads overall. Spatial Composition is the weakest construction category for every agent, while editing remains imprecise: the best Repair F1 is only 0.527, and 35.8% of edits that fully recover the target still introduce unintended changes elsewhere in the scene. These results expose a gap between plausible 3D generation and reliable spatial reasoning and state control.
Figures & tables
| Benchmark | Artifact | Input | Task Setting | Evaluation | ||||
|---|---|---|---|---|---|---|---|---|
| Text | Images | Open-ended | GT-based | Semantic | Physical | Preservation | ||
| BlenderGym ( 2025 ) | Script | |||||||
| SceneActBench ( 2026 ) | GLB/pose | |||||||
| 4DBuildBench ( 2026a ) | .blend | |||||||
| CutsceneBench ( 2026 ) | Sequence | |||||||
| WorldCoder-Bench ( 2026 ) | HTML | |||||||
| Agent configuration | Text-to-Scene (20 cases) | Image-to-Scene (75 cases) | Overall | ||||
|---|---|---|---|---|---|---|---|
| Semantic | Physical | Repair F1 | Physical | ||||
| GPT-6 Astra (max) | 0.727 | 0.712 | 0.724 | 0.445 | 0.796 | 0.515 | 0.619 |
| Gemini 3.8 Flash (high) | 0.657 | 0.655 | 0.657 | 0.527 | 0.796 | 0.581 | 0.619 |
| Claude Fable 5.1 (max) | 0.760 | 0.898 | 0.788 | 0.332 | 0.795 | 0.424 | 0.606 |
| Claude Opus 5 (max) | 0.695 | 0.811 | 0.718 | 0.389 | 0.786 | 0.468 | 0.593 |
| GPT-5.6 Sol (high) | 0.691 | 0.772 | 0.707 | 0.319 | 0.689 | 0.393 | 0.550 |
Appendix figures & tables26 assets
Supplementary material from the paper’s appendix.
Appendix
| Group | Tool (arguments) | Result |
| Asset discovery | search_assets(query ∗ , category, k) | Ranked matching assets |
| get_categories() | Asset categories with counts and descriptions | |
| get_asset_metadata(ids ∗ ) | Category, description, tags, dimensions in metres, spawn path | |
| get_asset_preview(id ∗ ) | Rendered preview image, if available | |
| Scene editing | spawn_actor(name ∗ , static_mesh ∗ , location ∗ , rotation, scale) | Spawns a static-mesh actor |
| spawn_blueprint_actor(actor_name ∗ , blueprint_id ∗ , location ∗ , rotation, scale) | Spawns a Blueprint actor |
| Cases | T2S/Indoor/ Outdoor | Kept | Total error | Component error | Reversed pairs |
|---|---|---|---|---|---|
| 61 | 16/25/20 | 32.1% | 0.016 | 0.025 | 8 |
| 75 | 20/25/30 | 39.5% | 0.014 | 0.019 | 1 |
| 95 | 20/25/50 | 50.0% | 0.011 | 0.017 | 1 |
| 128 | 28/50/50 | 67.4% | 0.007 | 0.011 | 0 |
| Score | Mean | Max | Mean | Kendall | Reversed pairs |
|---|---|---|---|---|---|
| 0.009 | 0.023 | 0.956 | 0 | ||
| Indoor | 0.034 | 0.115 | 1.000 | 0 | |
| Outdoor | 0.009 | 0.016 | 0.956 | 1 | |
| 0.013 | 0.030 | 1.000 | 0 | ||
| 0.008 | 0.024 | 0.956 | 0 |
| Group | Input | Criterion |
|---|---|---|
| Candidate Integrity all cases | Generated scene, execution record, and dependencies | Loadability, minimum content, scene-graph validity, dependency resolution, and asset-library manifest agreement |
| Physical Safety all eligible cases | Scene geometry and targeted engine measurements | Supported actors and collision-free actors |
| Semantic Verifier Text-to-Scene | Prompt, frozen requirements, scene state, and rendered evidence | Detailed Alignment and Overview Alignment |
| Ground-Truth-Based Verifier Image-to-Scene | Input scene, generated scene, and withheld human-assembled scene | Actor repair TP/FP/FN, precision, recall and F1 |
| Downstream EUS reported separately | Navigation mesh, eligible targets, and fixed-walker rollouts | Approachability and route completion |
| Quantity | Acceptance test |
|---|---|
| Asset and class | Exact normalized structural descriptor agreement |
| World position | cm |
| World rotation | |
| Signed scale | |
| Bounds centre, if recorded in GT | cm |
| Bounds extent, if recorded in GT |
| Agent configuration | Track | Unresolved dependencies | Empty scene | No submission | Missing result | Total |
|---|---|---|---|---|---|---|
| Muse Spark 1.3 (medium) | Outdoor | – | – | 7 | – | 7 |
| DeepSeek V4.1 Flash (high) | T2S | 4 | 1 | – | – | 5 |
| GLM-5.3 Flash (max) | T2S | 2 | – | – | 2 | 4 |
| Claude Opus 5 (max) | T2S | 1 | – | – | – | 1 |
| GPT-6 Astra (max) | T2S | 1 | – | – | – | 1 |
| Grok 4.6 (high) | T2S | 1 | – | – | – | 1 |
| Weights and order | Adopted | Individual fit | PL fit |
|---|---|---|---|
| : identity/environment, content/quantity, attributes/materials, spatial composition | |||
| : prompt alignment, layout, style/atmosphere, completeness/polish | |||
| : supported fraction, collision-free fraction | |||
| : Detailed, Overview, Physics |
| Agent configuration | T2S Easy | T2S Medium | T2S Hard | I2S Easy | I2S Medium | I2S Hard | |
|---|---|---|---|---|---|---|---|
| Gemini 3.8 Flash (high) | 0.724 | 0.618 | 0.660 | 0.627 | 0.610 | 0.553 | 0.632 |
| GPT-5.6 Sol (high) | 0.733 | 0.713 | 0.687 | 0.451 | 0.427 | 0.372 | 0.564 |
| Muse Spark 1.3 (medium) | 0.662 | 0.605 | 0.602 | 0.485 | 0.330 | 0.311 | 0.500 |
| GLM-5.3 Flash (max) | 0.630 | 0.462 | 0.499 | 0.427 | 0.338 | 0.276 | 0.438 |
| Qwen 3.8 27B (thinking off) | 0.598 | 0.566 | 0.512 | 0.258 | 0.199 | 0.149 | 0.380 |
| Qwen 3.8 27B (thinking on) | 0.572 | 0.540 | 0.442 | 0.291 | 0.222 | 0.146 | 0.369 |
| Task | score [95% CI] | calls [95% CI] |
|---|---|---|
| Text-to-Scene | 6.69 [ 3.23, 13.46] | 6.60 [ 19.55, 6.75] |
| Indoor | 6.89 [ 4.62, 17.22] | 8.44 [5.64, 11.65] |
| Outdoor | 13.38 [ 25.78, 1.55] | 1.88 [0.02, 3.54] |
| Agent configuration | Indoor Pub. | Indoor Priv. | Outdoor Pub. | Outdoor Priv. |
|---|---|---|---|---|
| GPT-6 Astra (max) | 71.7 / 92.0 / 78.1 | — | 31.0 / 31.5 / 27.6 | — |
| Gemini 3.8 Flash (high) | 66.7 / 76.0 / 69.1 | 53.4 / 72.7 / 58.1 | 48.7 / 55.5 / 44.6 | 51.8 / 56.2 / 50.2 |
| Claude Fable 5.1 (max) | 46.0 / 48.0 / 46.7 | — | 31.4 / 26.1 / 26.4 | — |
| Claude Opus 5 (max) | 54.7 / 60.0 / 56.5 | — | 31.3 / 30.7 / 30.0 | — |
| GPT-5.6 Sol (high) | 31.4 / 88.0 / 44.2 | 30.8 / 78.2 / 41.6 | 26.0 / 41.8 / 25.8 | 23.5 / 52.8 / 30.1 |
| Muse Spark 1.3 (medium) | 56.7 / 60.0 / 57.9 | 35.2 / 40.0 / 36.7 | 7.2 / 10.7 / 8.0 | 10.7 / 14.4 / 11.6 |
| Change type | Public, 14 configs. | Public, 10 configs. | Private, 10 configs. |
|---|---|---|---|
| Added actors without a target match | 27 | 23 | 40 |
| Modified non-target actors | 62 | 52 | 73 |
| Deleted non-target actors | 3 | 3 | 3 |
| Non-target actors repurposed for a repair | 2 | 2 | 0 |
| Unrecovered target state | 0 | 0 | 0 |
| Agent configuration | Text-to-Scene | Indoor | Outdoor | |||
|---|---|---|---|---|---|---|
| Public | Private | Public | Private | Public | Private | |
| GPT-6 Astra (max) | 65.6 | — | 19.2 | — | 14.2 | — |
| Gemini 3.8 Flash (high) | 72.2 | 73.0 | 10.8 | 10.7 | 12.4 | 11.9 |
| Claude Fable 5.1 (max) | 85.2 | — | 12.4 | — | 14.2 | — |
| Claude Opus 5 (max) | 116.7 | — | 18.9 | — | 20.5 | — |
| GPT-5.6 Sol (high) | 55.4 | 56.4 | 23.9 | 28.2 | 22.3 | 23.3 |
| Agent configuration | EUS | Measured | Coverage | Scored | Status | ||
|---|---|---|---|---|---|---|---|
| Gemini 3.8 Flash (high) | 0.479 0.050 | 0.513 | 93% | 0.533 | 0.905 | 28 | 0 / 2 |
| GPT-5.6 Sol (high) | 0.477 0.068 | 0.511 | 93% | 0.519 | 0.926 | 27 | 1 / 2 |
| GLM-5.3 Flash (max) | 0.387 0.066 | 0.432 | 90% | 0.478 | 0.778 | 24 | 2 / 3 |
| Qwen 3.8 27B (thinking off) | 0.373 0.061 | 0.399 | 93% | 0.420 | 0.810 | 28 | 0 / 2 |
| Gemma 4 31B (thinking on) | 0.369 0.069 | 0.410 | 90% | 0.419 | 0.792 | 24 | 3 / 3 |
| Gemma 4 31B (thinking off) | 0.347 0.064 | 0.372 | 93% | 0.389 | 0.736 | 24 | 4 / 2 |
| A. Validation questions | |||
|---|---|---|---|
| Question | Unit | Result | Scope |
| Human agreement | Four holdout prompts, 84 consensus pairs | 73/84 agreement; 95% CI 76.19–94.05%; | Internal validation: earlier exploration used all 16 prompts. |
| Judge repeatability | Nine configurations, six cases, three repeats | Rank – ; model-mean SD 0.0010–0.0132 | Fixed evidence and routing; not complete adaptive-verifier variability. |
| Repair-weight sensitivity | Fourteen configurations, 75 public repairs | For tested , rank ; at most three places shifted | Fixed scenes, thresholds and cases; no human labels fitted. |
| Spearman | Kendall | Max. rank shift | |
|---|---|---|---|
| 0.00 | 0.705 | 0.516 | 6 |
| 0.25 | 0.916 | 0.802 | 3 |
| 0.50 | 0.952 | 0.868 | 3 |
| 0.60 | 0.978 | 0.912 | 2 |
| 0.70 | 0.991 | 0.956 | 1 |
| 0.80 | 1.000 | 1.000 | 0 |