Repository navigation
iOS: draw paints requested during a display callback in that callback - #50
Merged
Merged
Conversation
Messages posted while a display callback's batch runs still wait for the next callback, so a touch can reach UIKit between animation steps. The paints those messages request no longer wait: once the batch has drained, the paints queued so far are delivered in the same callback, so each animation step and touch is shown in the frame that handled it instead of one display interval later. Before, callbacks alternated between stepping and drawing, halving the paint rate of every animation. A paint posted by a paint still waits, so a repainting handler cannot starve the run loop. ios_paint_count() reports delivered paints for frame profiling. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
corepunch
added a commit
to corepunch/orca
that referenced
this pull request
Oct 28, 2026
The submodule referenced the pre-rebase commit of corepunch/platform#50; main there now carries it as 5ce73ca plus its test update 3c3cf61. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The iOS message queue freezes a batch per
CADisplayLinkcallback so a touch can reach UIKit between animation steps. The paint an animation step requests was posted inside that batch and therefore waited for the next callback, so callbacks alternated between "step, no draw" and "draw", halving every animation's paint rate on iPhone.Once a callback's batch has drained, the paints queued so far are now delivered in the same callback, so each animation step and touch is shown in the frame that handled it. Other messages still wait for the next callback (touch priority unchanged), and a paint posted by a paint waits too, so a repainting handler cannot starve the run loop.
ios_paint_count()exposes delivered paints for ORCA's frame profiler.Verification
ORCA's
test-ios-message-frame(rewritten to mirror the application loop and assert one paint per step) passes, and ORCA's merged corepunch/orca#404 points its submodule at this commit; on the simulator, turnstile and inertia now paint on every display callback.🤖 Generated with Claude Code