4DCodeBench: Benchmarking Agents on Inverse Graphics of Dynamic Scenes

Ruihong Shen, Žiga Kovačič, Peter Kulits, Xingrui Wang, Zizhang Li, Joshua B. Tenenbaum, Alan Yuille, Jieneng Chen, Jiajun WuarXiv 2026

TL;DR

4DCodeBench is a new benchmark that challenges AI agents to reconstruct dynamic 3D scenes from video by writing executable graphics code. It reveals a significant "dynamics gap": while frontier models are becoming adept at reconstructing static geometry and appearance, they still struggle to capture the underlying physics of motion, fluids, and material interactions.

What Problem Does This Paper Address?

Inverse graphics—the process of recovering a structured 3D representation from 2D images—is a cornerstone of computer vision. However, most research has focused on static scenes. When things start moving, the problem becomes exponentially harder. You aren't just recovering shapes; you're recovering dynamics: how a loaf of bread tears, how honey flows, or how a robotic arm interacts with a pile of blocks.

Existing benchmarks for "4D" (3D + time) reconstruction are often limited to synthetic data or simple rigid-body motions. The authors of 4DCodeBench argue that for an AI to truly understand the world, it should be able to translate a video into a "world program"—executable code that uses physics engines or mathematical abstractions to reproduce the observed behavior.

Methods

The core task is straightforward but demanding: given an input video, an agent must write a Python script that, when executed in a graphics environment (like Blender), generates the 3D geometry and its evolution over time.

The 4DCodeBench task pipeline: Video input leads to agent-written code, which is then rendered and compared against the original.

To evaluate these "world programs," the authors developed a multi-faceted scoring system:

  • Perceptual & 2D Metrics: Comparing the rendered output to the original video using DINOv3 features and optical flow.
  • 3D Ground Truth: For synthetic scenes, the agents' code is evaluated directly against the true 3D trajectories of particles and surfaces.
  • VLM-as-a-Judge: Using a Vision-Language Model (Gemini 3.8 Flash) to answer specific questions about the scene (e.g., "Does the honey stretch into a thin strand?") and to perform pairwise comparisons between different models' outputs.
  • Human Alignment: A large-scale human study to ensure the automated metrics actually reflect what people perceive as a "good" reconstruction.

Datasets

The benchmark consists of 200 scenes, split evenly between real-world and synthetic data:

  • 100 Real-World Videos: Curated from robotics and physics datasets, featuring complex lighting and "messy" real-world physics.
  • 100 Synthetic Scenes: Built using high-end simulators (like MPM for fluids and IPC for contact) to provide perfect 3D ground truth for evaluation.

The scenes are categorized into four "matter families": Rigid/Articulated, Deformable (squishy solids), Co-dimensional (cloth and rope), and Flowing (fluids and grains).

Breakdown of the 4DCodeBench dataset by matter type and complexity.

Key Insights and Ideas

  • The Dynamics Gap: There is a persistent performance gap between static and dynamic reconstruction. Even the best models score much higher on appearance and static geometry than they do on motion trajectories. Reconstructing how a scene evolves remains significantly harder than recovering what is in it.
  • Diverse Modeling Strategies: Agents don't just use one method. Some write analytic equations for motion, while others implement custom physics solvers like Position-Based Dynamics (PBD) or Material Point Methods (MPM) directly in their code.
  • The Scaling of Reasoning: Interestingly, simply using more tokens (longer outputs) across different models doesn't correlate with better performance. However, for a single model (like GPT-6 Astra), increasing "inference-time reasoning" effort leads to a steady improvement in physical accuracy.
  • Real vs. Synthetic: Models perform significantly worse on real-world footage. The gap suggests that current agents rely heavily on the idealized physics and clean visuals found in synthetic training data.
The "Static-Dynamic Gap": Models consistently perform better at capturing appearance (blue) than motion (orange).

Key Results

The authors benchmarked 18 frontier and open-weight models.

  • The Leaderboard: GPT-6 Astra [Max] currently leads the benchmark with an overall score of 0.79, followed closely by Claude Opus 5.5 and Claude Fable 5.1.
  • Proprietary vs. Open-Weight: There is a massive gulf in performance. The best open-weight model (DeepSeek v4.1) scores 0.60, trailing far behind the top proprietary models.
  • VLM/Human Agreement: The VLM-based Elo ratings showed a remarkable correlation ($\rho = 0.980$) with human judgments, validating the use of VLMs as scalable judges for complex 4D tasks.
The 4DCodeBench leaderboard, showing the dominance of proprietary models and the specific metric breakdowns.

Limitations and Future Work

The authors identify several areas for growth:

  • Fidelity vs. Understanding: Currently, an agent can get a high score by "keyframing" a trajectory to match the video without actually understanding the underlying physics (e.g., the mass or friction of an object).
  • Generalization and Interventions: Future versions of the benchmark could ask agents to predict what happens if the scene is changed (e.g., "What if the ball was twice as heavy?"). This would test true physical intuition rather than just reconstruction.
  • Iterative Refinement: The current study looks at the final code output. Tracking how agents use visual feedback to refine their code over multiple "render-and-compare" loops would provide deeper insight into their reasoning processes.

Summary updated

BibTeX
@misc{shen2026dcodebench,
  author = {Ruihong Shen and Žiga Kovačič and Peter Kulits and Xingrui Wang and Zizhang Li and Joshua B. Tenenbaum and Alan Yuille and Jieneng Chen and Jiajun Wu},
  title = {{4DCodeBench: Benchmarking Agents on Inverse Graphics of Dynamic Scenes}},
  year = {2026},
  eprint = {2610.03715},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.03715},
}
Figure