arXiv(opens in a new tab)cs.CVSep 2026Cited by 5 papers on PaperVantage

Manuscript Offprint

arXiv:2609.11499

Recursive Code World Models: Building Complex Worlds through Recursive Scene Programs

Zhiqi Li, Yuxuan Liao, Bo Zhu

ABSTRACT

Code world models represent worlds as executable programs, but this representation alone does not determine how to construct a complex world. We introduce Recursive Code World Models (RCWM), a framework for reconstructing complex 3D worlds in code from a single reference image. RCWM couples a Recursive Scene Program (RSP) representation with a construction solver that recursively calls itself. An RSP represents the executable world as compositional scene code, while each solver call follows the same complete process: establish the whole, recursively reconstruct unresolved parts, and revisit the whole to refine their composition. This global-local-global recursion gives fine-scale structures their own perception-and-editing loops while preserving scene-wide geometry and relationships. Reference-aligned views propagate a shared camera projection across levels, while parent revisitation addresses boundaries, spatial relations, and shared errors that emerge after local refinement. A vision-language coding agent directly compares reference images with scene renders to guide refinement, recursive descent, and return. Across complex scenes, RCWM outperforms prior code-based image-to-scene reconstruction methods. Ablation studies further support the benefits of recursive construction and suggest that deeper calls can improve finer-scale reconstruction. RCWM provides a recursive construction principle for building complex executable worlds from visual evidence.

1 INTRODUCTION

Code offers an executable and compositional representation of a world, exposing its structure and state for direct inspection and manipulation rather than leaving them implicit in generated pixels (Chen et al., 2026). By expressing geometry, materials, and spatial relationships as program elements, scene code supports targeted editing, component reuse, and integration with physical simulation (Yin et al., 2026). Recent vision-language coding agents have begun to realize this potential by reconstructing scenes from images through program generation and render-based visual inspection.

*Correspondence: zli3167@gatech.edu

September 2026

(Yin et al., 2026; He et al., 2026; img2threejs contributors, 2026). Yet constructing a complex world requires more than an expressive representation: it requires resolving structures at multiple scales while maintaining the relationships among its parts. This raises a fundamental question: how should a coding model organize its computation when the world contains more structure than a single reconstruction trajectory can resolve?

Consider rebuilding a town from an image. Streets and terrain define its layout; buildings contain facades, and facades contain windows, signs, and ornaments. A scene-wide reconstruction establishes a shared spatial context, but repeated whole-scene reviews may still overlook these small structures. Giving them focused reconstruction tasks makes their details easier to inspect and refine, yet local edits are not independent: a sign may overlap a neighboring window incorrectly, or a refined bridge may no longer meet the riverbanks. These conflicts can emerge even from a coherent initial layout and may only become apparent when the refined parts are inspected together. The same tension arises at every scale, from buildings within a town to windows and signs within a facade.

Our central claim is that complex-world construction should be recursive. A part is not merely an asset to generate and insert. It is a subworld that deserves its own complete reconstruction process, with inherited context, focused visual evidence, and a return to the whole that contains it. The essential recurrence is

Figure

(1)

F\mathcal{F}: the same solver at every level

The first whole establishes a shared spatial context for local construction. The second inspects and refines the assembled whole, correcting inconsistencies among its parts and their relationships. Crucially, the same complete cycle applies within a building, a facade, or a terrain region. This is not a fixed scene–object pipeline followed by a final cleanup, but a construction process that recursively calls itself: each subworld establishes its own whole, reconstructs its unresolved parts through the same solver, and refines their composition before returning to its parent.

We introduce Recursive Code World Models (RCWM) and their output representation, Recursive Scene Programs (RSPs). An RSP represents an executable world as compositional scene code organized over nested subworlds. RCWM constructs this representation through a complete recursive process. At each node, a vision-language coding agent establishes a whole, invokes the same solver on unresolved visual subproblems, and then inspects and refines their composition. Each child receives focused reference evidence and its own perception-and-editing loop, while inheriting the parent's camera projection and spatial conventions. Parent revisitation addresses boundaries, spatial relationships, and shared causes of error that isolated local reviews may overlook. Together, these mechanisms allow local detail and cross-part consistency to be addressed at every level, with visual feedback guiding further descent where finer structure remains unresolved. Recursion determines which subproblems receive a complete solve, whereas parallelism only changes how compatible branches are scheduled. Our contributions are threefold:

• Recursive Scene Programs. We introduce an executable scene representation that organizes complex worlds as compositional subworld programs with explicit child references, editable structure, and shared dependencies.

• Recursive Code World Construction. We introduce a complete recursive construction process in which the same visual solver establishes each subworld, recursively reconstructs its unresolved parts, and revisits their composition after return, combining inherited observation geometry, visually guided recursive calls, and active parent-level refinement.

• Reference-driven reconstruction and evaluation. We instantiate the framework with a parameterized Three.js compiler and evaluate whole-scene and local reconstruction against image-to-scene-program baselines using the same base model. Ablation studies examine the roles of construction order, recursive depth, and parent revisitation under the same local visual access.

September 2026

Figure

Figure 2: Recursive Code World Models. Top: the recursive construction process. At level k, the solver F establishes the current whole, calls the same solver on unresolved subworlds at level k+1k+1, and revisits and refines the whole after their results return. Each child can in turn make further calls at level k+2k+2 and beyond, producing a recursive call tree. Bottom: one recorded construction path on medieval-village: the scene calls a solver for the west village, which in turn calls a solver for the tall house. Each level receives a matched reference crop and camera view, returns its constructed subprogram to the parent, and is then revisited in the parent composition.

References (13)