Repository navigation
Keep at least three screens of kitty images in the registry - #168
Conversation
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>
Perf comparison — this change, against its base3 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.
Each corpus is gated at assemblies measured
Perf comparison — cumulative, everything since 2.0.33 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.
Each corpus is gated at assemblies measured
|
|
@copilot resolve the merge conflicts in this pull request |
Main's #170 changed how the kitty registry trims: by recency, never the image just stored or one on screen, and a retransmitted id drops the placements of the image it replaces. This branch makes the budget a floor of three screens. Both are kept. InputHandler.KittyGraphics.cs conflicted at the Store call: main's DropPlacements for a retransmitted id and its ShowsImage argument are kept, with this branch's KittyRegistryBudget as the budget. Two tests had to be reconciled. KittyPlacementDeleteTests set budgets of 300 and 600 bytes on a 20x5 terminal of 8x16-pixel cells, which the floor now raises to 153,600 bytes, so nothing ever trimmed; the images are now 256x256 (262,144 bytes), placed into one cell with c=1,r=1, and the budgets 300,000 and 600,000, keeping the same ratios. This branch's test that a lone image beyond three screens is dropped contradicted main's rule that the image just stored is never trimmed; it now shows the floor as a budget the way main trims: an older image nothing shows goes once three screens are exceeded, and the one just stored stays. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Problem
MaxImageRegistryBytesdefaults 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