Video generation models can now render strikingly realistic footage, but ask them to count the balls in a scene, to drop three spheres from different heights at the same time, or to roll an object correctly behind an obstacle, and they frequently get it wrong. Physical consistency has long been the most criticized weak spot of video generation, and the standard fixes are more explicit physical priors, trajectory conditioning, or simply larger models. One paper submitted to arXiv on November 6 takes a different route: stop asking the video model to imagine physics, and have a coding agent build the scene in code first.
Let the agent write code, then let the model render
The framework has two stages. First, given a text prompt, an agent writes a Blender Python program, executes it in a sandbox, and renders a "Draft Video" — untextured, with untextured gray clay shading, a fixed resolution, and a fixed frame rate. Second, that draft video is handed together with the prompt to a downstream video generator, which handles textures and photorealistic appearance.
The division of labor is clean: geometry, object counts, spatial layout, and camera trajectories are decided by code, and code is executable, verifiable, and reproducible; appearance is left to the generator. The paper's argument is that code is a precise, executable, composable representation — a short program can unambiguously specify that "three spheres fall simultaneously from different heights," a constraint that pixel-level models struggle with.
The accompanying Video-Coder Harness is an interactive environment that gives the agent two tools: check_script, a fast static check, and run_blender, which actually executes the script and renders the draft. Each tool call returns three kinds of feedback: execution feedback such as syntax errors, missing camera or render calls, and runtime tracebacks; content checks that flag empty frames, static videos, or objects leaving the frame; and visual feedback, a few evenly spaced frames returned as images so the model can inspect its own output and adjust layout, motion timing, or camera framing. One detail is worth flagging: a submission is not trusted directly. The Harness re-runs the final script from scratch in a clean directory and accepts the episode only if that independent re-execution again passes all checks — effectively an independent re-verification of the agent's output.
Two rewards: first it must run, then it must look good
Training runs in two stages: supervised fine-tuning on the SFT data, then harness-native agentic RL on top, with Qwen3.5-9B as the base model and GRPO as the RL algorithm. The interesting part is the dual reward design. The execution reward R_exe is binary — 1 is assigned only if all tool call formats are correct and the final Blender program executes successfully and passes all environment checks, otherwise 0. The video reward R_video is scored by a Qwen3.8-omni-flash VLM judge, which evaluates consistency with the text prompt and the reference video along four axes: object categories, spatial layout, motion dynamics, and camera behavior. The score is normalized to the range [0, 1].
The two rewards play different roles at different stages. Early in training the model frequently produces programs with execution errors, so video rewards are hard to obtain and execution rewards do the work of teaching reliable tool calls and code generation. As the code execution success rate improves, video rewards provide much finer-grained supervision about structure, motion, and camera behavior. The two are combined as R = α·R_video + e^(−steps/T)·R_exe, with α set to 0.5, so the execution reward decays exponentially with training steps.
The ablation study supports the design. On PhyGenBench, the MiniMax-H3 baseline scores 0.61; SFT alone reaches 0.63, and adding agentic RL reaches 0.67. Removing the video reward drops the score to 0.64, removing the execution reward drops it to 0.63, and disabling the annealing schedule (fixed weights instead) yields only 0.65. The paper's explanation is that an over-weighted execution reward masks the fine-grained differences inside the video reward, pushing the agent toward executable but conservative programs. In terms of results, Video-Coder-9B paired with MiniMax-H3 averages 0.67 on PhyGenBench, with 0.68 on mechanics, 0.79 on optics, 0.60 on thermal, and 0.61 on material, ranking first on all four dimensions in the paper's Table 1. On VBench-2.0's physical dimensions the average plausibility is 78.19%, with mechanics at 88.67% and thermotics at 70.88%. The compute bill is 8 H100 GPUs for the RL stage, plus another 16 H100 GPUs to run MiniMax-H3 for rollout, and the whole training process takes approximately 3 days.
But the paper's own arithmetic does not quite add up
The method is interesting, yet several numbers do not line up — and that is the part of this paper most worth reading carefully.
On the PhyGenBench gain, the abstract says "approximately 7 points," the ablation section says "6 points," and the raw values in Table 1 are 0.61 → 0.67, which is 6 points. The project page's headline number says +6 as well. On VBench-2.0, the abstract says "improves over MiniMax-H3 by 24 points" while the GitHub README says "23.61 percentage points," and in Table 2 the 78.19% against 54.58% is indeed 23.61 — that one is just rounding, not a contradiction.
The real mismatch is elsewhere. The paper says Video-Coder improves OmniWeaving from 0.48 to 0.51, yet the parenthetical reads "(an increase of 16.28 points)." 0.51 minus 0.48 is 0.03, which does not reconcile with 16.28 points, and the paper offers no explanation for where that number comes from.
The dataset sizes come in two versions as well. The abstract, Section 3.1, and Section 3.3 describe SFT 6k and RL 2k. The training setup in Section 4.1 and the conclusion say SFT 10k and RL 4k. The Hugging Face model card follows the 10k/4k version, while the project page says 6k + 2k. That is not a decimal-place discrepancy — the amount of training data differs by a factor of two.
None of this erases the method's insight, but it directly affects how a reader should treat the headline numbers: the 0.67 and 0.61 in the tables are hard numbers, whereas "approximately 7 points" is narrative. And the paper describes itself as "the first attempt to train a code-driven video generation agent" — for now that remains the authors' own claim, since the paper, the GitHub repository, and the project page all come from the same team, with no third-party independent source corroborating the priority.
So what
The real contribution is not a score but a programmatic interface bolted onto video generation: anything that can be expressed precisely in code — object counts, spatial relations, trajectories, camera moves — should not be left to a probabilistic model to guess. Part of the reason physical consistency is weak is that we ask models to imagine physics directly, while code is verifiable.
The cost is equally clear: one more agent, one more sandbox render, and during training another 16 H100 GPUs reserved for the rollout generator, with an inference pipeline more complex than direct generation. It is worth trying for accuracy-sensitive work such as game assets, robotics simulation data, or ad storyboards; for consumer-grade short-video generation, the gain may not pay for the latency.
One more point is worth keeping in mind: the white-model video encodes only structure and motion, and the paper concedes that the material dimension suffers for exactly this reason — Video-Coder scores 75.02% on material, still below CogVideoX-1.5 at 83.19%. That shows the white-model route and appearance modeling are structurally partitioned rather than simply stackable. As for the numbers that do not reconcile, and the "first" claim only the authors themselves have made, it is worth keeping a slight distance from both.