Repository navigation
Windows: a frame only a loop asked for runs the loop alone - #1136
Merged
Merged
Conversation
When nothing reached the window since its last frame and every loop on screen is one a step can draw (a spinner's dots, or a sliding window over content that slides back inside it, as a text shimmer is made), the frame samples the loops into the instances they drew and skips poll, view, layout, paint and the instance diff. Only those instances upload, only the pixels they cover redraw (with only the instances that reach them), and only those present. A sliding loop's own edges glide between pixels; what it holds still snaps.
… order too; say why a cycle has no slot
…ission of their own
… them with what each step would have drawn
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
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.
…ndows a step can move (Windows), no slide up or down, unchanged dots not redrawn; RUNE_LOOP_CHECK in headless runs
…r (a missed frame's included); any surface configure makes the next frame whole; RUNE_LOOP_CHECK=2 compares pixels; RUNE_MISS_LOOP_FRAMES (frame-profile)
…n one, and surfaces acquire reconfigured
… differed, fails (exit 3); the pixel check compares its last frame too
…e 3, fast or orderly exit, never mid-run; RUNE_LOOP_CHECK_SPOIL (frame-profile) for its failing row
…cOS and Linux answer that no check failed
…dinary frame's is the same picture
…he ordinary frame's is drawn beside it and the pictures compared; any differing pixel fails the run
…against the frame's
…nchor, so their clips are the same numbers; the check has no tolerance again, and its ordinary frame samples at the step's clock
…n't handled, so work it brought is polled at once
…s it its edges land on whole pixels, as before
…p takes the snapped top and bottom and glides along the slide from its anchor
8 of 9 tasks
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.
While a turn runs, the Working shine asks for a frame every refresh. Each of those frames used to run the app's
poll, rebuild the view, lay it out, walk every node in paint, and compare every instance with the last frame's, all to move 7 glyph clips. Now a frame that only a loop asked for runs the loop and nothing else.CPU per shine frame (blade, Windows, Iris Xe, 800x540 at 1.5x, 240 Hz, frame-profile builds, medians in µs)
That runs 240 times a second for the whole of every reply.
flowchart LR F["frame only a loop asked for"] --> C{"nothing reached the window;<br/>every loop on screen is a slot or a window;<br/>nothing would show or hide;<br/>same swap chain as the last frame"} C -- no --> O["ordinary frame"] C -- yes --> S["loop_step: sample the loops into<br/>the instances they drew"] S --> U["upload only those instances"] U --> D["redraw, where an instance differs from the buffer,<br/>its old and new pixels, with only the instances that reach them"] D --> P["present those rectangles"]clip_fadeon aLoopSpec::slidewhose only child slides the other way, assession-view's shimmer is made. The content holds still, so a step moves only the window's clip and soft edges (runtime/paint/slide.rs).Scene::frame'sorigin_dual, thenbuild'srect_pt). A step would add the offset's change to the last paint's rect. The two float sums land one 1/64-pixel grid step apart where the offset sits on a grid line's half. Drawn side by side, that was a 1/255 change in 35 of 612 steps at 1.5x. So both pose the window throughpose_rectfrom oneAnchor: a rect at an offset, kept across paints while the window's laid-out place holds (slide_anchor). The check needs no tolerance. Across the slide, the window snaps as a still box does, and its clip takes those whole-pixel top and bottom.window/loop_frame.rs);configuregets a number (window/configure.rs);Damagekeeps the number it drew on, and a frame on a different one plans whole, loop-only or not. That coversrebind_alpha, a replaced surface, a resize, a blend switch, andacquirereconfiguring an outdated surface inside a frame.drainpolls, so a streamed token, a tool's result or a toast that another thread queued is polled at once, as ondev.arm_loopthen redraws only the instances whose bytes differ from what the instance buffer holds: a dot a missed frame stepped is redrawn, and a stepped spinner's dots between steps are not.slide_glides): every other slide, and every slide on macOS, Linux and the web, snaps as ondev(the kit's indeterminate progress bar included).pollno longer runs on frames only a loop asked for. Work an app does on a timer asks withTx::wake_after, as on a window at rest. The desktop app's polls that are live during a turn all do (rows below).dev: they have no loop-only frames (the decision is Windows-only), and every slide snaps as before. The web keeps its own spinner step, which now also takes a dot under a faded ancestor.RUNE_LOOP_CHECK=1works in a headless run on every platform (it checksloop_step, which is shared).RUNE_LOOP_CHECK=2and the kept-frame pixel check exist only on Windows (and the web's build), where partial frames do; elsewhere they are absent.looped: the instances it wrote), why one wasn't (loop_why), and how many frames were missed since the last drawn one (missed);RUNE_MISS_LOOP_FRAMES=<n>makes every nth loop-only frame miss its drawable;RUNE_LOOP_CHECK=1runs every frame a step could draw as an ordinary frame and compares the instances; in a headless run (--frames, any platform) it asks before every frame and ends with a tally;RUNE_LOOP_CHECK=2(Windows) compares pixels: each loop-only frame's kept picture against the same instances drawn whole.The step against the ordinary frame
Frame-profile builds at this head; every launch with
OPENCODE_RUNE_OTEL=0.RUNE_LOOP_CHECK=1, the floor app headless: the shine, the shine beside a spinner, a list scrolling under the shine, a reply streamingRUNE_LOOP_CHECK=2, the same app scene (each loop-only frame's picture against the whole frame's)RUNE_MISS_LOOP_FRAMES=7(89 frames missed, a spinner on screen)RUNE_LOOP_CHECK_SPOIL), fast and orderly exit; a resize mid-runOrdinary frames against
dev307b2cd7, headless, every 6th frame of 2 s, 40 pairs per row. Every difference lies inside the shine's band and is at most 3/255 (2/255 at 1.5x and 1.875x). It is the designed glide: ondevthe band steps a whole pixel at a time. Screens with no sliding window are byte-identical.GPU (blade, on screen, the same window size for each)
Official's shine on screen at a matched window size, and the GPU per shine frame before and after, are in one timing ticket on GPUI's list (blade's screen).