Code2RSITowards Recursive Self-Improvement
for Real-to-Sim Code World Models

1University of Bristol 2School of Computer Science, Peking University
*Equal contribution. †Project lead. ‡Corresponding author.
Code2RSI real and simulated examples of 4D scenes, rigid and deformable objects, robotics, and games.
From observations to executable worlds. Code2RSI constructs and refines world programs through execution feedback, while retaining reusable skills for subsequent construction.

Abstract

Generative models have shown promise in constructing interactive worlds. However, these worlds can appear visually plausible and exhibit desired outcomes without faithfully modeling the underlying physical interactions that produce them. This gap between visual plausibility and satisfaction of task requirements remains a challenge for reliable Real-to-Sim. We present Code2RSI, an agentic framework that structures world construction around task-specific agent harnesses, each connecting world programs with domain-specific tools, observations and feedback. Code2RSI enables recursive self-improvement by distinguishing immediate repairs to individual worlds from persistent updates to reusable construction skills and harness routines. We evaluate the framework on dynamic scene reconstruction and robotic interaction. Code2RSI improves reconstruction quality and task performance in these settings. Additional experiments on text-conditioned scene generation and task-driven game construction demonstrate its applicability beyond Real-to-Sim. These findings highlight the potential of execution-driven recursive self-improvement for reliable world construction.

Method

Code2RSI learns through building: execution feedback guides each world’s refinement and shapes reusable skills for the worlds that follow.

Scroll horizontally to view the full framework.

Code2RSI: world construction and recursive self-improvement Task inputs and a reusable harness guide a coding agent to construct a world program. The inner loop uses execution feedback to repair the current program. The outer loop uses construction records to revise and evaluate modeling guidance and skills for reuse in subsequent construction. Task Inputs Reference / goal Coding Agent Construct / revise World Program Scene / control code Execute & Verify Observations & task checks Inner Loop Execution feedback & program repair Reusable Harness Guidance & skills Evaluation Task performance comparison Harness Revision Modeling guidance & skills Construction records Outer Loop Harness reuse
Execution-grounded recursive self-improvement. A task-specific harness connects the coding agent to execution tools, observations and verification. The inner loop uses execution feedback to revise the current world program. The outer loop uses construction records to update reusable modeling guidance and skills, improving the harness for subsequent world construction.

Real2Sim

  • Dynamic Scene Reconstruction
  • Deformable Object Reconstruction
  • Robotic Interaction

Beyond Real2Sim

  • Text-Conditioned Scene Generation
  • Task-Driven Game Construction

Models & Simulators

Models
GPT-6-Astra / GPT-6-Luna / DeepSeek-V4.1-Flash / GLM-5.3-Flash / Qwen3.8-27B
Backends
PyBullet / Isaac Sim / Blender / Mineflayer

Demos below are based on GPT-6-Astra backbone unless otherwise noted.

Applications on Real2Sim

From moving scenes and deformable objects to robotic interactions, Code2RSI turns real-world observations into executable simulations that can be tested and refined.

Dynamic Scene Reconstruction

Deformable Object Reconstruction

Robotic Interaction

Cross-Model and Cross-Simulator Comparison

Different models and simulator backbones open up different ways to build a world, and the examples below show how Code2RSI brings its iterative construction process across these choices.

Cross-Model Comparison

Code2RSI supports different backbone LLMs, with GPT-6-Astra delivering the most consistent performance.

Applications Beyond Real2Sim

Beyond reconstruction, Code2RSI applies the same iterative process to text-conditioned scene generation and task-driven game construction, using execution feedback to refine the generated code.

Text-Conditioned Scene Generation

Task-Driven Game Construction

Nitrogen Game

Real-to-sim reconstruction of game scenes from Nitrogen with GLM-5.3-Flash backbone

Celeste Dark Ledges
ReferenceCode2RSI (Low-Poly)Code2RSI (Final)

More demos

Isaac room item: Real Isaac room item: Code2RSI RealCode2RSI
Pogo mushroom slope: Real Pogo mushroom slope: Code2RSI RealCode2RSI
Celeste corridor dash: Real Celeste corridor dash: Code2RSI RealCode2RSI