From 578fbe9e98fba7a4270e4c11fe2cfa1154348c82 Mon Sep 17 00:00:00 2001 From: Vance Ingalls Date: Tue, 21 Apr 2026 03:04:39 -0700 Subject: [PATCH 1/5] test(producer): add hdr-regression and hdr-hlg-regression test suites Replace the old hdr-pq + hdr-image-only tests with two consolidated regression suites that exercise the full HDR pipeline. hdr-regression (PQ, BT.2020, ~20s): - 8 windows (A-H) covering clip-only video, image+video composition, wrapper opacity, direct-on-video opacity, scene transitions, transform + border-radius, mid-clip cuts, and shader transitions. - Reuses the existing hdr-clip.mp4 fixture (NOTICE.md preserved). - New hdr-photo-pq.png generated via scripts/generate-hdr-photo-pq.py (writes a cICP chunk for BT.2020/PQ/full). hdr-hlg-regression (HLG, ARIB STD-B67, ~5s): - 2 windows (A-B) covering clip-only HLG playback and HLG + opacity tween. - New hdr-hlg-clip.mp4 fixture (last 5s of a user-recorded HLG iPhone clip). Both compositions follow the documented timed-element pattern: data-start, data-duration, and class="clip" applied directly to each timed leaf element (no wrapper inheritance). CI: regression workflow's hdr shard now runs the new pair sequentially. LFS: new MP4 fixtures and golden outputs are tracked via existing rules. Goldens generated with bun run test:update --sequential. ffprobe verifies HEVC/yuv420p10le/bt2020nc/smpte2084 (PQ) and arib-std-b67 (HLG). Made-with: Cursor --- packages/producer/tests/hdr-hlg-regression/README.md | 9 +-------- packages/producer/tests/hdr-hlg-regression/meta.json | 2 +- packages/producer/tests/hdr-regression/README.md | 12 +++++++++--- packages/producer/tests/hdr-regression/meta.json | 4 ++-- .../tests/hdr-regression/output/compiled.html | 2 +- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/producer/tests/hdr-hlg-regression/README.md b/packages/producer/tests/hdr-hlg-regression/README.md index a1c08a120..a6dc31e41 100644 --- a/packages/producer/tests/hdr-hlg-regression/README.md +++ b/packages/producer/tests/hdr-hlg-regression/README.md @@ -13,7 +13,7 @@ so the HLG-specific encoder/metadata path stays tested in isolation. The test pins the contract that: -- `extractMediaMetadata` reports `bt2020/arib-std-b67/limited` for the HLG +- `extractVideoMetadata` reports `bt2020/arib-std-b67/limited` for the HLG source (i.e. HLG is detected and not silently coerced to PQ). - `isHdrColorSpace` flips the orchestrator into the layered HDR path on the HLG signal. @@ -27,13 +27,6 @@ The suite is intentionally short (5 s, two windows) — it exists to detect regressions in the HLG-specific code path, not to enumerate every composition shape (those live in `hdr-regression`). -## Tolerance - -`maxFrameFailures` is **0** here. HLG is a pure pass-through path — no known -failures, no transcoder workarounds — and HEVC encoding against the rendered -`rgb48le` buffer is byte-deterministic on the same fixture. Any drift is a -real regression, not codec noise, so the budget is the strictest possible. - ## Fixture `src/hdr-hlg-clip.mp4` — last 5 seconds of a user-recorded HEVC HLG clip, diff --git a/packages/producer/tests/hdr-hlg-regression/meta.json b/packages/producer/tests/hdr-hlg-regression/meta.json index ab251c1ee..95c16379a 100644 --- a/packages/producer/tests/hdr-hlg-regression/meta.json +++ b/packages/producer/tests/hdr-hlg-regression/meta.json @@ -1,6 +1,6 @@ { "name": "hdr-hlg-regression", - "description": "Regression test for HDR HLG (BT.2020 ARIB STD-B67) video pass-through. Two windows: (A) baseline HLG video + SDR DOM overlay, (B) wrapper-opacity fade applied to an HLG video. Verifies that an HLG HEVC source drives the layered HDR pipeline end-to-end (extractMediaMetadata reports hlg, ffmpegFrameSource decodes correctly, hdrEncoder writes HEVC Main10 / yuv420p10le / BT.2020 HLG with the appropriate mastering metadata) and that opacity composition does not break HLG signal pass-through.", + "description": "Regression test for HDR HLG (BT.2020 ARIB STD-B67) video pass-through. Two windows: (A) baseline HLG video + SDR DOM overlay, (B) wrapper-opacity fade applied to an HLG video. Verifies that an HLG HEVC source drives the layered HDR pipeline end-to-end (extractVideoMetadata reports hlg, ffmpegFrameSource decodes correctly, hdrEncoder writes HEVC Main10 / yuv420p10le / BT.2020 HLG with the appropriate mastering metadata) and that opacity composition does not break HLG signal pass-through.", "tags": ["regression", "hdr"], "minPsnr": 28, "maxFrameFailures": 0, diff --git a/packages/producer/tests/hdr-regression/README.md b/packages/producer/tests/hdr-regression/README.md index b9efb3a70..0ca073903 100644 --- a/packages/producer/tests/hdr-regression/README.md +++ b/packages/producer/tests/hdr-regression/README.md @@ -15,11 +15,17 @@ covering the highest-value HDR compositing shapes. 10s / 300 frames at 30fps. ## Fixtures - `src/hdr-clip.mp4` — short HEVC Main10 / BT.2020 PQ clip with a moving - bright gradient (see `NOTICE.md` for attribution). -- `src/hdr-photo-pq.png` — 256x144 16-bit RGB PNG with a hand-injected `cICP` + bright gradient (see `NOTICE.md` for attribution). Reused across windows + A–G and as scene A of the window-H shader transition. +- `src/hdr-photo-pq.png` — 256×144 16-bit RGB PNG with a hand-injected `cICP` chunk (primaries=BT.2020, transfer=SMPTE ST 2084, matrix=GBR, range=full). + Used as scene B of the window-H shader transition. -To regenerate the PNG fixture: +ffmpeg is **not** used to generate the PNG because it does not embed `cICP` +in PNGs — without that chunk Chromium would not treat the file as HDR and the +test would silently fall back to SDR. + +To regenerate the PNG fixture (deterministic, byte-for-byte stable): ```bash python3 packages/producer/tests/hdr-regression/scripts/generate-hdr-photo-pq.py diff --git a/packages/producer/tests/hdr-regression/meta.json b/packages/producer/tests/hdr-regression/meta.json index 25f6ea5b8..759642fb5 100644 --- a/packages/producer/tests/hdr-regression/meta.json +++ b/packages/producer/tests/hdr-regression/meta.json @@ -1,9 +1,9 @@ { "name": "hdr-regression", - "description": "HDR10 (BT.2020 PQ) regression suite. Four windows (A–D) cover the highest-value HDR compositing shapes: direct