Skip to content

Keep at least three screens of kitty images in the registry - #168

Open
tomlm wants to merge 1 commit into
mainfrom
tomlm/kitty-registry-screens
Open

tomlm wants to merge 1 commit into
mainfrom
tomlm/kitty-registry-screens

Conversation

@tomlm

@tomlm tomlm commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Problem

MaxImageRegistryBytes defaults to 32 MB and the registry trims the oldest images by id regardless of screen size. A client that tiles a full-screen picture (Consolonia's kitty renderer keeps up to three screens' worth of tiles in the terminal to show them again without resending) exceeds that from about 2560x1440 up, and a 4K screen alone is 33 MB. Once the registry has dropped a tile the client still counts on, placing it again silently shows nothing.

Change

The option becomes a floor: the kitty registry budget is max(MaxImageRegistryBytes, 3 × Cols × CellWidthPixels × Rows × CellHeightPixels × 4). Zero or less still means no limit, and a configured budget larger than three screens still applies. Only the two kitty store/charge sites use the registry budget for storage; the iTerm2 OSC sites keep using the option as a per-image sanity ceiling, so their tests at 1 and 1024 bytes are unchanged.

Three tests cover the floor, an image beyond it, and a larger configured budget.

🤖 Generated with Claude Code

MaxImageRegistryBytes (32 MB) is now a floor: the registry holds at
least three screens' worth of pixels, computed from the terminal's size
and cell pixel size. A client that tiles a full-screen picture, as
Consolonia does, keeps a few screens of tiles in the terminal by id to
show them again without resending; at 32 MB a 2560x1440 screen already
could not hold three of them, and a tile the registry had dropped
placed as nothing. Zero or less still means no limit, and a configured
budget larger than three screens still applies.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Perf comparison — this change, against its base

3 run(s) of each side, alternating on one machine. Allocation is a count and is gated exactly. Time is a measurement, so its gate is derived from the spread this job just observed in itself rather than fixed in advance.

corpus bytes/char gen0/Mchar ns/char Δ time noise gate
scroll-ascii 0.00 → 0.00 0.00 → 0.00 3.38 → 3.35 -0.8% ±1% 4%
sgr-churn 0.00 → 0.00 0.00 → 0.00 9.09 → 9.08 -0.1% ±1% 4%
truecolor 0.00 → 0.00 0.00 → 0.00 10.18 → 10.19 +0.1% ±3% 8%
alt-redraw 0.00 → 0.00 0.00 → 0.00 14.41 → 14.47 +0.4% ±4% 12%
unicode 7.66 → 7.66 0.45 → 0.45 35.35 → 35.78 +1.2% ±4% 13%
flood 0.00 → 0.00 0.00 → 0.00 94.52 → 95.18 +0.7% ±1% 4%

Each corpus is gated at max(4%, 3 × its own noise). A wide noise column means this runner was busy and the timing half of the table should be read as advisory; the allocation half is exact either way.

assemblies measured
  • base: XTerm.NET 2.0.5.0 mvid:b94dd2c9-f50b-43db-b2d0-05a1b99d4b78
  • head: XTerm.NET 2.0.5.0 mvid:a83e726a-a65b-4bb4-b367-f6e957ea504e

Perf comparison — cumulative, everything since 2.0.3

3 run(s) of each side, alternating on one machine. Allocation is a count and is gated exactly. Time is a measurement, so its gate is derived from the spread this job just observed in itself rather than fixed in advance.

corpus bytes/char gen0/Mchar ns/char Δ time noise gate
scroll-ascii 0.00 → 0.00 0.00 → 0.00 3.38 → 3.35 -0.9% ±1% 5%
sgr-churn 0.00 → 0.00 0.00 → 0.00 9.08 → 9.08 +0.0% ±2% 6%
truecolor 0.00 → 0.00 0.00 → 0.00 9.93 → 10.19 +2.7% ±3% 9%
alt-redraw 0.00 → 0.00 0.00 → 0.00 14.36 → 14.47 +0.8% ±4% 12%
unicode 7.66 → 7.66 0.45 → 0.45 35.80 → 35.78 -0.0% ±4% 13%
flood 0.00 → 0.00 0.00 → 0.00 94.48 → 95.18 +0.7% ±1% 5%

Each corpus is gated at max(5%, 3 × its own noise). A wide noise column means this runner was busy and the timing half of the table should be read as advisory; the allocation half is exact either way.

assemblies measured
  • base: XTerm.NET 2.0.3.0 mvid:9ba0ce98-0d1e-4424-8aa1-9ab012cdc07a
  • head: XTerm.NET 2.0.5.0 mvid:a83e726a-a65b-4bb4-b367-f6e957ea504e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant