fix(producer): reject impossible distributed durations#1732
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Distributed planning now fails fast when a probed composition duration would produce an impossible frame count. Instead of freezing a plan and fanning out chunk work for an unbounded timeline sentinel,
plan()raises a typedDISTRIBUTED_DURATION_OUT_OF_RANGEvalidation error before chunk metadata is written.Why
A composition can accidentally expose an unbounded runtime timeline as a huge finite duration, for example from an infinite animation loop without an explicit finite root duration. In distributed mode that turns into billions of frames and pushes the failure downstream into chunk workers and orchestration. The producer should reject that deterministic authoring/configuration error at the planning boundary.
How
Added a shared distributed-duration validator with a one-day operational ceiling and wired it immediately after browser probing, before plan freeze and chunk fanout. The typed error code is exported from
@hyperframes/producer/distributedso adapters can classify it as terminal while continuing to retry real infrastructure faults.Test plan
Verification run:
bun test packages/producer/src/services/render/planValidation.test.ts packages/producer/src/services/distributed/planSizeCap.test.ts packages/producer/src/services/distributed/publicExports.test.ts --timeout 60000bun run format:checkbun run --filter @hyperframes/producer typecheckPATH="/tmp/node22-bin:$PATH" bun run lintbun run build:producer