Repository navigation
Conversation
Entry readings and the lines a plain fit store does not hold are cut in one search: each binary-search step for every line shares a measuring render, through the existing widths limits. A single line asks exactly what it asked before. Rooms that reach the measuring columns keep the one-line path, and a failure found while batching is discarded so the lines are cut again in written order, reporting the first failure as before. A cold 1,000-line wrapping entry goes from about 24,000 measuring renders to fewer than 150, with identical rows.
Independent review from Claude Fable 5.2Changes requested for
|
Independent review from Claude Fable 5.2PASS for The 2,048-part budget applies to grouped line-search probes. Individual measurements and finished row widths still use the existing behavior. At 80×24, the same 1,000-line fixture dropped from 12,004 measurement renders on the earlier PR head to 41 on this head. The median across seven isolated runs was 154 ms on base, 178 ms on the earlier head, and 47 ms with the correction. At 160×36, the 2,000-line fixture took 82 ms on this head, compared with 87 ms on the earlier head and 599 ms on base. The real-renderer comparison found identical output, refusals, and retained cuts in 1,200 differential cases. Narrow and wide stress probes agreed with base, including the existing refusal in the finished-width pass for 2,000 non-wrapping lines at 80×24. |
Why
Opening a long REPL entry makes the terminal renderer measure each logical line separately at every step of wrapping. The work delays the first visible Output after selecting or submitting an entry.
What changes
The fitter sends width probes for several lines in the same renderer call. Each line keeps its own grapheme boundaries, search window, and indentation. The fitter limits batches with multiple search probes to 2,048 parts so they fit the smaller measuring cache on narrow terminals. Near the terminal width or when a batch refuses, the fitter measures lines individually in written order.
How to verify it
The Source reading tests compare fitted rows against the real renderer run one line at a time. The tests cover Unicode, cached and uncached plain text, wrapping near the terminal width, and refusal order.
In the dedicated 80×24 regression, fitting 1,000 wrapping lines took 41 measurement renders, down from about 12,000 on the base. The median time spent preparing that reading fell from 157 ms to 44 ms across seven runs.
ReplBench ran three paired macOS launches at each viewport with the same synthetic 1,000-line traceback. The medians below measure from input through the expected terminal text.
Terminal frames
The styled frames match at all five checkpoints after accounting for the generated session ID. Captures use base
8c71b35b6and head1ceee0bf4.Scope
This is the fitting optimization discussed alongside #1342. The Markdown presentation work is tracked in #1351.
Scope confirmation