Repository navigation
Rest: free the kept last frame after 60 s idle with one shared 60 s timer; refill on an idle turn - #1063
Rest: free the kept last frame after 60 s idle with one shared 60 s timer; refill on an idle turn#1063Hona wants to merge 4 commits into
Conversation
Partial frames (#852) redraw changed rectangles into a window-sized texture the renderer keeps, and copy it to the drawable. The first partial frame makes it and nothing gave it back: after a session is open and closed, Home holds it for the window's life (9,708,544 B of GPU memory at 1920x1200 on an Iris Xe, mapped into the process as private bytes). Rest now drops it with the other textures it gives back; the next partial frame finds no kept frame and draws whole into a new one, as the first one does.
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. 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.
|
Not merging as is. Two findings on blade (Iris, diagnostic and frame-profile builds of app
Proposal, for PRESENT: free it only after a longer idle period, with a non-blocking poll so the bytes actually go, and re-create it off the input frame. Converting to draft. |
…imer; refill on an idle turn
Replaces the 10 s rest drop with PRESENT's option (a) and the shared 60 s `Rest` deadline (`LONG_REST_AFTER`):
- Visible and idle for 60 s: `GiveBackKept` drops `Retained` and calls `device.poll(PollType::Poll)` once so wgpu frees the ~9.2 MB texture without a frame.
- Out of sight (`RestEvent::Unseen`): `GiveBackAll` drops `Retained` immediately and `Rest::Unseen { long }` holds the single 60 s deadline (`keeps_third_buffer`) before emitting `DropThirdBuffer`.
- First frame back: draws whole straight into the drawable (`whole`: "given back"), making and copying nothing on the input frame.
- Next idle turn with no input waiting (`post_frame_turn`): re-creates `Retained` and draws the current frame whole into it with no present.
|
Closing (owner's decision): the measured build freed nothing at an idle rest and made the first frame after it slower; the current head was not measured again, and it conflicts in 5 places with dev. Branch kept. |
Replaces the 10 s kept-frame drop with PRESENT's option (a) and the single 60 s
window::restdeadline (LONG_REST_AFTER, shared with swap-chain depth when unseen).What changes
GiveBackKept): after 60 s with no drawn frame (LONG_REST_AFTER),window::restdropsrender::damaged's full-windowRetainedtexture (~9.2 MB at 1920x1200) and callsdevice.poll(PollType::Poll)once without waiting, so wgpu frees the texture without waiting for a frame.Retainedis away draws whole straight into the drawable (whole:"given back"), allocating and copying nothing on the input frame.post_frame_turn): on Windows, the next idle turn with no input waiting re-createsRetainedand draws the current frame whole into it with no present, so the following armed frame finds it current.Rest::Unseen+keeps_third_buffer): going out of sight (RestEvent::Unseen: hidden, minimised, covered whole) dropsRetainedimmediately inGiveBackAlland holdsRest::Unseen { long: now + LONG_REST_AFTER }(keeps_third_buffer() == true), emittingRestEffect::DropThirdBufferat 60 s so swap-chain depth shares the same timer. Non-Windows targets arm no 60 s wake.Gate results (3 runs, blade Iris, release-quick +
frame-profile, exclusive timing tickets)proof/memory/runs/longrest-kept-{1,2,3}(longrest-kept-{1,2,3}-frames.jsonl):rest8→rest63(no frame drawn)given back)totalafter 65.3 s rest (given back)totalafter 53.7 s rest (kept frame held)Tests
06aee70f): 3,088 passed, 1 failed (the known order-dependentruntime::tests::scroll_children::scroll_xy_with_direct_children_scrolls_both_axes_and_warns_on_trailing_growth_sibling);clipboard::macosincluded, general pasteboard 17 → 17 (proof/memory/mac-pr1063-06aee70f-all.log).cargo checkpasses; whole Windows suite queued in PROOF-FARM's lane (06aee70f). Zero test files added or edited.