refactor(producer): extract HDR compositing helpers and rename media metadata#373
Merged
vanceingalls merged 2 commits intomainfrom Apr 23, 2026
Merged
refactor(producer): extract HDR compositing helpers and rename media metadata#373vanceingalls merged 2 commits intomainfrom
vanceingalls merged 2 commits intomainfrom
Conversation
This was referenced Apr 21, 2026
Collaborator
Author
This was referenced Apr 21, 2026
Merged
perf(producer): hdr benchmark harness — --tags filter, peak heap/RSS tracking, bench:hdr script
#382
Merged
bc48483 to
57d6459
Compare
4f4682b to
78a6af9
Compare
57d6459 to
9b1f281
Compare
78a6af9 to
3838031
Compare
9b1f281 to
9199f7c
Compare
3838031 to
95df8c6
Compare
9199f7c to
a4b7030
Compare
d22e419 to
44ff16f
Compare
0922d9a to
c1e9467
Compare
44ff16f to
aa8b9be
Compare
c1e9467 to
ebef5d5
Compare
c623430 to
ba25661
Compare
3643a05 to
7468d97
Compare
ba25661 to
ccc725f
Compare
7468d97 to
3196e2c
Compare
ccc725f to
5589417
Compare
3196e2c to
34926b3
Compare
5589417 to
6d73142
Compare
86e4952 to
e7bae09
Compare
6d73142 to
52c6034
Compare
52c6034 to
263d844
Compare
e7bae09 to
53e1aea
Compare
3d8b1dd to
daae643
Compare
Merge activity
|
daae643 to
9678521
Compare
notes/ and plans/ are working documents, not project docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9678521 to
71e67e2
Compare
5 tasks
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
Four behavior-preserving refactors that reduce complexity in
renderOrchestrator.tsand clarify the engine ffprobe utility surface. Lands after the correctness fixes (Chunks 1–5) so the refactored code is already correct.Why
Chunk 7ofplans/hdr-followups.md. The HDR composite block had grown a ~200 LOC inline closure with 14 captured deps, a repeated capture-options spread, aextractVideoMetadataname that now also handles still images, and per-frame re-creation of debug helpers.What changed
7A — Hoist
compositeToBufferinto a module-scoped helper. Extract the inline HDR closure into a top-levelcompositeHdrFrame()that takes anHdrCompositeContextstruct. Construct the context once at the top of the HDR render block and pass it through. Removes a deeply-nested closure from the middle of the orchestrator.7B —
buildHdrCaptureOptions()helper. Factor the repeated{ ...captureOptions, skipReadinessVideoIds: ... }spread into a named helper at the call site.7C — Rename
extractVideoMetadata→extractMediaMetadata. Reflects that the helper handles still images (PNG/JPEG/WebP) in addition to video. Update all callers in engine + producer (videoFrameExtractor,htmlCompiler, regression-harness, producer ffprobe re-export, tests). Re-export the old name as a deprecated alias from@hyperframes/enginefor backward compatibility, plus the producer re-export shim.7D — Hoist debug counters to module scope.
countNonZeroAlphaandcountNonZeroRgb48are now module-scoped so they aren't re-created per frame and so the closure has fewer captures.Also touches the
hdr-regressionandhdr-hlg-regressionREADME +meta.jsonfiles reviewed during this refactor.Test plan
bunx tsc --noEmit -p packages/producer && bunx tsc --noEmit -p packages/engineclean.bunx oxlint+bunx oxfmt --checkclean on 8 changed source files.Stack
Chunk 7 of
plans/hdr-followups.md. Lands after the correctness fixes (Chunks 1–5) per the suggested merge order.