Faster busy-client frames: read only the buffer's bytes, cache the wallpaper, cheaper strokes
CI / test (push) Failing after 18s

Profiling a full-screen terminal at 1080p (about 2 fps):
- snapshot_shm_buffer asked the host to copy the pool from byte 0 to the end of the buffer; foot
  puts its buffers deep in a ~135 MB pool, so every commit moved ~135 MB (~185 ms). New
  sys.mmap-read-at(fd, offset, len) copies just the buffer: step 200 ms -> 5 ms per frame.
- The wallpaper (gradient + discs) is rendered once and copied back each frame while unchanged;
  it is split from the desktop card, which changes every second.
- stroke_rounded_rect walked every pixel of the window to draw a 1px outline; it now only
  draws the border strips (exact per-pixel path kept for the corner bands).
- Window shadows only blend the strips that stick out from under the window.
Rasteriser: ~256 ms -> ~93 ms per full-screen frame. Tests compare strokes and fills with the
old per-pixel code, and check the wallpaper cache.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 04:01:25 -08:00
1 parent 70ad87f2d2
commit 66bf293085
21 files changed
+302 -136

No files matched your search

+3
View File
@@ -29,6 +29,9 @@ interface sys {
pwrite: func(fd: s32, data: list<u8>, offset: s32) -> s32;
/// Copy `size` bytes of the file behind `fd` (mapped read-only by the host).
mmap-read: func(fd: s32, size: s32) -> list<u8>;
/// Copy `len` bytes starting at `offset` of the file behind `fd` (a client's buffer inside its
/// shared pool; a pool can be far larger than any one buffer, so never read from byte 0).
mmap-read-at: func(fd: s32, offset: s32, len: s32) -> list<u8>;
read-file: func(path: string) -> list<u8>;
write-file: func(path: string, data: list<u8>) -> s32;