When a language model writes code for a physics simulator, for example a script that sets up and runs a collision in a rigid-body engine, the usual way to judge the script is a single pass/fail test: did the scene come out right? Loops that repeatedly run the code, report what went wrong, and ask the model to fix it are known to stall after one or two rounds. This note proposes that part of the stall is an illusion created by the pass/fail score, and part is real, caused by giving the model feedback that is too coarse to act on. The simulator already computes graded quantities for free: how far two solids overlap, how much energy appeared from nowhere, how much momentum went missing. If we score and steer the loop with these per-law error measurements, we can tell apparent plateaus from real ones, and we should be able to push through the real ones.
The idea brings together four threads. Work on "emergence" shows that sudden jumps in ability often come from all-or-nothing metrics layered on smooth underlying progress. Work on chain-of-thought evaluation shows that judges who reason step by step before scoring are more stable. Video-generation benchmarks document that generated scenes break conservation laws. Execution-feedback coding loops are the fourth thread. Here the emergence lens becomes both a measurement tool and a design rule for feedback, the physical laws supply the graded signal, and a rationale-first critic turns that signal into edits.
Core Claim
For a simulation script, define a per-law residual $r_\ell \ge 0$ for each of $L$ physical checks $\ell$: maximum interpenetration depth, relative energy drift in closed systems, momentum error across collisions, and deviation from the specified trajectory. Each residual is computed directly from the simulator state. The standard binary outcome is success if and only if $r_\ell < \tau_\ell$ for every $\ell$, where $\tau_\ell$ is a fixed tolerance. If the per-law pass probabilities $p_\ell(t)$ at refinement round $t$ are roughly independent, then
$$P_{\text{success}}(t) \approx \prod_{\ell=1}^{L} p_\ell(t).$$
The product can sit near zero while every factor is still climbing. This is the same multiplicative structure that Compositional Abilities Emerge Multiplicatively verified for diffusion models composing attributes, and that Are Emergent Abilities of Large Language Models a Mirage? exposed across BIG-Bench.
We make two claims that can be tested separately. The measurement claim is that the refinement plateau reported by CodeTransOcean will, in physics-code tasks, partly dissolve into steady residual decline when scored continuously. The intervention claim is that feeding the refiner per-law residuals, attributed to specific lines of code by a critic that reasons before it scores, raises final success beyond what pass/fail feedback or raw logs achieve at equal compute. Either claim can fail independently, and the experiments are built so that each gets its own verdict.
Relation to Prior Work
Several papers motivate the proposal by showing the gap. Two systems iteratively correct physics in generated video, but only by rewriting text prompts. PhyT2V captions each output and has GPT-4o revise the prompt. Bootstrapping Physics-Grounded Video Generation through VLM-Guided Iterative Self-Refinement has a vision-language critic reason step by step over frames. Neither executes code or measures a physical quantity. Two other systems do execute physics code, but only once. AutoVFX writes Blender/Bullet scripts, and PhysGen runs Pymunk with parameters estimated by GPT-4V. Neither debugs a failed simulation. Dream.exe executes video-derived trajectories in MuJoCo and finds a cliff: Level 3 success is 6.2% for Kling 3.0 and 0% for all other models. It never asks whether that cliff comes from the all-or-nothing metric, and it never feeds failures back into generation. Jin et al. refine robot-control code inside simulators, but the file describes no graded, per-law feedback signal.
Other papers supply methods we reuse. From Predicting Emergent Abilities with Infinite Resolution Evaluation we take the idea of measuring tiny success probabilities through heavy sampling, its PassUntil score. From DCR-Consistency we take the pattern of checking atomic units one at a time, writing rationales, and then improving; DCR-Consistency applies this to summaries and reports fixing about 90% of inconsistencies. From An Empirical Analysis of Uncertainty in Large Language Model Evaluations we take the finding that reasoning first stabilizes judges.
Some work constrains the design. VideoPhy reports that Gemini 1.5 Pro reaches only 0.58 ROC-AUC on physics judgments, and Dream.exe's top-rated model by vision-language judgment scored 0% in execution. For that reason, our critic never judges physics from pixels. It only interprets numbers the simulator computed. Finally, Srivastava et al. warn that refinement loops entrench bugs when diagnostics lack semantic detail. This is exactly the failure that graded, attributed feedback should reduce, and we measure it directly.
Research Program
The first component is a task suite for physics-script synthesis, built from existing prompts. We take Solid-Solid and Solid-Fluid captions from VideoPhy, the mass- and momentum-heavy Hard Subset of VideoPhy-2, and mechanics prompts from PhyGenBench. We convert them into specifications with explicit initial conditions and an expected qualitative outcome. The model writes a Pymunk script (2D) or a PyBullet script (3D rigid bodies). A harness runs the script, records the state trajectory, and computes the residual vector. The expected-outcome check is written as a residual as well, so success is fully defined by the tolerances. We add a second track from RoboCasa365 in Dream.exe: MuJoCo manipulation tasks where the program is a waypoint-and-gripper script, and the residuals are object-goal distance, contact-force spikes, joint-limit excess, and drop events.
The second component is a set of feedback conditions that share the same generator, the same round budget, and the same token budget. They differ only in what the refiner sees after each run. In the binary condition, the refiner sees pass/fail. In the raw condition, it sees the traceback plus a raw dump of the residual time series. In the graded condition, it sees per-law residuals with their tolerances. In the critic condition, a rationale-first critic first reads the code and the residual series. For each violated law, it writes a short diagnosis that names the responsible lines and the physical cause, for instance "restitution set above 1 injects energy at t = 0.8 s". Only then does it emit a structured edit request. Following MEIC's rollback idea (MEIC), every condition keeps the best script found so far under the summed normalized residual, so that oscillation cannot erase progress.
The third component is analysis. We log $p_\ell(t)$ for every law and round, test how well the independence product predicts observed binary success, and compute PassUntil-style success estimates by resampling scripts at each round. With these, we can locate where apparent plateaus occur and determine which laws are the bottleneck.
Baselines
The naive reference point is single-shot generation with no refinement, in the style of AutoVFX's open-loop synthesis, sampled once per task. This sets the floor for both residuals and binary success.
The strongest existing method on this question is execution-feedback refinement with raw tracebacks and pass/fail outcomes, the standard loop of OpenCodeInterpreter (OpenCodeInterpreter) and the loop whose plateau CodeTransOcean documents. It is the natural competitor because it already uses the simulator as the oracle and needs no new machinery. We run it with the same generator, five rounds, the same token cap per round, and prompt wording tuned for the same number of trials as ours. We found no reported result on Lacuna for any refinement method on physics-simulation-code tasks, so the numbers will be established here.
The second strong competitor is compute-matched best-of-N resampling with no feedback, which turns PassUntil's insight into an alternative strategy. For each task, N equals the total number of generator calls used by our loop.
The third competitor is PhyT2V-style prompt refinement. It matters in the downstream check, where simulated trajectories condition a video generator the way PhysGen does. It is compared on PhyGenBench, where PhyT2V reports up to 2.3x improvement in physical-rule adherence and 35% over prompt enhancers. On VideoPhy-2, the reference is Wan2.2-27B-A14B's 55.4% joint score overall and 47.7% on the Hard Subset. In MuJoCo, the reference is Dream.exe's 21.4% Level 2 and 6.2% Level 3 success.
Two ablations isolate the key ingredient. Graded-without-critic tests whether the numbers alone do the work. Critic-with-binary-only gives the critic reasoning without residuals, and tests whether reasoning alone does. Beating the strongest baseline means a statistically reliable gain in final binary success at matched calls, together with a lower rate of rounds that make things worse.
Why not just…?
Why not just hand the refiner the raw simulator logs and let it read the numbers? This is the most serious threat. A capable model might extract everything the critic provides from raw state dumps. The raw condition exists to settle the question. If raw logs match the critic condition, we drop the critic from the claim and report that graded signal, not rationale, is what breaks the plateau. We expect a gap mainly on multi-law failures, where attributing each violation to a specific line is the hard part. The DCR-Consistency result on atomic decomposition is the reason to expect one.
Why not just sample more scripts instead of refining? PassUntil shows that heavy sampling uncovers hidden success probability. If best-of-N at matched calls equals refinement, then the plateau was never about feedback. We compare the two per law: refinement should win on laws where success requires coordinated edits, such as contact geometry combined with restitution, which independent samples rarely get right together.
Why not just refine the video prompt, as PhyT2V does? Prompt refinement cannot add dynamics the video model never learned, as both prompt-refinement papers acknowledge. Its critics also depend on captioners or vision-language judges that VideoPhy and Dream.exe show to be unreliable on physics. The downstream check compares both approaches on PhyGenBench and VideoPhy-2 using the same automatic rater.
Why not just report continuous metrics and leave the loop alone? This alternative would confirm only the measurement claim. The graded condition against the binary condition shows whether changing what the refiner sees adds anything beyond changing what we report.
Proposed Experiments
The first decisive check tests the measurement claim. On the physics-script suite, we plot binary success and every $r_\ell$ across rounds 0 to 5 under binary feedback. If binary success flattens after round 2 while median residuals keep falling, and the product $\prod_\ell p_\ell(t)$ tracks observed success within its confidence band, then the plateau is at least partly an artifact of the metric. If the residuals flatten too, the plateau is real and the measurement claim fails.
The second check applies the same lens to Dream.exe. We score the existing models' Level 1 to 3 trajectories by continuous goal distance and contact residuals. The test is whether the Level 3 cliff becomes a smooth ordering across models and difficulty tiers.
The third check tests the intervention claim. It is a four-way comparison of binary, raw, graded, and critic feedback, plus best-of-N, with the primary metric being final binary success at matched calls. The secondary metrics are area under the residual-versus-round curve and the fraction of rounds that make things worse.
The fourth check is downstream. Refined simulator trajectories drive PhysGen-style rendering. We score the results with VideoPhy-2-AutoEval against PhyT2V prompt refinement, and test whether a lower residual predicts a higher physics rating.
A null result in the third check alongside a positive result in the first would still be informative: it would show that the reported plateau in physics-code refinement is largely a scoring artifact, and would change how such loops ought to be reported.
References
- Compositional Abilities Emerge Multiplicatively: Exploring Diffusion Models on a Synthetic Task
- Are Emergent Abilities of Large Language Models a Mirage?
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translation
- PhyT2V: LLM-Guided Iterative Self-Refinement for Physics-Grounded Text-to-Video Generation
- Bootstrapping Physics-Grounded Video Generation through VLM-Guided Iterative Self-Refinement
- AutoVFX: Physically Realistic Video Editing from Natural Language Instructions
- PhysGen: Rigid-Body Physics-Grounded Image-to-Video Generation
- Dream.exe: Can Video Generation Models Dream Executable Robot Manipulation?
- RobotGPT: Robot Manipulation Learning From ChatGPT
- Predicting Emergent Abilities with Infinite Resolution Evaluation
- Divide-Conquer-Reasoning for Consistency Evaluation and Automatic Improvement of Large Language Models
- An Empirical Analysis of Uncertainty in Large Language Model Evaluations
- VideoPhy: Evaluating Physical Commonsense for Video Generation
- Do Users Write More Insecure Code with AI Assistants?
- VideoPhy-2: A Challenging Action-Centric Physical Commonsense Evaluation in Video Generation
- MEIC: Re-thinking RTL Debug Automation using LLMs
- OpenCodeInterpreter: Integrating Code Generation with Execution and Refinement