Skip to content

ghostty-next: the wrap edge break reads a compressed history row only when the pair was joined - #29775

Merged
lawrencecchen merged 3 commits into
feat-cmux-nextfrom
cp/ghostty-wrap-edge-history-cost-2
Nov 1, 2026
Merged

lawrencecchen merged 3 commits into
feat-cmux-nextfrom
cp/ghostty-wrap-edge-history-cost-2

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Testing

  • Red: fork run 41240560795. The new Zig test "insertLines and deleteLines at the top row leave a compressed history page compressed" fails without the fix.
  • Green: fork PR fix cmux crashing issue #68 run 41240575661, and the release run 41241826620, which built and published this kit.
  • The cmux Rust replay tests on this pin: see the fleet step in a comment below.

Observed / Not run

  • Observed: the red and green fork runs above. SHA256SUMS of the release lists 66e883f7130352862fd3dd4b46cf0a6d22d50750bf633f3589831bf9b2f4f99f, which is the checksum in Package.swift.
  • Not run: a timing benchmark. The test proves that the common case leaves the compressed page alone. It does not measure time.

Changelog

none


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes a performance issue in ghostty-next where Screen.breakWrapAbove read a compressed history row before checking flags, so IL or DL at the screen's top row restored the last history page from compression on every call. The function now decides on the resident row first and reads a compressed row only when the pair was joined.

  • Pins GhosttyNextKit xcframework-84a225487372c53851b186864c867e469e7596d2-apple-v6 (checksum 66e883f7...); the gitlink, package-notices.json, and vt-link-graph.json move with it.
  • Adds the Zig test "insertLines and deleteLines at the top row leave a compressed history page compressed", which fails without the fix and passes with it.
  • docs/ghostty-fork.md now states that every commit ID in the E2 section is a release-branch ID.

Written for commit 4bf50aa. Summary will update on new commits.

View guided diff Turn on auto-fix

… when the pair was joined

Pins GhosttyNextKit xcframework-84a225487372c53851b186864c867e469e7596d2-apple-v6
(checksum 66e883f7... from its SHA256SUMS) and moves the gitlink and the notices
with it. ghostty-next 8444cc1eb..84a225487 on release/cmux-9ce9b7d0-e2 is fork
PR #68 only (review note 1 on #29609): breakWrapAbove read the row above before
it checked the flags, so IL or DL at the screen's top row restored the last
history page from compression on every call, and a region scroll can run per
output line. It now decides on the resident row first and reads a compressed
row only when the pair was joined.

Red: fork run 41240560795 ("insertLines and deleteLines at the top row leave a
compressed history page compressed" fails without the fix). Green: fork PR #68
run 41240575661 and the release run 41241826620, which published this kit.

docs/ghostty-fork.md (review note 2): every commit ID in the E2 section is now
the one on release/cmux-9ce9b7d0-e2, and the section says so.
@lawrencecchen lawrencecchen added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 4bf50aa: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr29775 -f ref=cp/ghostty-wrap-edge-history-cost-2 -f platform=macos -f backend_mode=local

Not verified: macOS jobs did not run: compile and app tests were skipped on 4bf50aa683; ci-status is green without them.

CI passes on 4bf50aa683 (run 41263139029 attempt 1).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

Shipped in:

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (Claude Opus 5.5 review subagent): SHIP at eb7600b

Independent review subagent (read-only). It checked that the early return is sound for every state that this pin's own paths make, the moment top_joined is read in IL and DL, the other callers, that the Zig test reaches the compressed path and fails without the fix, the URL and checksum against SHA256SUMS, the gitlink, the notices, and every docs/ghostty-fork.md hash on release/cmux-9ce9b7d0-e2.

Non-blocking finding, kept as a follow-up: the new comment in Screen.breakWrapAbove says "every clear clears both", which is not true. Two older paths, clearRows (ED 1, ED 2, DECALN) and cursorScrollAbove with the cursor at row 0, can leave wrap=true on a history row whose active continuation row has no flag. This PR does not create that state. Before this PR, IL or DL at row 0 cleared it by chance; now that stops only when the history page is compressed. The comment fix, and a root fix for those two paths with their own red tests, go in the next fork change.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Rust replay tests on this pin: fleet step 0e1a97219c7ae128a85709bc (Actions run 41250330654): 6 vt_replay tests pass, among them vt_replay_keeps_a_stale_wrap_continuation_row_in_its_column.

@lawrencecchen lawrencecchen added the ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds label Oct 31, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

"cmux-next swift test" classification (run 41250318057): not caused by this PR.

  • This PR changes only the GhosttyNextKit pin. The fork diff is src/terminal/Screen.zig, Terminal.zig and a CI file. No Swift source changes.
  • 36 UI and app suites failed, for example Acpmux*, Home*, SidebarEditModeTests and PinnedRowHoverCardTests. None of them is a terminal or VT suite. 18 of them also failed on ghostty-next: a scroll region scroll breaks the soft wrap across its edges (VT fuzz finding E2) #29609's run 41237585801. ContextMenuStandardTests, EmptyWorkspaceRepairTests and ArchiveSurfacesTests fail at the merge-base too (fleet step 16cce5c1123dddb707523ea2, base b0e10a0).
  • I rerun the failed job once on this SHA, with no source change.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 01:10 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 01:10 Inactive
@lawrencecchen lawrencecchen added ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds and removed ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds labels Nov 1, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Classification of the compile reds on head 69ae06a (after cmux-bot merged feat): base red, not this change.

@lawrencecchen lawrencecchen added ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds and removed ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds labels Nov 1, 2026
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

I merged the feat tip 33995df into this branch (head 4bf50aa). It brings #29871 (ac5389c), the fix for the NativePopupHost compile base red. The PR's own diff against the merge-base is unchanged: the same 5 files. I removed and added ready-to-land again for this head. The review receipt is for the unchanged diff at eb7600b.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Review (Claude Opus 5.5 review subagent): SHIP at 4bf50aa

Re-review after the two base merges (69ae06a by cmux-bot, 4bf50aa by me). The PR's own diff against the merge-base is byte-for-byte the diff reviewed at eb7600b. Neither merge resolved a conflict in the PR's 5 files. Earlier non-blocking findings stay open:

  • clearRows (ED 1, ED 2, DECALN): fixed in fork PR fix cmux crashing issue #68 part 2. The next pin PR, cp/ghostty-clear-rows-wrap-edges, carries it.
  • cursorScrollAbove with the cursor at row 0: not fixed yet. It goes in a follow-up.

@lawrencecchen
lawrencecchen merged commit 1e327b2 into feat-cmux-next Nov 1, 2026
214 of 233 checks passed
@lawrencecchen
lawrencecchen deleted the cp/ghostty-wrap-edge-history-cost-2 branch November 1, 2026 02:36
lawrencecchen added a commit that referenced this pull request Nov 1, 2026
…s the cleared rows' edges (#30012)

* test(ghostty-vt): ED 2 and DECALN break the soft wrap from scrollback into the cleared screen (red; E2 class)

Review of #29775: clearRows resets the cleared rows, but the scrollback row
above the screen kept wrap=true. After ED 2 (or DECALN) and a wider resize,
reflow joined that row and the new text on row 0 into one line
("abcdeXY"). Red at pin 84a225487 (fleet step e3b896d45e34435553a6e67a on a
probe branch with the same tests).

* ghostty-next: a clear of rows (ED, DECALN) breaks the soft wrap across the cleared rows' edges

Pins GhosttyNextKit xcframework-34e73ba8ba7cb8da0115caeb780065e3a12f2f62-apple-v6
(checksum 32cb09bb... from its SHA256SUMS) and moves the gitlink and the notices
with it. ghostty-next 84a225487..34e73ba8b on release/cmux-9ce9b7d0-e2 is the
second part of fork PR #68 only: clearRows reset the cleared rows, but the row
above the range kept wrap=true (a scrollback row for ED 2 and DECALN) and the
row below kept wrap_continuation=true (the cursor row after ED 1). It now
breaks both edges after a full clear; a protected clear keeps its row flags.

Red: vt_ed2_breaks_the_wrap_from_scrollback_into_the_cleared_screen and
vt_decaln_breaks_the_wrap_from_scrollback_into_the_filled_screen fail on
1602522 (pin 84a225487: "abcdeXY" after a resize). Fork red: run
41251885912 (3 of 3 clearRows Zig tests fail without the fix). Fork green:
PR #68 run 41251888717, broad run 41254020927 (2297 of 2297 libghostty-vt
tests) and the release run 41255186701, which published this kit.
lawrencecchen added a commit that referenced this pull request Nov 1, 2026
…essed history row only when the pair was joined (port of #29775)

Port 89dd169 of feat PR #29775 (squash 1e327b2). The pin is resolved
for this line: ghostty-next release/cmux-ef6ce279-e2 at 7f8d846b2 (this line's
previous pin 3a82309b9 plus only fork PR #68 part 1, the same commits as feat's
8444cc1eb..84a225487), GhosttyNextKit
xcframework-7f8d846b24cf0f994feaebddfe6376f3ee38c595-apple-v6. PR #30015.
Port review: Review (Opus 5.5 review subagent): SHIP at 89dd169.
Fork red: run 41240560795 (the compressed history page test fails without the
fix); green in this release's run 41260252846. Journey r3-e2-reattach (kit
c370e63) passed 3 of 3 on port build 6d6a0fcc090a0347f7b7142d (cmux19
03:39Z, 03:40Z, 03:41Z).

This branch was previously deployed

3 inactive deployments
artifacts — 4bf50aa6 Deployed Nov 1, 2026 by lawrencecchen via add the Windows daemon to the tree #92818
sentry-dsyms — 4bf50aa6 Deployed Nov 1, 2026 by lawrencecchen via upload cmux-tui dSYMs to Sentry #92818
ci-routing-agent — 4bf50aa6 Deployed Nov 1, 2026 by lawrencecchen via cmux-tui tree preflight #92818
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant