Reclaim hidden Ghostty renderer memory - #8998
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe changes switch macOS renderer presentation to forced Ghostty rebuild transactions, align reclamation defaults with the settings catalog, derive Zig requirements from Ghostty’s manifest, expand rebuild-focused tests, and update Ghostty fork metadata. ChangesRenderer reclamation and presentation
Build and Ghostty integration
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant TerminalSurface
participant Ghostty
participant PresentationRepair
TerminalSurface->>Ghostty: request renderer rebuild
Ghostty-->>TerminalSurface: accept or reject rebuild publication
TerminalSurface->>PresentationRepair: cancel or arm repair
PresentationRepair->>TerminalSurface: retry after renderer activity
Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (23 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryUnifies renderer-reclamation defaults and adopts the pinned Ghostty lifecycle implementation.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the runtime and Settings UI now obtain renderer-reclamation defaults from the same catalog, and the app target already links the imported settings module. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Hidden["Tab remains hidden for 5 seconds"] --> Policy["Renderer realization policy"]
Policy --> Release["Release Ghostty renderer resources"]
Release --> Preserved["Retain PTY, terminal state, and scrollback"]
Preserved --> Selected["Tab becomes visible"]
Selected --> Restore["Publish realized state"]
Restore --> Presented["Renderer presented again"]
Reviews (5): Last reviewed commit: "Use catalog renderer reclamation default..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ac4f04746
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmuxTests/RendererRealizationPlannerTests.swift`:
- Around line 91-110: Update defaultFiveTabBaselineReclaimsFourHiddenRenderers
to resolve settings through RendererRealizationSettings.values(defaults:) using
an isolated UserDefaults instance with no stored keys, then pass the resolved
settings to selectedSurfaceIds instead of constructing Values directly from
constants. Preserve the test’s existing inputs and expected planner behavior.
In `@docs/ghostty-fork.md`:
- Around line 60-62: Before pinning the 517a4c75a GhosttyKit artifact, add a
deterministic teardown/shutdown regression test covering the clearSurface
main-queue dispatch_sync interaction with renderer-thread teardown, or update
the dependency to a release containing the fix from PR `#153`. Only promote the
pinned commit and checksum after shutdown completes without hanging.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 60f50b35-6bbd-4178-8cff-0fcdd3cc2d78
📒 Files selected for processing (8)
Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Surface/TerminalSurface+Renderer.swiftPackages/macOS/CmuxTerminal/Tests/CmuxTerminalTests/TerminalSurfaceRendererPresentationTests.swiftSources/App/RendererRealizationController.swiftSources/App/WorkspaceRuntimeSettings.swiftcmuxTests/RendererRealizationPlannerTests.swiftdocs/ghostty-fork.mdghosttyscripts/ghosttykit-checksums.txt
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Final tagged benchmark on
The four extra tabs add 1.0 MB physical and 2.3 MB graphics after reclamation. The remaining 220.9 MB graphics baseline is fixed cmux process cost, not Ghostty tab growth. The catalog regression failed at the stale 30-second/12-renderer defaults, then passed at 5 seconds/1 renderer. Cloud build: https://github.com/manaflow-ai/cmux/actions/runs/30263879004 |
…aseline # Conflicts: # docs/ghostty-fork.md # ghostty # scripts/ghosttykit-checksums.txt
|
@codex review |
@austinywang I can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 241,631 of the 240,000 allowed lines of code this month. Reviews resume on 1 August 2026 (in 4 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
…to feat-ghostty-memory-baseline # Conflicts: # tests/test_ghostty_zig_version_sync.sh
# Conflicts: # .github/workflows/ios-testflight.yml # Packages/macOS/CmuxTerminal/Sources/CmuxTerminal/Engine/SurfaceRegistry/TerminalSurfaceRegistry.swift # docs/ghostty-fork.md # ghostty # scripts/ghosttykit-checksums.txt
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Summary
Benchmark
Controlled workload: one isolated 80 by 24 window, five idle login-shell tabs, 30-second settle, five samples at five-second intervals. Values are app-only physical footprint.
The patched standalone Ghostty build closes 90.4% of the retained-memory gap between Ghostty 1.3.1 and the 96.6 MB Otty/Termy mean.
Tagged cmux control after reclamation:
Tab scaling is competitive. cmux retains a separate roughly 319 MB whole-app baseline above the Otty/Termy mean.
Memory-runtime implementation and test churn is 3,471 Ghostty lines versus 197 cmux GUI lines, or 94.6% Ghostty and 5.4% cmux. This excludes the compiler-synchronization workflow changes and unrelated commits brought in by merging current
mainin each repository.Ghostty dependency
1e86b46e235d644442956f0f067b93ec2c8eaade.4dab6fd6c38e9ebed2408a971d3e4b0af7f56b45.2fc66ed157fdfe2557f6e3db2bf56f6a1ee95c0f.3c1b75d25de46865ce541a41a918d5e299979bd1.c467d389cba3b7560b88dbeb07a2d239898be1a2; cmux pins its reviewed head78621f8ce6c113c520cc9388f7306643a2329502.76741da4c4cf640293ad8fabc08d03056ec113afb42140208d6141af5eb58e96.Testing
019fabe3-1f2f-7622-a43f-b46f479207c2.arm64andx86_64.Demo Video
No video. This changes renderer memory lifecycle rather than visible UI; tagged preflight exercises tab reclamation and restoration.
Review Trigger
Checklist