Cheaper cursor, a fortify panic that names its function; Finch's gap

The cursor now costs nothing for a byte inside an escape sequence and
one cell fewer for a plain glyph: the grid is the truth, so the old
cursor cell is repainted after the byte, and not at all when a glyph
has just been drawn over it.

__fortify_panic says "r8169: rtl_open.cold+0x..." through ldlsd's module
list, so a photograph of the screen is enough, and exits instead of
spinning on a core and holding /dev/netdev.

docs/plan/finch.md: only integrating Finch is later; finishing it is
not. The self-hosting gap measured against Finch's own bootstrap test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015f73FesGZGYPkmDvUcj6QX
This commit is contained in:
Nexoniarz 2026-10-25 18:31:40 +01:00
commit 9c729edac1
5 changed files with 101 additions and 15 deletions

View file

@ -1241,7 +1241,20 @@ vt_cycle(int dir)
void
vt_feed(struct vt *v, int c)
{
cursor_erase(v);
// The grid is the truth, so the old cursor cell can be repainted from it
// *after* the byte is consumed -- which lets two cases cost nothing:
// - a byte inside an escape sequence changes nothing on screen;
// - a plain glyph is drawn over the cell the cursor sat on, which repaints
// it anyway (unless a wrap is pending, when it lands on the next line).
int mid = v->esc_state != VE_NORMAL;
int over = !mid && !v->wrap_pending && c >= 0x20 && c < 0x7f &&
v->u8_need == 0;
vt_feed_1(v, c);
if (mid && v->esc_state != VE_NORMAL)
return;
if (over)
v->curs_drawn = 0;
else
cursor_erase(v);
cursor_draw(v);
}