Skip to content

feat(cli): a start and end render that part of the film in any format, frame rate or HDR - #8878

Merged
miguel-heygen merged 2 commits into
mainfrom
feat/cli-range-single-pass
Nov 26, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
feat/cli-range-single-pass

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

hyperframes render --start/--end and a Studio render asked for a start and end now render that part of the film as a normal render job, in any format, frame rate or HDR mode. Before, the CLI allowed only MP4 at 24, 25, 30 or 60 fps in SDR, and both Studio servers refused any range.

Why

The producer renders a frame window in one pass on every route (#8794, #8802), and the Studio render route takes a start and end (#8787). The CLI still sent a range through the chunked renderSpan path with its old limits, and both Studio adapters failed the job before the producer saw it.

Related work

Refs #8787, #8794, #8802.

How

  • The render request carries range and validates it at the boundary: start 0 or more, end after start. renderConfigFromRequest passes it to RenderConfig.range, so the CLI, Docker and Studio all take one path.
  • The CLI drops renderRange and the --start/--end format, frame rate and HDR limits. The --fps and span checks stay.
  • The CLI Studio server and the Vite Studio adapter pass opts.range to createRenderJob. RANGE_NOT_RENDERED is removed.
  • distributedConfigFromRequest refuses a request that carries a range. A distributed render takes its range from renderSpan, so dropping it would render the whole film without saying so.
  • executeRenderJob already runs ffmpeg from the empty folder (fix(engine,cli,producer): ffmpeg reading project media runs from an empty folder #8832), so the CLI's wrapper around the span render goes with it.

Test plan

  • Unit tests added/updated
    • producer renderRequest.test.ts: the range round-trips into the local config; a malformed range is refused; the distributed adapter refuses a range.
    • cli render.test.ts: a WebM range at 30000/1001 reaches createRenderJob with its range.
    • cli plan.test.ts: WebM, 30000/1001, 50 fps and --hdr plan with a range; bad spans are still refused. The old refusal case --fps 29.97 failed on fps parsing before the range limit, so it never tested that limit.
    • cli studioServer.test.ts and studio vite.adapter.render.test.ts: a job with a range completes, and the range reaches the render job.
    • fails without the fix: removing the range hand-off in render.ts, studioServer.ts or vite.adapter.ts, or the request validation, each turns its new test red (1 failed per file); restored, all pass.
    • 252/252 in the three CLI files, 3 runs in a row; producer 29/29; studio 8/8. tsc for producer, studio-server and studio is clean. tsc for cli shows only the unbuilt @hyperframes/inspector imports, none in changed files.
  • Manual testing performed: from this branch's source on Linux, render packages/producer/tests/audio-mux-parity/src --start 1 --end 2.5 --format webm --fps 30000/1001 exits 0. ffprobe: VP9 at 30000/1001, 45 frames (1.5015 s), Opus audio, duration 1.522 s.
  • Documentation updated (if applicable): the --start, --end row in docs/packages/cli.mdx and the flag help text.
  • Comments follow CONTRIBUTING.md "Comments"

@mintlify

mintlify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Nov 25, 2026, 11:54 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 273 (base branch 271), smooth 74 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-nested-z100
  • seqscaletwice-scale-px-r0-root-z100

Quarantined, measured but not gated (0)

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

No visible change

No screen changes: the CLI, the render request and the two Studio servers now hand a range to the render job, and a Studio range that used to fail now renders.

Also at d71e390: the range check moved into its own function, so the request validator stays under the complexity limit the audit flagged.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE. A CLI --start/--end render and a Studio range now go through the normal RenderConfig.range path, in place of the chunked renderSpan path and its MP4 / whole-fps / SDR limits.

Checked at d71e390a:

  • One path. renderConfigFromRequest already spreads options, so the new validated range reaches RenderConfig.range. The orchestrator turns it into a frame window: resolveFrameWindow clamps the end to the film and refuses an empty window. It forces enableStreamingEncode = false, so assertRangeSupported only ever sees sdr_disk or hdr_layered. It drops the inversion and parallel-router routes (renderOrchestrator.ts:3600-3612, :4328-4331), and trims audio to the window (audioStage.ts:120). That is the producer work from #8794 and #8802, so the CLI's old limits had no remaining reason.
  • The distributed adapter refuses a range instead of rendering the whole film without saying so. That is pinned in renderRequest.test.ts.
  • Docker. dockerRunArgs still forwards --start/--end to the in-container CLI, which is the same version and so takes the same path.
  • Validation at both edges. The CLI still refuses negative, non-numeric and end-not-after-start values. The request now refuses a malformed range (isRenderRange: finite, 0 or more, end after start).
  • The "fails without the fix:" line is present and holds. I removed range: options.range in render.ts: 1 test fails in render.test.ts. I removed the spread in studioServer.ts: 1 test fails in studioServer.test.ts.
  • Tests run locally: producer renderRequest + frameWindow 35/35, CLI render/plan/studioServer 252/252, studio vite adapter 8/8.

Nit: nothing renders a non-MP4 range end to end in CI. The manual WebM 30000/1001 run in the body covers it for now.

Need · Size · Reuse · Simpler · Structure: needed (ranges were refused outside MP4, and in Studio entirely) · +96/−152, a net deletion · uses the producer's existing frame-window path · removes a second render path · validation lives at the request boundary.
Risk: Low — opt-in flags only; a render without a range is unchanged.

Review by Rames

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 31dc4b8 Nov 26, 2026
159 of 173 checks passed
@miguel-heygen
miguel-heygen deleted the feat/cli-range-single-pass branch November 26, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants