feat(diags): time the host render path in video_render_probe - #278
Merged
Conversation
The probe modelled what a frame costs to put on the wire but measured nothing about what it costs to produce, so it could not answer whether a given machine is fast enough to drive c64cast — the question that decides whether the host can be a small single-board computer rather than a laptop. Time the decode and render halves separately (the frame loop steps the decode generator by hand so the decoder can be timed apart from the render path it feeds) and report them against the existing per-region link cost, with a verdict naming which side, if either, binds the source frame rate. Add --threads N to pin decode and OpenCV so two machines compare by single-core speed rather than core count, and two CSV columns. The verdict names pre-scaling as the fix because compose cost tracks the source resolution rather than the display mode: every mode resizes the source down to its own small target and that resize reads every source pixel, so one frame costs ~30 ms from 4K in any mode and ~3.4-6.7 ms from 720p. The media is usually what decides whether host or link binds.
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.
Why
video_render_probe.pymodelled what a frame costs to put on the wire but measured nothing about what it costs to produce. That leaves it unable to answer whether a given machine is fast enough to drive c64cast at all — the question that decides whether the host can be a small single-board computer instead of a laptop.What
--threads Npins decode and OpenCV to N threads, so two machines can be compared by single-core speed rather than by core count.decode_ms,render_ms.The frame loop now steps the decode generator by hand instead of using a
for ... in container.decode(v), so the generator advance — where the decoder actually runs — can be timed apart from the render path it feeds.The measurement this makes visible
Compose cost tracks the source resolution, not the display mode, because every mode calls
cv2.resize()down to its own small target and that resize reads every source pixel:So the media, not the renderer, is usually what decides whether the host or the link is the bottleneck — which is why the verdict names pre-scaling as the fix rather than just printing a ratio.
Verification
--threadspin.make check(ruff, pyright, 3801 tests) andmake site-checkpass.Two pre-existing
ruff formatfindings indocs/extending.mdare untouched by this branch (they fail identically with these changes stashed).