Repository navigation
bench-terminal-resize: pane check samples each window's frames; unsampled or lagging terminals fail - #36223
bench-terminal-resize: pane check samples each window's frames; unsampled or lagging terminals fail#36223lawrencecchen wants to merge 6 commits into
Conversation
…s not change size with its pane debug.terminal_display now also samples, once per display frame after the frame's commit, every terminal shown at start: its pane's size (TerminalHostView.surfaceSize(forHostSize:)), the size its host asked of it (the frame owner's wanted frame, else the view's frame) and the size its layer shows. The stop reply adds terminals_followed (per terminal: frames, held, lagging, the first 3 of each) and follow_frames; the other keys stay. Nothing runs while the probe is stopped. The probe moves to CmuxNextTerminal (TerminalDisplayProbe), next to the geometry it reads; the App keeps the route. terminal_resize_verdict.problems fails a drag or key round with a held frame, naming the terminal, its held frames and the first sizes; a round with no pane check fails too. The held-drag excuse (holds_terminals) is gone: it stays as data. Lagging frames are data only. Arm summaries add held and lagging frames. Tests: scripts/cmux-next/tests/test_bench_terminal_resize.py (26 pass); TerminalPaneFollowTallyTests (fleet).
…fault isolation is the main actor)
…round must fail the round Review of #36109, finding 2. Red: the round passes today (problems() returns []).
…n unsampled terminal fails Review of #36109 (frame-owner-s4): 1. The pane check sampled on the screen's display link (FrameScheduler.app). Each window that shows a followed terminal now gets a client on its own frame clock (FrameScheduler.forWindow), the clock its springs and its frame presenter tick on, and the after-commit observer samples only the windows whose frame ticked in that turn. 2. terminal_resize_verdict: a terminal shown at the round's start with 0 sampled frames fails the round ("was not sampled"), instead of passing on the other terminals' frames. 3. The verdict's docstring named DebugTerminalPaneFollow, which does not exist; it names TerminalPaneFollowProbe. Data for the lagging question: per terminal `in_flight` (frames with a size asked of Ghostty and not shown yet), and `follow_presenter` in the stop reply (the frame presenters' passes, presented, keeps, group waits and fallbacks in the run). The bench carries both into each round and the arm summaries. Tests: test_bench_terminal_resize.py 27 pass (the new unsampled test was red at 31c3daf); TerminalPaneFollowTallyTests (fleet).
…round frame-owner-s4 (m14 contract: a late frame is a failure). Red: lagging frames are data only today.
frame-owner-s4, 2026-11-05 (the m14 contract: a late frame is a failure). A frame whose layer shows another size than its pane after that frame's commit fails the round, with a message naming the terminal, its lagging frames and the first sizes; lagging_frames stays in the report. Expected red: ON key rounds until draw ahead and the window frame sync land. Tests: test_bench_terminal_resize.py 27 pass (the lagging test was red at 0c16e59).
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
|
|
Review (independent subagent): SHIP at ed6ba20 Scope: the 4 commits on top of 135c183 (#36109, now merged). I read the code, ran the Python tests, and read the A/B fleet log. I did not build Swift. Verdict: SHIP. The sampler is correct for what it claims, and the A/B data supports the ON result. Findings below are follow-ups. None blocks. 1. Sample timing (correct).
2. What it can still miss (follow-ups):
3. Rules, cost and threads (OK).
4. Tests (not vacuous; red for the right reason).
5. No CI job, gate, perf-gate row or budget is added. No 6. Arch and tables.
7. CI at the head.
8. With #36242. There is no code dependency. #36242 changes Review (independent subagent): SHIP at ed6ba20 |
Stacked on #36109: until it merges, this diff also shows its commit (135c183). The follow-up is the four commits after it. Review of #36109 (comment 6650044486) plus frame-owner-s4's later rules.
Summary
FrameScheduler.app). Each window that shows a followed terminal now has aFrameClientonFrameScheduler.forWindow(window), the clock its springs and frame presenter tick on. An observer after Core Animation's commit (beforeWaiting, orderCFIndex.max) samples only the windows whose frame ticked in that turn. A sample is the geometry that turn's commit carried for that window's frame. The doc comment says exactly this.lagging_framesstays in the report.DebugTerminalPaneFollow, which does not exist; it now namesTerminalPaneFollowProbe.in_flight: frames where a size was asked of Ghostty and was not shown yet. The stop reply addsfollow_presenter: the frame presenters' passes, presented, keeps, group waits and fallbacks in the run. The bench carries both into each round, and the arm summaries addin_flight_framesandpresenter_keeps.Bench only. This PR adds no CI job, step, gate or budget. The probe stays in
CmuxNextTerminal, owned by PL-ghostty (session cmux-b6).Observed / Not run
Red, then green:
python3 scripts/cmux-next/tests/test_bench_terminal_resize.py:test_a_terminal_not_sampled_in_the_motion_failsfails at 31c3daf and passes at 6a87567.test_a_lagging_frame_fails_and_names_the_terminal_its_frames_and_sizesfails at 0c16e59 and passes at ed6ba20.Fleet step
ad3ccfc1219e74f7aeb7b804at 6a87567 compiled CmuxNext, and the 4TerminalPaneFollowTallyTestspassed, including the new in-flight test.A/B
--ab=motion.frameOwner.terminals, keys and keys-stress, 2 rounds per arm, at 6a87567 (same Swift as the head) on cmux23-perf: stepd557f84ae28f821bd9f55bc1. Held and lagging frames are summed over the round's terminals:In this bench build, the ON key rounds still show 0 lagging frames. frame-owner-s4 expected lagging in most spring frames, from pixel-perfect's trace ("presenter request, host frame pending"). I checked whether the 0 comes from sampling at the wrong time. Two counters that do not depend on when the sampler reads say it does not:
keeps0,fallbacks0, and all 112 (keys) or 140 (keys-stress) requests per round were presented in their own pass.The sampler also never saw a size in flight after a commit (
in_flight0). So in the optimized bench build (--config=bench) on cmux23, each key-spring frame's new size was drawn and presented in the commit of the same turn. I did not reproduce pixel-perfect's one-tick lag. The likely cause is a different build or display. A known gap: if the host view itself lags its pane, this check cannot see it, because "pane" here means the host's bounds.With this head's rules, the ON key rounds above pass and the OFF rounds fail (held and lagging). A run with lagging > 0 would now fail. That path is covered only by the unit test, not by a bench run.
I moved the run off two minis. cmux17-perf showed idle but did not claim step
4fb4e24064b35b4ba1a0e766for 35 minutes. cmux22-perf was held for a capture pool. I cancelled both steps.Not run: drag layouts on this head, and films.
Changelog
none
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
The pane check for
bench-terminal-resizenow samples each window's own frame clock, so a terminal that is never sampled, or that shows a size other than its pane's, fails the round.holds_terminals) is data only and no longer excuses a round.Bench only: no CI job, step, gate, or budget changes.
Written for commit ed6ba20. Summary will update on new commits.