chore(producer): drop internal plan-doc refs from source + docs (#903)

The producer source + docs referenced an internal coordination doc
(DISTRIBUTED-RENDERING-PLAN.md) that doesn't ship in the OSS repo,
leaving broken cross-links for adopters. Drops the references and the
bare section-number shorthand that depended on them; behavioural
content (hash contract, retry semantics, threshold rationale) is
preserved inline where it was previously offloaded to a section number.
This commit is contained in:
James Russo
2026-05-16 15:54:50 -04:00
committed by GitHub
parent efc16a945f
commit cad9160cd8
7 changed files with 35 additions and 31 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
/**
* `@hyperframes/producer/distributed` — the distributed render primitives.
*
* See `DISTRIBUTED-RENDERING-PLAN.md` for the full architecture. The three
* activities (`plan` → `renderChunk` × N → `assemble`) are pure functions
* over local file paths; networking + orchestration live in adapters.
* The three activities (`plan` → `renderChunk` × N → `assemble`) are pure
* functions over local file paths; networking + orchestration live in
* adapters.
*
* Adopters (AWS Lambda, Cloud Run Jobs, Temporal, K8s Jobs, plain SSH):
*
@@ -18,11 +18,11 @@
* pass the same quality bar the in-process renderer passes against the
* same frozen baseline. A separate {@link DISTRIBUTED_SIMULATED_MIN_PSNR_DB}
* pathology floor catches the case where a fixture authored a permissive
* threshold and distributed regresses to fully-black output. The §5.1
* 50 dB target was written for per-render comparison (fresh in-process vs
* fresh distributed); against the frozen baseline file it's unreachable
* for either mode due to shared encoder/JPEG-capture jitter, so the
* harness can't use it as a per-test gate.
* threshold and distributed regresses to fully-black output. The 50 dB
* "distributed vs in-process" contract is a per-render comparison
* (fresh in-process vs fresh distributed); against the frozen baseline
* file it's unreachable for either mode due to shared encoder/JPEG-
* capture jitter, so the harness can't use it as a per-test gate.
*
* Not every fixture can run in distributed-simulated mode. Distributed mode
* refuses webm, HDR mp4, NTSC framerates, and non-{24,30,60} fps at plan
@@ -44,8 +44,9 @@ export type HarnessMode = "in-process" | "distributed-simulated";
* a chunk that renders fully-black against a fixture authored with a
* permissive `minPsnr`. Non-pathological drift is caught by the fixture's
* own threshold; both modes share the same encoder/JPEG-capture jitter
* floor against the frozen baseline file, so the §5.1 50 dB target is
* unreachable for either mode and isn't a useful per-test gate.
* floor against the frozen baseline file, so the 50 dB distributed-vs-
* in-process contract value is unreachable for either mode and isn't a
* useful per-test gate.
*/
export const DISTRIBUTED_SIMULATED_MIN_PSNR_DB = 10;
@@ -1,7 +1,7 @@
/**
* planHash — content-addressed hash for distributed render plans.
*
* See DISTRIBUTED-RENDERING-PLAN.md §4.2 for the contract:
* Hash contract:
*
* planHash = sha256(
* SCHEMA_PREFIX
@@ -14,9 +14,10 @@
* ⊕ fps ⊕ width ⊕ height ⊕ format
* )
*
* Two invocations with identical inputs MUST produce the same hash. Adapters
* use this to short-circuit `plan()` on workflow replay and to detect
* cross-version mismatches (§9.3 PLAN_HASH_MISMATCH).
* Two invocations with identical inputs MUST produce the same hash.
* Adapters use this to short-circuit `plan()` on workflow replay and to
* detect cross-version mismatches via a typed PLAN_HASH_MISMATCH error
* (defined in `errors.ts` and enumerated in `events.ts`).
*
* Pure utility; no caller exists yet — the distributed-render
* `services/distributed/plan.ts` will compose it.
@@ -8,9 +8,11 @@
* clean them up in its `finally` block.
*
* Hard constraints preserved verbatim from the in-process renderer:
* - `recompileWithResolutions` runs inside this stage because it depends
* on browser-resolved durations, even though §2.1 of the distributed
* plan lists recompile as a sibling phase.
* - `recompileWithResolutions` runs inside this stage because it
* depends on browser-resolved durations. (Distributed-pipeline
* callers can think of recompile as logically separate from probe,
* but the implementation co-locates them here because they share
* the browser session.)
* - `composition` (videos/audios/duration) is mutated in place — callers
* downstream see the reconciled view through the same object reference.
* - The stage computes the final composition `duration` and `totalFrames`
@@ -1452,8 +1452,8 @@ export async function executeRenderJob(
// returned on `compileResult.forceScreenshot`. The sequencer stores it
// in a local `captureForceScreenshot` below; the BeginFrame calibration
// fallback updates the local — not `cfg` — and capture stages receive
// the value as an explicit parameter. See DISTRIBUTED-RENDERING-PLAN.md
// §4.3 (`LockedRenderConfig.forceScreenshot`).
// the value as an explicit parameter. This keeps `cfg` immutable for
// the rest of the pipeline.
const enableChunkedEncode = cfg.enableChunkedEncode;
const chunkedEncodeSize = cfg.chunkSizeFrames;
// Declared outside the try so `finally` can stop the interval, but