Skip to content

Reland: stop generating frames for occluded surfaces - #257

Closed
arzafran wants to merge 7 commits into
mainfrom
reland/ghostty-occluded-render
Closed

Reland: stop generating frames for occluded surfaces#257
arzafran wants to merge 7 commits into
mainfrom
reland/ghostty-occluded-render

Conversation

@arzafran

@arzafran arzafran commented Aug 5, 2026

Copy link
Copy Markdown
Member

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

  • CI run 1 green
  • CI run 2 green (rerun-all)
  • CI run 3 green (rerun-all)
  • Post-merge: hidden-busy-pane CPU drop visible in Activity Monitor; un-occlude shows current content; resize-while-hidden correct

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.
@arzafran

arzafran commented Aug 5, 2026

Copy link
Copy Markdown
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.

@arzafran arzafran closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant