https://gitlab.synchro.net/main/sbbs/-/commit/03b010efd3bf250b46b27e0f
Modified Files:
src/doors/syncretro/README.md syncretro.h syncretro_config.c syncretro_dirty.c syncretro_dirty.h syncretro_io.c test_dirty.c
Log Message:
syncretro: make dirty rects work on register-resetting terminals
Enabling dirty-rect patching off SyncTERM surfaced three defects that
only a live session could find. On foot (cell 6x13, image 1254x806) the
door patched ZERO frames while SyncTERM patched 75-90% of the identical content; an instrumented session showed 139 of 145 frames rejected for
a single reason.
- Grid cap: sr_dirty_find() rejected any geometry needing more than 160
grid columns or 100 rows. foot's 6px-wide cell needs 209 columns, so
the finder bailed on 95.9% of frames. A pre-existing limit, latent
only because patching had been gated to SyncTERM, whose wider cell
stayed under it. The grid is now heap-allocated to the actual
cols*rows (1M-cell sanity ceiling), so any cell geometry works.
- Bottom-of-frame stranding: the band-aligned path grew a box's height
downward and, at the frame bottom, clamped it down -- and if that left
the box unable to cover its own changed rows, the WHOLE frame fell
back to a repaint. Boxes now grow UPWARD from their changed-rows
bottom, which is always safe and never runs off the frame, so activity
in the bottom band no longer strands.
- Stale bottom row: clamping patches to the last whole cell row meant a
sub-cell remainder at the image bottom was never covered by any patch,
and it rendered stale until the next full frame happened along. The
sixel canvas height is now rounded down to a whole number of text
cells for the band-aligned path, so the dirty grid tiles the image
exactly. Gated to non-SyncTERM: SyncTERM clamps to the full height
already, and its geometry is deliberately left untouched.
Also adds two knobs and a diagnostic:
- [video] palette_subset (default on) toggles the used-colour palette
subset off SyncTERM, for A/B measurement against the old full
256-register emission.
- The Ctrl-S "dr" readout is now a rolling window, like fps and KB/s,
instead of a lifetime average that barely moved once a session had
accumulated history.
- [debug] dirty_log (default off) traces the per-frame patch-vs-repaint
decision to its own file; a native door's stderr is discarded by the
BBS, so it cannot use the usual diagnostic path. This is what
root-caused all three defects above.
Live-verified on foot: 84.5% of frames patched, image correct, bottom
row correct across terminal resizes. SyncTERM behaviour unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)