Repository navigation
feat(cli): diff --offset compares the original at t with yours at t + offset - #7057
Conversation
… offset Every per-frame measure (SSIM per frame and per cell, frames.tsv, cuts, missing content) reads yours offset seconds later, and a project folder is captured at the shifted times. The window keeps to where both sides have frames and says so in warnings; an offset with no overlap, or one that is not a number, is refused with a fix. Sound keeps its own offset reading, duration is reported as not measured, and the result echoes offset.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
agammann
left a comment
There was a problem hiding this comment.
parseOffset() accepts exponent notation but returns Number(value) without checking the result. --offset 1e309 passes the regex and becomes Infinity (while the literal Infinity is rejected), so captureTimes() and the video-clip calculations can receive non-finite timestamps. Could the parser reject results where !Number.isFinite(offset) and add an overflow regression?
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 1 nit · head 4336869
The headline case fails. A complete late render (yours = the original + 0.5 s at the head, nothing trimmed) scores as wrong with --offset 0.5. ↓ inline
- nit: +1 to @agammann's
1e309→Infinitypoint. In video mode it ends in the no-overlap refusal (I checked), but a project folder with+1e309would capture atInfinitys.
Scope
Read the whole diff. Ran diff-offset, diff.exit, diff and diff-segments locally: 41/41 pass. Mutation check: dropping start_time fails all 4 synthetic offset cases. --sbs with offset 0.5 lines up (half-vs-half SSIM 0.993). CI is green.
— Claude (Genesis)
Keep offset streams on a zero-based clock even when every frame is selected. Cover an untrimmed delayed render and reject non-finite offsets before file or project processing. — Jerrai
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · 2 resolved, 0 open, 1 new · 4336869 → 96c1b00
Both fixes check out locally. The new full-length test fails on 4336869 (0.7691) and passes now. A late render with an extra 1 s tail also passes (90/90, SSIM 0.995). The one blocker is Comments, which went red at this head. ↓ inline
— Claude (Genesis)
What
hyperframes diffgains--offset <seconds>. It compares the original's frame at time t with yours at t + offset, for every per-frame measure.Why
A rebuild often starts a little later or earlier than the original (a lead-in, a trimmed head). Today every frame is compared at the same time on both sides, so a render that is right but half a second late scores as wrong everywhere and its cuts read as missing plus extra. With
--offsetthe two line up and the scores measure the picture again.Related work
None.
How
The flag contract:
--offset <s>is a finite number of seconds and may be negative. The default is 0. Positive means yours runs behind the original; negative means it runs ahead.fps=…:start_time=<offset>), then its timestamps are rebased to zero even when no frames are trimmed. For a project folder, the capture times are shifted by the offset.frames.tsvrows, cuts (yours' cuts are compared, and reported, on the original's clock, which is yours' time minus the offset), missing content, drawn elements, the worst-moment pictures and their labels, the motion and look of regenerated segments, and the--sbsvideo.windowreports the clipped window, andwarningssays how many frames were left out and which stretch of each side was compared. A project's length is only known after capture, so for a project only the start is clipped.soundkeeps its own offset measurement, unchanged.durationstays a whole-video comparison. When the offset is not 0 it is reported as not measured (pass: null, with anote), because shifted lengths do not compare.frames.tsvadds no columns.tstays the original's time, and the docs say that yours' time is t + offset.offsetin seconds, echoing the input, when the flag is given.ok: falsewitherrorandfix.--offset(or--offset 0), the same filters, frame times and output are produced as before.Test plan
packages/cli/src/measure/diff-offset.test.tsand CLI cases inpackages/cli/src/commands/diff.exit.test.tswindow, the warning,frames.tsvrows and thatdurationis not measured.--attime pushed past yours' end.frames.tsvandssim.logare byte-identical to a run with no offset, and the result is identical apart from the echoedoffset.--offsetprintsok: falsewitherrorandfix; non-finite offsets are rejected for both video files and project folders before reading media.diffVideos, the four synthetic-render cases fail.diff.test.ts,diff-segments.test.ts,diff-people.test.ts,diff.exit.test.ts) pass unchanged.tsc --noEmitare clean on the changed files, and fallow audit reports no issues.docs/packages/cli.mdx.--sbsvideo with an offset, and a project folder with an offset (only its capture times are unit-tested).— Jerrai