feat: dropped-frame / achieved-fps telemetry (fixes #23) - #34
Merged
Conversation
Instrument the four previously-silent frame-shed sites — PTS-deadline pacing, bufferingNewest(1) backpressure, compositor pool exhaustion, and VideoFrameAdmission — plus the encoded-frame rate, so the M3 HUD and the M1/M9 adaptive logic finally have real measured observability instead of only the encoder's targets. - FrameTelemetry (StreamCore): thread-safe cumulative counters (OSAllocatedUnfairLock, mirroring VideoFrameAdmission) and a pure, unit-tested achieved-fps / congestion-drops-per-second rate function. - LiveStats gains achievedFrameRate + droppedFrames. Congestion drops = backpressure + admission (the frames the pipeline wanted to encode but couldn't); intentional pacing and overlay-only compositor drops are tracked but excluded. - The capture output records captured/pacing/backpressure/compositor on the sample queue; both publishers record admission + encoded and hold the shared telemetry so the adaptive controller (M9) can consume the congestion signal. - The controller folds measured fps + cumulative drops into liveStats each ~1s poll; the Settings HUD shows achieved fps and a "N frames dropped" notice that appears only under real congestion. Tests (StreamCore, CI-testable): FrameTelemetry counters + rate math and the new LiveStats formatting/equality. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 & why
Closes #23 (M8 · Dropped-frame / achieved-fps telemetry). There were ≥4 silent frame-shed sites with no counters — PTS-deadline pacing,
bufferingNewest(1)backpressure, compositor pool exhaustion, andVideoFrameAdmission— and no measured achieved fps (the HUD showed the encoder's target rate). This adds real observability that feeds the M3 HUD now and is reachable by the M1/M9 adaptive logic.Changes
FrameTelemetry(StreamCore) — thread-safe cumulative counters (captured / encoded + the four drop reasons) viaOSAllocatedUnfairLock, mirroringVideoFrameAdmission. Plus a pure, unit-testedrate(from:to:elapsed:)for achieved fps + congestion-drops/sec.LiveStatsgainsachievedFrameRateanddroppedFrames. Congestion = backpressure + admission (frames the pipeline wanted to encode but couldn't); intentional pacing and overlay-only compositor drops are tracked but excluded from the HUD total.AsyncStream.droppedyield result) / compositor (pool-exhaustion fallback) on the serial sample queue.liveStatseach ~1s poll. HUD now shows achieved fps (falling back to the target for the first second) and a subtle "N frames dropped" notice that appears only under real congestion.Testing
StreamCoreTestsgreen (144 tests): newFrameTelemetryCounterTests,FrameTelemetryRateTests, andLiveStatsTelemetryTestscover the counters, congestion-vs-total accounting, and the rate math (elapsed-window guard, delta flooring on reset).🤖 Generated with Claude Code