Conversation
|
Claude finished @cweill's task in 1m 52s —— View job PR Review: LAB-1803 Trim styled blank scrollback cells
Dependency pin (
|
|
Claude finished @cweill's task in 1m 48s —— View job PR Review: LAB-1803 Trim styled blank scrollback cells
Dependency pin (
|
Greptile SummaryPins the
Confidence Score: 5/5Safe to merge — the change is a targeted fork-pin bump with a new benchmark; no production logic is modified in this repo. The diff is confined to a dependency version bump and an additive test file. The fork's go.mod hash is unchanged between the two commits, confirming only source files differ. The benchmark correctly instruments allocs and bytes, handles the drain-pipe close path, and the Grow hint is arithmetically accurate. Existing preserve-output regression tests re-pass at -count=100, and the heap profiles show the intended reduction. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant B as Benchmark loop
participant E as VTEmulator (132×24, 512 scrollback)
participant R as scrollbackRing
participant vt as weill-labs/x/vt fc372e8574ca
B->>E: Write(payload: 260 styled rows)
loop each row beyond viewport (236 rows)
E->>vt: push row into scrollback
vt->>vt: trim trailing styled blank cells
vt->>R: cloneLineInto (trimmed row)
end
B->>E: Resize(80, 24)
E->>R: reflow scrollback
B->>E: Resize(132, 24)
E->>R: reflow scrollback
B->>E: Close()
Reviews (2): Last reviewed commit: "LAB-1803: Account for ANSI bytes in benc..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Claude finished @cweill's task in 3m 12s —— View job PR Review: LAB-1803 Trim styled blank scrollback cells
Dependency pin (
|
Motivation
LAB-1803's live heap profile reproduced the reported post-LAB-1750 shape. During verification on 2026-05-13, a fresh server heap profile for the installed
d266004build showed 676.69 MB in-use withvt.cloneLineIntoretaining 411.63 MB / 60.83%; the issue artifact from 2026-05-13 showed the same post-LAB-1750 shape at 507.70 MB withcloneLineIntoat 298.41 MB / 58.78%. A pre-LAB-1750 heap artifact from 2026-05-12 showed 300.18 MB total withcloneLineIntoat 91.16 MB / 30.37%.go tool pprof -peek cloneLineIntopointed atvt.(*scrollbackRing).push, not an amux snapshot cache, so the fix targets the vt scrollback clone input instead of adding amux-side memoization.Summary
github.com/charmbracelet/x/vtto weill-labs/x commitfc372e8574ca, which trims trailing styled blank cells before cloning rows into scrollback.cloneLineInto's API unchanged; the fork-side change is tracked in LAB-1803: Trim styled blanks in vt scrollback x#15.mainby6adbf8184605, so this PR pins a later fork commit rather than cherry-picking the soft-wrap API restoration here.Baseline numbers
Hardware: AMD EPYC-Milan Processor, Linux amd64.
BenchmarkVTEmulatorResizePreservationStyledScrollbackbytes/opBenchmarkVTEmulatorResizePreservationStyledScrollbackallocs/opvt.cloneLineIntoin-useTesting
go test ./internal/mux -run '^$' -bench BenchmarkVTEmulatorResizePreservationStyledScrollback -benchmem -count=5go test ./internal/mux -run 'TestRenderWithCursorRoundTripPreserves(SoftWrapForResize|WrappedTrailingSpaces|BlankWrappedSpacesAtCursor|BlankWrappedRowsBeforeHardNewline|PhantomCursorForResize)|TestVTEmulatorResizeShrink' -count=100go test -race ./internal/mux -timeout 120s -count=10go test ./... -timeout 180sgo test ./test -run '^TestSwapForward$' -timeout 120s -count=1after onego test ./... -timeout 120srun hit that integration timing flake.weill-labs/x/vt:go test -run 'TestScrollback/trims_trailing_styled_blanks' -count=100weill-labs/x/vt:go test -run TestScrollback -count=1weill-labs/x/vt:go test ./...go test -race ./... -timeout 120s -count=10was attempted and currently fails outside the touched package set in timing-heavy tests/packages (internal/cli,internal/client,internal/dialutil,internal/remote,internal/server, andtest).internal/muxpassed the same race/count loop.Review focus
-count=100.Closes LAB-1803.