fabric: codepoint -> glyph dispatch (DISPATCH-GLYPH, TOFU)

Punch list §25 item 4.3.6b complete.
capsules/fabric.4th blocks 4921-4924: DISPATCH-GLYPH routing via
WITHIN to six bucket words (DISPATCH-DIGIT/-UPPER/-LOWER/
-ASCII-PUNCT/-LATIN1/-GENPUNCT), TOFU fallback, DRAW-GLYPH. Buckets
carry one placeholder stroke word each (G-TEST-*), not the real
113-glyph set -- that's item 4.3.6c's scope, deliberately deferred.

Also: merged two lines in block 4920 (DECODE-UTF8) to fit mkcapsule's
real 64-char x 16-line block limit once a trailing blank separator
line is counted against it -- mechanical reformat, re-verified via a
DECODE-UTF8 regression check (65/176/8212, unchanged).

Verified live on amd64: one representative codepoint per bucket plus
one out-of-range codepoint, all seven DRAW-GLYPH results matched
expected exactly (400/600/450/250/550/700/500-TOFU). Three-arch
acceptance boot clean, Stadium conservation unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-09 19:15:05 -04:00
co-authored by Claude Sonnet 5
parent 24d6b9e20e
commit 4427986c96
13 changed files with 54536 additions and 100 deletions
+27 -23
View File
@@ -1,5 +1,5 @@
# Capsule Block Manifest — Auto-generated
<!-- Generated by mkcapsule --manifest 2026-08-09T22:59:10Z -->
<!-- Generated by mkcapsule --manifest 2026-08-09T23:13:12Z -->
<!-- DO NOT EDIT — re-run mkcapsule --manifest to refresh. -->
<!-- Hand-written justifications and immutability notes live -->
<!-- in MANIFEST.md alongside this auto-generated index. -->
@@ -13,7 +13,7 @@
| `common:msg.4th` | 4055 | `0xa99c5bcd3877f80e` |
| `doe-campaign.4th` | 4060, 4061, 4062, 4063, 4064, 4065 | `0x3d4549142d91ec20` |
| `doe.4th` | 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107 | `0xb6ecf5374e8ee77c` |
| `fabric.4th` | 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920 | `0x8da61551c0d1126a` |
| `fabric.4th` | 4900, 4901, 4902, 4903, 4904, 4905, 4906, 4907, 4908, 4909, 4910, 4911, 4912, 4913, 4914, 4915, 4916, 4917, 4918, 4919, 4920, 4921, 4922, 4923, 4924 | `0xe4359739c5d39f06` |
| `hermes:init.4th` | 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4114, 4115, 4116, 4117, 4118, 4119, 4120, 4121, 4142, 4143, 4144, 4145, 4146, 4147, 4148, 4149, 4150, 4151, 4152, 4153, 4154, 4155, 4156, 4157, 4158, 4159, 4175, 4176 | `0x85c7b311d1e5bf97` |
| `init-0.4th` | 2200, 2201 | `0xd0a9550baf786bb3` |
| `init-1.4th` | 4406, 4415, 4425, 4435 | `0x63e251adb0a03613` |
@@ -225,27 +225,31 @@
| 4842 | `init-l8-transition.4th` | `0xbcc1a81976f0a4c9` | ok |
| 4851 | `artemis:init.4th` | `0xc9e92cd18f4c7b49` | ok |
| 4852 | `artemis:init.4th` | `0xc9e92cd18f4c7b49` | ok |
| 4900 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4901 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4902 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4903 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4904 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4905 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4906 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4907 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4908 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4909 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4910 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4911 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4912 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4913 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4914 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4915 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4916 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4917 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4918 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4919 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4920 | `fabric.4th` | `0x8da61551c0d1126a` | ok |
| 4900 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4901 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4902 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4903 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4904 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4905 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4906 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4907 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4908 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4909 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4910 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4911 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4912 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4913 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4914 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4915 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4916 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4917 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4918 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4919 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4920 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4921 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4922 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4923 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
| 4924 | `fabric.4th` | `0xe4359739c5d39f06` | ok |
## Conflicts
+50 -2
View File
@@ -230,8 +230,7 @@ Block 4920
UADDR @ 2 + C@ 63 AND 6 LSHIFT OR
UADDR @ 3 + C@ 63 AND OR ;
: DECODE-UTF8 ( addr u -- codepoint addr' u' )
ULEN ! UADDR !
UADDR @ C@ ULEAD !
ULEN ! UADDR ! UADDR @ C@ ULEAD !
ULEAD @ UTF8-SEQ-LEN USEQLEN !
USEQLEN @ 1 = IF UTF8-ASSEMBLE-1 UCP ! ELSE
USEQLEN @ 2 = IF UTF8-ASSEMBLE-2 UCP ! ELSE
@@ -239,3 +238,52 @@ Block 4920
USEQLEN @ 4 = IF UTF8-ASSEMBLE-4 UCP ! ELSE
65533 UCP ! 1 USEQLEN ! THEN THEN THEN THEN
UCP @ UADDR @ USEQLEN @ + ULEN @ USEQLEN @ - ;
Block 4921
( 4.3.6b placeholder test glyphs -- one per dispatch bucket. )
( Minimal, NOT the real 113-glyph set (item 4.3.6c). Proves )
( DISPATCH-GLYPH routes to the correct stroke word only. )
: G-TEST-DIGIT ( -- adv ) 0 0 500 700 G-LINE 400 ;
: G-TEST-UPPER ( -- adv ) 0 0 600 700 G-LINE 600 ;
: G-TEST-LOWER ( -- adv ) 0 0 500 500 G-LINE 450 ;
: G-TEST-PUNCT ( -- adv ) 0 0 200 200 G-LINE 250 ;
: G-TEST-LATIN1 ( -- adv ) 0 0 500 500 G-LINE 550 ;
: G-TEST-GENPUNCT ( -- adv ) 0 0 1000 0 G-LINE 700 ;
: TOFU ( -- adv )
100 0 100 700 G-LINE
100 700 400 700 G-LINE
400 700 400 0 G-LINE
400 0 100 0 G-LINE
500 ;
Block 4922
( Dispatch buckets 1/2/3 -- digit/upper/lower. Item 4.3.6b. )
: DISPATCH-DIGIT ( codepoint -- adv )
CASE 48 OF G-TEST-DIGIT ENDOF DROP TOFU ENDCASE ;
: DISPATCH-UPPER ( codepoint -- adv )
CASE 65 OF G-TEST-UPPER ENDOF DROP TOFU ENDCASE ;
: DISPATCH-LOWER ( codepoint -- adv )
CASE 97 OF G-TEST-LOWER ENDOF DROP TOFU ENDCASE ;
Block 4923
( Dispatch buckets 4/5/6 -- punct/latin1/genpunct. 4.3.6b. )
: DISPATCH-ASCII-PUNCT ( codepoint -- adv )
CASE 33 OF G-TEST-PUNCT ENDOF DROP TOFU ENDCASE ;
: DISPATCH-LATIN1 ( codepoint -- adv )
CASE 176 OF G-TEST-LATIN1 ENDOF DROP TOFU ENDCASE ;
: DISPATCH-GENPUNCT ( codepoint -- adv )
CASE 8212 OF G-TEST-GENPUNCT ENDOF DROP TOFU ENDCASE ;
Block 4924
( DISPATCH-GLYPH: codepoint -> bucket, via WITHIN. 4.3.6b. )
: DISPATCH-GLYPH ( codepoint -- adv )
DUP 48 58 WITHIN IF DISPATCH-DIGIT EXIT THEN
DUP 65 91 WITHIN IF DISPATCH-UPPER EXIT THEN
DUP 97 123 WITHIN IF DISPATCH-LOWER EXIT THEN
DUP 32 127 WITHIN IF DISPATCH-ASCII-PUNCT EXIT THEN
DUP 160 256 WITHIN IF DISPATCH-LATIN1 EXIT THEN
DUP 8192 8304 WITHIN IF DISPATCH-GENPUNCT EXIT THEN
DROP TOFU ;
: DRAW-GLYPH ( codepoint x y size color -- adv )
GCOLOR ! GSIZE ! GOY ! GOX !
DISPATCH-GLYPH ;