ui diff: add multithreading and improve logging (split from #37328)#37474
ui diff: add multithreading and improve logging (split from #37328)#37474TheSecurityDev wants to merge 7 commits intocommaai:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR splits out the multithreading improvements and logging enhancements from PR #37328 into a standalone, easier-to-review change. It introduces background threading for diff video generation and parallel frame-hash extraction, which significantly reduces total runtime for long videos. It also modernizes the script with Path types, adds missing type annotations, and improves console output formatting.
Changes:
- Adds background threading for
create_diff_video(runs while the rest of the report is generated) and parallel frame-hash extraction usingThreadPoolExecutor. - Refactors video path arguments from
strtoPath, adds full type annotations, and splitsfind_differencesinto a dedicatedget_video_frame_hasheshelper +find_frame_differences. - Improves console logging with step indicators (
[1/4], etc.), alignment, and a "Waiting for diff video…" message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
UI Previewmici: Videos are identical! View Diff Report |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Split out some of the extra stuff in #37328 (e.g. multi-threading and refactors) so it will be easier to review (will cause merge conflicts, but that's fine).
This PR specifically introduces multithreading for generating the diff video in the background while generating the rest of the report, and also does the frame hash generation in parallel now to save time. This makes a huge difference for longer videos which will be coming in the future. For example, generating the diff video takes almost as long as the rest of the script, but it's completely unnecessary to wait for it.
Also improves the script logging, adds some missing Python types, and switches to
Pathtypes for video paths which makes things a bit easier to work with.-nostdinis added to the ffmpeg commands that run in threads since otherwise it breaks my terminal.Example output