arXiv:2611.22967cs.MMNov 2026

Manuscript Offprint

arXiv:2611.22967

CodeReel: Accelerating Code-to-Video Agents with Exact Frame Reuse and Blocking-Aware Scheduling

Junyi Shen, Yao Lu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract.

Coding agents make videos by writing and refining programs in a build–inspect–edit loop. A finished film costs a median of 2.85inmodelcallsand11minutes,overathirdofthattimeinbuildsthatblocktheagent.Wefindthatmuchofthistimeisavoidable,fortworeasons.First,37.52.85 in model calls and 11 minutes, over a third of that time in builds that block the agent. We find that much of this time is avoidable, for two reasons. First, 37.5% of the frames of a session’s later films were drawn before, many shifted in time or inside an edited scene. Second, half of the builds stop at a check, where the agent needs only the verdict, but which builds stop is unknown until the checks finish. We present CodeReel, a training-free execution layer behind agents’ existing commands. Exact frame reuse keys each frame by its drawing commands, regardless of its position in time, and reuses each frame whose key recurs. Blocking-aware scheduling runs the checks first and starts the render alongside them, at idle priority, unless the session’s recent builds make a pass unlikely. Scheduling spends CPU to answer sooner and reuse returns it; exact keys let later versions use frames rendered for a failed one as the agent thinks. We introduce EditLoop, a benchmark of replayable agent sessions whose films are checked against renders from scratch. On it, CodeReel cuts the agent’s wait by 36.3% against Rebuild, a warm pipeline with parallel rendering, and by 57.9% against Sequential, today’s step-by-step pipeline. On time-shifting edits its reuse renders 43.9%, close to the 43.0% whose pixels are new, while Manim-style caching renders 99.8%. With real agents, the median wait per build is 0.62\timesRebuild’sinClaudeCode,ontopicsneverusedindevelopment,and0.67 Rebuild’s in Claude Code, on topics never used in development, and 0.67\times$ in Codex CLI. The gain holds for five models and two frameworks.

1. Introduction

aHow a code-to-video agent worksAgentUserchange requestsvoicelayoutchecksrenderencodeeditserrors,51.8% of buildsfilmone build: the agent waits 25.5 s (median)12bOne edit, from version 11 to version 13 of a film reused in placeFigureFigureidentical reused, movedFigureFigureshifted 0.2 s newFigureFigure+ gate, galleryv11v136%39%55%cThe build of version 13Rebuildchecksrender all 2,701 framesverdict 7 sfilm 21 sCodeReel1,496 new framesverdict 2 sfilm 13 s, 0.65×\times1201020s

Figure 1. Code-to-video agents and CodeReel. (a) The agent edits its program and calls a build, which returns errors if a check fails and a film otherwise. CodeReel adds blocking-aware scheduling at the checks (1) and exact frame reuse at the render (2). (b) One edit: frames of version 13 that version 11 drew at the same time (reused in place), at another time (reused, moved) or not at all (new), with the changes boxed; the bar gives each class’s share of its frames. (c) The build of version 13 under Rebuild and CodeReel.

Coding agents such as Claude Code (Anthropic, 2026a) and Codex CLI (OpenAI, 2026a) produce videos by writing programs (Chen et al., 2026b; Ku et al., 2025; Liu et al., 2025b; Li et al., 2026b; Lin, 2026; Chen et al., 2026c). To make an explainer film, the agent writes scene scripts, a narration timeline and assets, and then refines them in a loop (Fig. 1a). In each round it builds the program, inspects the errors or the film, and revises the sources. Some revisions fix its own defects, such as text over subjects or captions out of sync with the speech (Chen et al., 2026b; Li et al., 2026b; Lin, 2026); others answer its user’s change requests. Each build is a tool call the agent waits for. A build runs four steps in sequence, as current pipelines run theirs (Chen et al., 2026b; Ku et al., 2025): it synthesizes the narration’s voice, lays out the timeline, checks the whole film and, if the checks pass, renders every frame. It returns a verdict, pass or fail, with the film on a pass and the errors on a fail. In 123 recorded sessions of Claude Code, a finished film takes a median of 10 builds and costs $2.85 in model calls and 11 minutes. The builds take over a third of that time, each blocking the agent for a median of 25.5 s. We find that much of this wait is avoidable (Sec. 2). The first cause is redundancy: 37.5% of the frames of a session’s later films were drawn by an earlier version, yet they are rendered again. The second is a scheduling mismatch: 51.8% of builds stop at a check before any film is made. The agent waits for the verdict or the film depending on an outcome known only when the checks finish, yet the pipeline runs every build in one fixed order.

Challenges. Redundancy. An agent revises a film incrementally, so the frames an edit does not touch recur: 30.2% of later films’ frames at the same time in the previous film and 6.5% at another time (Fig. 1b and Fig. 3b). Three kinds of edit make recurring frames hard to identify before rendering. First, an edit to a file that scenes share changes only some frames of the scenes that read it. But a script draws a whole scene from one clock, with no call, node or layer boundary inside it. Caches keyed by an animation call as in Manim (The Manim Community Developers, 2026), a scene (Fourier, 2026), a node or layer (Foundry, 2018; Adobe, 2026; The Chromium Authors, 2026) or a file (Mokhov et al., 2018; Curtsinger and Barowy, 2022) therefore redraw those scenes whole. Second, a narration edit moves every later scene. An incremental renderer such as kamishibai keys a frame by its index (kamishibai, 2026) and so misses frames that did not change. Third, many edits change little of a frame, such as a few words of a caption. Approximate reuse, as in training-free diffusion caches (Ma et al., 2024; Liu et al., 2025c; Kahatapitiya et al., 2025; Lyu et al., 2025) and in edit-time methods that recompute only the edited regions (Li et al., 2022; Nitzan et al., 2024; Yu et al., 2024), reuses results whose inputs or features change little. But 32.6% of the changed frames keep an SSIM (Wang et al., 2004) above 0.99 to the frame they replace, so it can keep a stale frame that still shows the old words. Scheduling mismatch. A failing build should give every core to its checks, and a passing one should start its render at once. The checks and the render both process the whole film on the same cores, so a render alongside the checks slows the verdict, and one after them delays the film. The machine is idle while the agent thinks, but the version to build next is not yet written. Pipelines fix the order that completes the film (Chen et al., 2026b; Ku et al., 2025), schedulers for agents schedule around tool calls (Kim et al., 2024; Xu et al., 2024; Ye et al., 2026; Zhang et al., 2026), and test prioritization reorders the tests of a suite (Rothermel et al., 2001; Prado Lima and Vergilio, 2022). None orders the work inside a build by what the agent is blocked on.

Our approach. We present CodeReel, a training-free, model-agnostic execution layer behind the commands agents already call, built on two observations. First, video programs draw each frame from its time alone (Remotion, 2026a), so the commands a frame issues determine its pixels. Evaluating them costs 2.7 ms of CPU, against 81 ms per frame for a full render. Exact frame reuse therefore keys a frame by its drawing commands, regardless of its position in time, and reuses every frame whose key was rendered before. Second, a build call is synchronous, so the agent is blocked on the verdict until the checks return, on the film once they pass, and on nothing once the build has answered. Blocking-aware scheduling runs the checks first and in parallel, and decides from the session’s history and the machine’s cores whether to render alongside them. In the agent’s think time it works ahead, rendering a failed version’s frames, since a stored frame serves any later version that draws it. Neither technique changes the verdict or the film of a build from scratch.

On recorded sessions replayed on 32 cores, CodeReel cuts the agent’s wait by 36.3% against Rebuild, a pipeline with warm processes and workers sized to the machine (Fig. 1c shows one build). Against Sequential, that pipeline run step by step as today’s agents run theirs (Chen et al., 2026b; Ku et al., 2025), the cut is 57.9%. CodeReel answers failing builds in 0.39×\times Rebuild’s time. Most of the reduction comes from scheduling, which spends CPU to answer sooner; reuse renders 34.9% fewer frames, returns that CPU and helps most where cores are scarce. Real agents wait less as well, with a median wait per build of 0.62×\times Rebuild’s in Claude Code, on topics never used in development, and 0.67×\times in Codex CLI. Of the reuse schemes without stale frames, CodeReel renders the fewest frames. On time-shifting edits it renders 43.9%, close to the 43.0% whose pixels are new, while Manim-style caching (The Manim Community Developers, 2026) renders 99.8%. On programs of another video framework, Remotion (Remotion, 2026b), the agent waits 0.51×\times as long under CodeReel as under Remotion’s own renderer (Sec. 4). We contribute:

  • EditLoop: a benchmark of replayable agent sessions, every delivered film checked against a render from scratch (Sec. 2).
  • Exact frame reuse: frames keyed by their drawing commands, shift-invariant, with cheaper tests first, returning the CPU that scheduling spends (Sec. 3.2).
  • Blocking-aware scheduling: a build ordered by what the agent is blocked on, spending CPU to answer sooner, with work ahead in its think time that exact keys let later versions keep (Sec. 3.3).
  • CodeReel: a general execution layer that existing coding agents use unmodified, across video frameworks (Sec. 3).

References (39)