Skip to content

Windows: a frame waiting for the swap chain's room doesn't turn the loop, and a covered window's owed frame stays covered - #851

Merged
Hona merged 1 commit into
devfrom
present-fix
Nov 13, 2026
Merged

Hona merged 1 commit into
devfrom
present-fix

Conversation

@Hona

@Hona Hona commented Nov 13, 2026

Copy link
Copy Markdown
Member

Two fixes to #844, found measuring an OpenCode window with spinners on screen.

  • No turning loop: when a frame finds the swap chain full, it waits for the swap chain's thread-pool wait. Until then, its runtime timers no longer set the event loop's deadline (Win::waits_for_slot). Before, they woke the loop at once, over and over.
  • The covered frame stays covered: the settled frame that a covered window still draws (CoveredDraw) no longer sets the runtime live. When it did, the spinners' loops asked for frames that nobody saw.

Measured with a spinner on screen (OpenCode fixture, 240 Hz Iris Xe, present wakes, 10 s):

State Before After
Covered 131.7 wakes/s, 333,847 µs/s CPU 29.6 wakes/s, 6,236 µs/s
Visible 472.9 wakes/s 214.0 wakes/s (before #844: 114-119)

The visible row also includes the partial-frame work that follows in the next PR. Its staging fix accounts for the rest: strobe puts the visible window at 13.1% of a core against 13.7% before #844.

…oop, and a covered window's owed frame stays covered

- A frame that found the swap chain full (window::slot) comes when there is room: until then its runtime timers stay out of the loop's deadline and new_events (Win::waits_for_slot), which otherwise woke the loop at once, over and over.
- The settled frame a covered window still draws (CoveredDraw) no longer sets the runtime live: live, its loops asked for frames no one sees.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 01:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Hona
Hona merged commit 4343344 into dev Nov 13, 2026
1 check passed
@Hona
Hona deleted the present-fix branch November 13, 2026 01:34
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