test(shader-transitions): add midpoint (p=0.5) regression invariants for all shaders#378
Open
vanceingalls wants to merge 2 commits intovance/srgb-hdr-reference-testsfrom
Open
test(shader-transitions): add midpoint (p=0.5) regression invariants for all shaders#378vanceingalls wants to merge 2 commits intovance/srgb-hdr-reference-testsfrom
vanceingalls wants to merge 2 commits intovance/srgb-hdr-reference-testsfrom
Conversation
This was referenced Apr 21, 2026
Collaborator
Author
This was referenced Apr 21, 2026
Open
perf(producer): hdr benchmark harness — --tags filter, peak heap/RSS tracking, bench:hdr script
#382
Open
a1d1fdd to
afe3517
Compare
2163cd0 to
ca9c359
Compare
ca9c359 to
d8c43e8
Compare
2af7fa2 to
f675c92
Compare
d8c43e8 to
1733e38
Compare
f675c92 to
b09ef42
Compare
1733e38 to
6881964
Compare
f1bcae5 to
f152c4e
Compare
c1d8c12 to
1f9a361
Compare
f152c4e to
d595e1c
Compare
1f9a361 to
f6c9af0
Compare
d595e1c to
ec366c4
Compare
f6c9af0 to
addad95
Compare
ec366c4 to
889ec57
Compare
addad95 to
500c56b
Compare
889ec57 to
7edeb28
Compare
652f647 to
9e0d048
Compare
93e21ac to
23721fc
Compare
9e0d048 to
1655176
Compare
23721fc to
29fbdb2
Compare
1655176 to
16e2fa4
Compare
29fbdb2 to
73a1f75
Compare
16e2fa4 to
58f97e9
Compare
73a1f75 to
01eb2f9
Compare
58f97e9 to
ea05258
Compare
01eb2f9 to
1ee49d8
Compare
ea05258 to
b4fa284
Compare
1ee49d8 to
981e6a8
Compare
193ed00 to
ff0f25b
Compare
b66e6e5 to
c694a91
Compare
…d-transfer caller error PR #370 review feedback (jrusso1020): - chunkEncoder: when codec=h264 and hdr is set, log a warning and strip hdr instead of emitting a half-HDR file (BT.2020 container tags + BT.709 VUI inside the bitstream). libx264 has no HDR support; the only honest output is SDR/BT.709. Caller is told to use codec=h265. - videoFrameExtractor: comment at the convertSdrToHdr call site clarifying that dominantTransfer is majority-wins; mixing PQ and HLG sources in a single composition is caller-error and the minority transfer's videos will be converted with the wrong curve. Render two compositions if you need both transfers. - docs/guides/hdr.mdx: limitations section now documents (a) H.264 + HDR is rejected at the encoder layer, and (b) GPU H.265 (nvenc, videotoolbox, qsv, vaapi) emits BT.2020 + transfer tags but does NOT embed master-display or max-cll SEI, since ffmpeg won't pass x265-params through hardware encoders. Acceptable for previews, not for HDR10 delivery.
…for all shaders Existing smoke tests cover only the endpoints (p=0 ≈ from, p=1 ≈ to), which miss a class of regressions that surface specifically at the midpoint — where the transition is most visible to viewers — and let shaders silently rot in CI: • A shader becomes a no-op (returns input as-is) • A shader prematurely completes (returns target at midpoint) • A shader doesn't write to the output buffer at all • A shader loses determinism (Math.random / Date.now / leaked state) Add four invariants every shader must satisfy at p=0.5, applied via a describe loop over ALL_SHADERS so any new transition added to the registry automatically picks up the same coverage: 1. output ≠ from catches no-ops 2. output ≠ to catches premature completion 3. output is non-zero catches blank output 4. output is deterministic catches accidental non-determinism Uses two distinct uniform input colors (40000/30000/20000 vs 10000/10000/10000) so equality checks have distinct byte patterns to compare against. Even shaders that warp UVs (which would be no-ops on uniform input alone) produce mix16(from, to, 0.5) at every pixel, distinct from both inputs. 60 new tests (4 invariants × 15 shaders), all passing. Follow-up to plans/hdr-followups.md Chunk 9G.
ff0f25b to
e24208f
Compare
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.

Summary
Add four midpoint (
p=0.5) regression invariants applied via adescribeloop overALL_SHADERS, so every existing and future shader transition automatically gets coverage at the most viewer-visible point in the animation.Why
Chunk 9Gofplans/hdr-followups.md. Existing smoke tests cover only the endpoints (p=0 ≈ from,p=1 ≈ to), which miss a class of regressions that surface specifically at the midpoint and let shaders silently rot in CI:Math.random/Date.now/ leaked state)What changed
packages/engine/src/utils/shaderTransitions.test.ts: a singledescribeloop overALL_SHADERSthat asserts atp=0.5:output ≠ from— catches no-opsoutput ≠ to— catches premature completionoutputis non-zero — catches blank outputoutputis deterministic — catches accidental non-determinismUses two distinct uniform input colors (40000/30000/20000 vs 10000/10000/10000) so equality checks have distinct byte patterns to compare against. Even shaders that warp UVs (which would be no-ops on uniform input alone) produce
mix16(from, to, 0.5)at every pixel, distinct from both inputs.Test plan
Stack
Chunk 9G of
plans/hdr-followups.md. Test-only change, independent of all other chunks.