# gpui: Stop sealing empty intervals on idle frame skips \(\#65057\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/36b6d0951fdee409f0957294a69360ba2e8e980e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 36b6d0951fdee409f0957294a69360ba2e8e980e

Requested commit: 36b6d0951fdee409f0957294a69360ba2e8e980e

Commit: 36b6d0951fdee409f0957294a69360ba2e8e980e

Tree: beb7010fc54637a44f0fe32604f4b607f8b333f6

Author: Anthony Eid

Committer: GitHub

## Message

```
gpui: Stop sealing empty intervals on idle frame skips (#65057)

## Summary

Follow-up to #64958. macOS (display link), Windows (`VSyncProvider`) and
X11 (refresh timer) deliver a frame request on every refresh while a
window is visible. Since frame skips became interval boundaries, each
idle refresh:

- sealed an empty snapshot that the hang monitor thread had to build and
discard, and
- flushed folded sub-floor task polls into the journal via the
platform-signal and skip records. Flushed polls reach the sealer even
when end-of-turn idle handling discards folded-only work, so idle
wake-ups could again accumulate toward a later frame budget, which is
what that rule exists to prevent.

Changes:

- `FrameSkipped` boundaries follow the same rule as idle boundaries:
they're recorded only when an event was retained since the last
boundary.
- `PlatformSignal` and `ReentrantFrameSkipped` are published as point
records that leave folded polls folded.
- The sealer no longer seals empty intervals.
- Throttled and no-render skips still seal real work, so GPUI's own
frame-rate limits (inactive windows, thermal pressure) aren't counted as
dropped frames.
- Cleanups: the throttle carries a `FrameRateLimit` enum instead of
`(Duration, bool)` with an underscore-named binding, `#[repr(u8)]` is
removed from `FrameRequestSource`, and `PlatformFrameSignal::record`
uses `expect(unused_variables)` in profiler-disabled builds instead of
`let _ = (at, source);`.

## Testing

- New `idle_refreshes_seal_nothing_and_keep_polls_folded`: refreshes
with folded polls and no retained work publish only platform signals and
seal nothing.
- Updated skip tests to give skips retained work. A late signal without
work now seals nothing.
- `cargo test -p gpui --features profiler --lib` (438 passed),
profiler-disabled frame-signal and window tests, `./script/clippy -p
gpui`, Windows (`--no-default-features`) clippy, wasm32 check.

Release Notes:

- [GPUI] Fixed idle frame requests sealing empty hang-detection
intervals and flushing folded task polls on every refresh
```

## Parents

- [506beb34de3f433707b7ebe8d8ad2d80f856af6c](https://git.cafe/gitcafe/zed/commit/506beb34de3f433707b7ebe8d8ad2d80f856af6c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/36b6d0951fdee409f0957294a69360ba2e8e980e?format=markdown)
