Skip to content

frameclock_apple: convert CA timestamps relatively - #45

Merged
waywardmonkeys merged 1 commit into
forest-rs:mainfrom
waywardmonkeys:frameclock-apple-relative-timestamps
Jun 18, 2026
Merged

frameclock_apple: convert CA timestamps relatively#45
waywardmonkeys merged 1 commit into
forest-rs:mainfrom
waywardmonkeys:frameclock-apple-relative-timestamps

Conversation

@waywardmonkeys

Copy link
Copy Markdown
Contributor

Project CADisplayLink.timestamp and CADisplayLink.targetTimestamp into the HostTime domain using their delta from CACurrentMediaTime() and a same-callback mach_time::now() sample.

This keeps FrameTick.now, FrameTick.predicted_present, and FrameTick.prev_actual_present in one Mach host-time domain without assuming Core Animation media seconds and Mach absolute ticks share an epoch.

Add regression coverage for present, future, past, saturating, non-finite, and non-nanosecond timebase conversion cases.

Project `CADisplayLink.timestamp` and `CADisplayLink.targetTimestamp` into the `HostTime` domain using their delta from `CACurrentMediaTime()` and a same-callback `mach_time::now()` sample.

This keeps `FrameTick.now`, `FrameTick.predicted_present`, and `FrameTick.prev_actual_present` in one Mach host-time domain without assuming Core Animation media seconds and Mach absolute ticks share an epoch.

Add regression coverage for present, future, past, saturating, non-finite, and non-nanosecond timebase conversion cases.
@waywardmonkeys
waywardmonkeys merged commit 0d87136 into forest-rs:main Jun 18, 2026
15 checks passed
@waywardmonkeys
waywardmonkeys deleted the frameclock-apple-relative-timestamps branch June 18, 2026 07:52
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.

1 participant