bench-terminal-resize: pane check samples each window's frames; an unsampled terminal fails

Merged
LA
9h ago
+168-55

Summary

Port of #36288 onto the current feat-cmux-next (its branch was 1,200+ commits behind and conflicted).

  • The pane check (debug.terminal_display, TerminalPaneFollowProbe) samples each followed terminal on its own window's frame clock (FrameScheduler.forWindow), not the screen's display link; the after-commit observer samples only windows whose frame ticked in that turn.
  • terminal_resize_verdict: a terminal shown at the round's start with 0 sampled frames fails the round ("was not sampled").
  • Data: per terminal in_flight frames, and follow_presenter (the frame presenters' passes, presented, keeps, group waits, fallbacks) in the stop reply and the arm summaries.

Not ported: #36288's last two commits ("a lagging frame fails a drag or key round"). feat-cmux-next's rule after it is that lagging frames are data only (the frame owner keeps a frame 1-4 refreshes by design; films judge that); feat's rule wins where they collide. The conflict in terminal_resize_arms.py keeps feat's missed_split with the PR's in_flight_frames and presenter_keeps.

Changelog

none

Observed / Not run

  • python3 scripts/cmux-next/tests/test_bench_terminal_resize.py: 29 OK (includes the unsampled-terminal test, red at 31c3daf3002 per the original PR).
  • Fleet: app build and TerminalPaneFollowTallyTests (package-test-lane suite) submitted at this head; results in a follow-up comment.

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


Summary by cubic

Ports #36288 onto feat-cmux-next (the old branch was 1,200+ commits behind and conflicted). The pane check (debug.terminal_display) now samples each followed terminal on its own window's frame clock (FrameScheduler.forWindow) instead of the screen's display link, so a sample reflects what that window's commit carried that turn. A terminal shown at the round's start that was never sampled (0 frames) now fails the drag or key round instead of passing on the other terminals' frames.

  • Adds per-terminal in_flight frames (a size asked of Ghostty and not shown yet) and the frame presenters' counts (follow_presenter: passes, presented, keeps, group waits, fallbacks) to the stop reply, each round, and the arm summaries.
  • #36288's lagging-frame-fails rule is not ported: feat-cmux-next treats lagging frames as data only (the frame owner keeps a frame for 1-4 refreshes by design), and its rule wins where the branches collide. terminal_resize_arms.py keeps feat's missed_split alongside the new counters.