perf(producer): phase-level render instrumentation#430
Closed
jrusso1020 wants to merge 1 commit intomainfrom
Closed
perf(producer): phase-level render instrumentation#430jrusso1020 wants to merge 1 commit intomainfrom
jrusso1020 wants to merge 1 commit intomainfrom
Conversation
…jector Adds observability hooks the architecture review at hyperframes-notes/producer-render-architecture-review-2026-04-21.md flags as a prerequisite: we need phase-level numbers from real compositions before committing to any of the Tier A/B/C work, so the perf summary can be validated against the doc's hypotheses (HDR preflight cost, VFR preflight cost, injector LRU behavior, /tmp pressure). No behavior change. All added fields are optional/additive. - videoFrameExtractor: new ExtractionResult.phaseBreakdown splits the pre-existing durationMs into resolveMs, probeMs, hdrPreflightMs, vfrPreflightMs, extractMs plus HDR/VFR preflight counts. Uses try/finally around the HDR and VFR re-encodes so aborted attempts still get accounted for. - videoFrameInjector: optional InjectorCacheStats out-param on the frame-dataURI LRU. Counts hits, misses, inFlight-coalesced concurrent reads, and peak entries. Callers that don't pass stats pay no cost. - renderOrchestrator: threads the new stats through sequential-capture injector callsites (parallel workers live in separate processes and can't share a mutable stats object). Adds videoExtractBreakdown, injectorStats, and tmpPeakBytes to RenderPerfSummary. Samples workDir size just before cleanup as a lower bound on peak /tmp usage. Tests: 5 new LRU-stats tests and a phaseBreakdown assertion on the existing VFR fixture. 318 engine tests pass (was 312). Sets up the rest of the proposed PR stack (segment-scoped HDR preflight, extraction cache, WebP unified format, gated hwaccel) which will each be validated against these metrics.
Collaborator
Author
This was referenced Apr 23, 2026
Collaborator
Author
|
Closed: rebuilt as #444 off current main (post Vance's HDR work #371/#373/#375). Scope narrowed to extractor-side instrumentation + tmpPeakBytes; the injector-stats plumbing that conflicted with upstream #371's lifecycle refactor was dropped. See hyperframes-notes/perf-stack-rebuild-plan-2026-04-23.md |
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.

What
Adds phase-level observability to the render pipeline — no behavior change, all additive fields.
ExtractionResult.phaseBreakdown: splits the existingdurationMsintoresolveMs,probeMs,hdrPreflightMs,vfrPreflightMs,extractMs, plus HDR/VFR preflight counts.InjectorCacheStats: optional out-param oncreateVideoFrameInjectorthat counts LRU hits, misses, in-flight-coalesced reads, and peak entries.RenderPerfSummarygetsvideoExtractBreakdown,injectorStats, andtmpPeakBytes.Why
This is PR 1 of a 5-PR stack distilled from `hyperframes-notes/producer-render-architecture-review-2026-04-21.md`. The doc flags specific bottlenecks (HDR/VFR preflight cost, injector disk reads, /tmp pressure) but explicitly says every claim is a hypothesis until profiled on real compositions. Downstream PRs — segment-scoped HDR preflight, extraction cache, WebP unified format, gated hwaccel — need these numbers to validate they actually helped.
Concretely, after this lands the validation plan from the doc (§ Validation plan) becomes runnable: the three reference compositions (short SDR, medium alpha-mix, long 4K) each emit a structured `perfSummary` with per-phase timings that can be diffed across PRs.
How
What's deliberately not in this PR
Test plan
Follow-ups (PRs 2–5 in the stack)
Each of these will reference the numbers this PR emits to validate the improvement: