starkernel: retarget REPL glyph rendering to TTF-TEXT's rasterizer (4.4j)

font_8x16.c keeps rendering everything through and including POST;
TTF-TEXT's rasterizer takes over at the interactive REPL boundary
(sk_repl()) via a new runtime mode switch, vt100_enable_ttf()
(console_fb_enable_ttf() wrapper), not a compile-time swap -- both
backends coexist in the same binary since boot/POST must stay
font_8x16.c per this item's own done-when.

TTF-TEXT (the FORTH word) isn't directly callable from vt100.c -- VM
stack arguments, different call shape than a one-glyph cell draw. Used
hal/ttf.c's VM-independent primitives directly instead (same rasterizer
TTF-TEXT itself calls underneath), added as a native C helper in
vt100.c. Lazily loads fonts:JetBrainsMono-Regular.ttf and kmallocs a
96-slot raster cache (covers all 95 printable ASCII, no eviction
thrash) on first switch.

Cell geometry changes at the switch (mode-aware cell_w()/cell_h()):
provisional 12x24 TTF cell (600/1000em * 20px = 12px exactly, using
4.4i's confirmed-uniform hmtx advance width) vs font_8x16's fixed 8x16
-- cols/rows re-derived and screen cleared at the switch point, same as
vt100_init() itself does. Final REPL text size is 4.4m's decision, not
this item's.

Also fixes the second call site 4.4i flagged: erase_line_range() now
uses one fb_fill_rect() instead of a per-cell font_8x16-specific blank
glyph draw, consistent with erase_display(2)'s full-screen case.

Three-arch verified: amd64/aarch64/riscv64 all reach ok>, POST
Failed: 0, identical dict-hashes. amd64 screendump shows real
proportional JetBrains Mono letterforms on the REPL tail, visibly
distinct from every prior font_8x16 screenshot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-11 19:56:50 -04:00
co-authored by Claude Sonnet 5
parent 64c20c78eb
commit f729b91a09
18 changed files with 55116 additions and 115 deletions
+36 -36
View File
@@ -72,39 +72,39 @@ tick_number,elapsed_ns,tick_interval_ns,cache_hits_delta,bucket_hits_delta,word_
71,710000,10000,0,0,44,22,39,4096,1757,0,0,0,65536,0,0,65536,0,0
72,720000,10000,0,0,130,24,27,4096,1757,0,0,0,65536,0,0,65536,0,0
73,730000,10000,0,0,134,26,21,4096,1757,0,0,0,65536,0,0,65536,0,0
1,10000,18446744073708831616,0,0,117,4,4,4096,0,0,4895412794951728796,25,65536,0,0,65536,0,0
2,20000,10000,0,0,78,10,7,4096,0,0,0,33,65536,0,0,65536,0,0
3,30000,10000,0,0,101,13,7,4096,0,0,0,40,65536,0,0,65536,0,0
4,40000,10000,0,0,63,19,8,4096,0,0,0,46,65536,0,0,65536,0,0
5,50000,10000,0,0,92,25,8,4096,2,0,0,57,65536,0,0,65536,0,0
6,60000,10000,0,0,64,27,8,4096,2,0,0,65,65536,0,0,65536,0,0
7,70000,10000,0,0,228,32,8,4096,210,0,0,214,65536,0,0,65536,0,0
8,80000,10000,0,0,256,34,9,4096,466,0,0,389,65536,0,0,65536,0,0
9,90000,10000,0,0,256,36,10,4096,722,0,0,564,65536,0,0,65536,0,0
10,100000,10000,0,0,256,36,11,4096,978,0,0,739,65536,0,0,65536,0,0
11,110000,10000,0,0,256,36,11,4096,1234,0,0,916,65536,0,0,65536,0,0
12,120000,10000,0,0,256,36,12,4096,1490,0,0,1092,65536,0,0,65536,0,0
13,130000,10000,0,0,256,37,12,4096,1746,0,0,1269,65536,0,0,65536,0,0
14,140000,10000,0,0,230,39,12,4096,1949,0,0,1414,65536,0,0,65536,0,0
15,150000,10000,0,0,256,39,13,4096,2204,0,0,1588,65536,0,0,65536,0,0
16,160000,10000,0,0,256,39,14,4096,2459,0,0,1763,65536,0,0,65536,0,0
17,170000,10000,0,0,256,39,15,4096,2713,0,0,1938,65536,0,0,65536,0,0
18,180000,10000,0,0,256,39,15,4096,2969,0,0,2113,65536,0,0,65536,0,0
19,190000,10000,0,0,256,39,16,4096,3224,0,0,2291,65536,0,1,65536,0,0
20,200000,10000,0,0,256,41,17,4096,3480,0,0,2467,65536,0,1,65536,0,0
21,210000,10000,0,0,256,41,17,4096,3736,0,0,2643,65536,0,1,65536,0,0
22,220000,10000,0,0,256,41,18,4096,3992,0,0,2820,65536,0,1,65536,0,0
23,230000,10000,0,0,256,41,19,4096,4096,0,0,2996,65536,0,1,65536,0,0
24,240000,10000,0,0,256,41,20,4096,4096,0,0,3171,65536,0,1,65536,0,0
25,250000,10000,0,0,256,43,20,2048,2048,0,0,3348,65536,0,1,65536,0,0
26,260000,10000,0,0,256,45,21,2048,2048,0,0,3527,65536,0,1,65536,0,0
27,270000,10000,0,0,256,45,22,1024,1024,0,0,3706,65536,0,1,65536,0,0
28,280000,10000,0,0,256,45,23,1024,1024,0,0,3882,65536,0,1,65536,0,0
29,290000,10000,0,0,256,45,24,512,512,0,0,4058,65536,0,1,65536,0,0
30,300000,10000,0,0,256,45,24,512,512,0,0,4238,65536,0,1,65536,0,0
31,310000,10000,0,0,256,45,25,256,256,0,0,4414,65536,0,1,65536,0,0
32,320000,10000,0,0,255,45,26,256,256,0,0,4586,65536,0,1,65536,0,0
33,330000,10000,0,0,256,45,27,256,256,0,0,4762,65536,0,1,65536,0,0
34,340000,10000,0,0,256,45,27,256,256,0,0,4938,65536,0,1,65536,0,0
35,350000,10000,0,0,256,45,28,256,256,0,0,5113,65536,0,1,65536,0,0
36,360000,10000,0,0,256,45,29,256,256,0,0,5290,65536,0,1,65536,0,0
1,10000,18446744073708831616,0,0,117,4,4,4096,0,0,4895412794951728796,26,65536,0,0,65536,0,0
2,20000,10000,0,0,78,10,7,4096,0,0,0,34,65536,0,0,65536,0,0
3,30000,10000,0,0,101,13,7,4096,0,0,0,42,65536,0,0,65536,0,0
4,40000,10000,0,0,63,19,8,4096,0,0,0,48,65536,0,0,65536,0,0
5,50000,10000,0,0,92,25,8,4096,2,0,0,59,65536,0,0,65536,0,0
6,60000,10000,0,0,64,27,8,4096,2,0,0,67,65536,0,0,65536,0,0
7,70000,10000,0,0,228,32,8,4096,210,0,0,220,65536,0,0,65536,0,0
8,80000,10000,0,0,256,34,9,4096,466,0,0,396,65536,0,0,65536,0,0
9,90000,10000,0,0,256,36,10,4096,722,0,0,571,65536,0,0,65536,0,0
10,100000,10000,0,0,256,36,11,4096,978,0,0,747,65536,0,0,65536,0,0
11,110000,10000,0,0,256,36,11,4096,1234,0,0,923,65536,0,0,65536,0,0
12,120000,10000,0,0,256,36,12,4096,1490,0,0,1099,65536,0,0,65536,0,0
13,130000,10000,0,0,256,37,12,4096,1746,0,0,1276,65536,0,0,65536,0,0
14,140000,10000,0,0,230,39,12,4096,1949,0,0,1423,65536,0,0,65536,0,0
15,150000,10000,0,0,256,39,13,4096,2204,0,0,1597,65536,0,0,65536,0,0
16,160000,10000,0,0,256,39,14,4096,2459,0,0,1772,65536,0,0,65536,0,0
17,170000,10000,0,0,256,39,15,4096,2713,0,0,1949,65536,0,0,65536,0,0
18,180000,10000,0,0,256,39,15,4096,2969,0,0,2127,65536,0,0,65536,0,0
19,190000,10000,0,0,256,39,16,4096,3224,0,0,2306,65536,0,1,65536,0,0
20,200000,10000,0,0,256,41,17,4096,3480,0,0,2486,65536,0,1,65536,0,0
21,210000,10000,0,0,256,41,17,4096,3736,0,0,2665,65536,0,1,65536,0,0
22,220000,10000,0,0,256,41,18,4096,3992,0,0,2842,65536,0,1,65536,0,0
23,230000,10000,0,0,256,41,19,4096,4096,0,0,3021,65536,0,1,65536,0,0
24,240000,10000,0,0,256,41,20,4096,4096,0,0,3201,65536,0,1,65536,0,0
25,250000,10000,0,0,256,43,20,2048,2048,0,0,3382,65536,0,1,65536,0,0
26,260000,10000,0,0,256,45,21,2048,2048,0,0,3559,65536,0,1,65536,0,0
27,270000,10000,0,0,256,45,22,1024,1024,0,0,3737,65536,0,1,65536,0,0
28,280000,10000,0,0,256,45,23,1024,1024,0,0,3916,65536,0,1,65536,0,0
29,290000,10000,0,0,256,45,24,512,512,0,0,4097,65536,0,1,65536,0,0
30,300000,10000,0,0,256,45,24,512,512,0,0,4275,65536,0,1,65536,0,0
31,310000,10000,0,0,256,45,25,256,256,0,0,4451,65536,0,1,65536,0,0
32,320000,10000,0,0,255,45,26,256,256,0,0,4625,65536,0,1,65536,0,0
33,330000,10000,0,0,256,45,27,256,256,0,0,4802,65536,0,1,65536,0,0
34,340000,10000,0,0,256,45,27,256,256,0,0,4979,65536,0,1,65536,0,0
35,350000,10000,0,0,256,45,28,256,256,0,0,5156,65536,0,1,65536,0,0
36,360000,10000,0,0,256,45,29,256,256,0,0,5332,65536,0,1,65536,0,0
1 tick_number elapsed_ns tick_interval_ns cache_hits_delta bucket_hits_delta word_executions_delta hot_word_count avg_word_heat_q48 window_width actual_window_size predicted_label_hits jitter_bits apic_ticks time_trust_q48 variance_q48 vm_call_depth_max hera_heat_q48 hermes_heat_q48 artemis_heat_q48
72 71 710000 10000 0 0 44 22 39 4096 1757 0 0 0 65536 0 0 65536 0 0
73 72 720000 10000 0 0 130 24 27 4096 1757 0 0 0 65536 0 0 65536 0 0
74 73 730000 10000 0 0 134 26 21 4096 1757 0 0 0 65536 0 0 65536 0 0
75 1 10000 18446744073708831616 0 0 117 4 4 4096 0 0 4895412794951728796 25 26 65536 0 0 65536 0 0
76 2 20000 10000 0 0 78 10 7 4096 0 0 0 33 34 65536 0 0 65536 0 0
77 3 30000 10000 0 0 101 13 7 4096 0 0 0 40 42 65536 0 0 65536 0 0
78 4 40000 10000 0 0 63 19 8 4096 0 0 0 46 48 65536 0 0 65536 0 0
79 5 50000 10000 0 0 92 25 8 4096 2 0 0 57 59 65536 0 0 65536 0 0
80 6 60000 10000 0 0 64 27 8 4096 2 0 0 65 67 65536 0 0 65536 0 0
81 7 70000 10000 0 0 228 32 8 4096 210 0 0 214 220 65536 0 0 65536 0 0
82 8 80000 10000 0 0 256 34 9 4096 466 0 0 389 396 65536 0 0 65536 0 0
83 9 90000 10000 0 0 256 36 10 4096 722 0 0 564 571 65536 0 0 65536 0 0
84 10 100000 10000 0 0 256 36 11 4096 978 0 0 739 747 65536 0 0 65536 0 0
85 11 110000 10000 0 0 256 36 11 4096 1234 0 0 916 923 65536 0 0 65536 0 0
86 12 120000 10000 0 0 256 36 12 4096 1490 0 0 1092 1099 65536 0 0 65536 0 0
87 13 130000 10000 0 0 256 37 12 4096 1746 0 0 1269 1276 65536 0 0 65536 0 0
88 14 140000 10000 0 0 230 39 12 4096 1949 0 0 1414 1423 65536 0 0 65536 0 0
89 15 150000 10000 0 0 256 39 13 4096 2204 0 0 1588 1597 65536 0 0 65536 0 0
90 16 160000 10000 0 0 256 39 14 4096 2459 0 0 1763 1772 65536 0 0 65536 0 0
91 17 170000 10000 0 0 256 39 15 4096 2713 0 0 1938 1949 65536 0 0 65536 0 0
92 18 180000 10000 0 0 256 39 15 4096 2969 0 0 2113 2127 65536 0 0 65536 0 0
93 19 190000 10000 0 0 256 39 16 4096 3224 0 0 2291 2306 65536 0 1 65536 0 0
94 20 200000 10000 0 0 256 41 17 4096 3480 0 0 2467 2486 65536 0 1 65536 0 0
95 21 210000 10000 0 0 256 41 17 4096 3736 0 0 2643 2665 65536 0 1 65536 0 0
96 22 220000 10000 0 0 256 41 18 4096 3992 0 0 2820 2842 65536 0 1 65536 0 0
97 23 230000 10000 0 0 256 41 19 4096 4096 0 0 2996 3021 65536 0 1 65536 0 0
98 24 240000 10000 0 0 256 41 20 4096 4096 0 0 3171 3201 65536 0 1 65536 0 0
99 25 250000 10000 0 0 256 43 20 2048 2048 0 0 3348 3382 65536 0 1 65536 0 0
100 26 260000 10000 0 0 256 45 21 2048 2048 0 0 3527 3559 65536 0 1 65536 0 0
101 27 270000 10000 0 0 256 45 22 1024 1024 0 0 3706 3737 65536 0 1 65536 0 0
102 28 280000 10000 0 0 256 45 23 1024 1024 0 0 3882 3916 65536 0 1 65536 0 0
103 29 290000 10000 0 0 256 45 24 512 512 0 0 4058 4097 65536 0 1 65536 0 0
104 30 300000 10000 0 0 256 45 24 512 512 0 0 4238 4275 65536 0 1 65536 0 0
105 31 310000 10000 0 0 256 45 25 256 256 0 0 4414 4451 65536 0 1 65536 0 0
106 32 320000 10000 0 0 255 45 26 256 256 0 0 4586 4625 65536 0 1 65536 0 0
107 33 330000 10000 0 0 256 45 27 256 256 0 0 4762 4802 65536 0 1 65536 0 0
108 34 340000 10000 0 0 256 45 27 256 256 0 0 4938 4979 65536 0 1 65536 0 0
109 35 350000 10000 0 0 256 45 28 256 256 0 0 5113 5156 65536 0 1 65536 0 0
110 36 360000 10000 0 0 256 45 29 256 256 0 0 5290 5332 65536 0 1 65536 0 0