Skip to content

frameclock_wayland: add present-time estimator - #44

Merged
no-materials merged 1 commit into
forest-rs:mainfrom
no-materials:wayland-present-time-estimator
Jul 2, 2026
Merged

frameclock_wayland: add present-time estimator#44
no-materials merged 1 commit into
forest-rs:mainfrom
no-materials:wayland-present-time-estimator

Conversation

@no-materials

@no-materials no-materials commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Replaces the subduction_backend_wayland present-hint stub with a real present-time estimator in frameclock_wayland, matching the Apple/Web adapter shape. TickerState now retains the last observed refresh interval next to the actual-present time and predicts the next vsync at or after the tick time, so emitted FrameTicks carry a real predicted_present/refresh_interval once wp_presentation feedback flows. New free functions present_hints, present_hints_with_commit_lead, default_commit_lead, and display_timing consume that tick: a predicted time is reported as Estimated (a client-side vsync-grid extrapolation, not a compositor-provided target) and falls back to pacing-only when no feedback exists yet.

The backend feeds the observed refresh interval to the ticker at the wp_presentation_feedback.presented sites and the old hints.rs stub is removed; the wayland_layers and wayland_lotta_layers examples are repointed to the new helpers and paired with SchedulerConfig::estimated().

Replace the subduction_backend_wayland present-hint stub with a real
estimator in frameclock_wayland. TickerState now retains the last
observed refresh interval alongside the actual-present time and predicts
the next vsync at or after the tick time, so emitted FrameTicks carry a
real predicted_present/refresh_interval once wp_presentation feedback
flows. New present_hints, present_hints_with_commit_lead,
default_commit_lead, and display_timing free functions mirror the Apple
and Web adapters; a predicted time is reported as Estimated, since it is
a client-side vsync-grid extrapolation rather than a compositor-provided
target, and falls back to pacing-only when no feedback exists.

The backend feeds the observed refresh interval to the ticker at the
wp_presentation_feedback.presented sites, the hints.rs stub is removed,
and the wayland_layers and wayland_lotta_layers examples are repointed to
the new helpers and paired with SchedulerConfig::estimated().
@waywardmonkeys

Copy link
Copy Markdown
Contributor

This looks interesting, but I think the best way to see about it will be to get a few things landed so that you can try writing a ui-events-wayland and overstory_host_wayland and be able to test it end to end! The Overstory side of that should be possible this week. The ui-events side is optional but could be done any time. (Although there are design questions there...)

@waywardmonkeys waywardmonkeys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have a way to test / confirm this ... I'm inclined to land it and let people test it by having it be usable via Overstory (at least).

@no-materials
no-materials merged commit 51a2d5d into forest-rs:main Jul 2, 2026
15 checks passed
@no-materials
no-materials deleted the wayland-present-time-estimator branch July 2, 2026 07:30
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.

2 participants