Skip to content

Commit 6d2569c

Browse files
jrusso1020claude
andauthored
test(producer): add webm-vp9 distributed regression fixture (#952)
* feat(producer): enable webm in distributed mode via concat-copy PR 8.2 of the WebM distributed-rendering plan (v1.5 backlog #1; see DISTRIBUTED-RENDERING-PLAN.md §7.2). Wires libvpx-vp9 webm through the distributed pipeline now that PR 8.1 proved concat-copy works. Architectural decision: Path A (concat-copy) — based on PR 8.1's smoke test result (9/9 tests pass for both yuv420p and yuva420p VP9 streams). The simpler architecture wins; no re-encode in assemble, no encode- parallelism loss. Changes: - plan.ts: - DistributedRenderConfig.format and PlanResult.format now include "webm" — type-level acceptance matches the runtime gate. - rejectUnsupportedDistributedFormat() no longer trips on webm. HDR mp4 remains the only refused configuration. - resolveEncoderTriple() returns libvpx-vp9-software + yuva420p + preset="good" for format="webm". yuva420p preserves alpha — the format's main reason for existing for web delivery. - codec= remains rejected for non-mp4 formats (mov is always ProRes 4444; webm is always libvpx-vp9). The error message lists all four distributed-supported formats. - FormatNotSupportedInDistributedError docstring updated to reflect the new reality (only HDR is unsupported). - freezePlan.ts: LockedRenderConfig.encoder gains "libvpx-vp9-software". Mirrors libx265-software / prores-software / png-sequence in shape; the chunk worker reads this discriminant to decide encode args. - renderChunk.ts: drops the now-incorrect cast that excluded webm from buildSyntheticRenderJob's format input; tightens the preset-format cast to include webm. - assemble.ts: docstring + comment updates. The mp4/mov concat-copy path is format-agnostic — webm uses the exact same code (applyFaststart is a no-op for webm via the existing chunkEncoder.ts gate; muxVideoWithAudio already routes webm to libopus audio). - planFormatBanlist.test.ts: webm-rejection tests removed; replaced with "accepts webm" tests + a HDR+webm combo test that verifies HDR is the trip regardless of format. - plan.test.ts: new describe block pins the webm wiring contract: format="webm" produces an encoder=libvpx-vp9-software / pixelFormat=yuva420p planDir with closedGop=true and gopSize=chunkSize. - webm-concat-copy.test.ts (smoke): extended with a yuva420p variant that proves the alpha pixel format the distributed pipeline actually emits also round-trips through concat-copy. 9/9 tests pass locally. §8 format support matrix in DISTRIBUTED-RENDERING-PLAN.md is intentionally left unchanged at this PR — it flips to ✓ in PR 8.4 once the end-to-end fixture (PR 8.3) is green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(producer): include webm in plan-time needsAlpha + strengthen alpha smoke PR review feedback from Miguel and Vai on #951 caught a real bug: `plan.ts`'s `needsAlpha` disjunction excluded `"webm"`, so the plan stage froze `forceScreenshot: false` into the `LockedRenderConfig` even though distributed webm uses `yuva420p`. Every chunk worker captured opaque RGB via BeginFrame (which doesn't preserve alpha on Linux headless-shell), and libvpx-vp9 encoded uniformly-opaque alpha that the encoder then dropped — producing un-keyable webm. Two changes: 1. **plan.ts**: include `"webm"` in `needsAlpha`. Matches the in-process renderer's logic at `renderOrchestrator.ts:1469` (`const needsAlpha = isWebm || isMov || isPngSequence`); the two sites must stay in sync since the distributed pipeline's PSNR regression compares against the in-process baseline. 2. **Smoke test (yuva420p describe)**: source frames now use a real alpha gradient (`geq=a='X*255/W'` on top of `testsrc2`) instead of `testsrc2 + format=rgba` which was uniformly opaque. The decode- pix_fmt assertion is dropped (ffprobe reports `yuv420p` for VP9-with-alpha because the alpha lives in a Matroska `BlockAdditional` sidecar) and replaced with two stronger checks: - `TAG:ALPHA_MODE=1` is present on the stream — proves the encoder was actually configured for alpha - alpha plane variance after `-c:v libvpx-vp9 -i ... -pix_fmt rgba -vf extractplanes=a,signalstats` — proves the alpha sub-stream round-trips through concat-copy with spatially-varying content, not uniform/dropped alpha - decode-test gate is now exit-code-only (was `exitCode || stderr` which would flake on chatty ffmpeg `-v error` builds emitting non-fatal DTS/container notes) These checks would have caught the `needsAlpha` bug before review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(aws-lambda): widen narrow format types to include webm CI on PR #951 was failing at typecheck/build because the producer's `DistributedRenderConfig.format` widened to include webm in this PR but the aws-lambda package's narrow `"mp4" | "mov" | "png-sequence"` type literals in `events.ts`, `handler.ts`, and `validateConfig.ts` hadn't kept up. `renderToLambda.ts:87` passed `config.format` (now including webm) into a parameter typed against the narrow union, producing TS2345. This widening originally landed in PR #952 (test fixture PR) but needs to be atomic with the producer's widening here to keep each PR independently typecheck-clean. Also refactor `formatExtension` from a switch dispatch to a `Record<DistributedFormat, string>` lookup. Adding the webm case tipped the switch's CRAP to the 30.0 fallow threshold; the lookup table drops cyclomatic from 5 to 1 with the same compile-time exhaustiveness guarantee (TS errors on missing entries when `DistributedFormat` adds a new format). The runtime `_exhaustive: never` throw was only protecting against a string slipping past TS; `validateConfig.ts`'s `ALLOWED_FORMATS` already gates untrusted input at the SDK boundary. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(producer): add webm-vp9 distributed regression fixture PR 8.3 of the WebM distributed-rendering plan (v1.5 backlog #1; see DISTRIBUTED-RENDERING-PLAN.md §7.2). End-to-end regression coverage for the webm distributed path PRs 8.1 and 8.2 wired up. Adds packages/producer/tests/distributed/webm-vp9/ matching the mp4-h264-sdr fixture pattern: a 2-second composition (60 frames @ 30fps) with text, a crossfade across the frame-30 chunk seam, and a continuous icon rotation — exercises chunk-boundary continuity for both display contents and VP9 closed-GOP alpha encoding. `chunkSize: 15` produces 4 chunks so 3 seams are tested, and the crossfade straddles the middle seam to surface alpha-plane discontinuities introduced by alt-ref drift. Baseline regenerated inside Dockerfile.test via `bun run --cwd packages/producer docker:test:update webm-vp9`. Runs in: - in-process mode: byte-identical match against baseline ✓ - distributed-simulated mode: PSNR 56.88-63.49 dB across 100 checkpoints, well above the 30 dB threshold ✓ Wiring updates required to let webm flow through the harness: - regression-harness-distributed.ts: - checkDistributedSupport() no longer rejects webm. HDR mp4 + NTSC fps + non-{24,30,60} fps remain rejected. - RunDistributedSimulatedInput.format widened to include webm. - Docstring + comments updated. - regression-harness-distributed.test.ts: webm-rejection test replaced with "accepts format=webm" test. - regression-harness.ts: the now-incorrect format cast at the distributed-input call site is dropped; comment about why webm was excluded is replaced with "webm is now distributed-supported". - regression-harness-lambda-local-types.ts: RunLambdaLocalInput.format widened to include webm so lambda-local mode can also exercise webm fixtures end-to-end. - aws-lambda webm support (Path A through the Lambda handler): - formatExtension.ts: DistributedFormat gains "webm" → ".webm" case. - events.ts: RenderChunkEvent / AssembleEvent / PlanLambdaResult Format widened to include webm. - sdk/validateConfig.ts: ALLOWED_FORMATS gains "webm". - handler.ts: downloadChunkObjects format param widened. The Lambda handler delegates to the producer's assemble() primitive which PR 8.2 already taught to handle webm (concat-copy + applyFaststart no-op + muxVideoWithAudio with libopus); no Lambda-side rendering changes are needed beyond the type/validation surfaces above. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(aws-lambda): drop stale webm rejection from validateConfig docblock PR #952 review nit (Miguel): the validateConfig.ts file-header comment still claimed the SDK rejects webm, but the runtime check no longer does (ALLOWED_FORMATS now includes 'webm'). Update the docblock to reflect that only force-hdr remains an SDK-side rejection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci(regression): add webm-vp9 to shard-3 + refactor formatExtension Three follow-ups bundled together (Vai's review feedback on PR #952 plus the fallow audit finding that surfaced when the webm case was added): 1. **Wire webm-vp9 into CI regression.** The fixture was added in this PR but never appeared in any `.github/workflows/regression.yml` shard's args allowlist, so the regression harness's positional-args gate skipped it in CI. Append `webm-vp9` to shard-3 (which already carries `mp4-h264-sdr` + `webm-transparency`) so the fixture runs. 2. **Fix stale "four hard gates" prose in checkDistributedSupport docstring.** Earlier in the stack I removed the webm bullet but didn't update the count. Two gates remain (fps + hdr). 3. **Refactor `formatExtension` from switch to lookup table.** Adding the webm case made the switch dispatch's CRAP score hit 30.0 (cyclomatic = 5, plus the function's small body). Replaced with a `Record<DistributedFormat, string>` lookup, which: - drops cyclomatic from 5 → 1, - keeps exhaustiveness enforcement at compile time (TS errors if a new format gets added to `DistributedFormat` without a matching key in the Record literal), - drops the runtime `_exhaustive: never` throw, which was only guarding against an arbitrary string slipping past TS — a caller-side concern, not this function's job. The function now reads as a table lookup, which matches what it actually does, and the fallow audit now reports zero new complexity findings (down from 1). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c336508 commit 6d2569c

10 files changed

Lines changed: 335 additions & 33 deletions

File tree

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- shard: shard-2
6565
args: "style-15-prod hdr-hlg-regression style-1-prod many-cuts vfr-screen-recording render-symlinked-assets"
6666
- shard: shard-3
67-
args: "style-7-prod style-8-prod style-10-prod css-spinner-render-compat webm-transparency mp4-h264-sdr"
67+
args: "style-7-prod style-8-prod style-10-prod css-spinner-render-compat webm-transparency mp4-h264-sdr webm-vp9"
6868
- shard: shard-4
6969
args: "style-16-prod style-9-prod style-17-prod iframe-render-compat variables-prod mp4-h265-sdr"
7070
- shard: shard-5

packages/aws-lambda/src/sdk/validateConfig.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
*
1313
* The check is deliberately narrow — it covers the *shape* errors any
1414
* caller could have surfaced with `tsc` if they passed a literal, plus
15-
* the documented `webm`/`force-hdr` rejections from §5.3 of the
16-
* distributed-rendering plan. Anything deeper (font availability, plan
15+
* the `force-hdr` rejection (HDR mp4 isn't supported in distributed
16+
* mode). webm was previously rejected here too; v0.7+ supports it via
17+
* closed-GOP concat-copy. Anything deeper (font availability, plan
1718
* size cap, GPU mode at runtime) needs the actual planner.
1819
*/
1920

packages/producer/src/regression-harness-distributed.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,9 @@ describe("checkDistributedSupport()", () => {
7070
}
7171
});
7272

73-
it("rejects format=webm", () => {
73+
it("accepts format=webm (distributed-supported via closed-GOP concat-copy)", () => {
7474
const result = checkDistributedSupport({ fps: { num: 30, den: 1 }, format: "webm" });
75-
expect(result.supported).toBe(false);
76-
if (!result.supported) {
77-
expect(result.reason).toMatch(/webm/);
78-
}
75+
expect(result.supported).toBe(true);
7976
});
8077

8178
it("rejects hdr=true", () => {

packages/producer/src/regression-harness-distributed.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
* capture jitter, so the harness can't use it as a per-test gate.
2626
*
2727
* Not every fixture can run in distributed-simulated mode. Distributed mode
28-
* refuses webm, HDR mp4, NTSC framerates, and non-{24,30,60} fps at plan
29-
* time. Fixtures that don't meet the constraints are skipped — the harness
30-
* logs the reason and the fixture is treated as "passed (skipped)" in
28+
* refuses HDR mp4, NTSC framerates, and non-{24,30,60} fps at plan time.
29+
* Fixtures that don't meet the constraints are skipped — the harness logs
30+
* the reason and the fixture is treated as "passed (skipped)" in
3131
* distributed-simulated mode.
3232
*/
3333

@@ -67,15 +67,13 @@ export type DistributedSupportResult = { supported: true } | { supported: false;
6767

6868
/**
6969
* Decide whether a fixture's `renderConfig` is one the distributed pipeline
70-
* can actually run. The four hard gates:
70+
* can actually run. Two hard gates:
7171
*
7272
* - fps must be `{ num: 24|30|60, den: 1 }`. `DistributedRenderConfig.fps`
7373
* accepts only the three integer values, and rationals like
7474
* `{ num: 30000, den: 1001 }` (NTSC) trip the type system at the call
7575
* site. We surface this gate in code rather than only in TS so the
7676
* harness can skip the fixture cleanly instead of throwing.
77-
* - format must not be `webm`. `plan()` refuses webm with
78-
* `FORMAT_NOT_SUPPORTED_IN_DISTRIBUTED`.
7977
* - hdr must not be `true`. Distributed mode is SDR-only at v1.
8078
*
8179
* Callers that want the structured reason can read it off the returned
@@ -99,13 +97,6 @@ export function checkDistributedSupport(renderConfig: {
9997
reason: `fps ${fpsNum} not in {24, 30, 60} (DistributedRenderConfig.fps is a closed set)`,
10098
};
10199
}
102-
const format = renderConfig.format ?? "mp4";
103-
if (format === "webm") {
104-
return {
105-
supported: false,
106-
reason: "format=webm refused in distributed mode (VP9+matroska concat-copy is unstable)",
107-
};
108-
}
109100
if (renderConfig.hdr === true) {
110101
return {
111102
supported: false,
@@ -129,7 +120,7 @@ export interface RunDistributedSimulatedInput {
129120
renderedOutputPath: string;
130121
/** From the fixture's renderConfig — must pass `checkDistributedSupport`. */
131122
fps: 24 | 30 | 60;
132-
format: "mp4" | "mov" | "png-sequence";
123+
format: "mp4" | "mov" | "png-sequence" | "webm";
133124
/**
134125
* Codec for `format: "mp4"`. Defaults to `"h264"`; pass `"h265"` to
135126
* exercise the libx265 closed-GOP path. Ignored for non-mp4 formats —

packages/producer/src/regression-harness-lambda-local-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface RunLambdaLocalInput {
2626
*/
2727
width: number;
2828
height: number;
29-
format: "mp4" | "mov" | "png-sequence";
29+
format: "mp4" | "mov" | "png-sequence" | "webm";
3030
codec?: "h264" | "h265";
3131
chunkSize?: number;
3232
maxParallelChunks?: number;

packages/producer/src/regression-harness.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ type TestMetadata = {
9494
* single video file — the harness branches its comparison logic
9595
* accordingly (per-frame byte equality instead of PSNR). `"mov"` and
9696
* `"webm"` are encoded video containers that share the PSNR path with
97-
* `"mp4"`. `"webm"` is rejected by the distributed pipeline at plan
98-
* time; the in-process renderer accepts it.
97+
* `"mp4"`. Distributed mode supports all four — webm goes through
98+
* libvpx-vp9 with closed-GOP concat-copy.
9999
*/
100100
format?: "mp4" | "webm" | "mov" | "png-sequence";
101101
/**
@@ -163,7 +163,7 @@ type TestResult = {
163163
passed: boolean;
164164
/**
165165
* Set when `--mode=distributed-simulated` skips a fixture that the
166-
* distributed pipeline can't run (webm, HDR, NTSC fps, fps∉{24,30,60}).
166+
* distributed pipeline can't run (HDR, NTSC fps, fps∉{24,30,60}).
167167
* `passed` is `true` for skipped fixtures — skipping is a clean outcome,
168168
* not a failure — but the summary distinguishes them.
169169
*/
@@ -939,19 +939,16 @@ async function runTestSuite(
939939
result.skipped = { reason: support.reason };
940940
return result;
941941
}
942-
// `checkDistributedSupport` already narrowed fps to {24,30,60} and
943-
// rejected webm; the cast surfaces that guarantee to TS.
942+
// `checkDistributedSupport` already narrowed fps to {24,30,60}; the
943+
// cast surfaces that guarantee to TS. webm is now distributed-
944+
// supported via closed-GOP concat-copy, so the format passes through.
944945
const fpsNum = suite.meta.renderConfig.fps.num as 24 | 30 | 60;
945946
const distributedInput = {
946947
projectDir: tempSrcDir,
947948
tempRoot,
948949
renderedOutputPath,
949950
fps: fpsNum,
950-
// `runDistributedSimulatedRender` / `runLambdaLocalRender`'s
951-
// `format` parameter accepts the distributed-supported set;
952-
// the harness type allows `"webm"` too but
953-
// `checkDistributedSupport` rejected that above. Narrow.
954-
format: outputFormat as "mp4" | "mov" | "png-sequence",
951+
format: outputFormat,
955952
codec: suite.meta.renderConfig.codec,
956953
chunkSize: suite.meta.renderConfig.chunkSize,
957954
maxParallelChunks: suite.meta.renderConfig.maxParallelChunks,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "Distributed: webm VP9",
3+
"description": "60-frame composition (2s @ 30fps) with text and a small rotating SVG icon, rendered to webm (VP9 + yuva420p). renderConfig.format=webm routes the distributed pipeline through libvpx-vp9 with closed-GOP keyint params (-g N -keyint_min N -auto-alt-ref 0 -cpu-used 2) so per-chunk VP9 output can be losslessly stitched with `ffmpeg -f concat -c copy`. The in-process baseline renders to webm too (codec=vp9, pixelFormat=yuva420p), so the harness's PSNR comparison measures 'libvpx-vp9 chunked + concat' against 'libvpx-vp9 single-pass'. Closed-GOP forces more keyframes than open-GOP, which inflates per-chunk bitrate at constant CRF; PSNR threshold is set at 30 dB to absorb the resulting cross-mode drift without masking gross regressions.",
4+
"tags": ["distributed", "webm", "vp9", "sdr"],
5+
6+
"minPsnr": 30,
7+
"maxFrameFailures": 0,
8+
9+
"minAudioCorrelation": 0.9,
10+
"maxAudioLagWindows": 120,
11+
12+
"renderConfig": {
13+
"fps": 30,
14+
"format": "webm",
15+
"chunkSize": 15
16+
}
17+
}

packages/producer/tests/distributed/webm-vp9/output/compiled.html

Lines changed: 165 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:b98efde6993524eaec419b2a7d3c37f33dcc84602bbd89cfcb1eea41cc125506
3+
size 78674
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
6+
<title>webm VP9 distributed fixture</title>
7+
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
8+
<style>
9+
@import url("https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap");
10+
11+
body,
12+
html {
13+
margin: 0;
14+
padding: 0;
15+
width: 640px;
16+
height: 360px;
17+
/* Transparent background — webm + yuva420p output preserves alpha,
18+
* which is the format's reason for existing. The renderer's
19+
* `initTransparentBackground` helper enforces this in production.
20+
*/
21+
background: transparent;
22+
overflow: hidden;
23+
font-family: "Space Mono", monospace;
24+
}
25+
26+
#main-comp {
27+
position: relative;
28+
width: 640px;
29+
height: 360px;
30+
}
31+
32+
.stage {
33+
position: absolute;
34+
inset: 0;
35+
}
36+
37+
.label {
38+
position: absolute;
39+
top: 22%;
40+
left: 50%;
41+
transform: translateX(-50%);
42+
font-size: 18px;
43+
letter-spacing: 4px;
44+
color: #94a3b8;
45+
text-transform: uppercase;
46+
}
47+
48+
.title {
49+
position: absolute;
50+
top: 50%;
51+
left: 50%;
52+
transform: translate(-50%, -50%);
53+
font-family: "Space Mono", monospace;
54+
font-size: 56px;
55+
font-weight: 700;
56+
color: #6366f1;
57+
white-space: nowrap;
58+
}
59+
60+
.icon {
61+
position: absolute;
62+
bottom: 18%;
63+
left: 50%;
64+
transform: translate(-50%, 0);
65+
width: 48px;
66+
height: 48px;
67+
}
68+
</style>
69+
</head>
70+
<body>
71+
<div
72+
id="main-comp"
73+
data-composition-id="main-comp"
74+
data-width="640"
75+
data-height="360"
76+
data-start="0"
77+
data-duration="2"
78+
>
79+
<div class="stage" id="stage-a">
80+
<div class="label">CHUNK</div>
81+
<div class="title" id="title-a">PHASE&nbsp;ONE</div>
82+
</div>
83+
<div class="stage" id="stage-b" style="opacity: 0">
84+
<div class="label">CHUNK</div>
85+
<div class="title" id="title-b">PHASE&nbsp;TWO</div>
86+
</div>
87+
<!-- Small inline SVG icon; no external image fetch required. -->
88+
<svg class="icon" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg" id="icon">
89+
<circle cx="24" cy="24" r="18" fill="none" stroke="#6366f1" stroke-width="4" />
90+
<circle cx="24" cy="24" r="6" fill="#6366f1" />
91+
</svg>
92+
<!--
93+
No audio element on purpose. Opus frame quantization at 20ms grain
94+
pads a 2-second silent track past 2.0s of container time, which
95+
extends the muxed webm's duration past nb_frames/fps and trips the
96+
harness PSNR sampler at the very last checkpoint. The chunk-
97+
boundary contracts this fixture pins are video-only; omitting
98+
audio keeps container duration == 2.0s exactly. Other webm-with-
99+
audio fixtures cover the mux path separately when added.
100+
-->
101+
</div>
102+
103+
<script>
104+
// Build a single timeline pinned to the composition's wall-clock so
105+
// every frame is fully determined by the seek position. Chunk
106+
// boundaries at frames {15, 30, 45} sit inside the crossfade window
107+
// (frames 27-33 = 0.9s-1.1s) and the icon rotation — both of which
108+
// therefore exercise per-chunk state continuity AND VP9 closed-GOP
109+
// alpha encoding (`-auto-alt-ref 0` so chunk seams remain
110+
// independently decodable).
111+
const tl = gsap.timeline({ paused: true });
112+
window.__timelines = window.__timelines || {};
113+
window.__timelines["main-comp"] = tl;
114+
115+
const stageA = document.getElementById("stage-a");
116+
const stageB = document.getElementById("stage-b");
117+
const icon = document.getElementById("icon");
118+
119+
// Crossfade A → B straddling the frame-30 chunk seam. The opacity
120+
// animation goes through the alpha plane in yuva420p output, which
121+
// is exactly what we want to test under chunked-concat conditions.
122+
tl.to(stageA, { opacity: 0, duration: 0.2, ease: "none" }, 0.9);
123+
tl.to(stageB, { opacity: 1, duration: 0.2, ease: "none" }, 0.9);
124+
// Continuous icon rotation — the absolute angle at any time must
125+
// match across chunk boundaries, so a state-keeping regression in
126+
// the engine's virtual clock would show up as a rotation
127+
// discontinuity at frame 15, 30, or 45.
128+
tl.to(icon, { rotation: 360, duration: 2, ease: "none" }, 0);
129+
</script>
130+
</body>
131+
</html>

0 commit comments

Comments
 (0)