samanyudas has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
fix(miri): pace from where they show the windows of apps focus moves between, and hand slice photos over once shown#91
Refs samanyudas/miri#163. Stacked on #90: the base is miri/163-pacing.
Summary
Two fixes to the pacing from #90.
1. Focus changes between apps. Helium and Beeper can turn slow right after a focus change. Before this, a window whose app kept up through the last motion still counted as prompt, so the window ahead of it ran off and the desktop showed between them.
| 1 | on(focus change) |
| 2 | + if focus moves from one app to another |
| 3 | + forget what pacing saw of every window of both apps |
| 4 | + (they pace from where the window server shows them until they keep up through a whole motion again) |
A focus move between two windows of one app forgets nothing. Resetting those too made every window of a one-app row wait a frame for the window behind it (the design reverted in the combined review).
2. Slice photo handover at the shared edge (x = 0). The photo closed when the app had taken the window's move, before the window server showed the window there. The bare desktop flashed where the photo had been.
| 1 | frame |
| 2 | + place slice panels, then commit Core Animation at once |
| 3 | write window frames |
| 4 | - photo sliding in: close once the AX write returns |
| 5 | + photo sliding in: close once the window server shows its window at rest |
| 6 | + (on a frame the sampler read, never on a seed), or after 250 ms |
The panels used to be placed after the window writes. A layer-backed panel shows a new frame only at the next run loop pass, so the window ahead could show its move a frame before the photo grew beside it. A lab probe confirmed this, and so did a live run.
Evidence
New harness tests. Each fails on its test commit and passes after the fix:
| 1 | the_window_ahead_waits_for_a_prompt_window_whose_app_gains_focus |
| 2 | a_photo_sliding_in_stays_up_until_its_window_shows_where_it_rests |
| 3 | a_sliding_photo_takes_its_place_before_the_windows_ahead_move |
These two guard the timeout and the read snapshot. They pass both before and after the fix:
| 1 | a_photo_sliding_in_closes_after_a_while_when_its_window_does_not_show |
| 2 | a_window_counts_as_read_only_once_the_sampler_has_read_it |
Checks on this branch:
cargo fmt --checkpasses.cargo clippy -- -D warningspasses.cargo clippy --all-targets -- -D warningsshows the base's 13 pre-existing errors.cargo testpasses.
Live on Sam's Mac, 30 October 2026, with fast-release engines. Both builds also have #86. The earlier build is #86 + #87 + #90, and the new build adds this PR. The measurements alternated between the builds in the same session:
| measure | before | after |
|---|---|---|
| desktop between different apps, 4 rounds of 12 presses | 100 ms in 1 of 4 bursts | 0 in 4 bursts |
| switch apps and reverse at once (S1), 10 tries in each of 3 sessions | desktop in 1/10 each time | 0/10 each time |
| slice crossing: frames showing wallpaper in the flash case | handover 3 to 5 ms after the write, before the window could show | none, handover about 19 ms, each on a real read |
| widest desktop beside a sliding photo | 1687 pt | 284 pt |
| busy app (#86 case), longest pause | 165 ms | 112 ms |
| front window starts moving from rest, median / p90 | 116 / 411 ms | 107 / 405 ms |
| time to place p50 / max, overshoot | 391 / 786 ms, 0 | 392 / 747 ms, 0 |
quit within 1 s of a move leaves Helium's AXEnhancedUserInterface on | yes | yes, 3 of 3 |
| stopped app does not stall the row | recovers | recovers |
Costs and what is left:
- Spotify paused 4 times mid-motion over 40 ms instead of 2, because the windows of the apps that focus moves between now pace from where they show.
- One burst of 4 showed 33 ms of desktop between two Helium windows. A focus move within one app resets nothing, on purpose.
- A leaving photo is still paced from where the engine put it. Focusing a stopped app still holds the engine about 0.85 s in
AXRaise, in both builds.
The recordings and frame captures stay local for privacy.
Reviewed with sol-loop: 3 rounds with gpt-6.1-sol on high. Sol verdict: approved.
Merge Danger
Door: two-way
A revert restores #90's behavior. The change touches no stored state or config.
Blast Radius: animation
It changes only pacing during row animations and the slice photo handover at the shared edge. If the handover check fails, a photo stays up for at most 250 ms longer.
๐ค Generated with Claude Code
Checks
Important
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
External image Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
da77d3b5-70c4-4efd-b586-acd66bb9f8e8
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- ๐ Trigger review
- Autofix ยท Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Added 7 commits
- fix(miri): pace from where they show the windows of apps that focus moves between2a0079b
- fix(miri): close a sliding photo only once the window server shows its window at rest3a3ef9b
- test(miri): keep a sliding photo up until its window shows where it rests813ec43
- test(miri): pace from where they show the windows of an app that gains focusd77c2f4
- fix(miri): hand a photo over only on a frame read from the window serverd931c56
- fix(miri): place a sliding photo before the windows ahead of it movee769404
- test(miri): place a sliding photo before the windows ahead of it moveef17d95
samanyudas has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.