Reland: stop generating frames for occluded surfaces - #257
Closed
arzafran wants to merge 7 commits into
Closed
Conversation
Reverts the revert (60c14d6). The teardown race the original bump exposed is fixed on main (#254): GhosttySurfaceCallbackContext is now data-only, so ghostty's IO-thread callbacks can no longer corrupt refcount side tables during rapid window teardown — the mechanism behind both CI crash signatures. The renderer patch itself is unchanged (fork commit c25020f99, prebuilt + checksum already published). Merge gate for this PR: CI must pass 3 consecutive runs on this head — the original failure was probabilistic and a single green proved nothing last time. The always-occluded CI environment plus this patch is the exact combination that crashed before, making this PR the definitive regression test for #254.
4 tasks
2 tasks
3 tasks
Member
Author
|
Superseded by #265. The skip-based approach caused two distinct regressions in CI's always-occluded environment: a use-after-free through the stale-userdata scrollbar path (fixed app-side in #262/#263, both merged) and an app hang, traced to the renderer going fully silent while ghostty_surface_read_text and the scrollbar dirty/clear handshake still expected it to tick. #265 throttles updateFrame to 4Hz while occluded instead of skipping it: keeps ~95-98% of the CPU win, removes that class of coupling. |
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.
What this does
Re-lands the herdr-class idle-CPU win (hidden-but-busy agent panes stop paying frame generation on every output burst) now that the teardown race it exposed is fixed by #254. Pure revert-of-revert: submodule pointer back to c25020f99, docs/ghostty-fork.md section 8 restored. The fork branch, prebuilt release, and checksum pin all survived the revert unchanged.
Why this PR is the proof: the original crash required the patched renderer + CI's always-occluded virtual display + rapid window teardown — CI reproduces that combination on every run. With #254's data-only callback context, the corruption mechanism (IO-thread reads of weak refs to deiniting objects) no longer exists.
Merge gate (deliberately harder than green-once)
3 consecutive green CI runs on this head before merging — the original failure passed twice as a PR ref then failed twice on main. One green proves nothing for a probabilistic race; three greens on the exact crashing combination is the bar.
Test plan