#646

tailnet: Kitty mode re-uploads whole sparkline images 2–4 times a second instead of editing them

Openwiiiimmopened 10d ago

In Kitty mode, tailnet deletes and re-uploads whole images every frame, where latency edits only the changed band. It is the "image changing every frame" pattern the data budget exists to catch. The new data-usage harness (stealth-factory/opscope#470) fails it.

Evidence

scripts/measure-output.py from PR stealth-factory/opscope#667, on main's tailnet, 57×40 pane, 6 s warm-up, 60 s window:

mode         total KB/s  text KB/s  image KB/s  uploads/s  raw-RGBA KB/s   x12 MB/h  a=T/f/p/d      status
text               1.95       1.95        0.00       0.00           0.00         82  0/0/0/0        PASS
kitty              2.44       1.48        0.96       3.70          20.69        103  133/89/78/133  FAIL (whole uploads a=T 2.22/s > 0.50/s)
  • 133 whole uploads (a=T) in 60 s, each paired with a delete (a=d). That is 2.2 a second, against a budget of 0.5. A 20 s run measured 4 a second (80 of each).
  • For comparison, latency, a busier chart widget, made 0 whole uploads and 182 small band edits (a=f) in the same window.
  • On a local terminal the wire cost is small (under 1 KB/s of image bytes), because the images are small and compressed.
  • Under a relay that re-sends images decoded (Herdr with OPSCOPE_GRAPHICS=kitty), it is about 21–23 KB/s of raw RGBA per pane. That is over the 16 KB/s relay budget, and about 1 GB an hour across 12 panes.

Likely cause (unverified)

tailnet draws a one-row sparkline per peer through trace_cells(), plus two on the detail screen (around main.rs lines 1842 and 1847). Each is a tc::Plot with a LineChart. The delete paired with every upload suggests these plots are rebuilt as new images each frame, rather than taking core's frame-edit path that latency uses (stealth-factory/opscope#350, stealth-factory/opscope#471).

Possible triggers:

  • the plot's size or position changing between frames, since samples.len() grows as history fills;
  • the per-row y offset moving as rows reorder;
  • a per-frame change in the plot's identity.

Find which before fixing.

Acceptance

  • python3 -I scripts/measure-output.py ./target/debug/tailnet --seconds 60 --mode kitty passes: whole a=T uploads at or under 0.5/s, and changes sent as a=f edits.
  • The kitty-herdr mode passes the 16 KB/s relay limit, or the PR says why it cannot.
  • Text mode is unchanged.
  • cargo test passes, including check.rs.

Activity

2
linear-code[bot]10d ago
coderabbitai[bot]10d ago
🔗 Related PRs

stealth-factory/opscope#667 - chore: add a skill for measuring widget data usage in text and Kitty mode (OPS-201) [open]


📝 Issue Planner

Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

  • Create Plan

🧪 Issue enrichment is currently in open beta.

You can configure auto-planning by selecting labels in the issue_enrichment configuration.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

💬 Have feedback or questions? Drop into our discord!