Conversation
…nly what drew the same screen
…ses every private mode and control it does not model, pinned
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PLAN step 6, the bench half; with #404 this completes the plan's six steps.
The reducer.
bench/harness.rip'sTerminalreplays what each side wrote — cursor moves, erases, SGR throughtest/ink/cells.rip's reader, line feeds and scrolling into a kept scrollback, the DEC modes, the alternate screen, grapheme widths, wraps, resizes in stream order — and refuses anything it does not model. After every update the two screens, scrollback included, are compared cell for cell, text and style (a blank shows no color; trailing blanks and trailing blank rows are dropped); Ink's five runs must agree with each other, ours too, and both sides with each other, or the scenario is refused with the first differing cell in its place. Reduction runs after the timing loops, so its cost is in neither side's number. Ink's update resolves on the write that ends its synchronized frame, so its throttle cannot misattribute one.bun run benchruns every scenario PLAN §11 lists on both sides — the same tree, node for node — each in a fresh process, five times, and writesbench/RESULTS.mdwith the machine, versions and load; README's numbers and PLAN §11 quote it, and every number reproduces withbun run bench. CPU µs per update, median ±half the spread, Apple M5, Bun 1.4.2, Ink 7.1.1 on React 19.3.0's production build with memoized rows and its throttle lifted:Cold start, median of 7: Ink imports in 39.5 ms and draws 70.6 ms from process start; Rip TUI 8.6 ms and 39.0 ms. Every Ink update is three writes; ours is one.
Where it does not flatter, stated in PLAN §11 and the README:
Staticappends are superlinear here (149 µs each over 1,000, 348 over 8,000) where Ink is flat, so past about 4,000 appends Ink wins — TODO §5 holds the cause; a resize writes more bytes than Ink (6,635 vs 4,295), since the frame is drawn from nothing; and a wrap divergence the reducer caught at a33%cell (Ink wraps at Yoga's float width 39.6, we at the rounded 40, and our wrapper leaves a leading space when a line ends exactly at a space) is recorded as open text-engine work, and the scenario uses25%cells that are whole at both widths.Lines of code (
bun run lines, non-blank non-comment bytest/lines.rip's rule): Inksrc/6,760 against 4,252 here (1.6×); with Yoga's algorithm, 10,252 against 4,252 (2.4×, of whichlayout.ripis 1,466). PLAN §2's "about 3×" does not hold and now says 2.4× and why: the package ships the mouse, hover, the kitty keyboard, selection, links and progress, which Ink does not.Also:
package.jsonshipsmouse.rip, which it did not list;cells.ripexports its SGR reader for the reducer.Suites unchanged (14, examples included); root style gate passes.