Skip to content

fix: account for native media precision in motion playback test - #4419

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4418
Oct 27, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4418

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The motion playback test compared native video time with the transport clock using a relative tolerance that allowed less than one microsecond early in playback. Chromium can truncate a fractional seek by one microsecond: requesting 252.00699999999998 ms returns 252.006 ms from both videos, reproducing the exact failure in #4418.

Use a fixed 0.002 ms tolerance for the native-media comparison, covering that truncation and floating-point rounding. The test now exercises the reported fractional seek deterministically as well as the ordinary pause. Exact agreement between the two recordings and the assertion against per-frame seeking remain intact; product behavior is unchanged. This preserves #3658's shared native playback intent.

Validation: the fractional seek fails with the old assertion and passes with the correction in the full touch playback/sticky transport journey.

Closes #4418 — automated triage

Keep exact agreement between recordings and verify shared transport time within two microseconds, including a deterministic fractional seek that failed the old relative assertion. No product behavior changes.

Closes #4418
@leaf-agent
leaf-agent merged commit 4885533 into main Oct 27, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4418 branch October 27, 2026 09:36
max-sixty pushed a commit that referenced this pull request Nov 3, 2026
Pausing two motion recordings could leave them a microsecond apart. On
pause, `lf-motion` reads the furthest recording's time and seeks only
the recordings behind it. Chromium truncates a seek target to whole
microseconds, so for about one playback position in fifty the seeked
recording lands a microsecond behind the leader, which was never seeked:
a leader at 0.5004 s pulls the trailing recording to 0.500399 s. That is
the `0.5004 == 0.500399` failure in #5169. Now, once any recording is
off the clock's time, `#seekVideos` seeks all of them, so each gets the
same native rounding. A transport whose recordings already agree still
seeks none, and the test's check that playback never seeks per frame
still passes.

This is the same truncation #4419 found for a seek requested by the
author. That PR widened the transport-versus-video tolerance. This
change fixes the transport itself, and the exact agreement between
recordings holds again without a wider tolerance.

**Verification.** A new step in
`test_motion_recordings_share_native_playback_and_a_sticky_transport`
pauses and resumes the leading recording natively until it stops on a
position the truncation moves, then pauses the transport and asserts the
two recordings agree exactly. That search is a `wait_for_function` under
the suite's deadline, so the test fails rather than passes when it never
reaches such a position. With main's `lf-motion.js` the step failed
three runs out of three (`4.0623 == 4.062299`, `2.0136 == 2.013599`,
`1.0006 == 1.000599`); with the fix it passed three out of three. The
browser type check (`tsc -p browser/types`) is clean.

Closes #5169 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paused motion playback time differs from its native video by one microsecond

1 participant