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
+41 -1
View File
@@ -4465,7 +4465,7 @@ document and committing that amendment as its own item.*
> (`logs/20260809-185758`), aarch64 (`logs/20260809-185835`), riscv64
> (`logs/20260809-185925`).
- [ ] **4.3.6b — Codepoint → glyph dispatch.** Bucketed `CASE`/`OF`/`ENDOF` chain
- [x] **4.3.6b — Codepoint → glyph dispatch.** Bucketed `CASE`/`OF`/`ENDOF` chain
(`DISPATCH-DIGIT`/`-UPPER`/`-LOWER`/`-ASCII-PUNCT`/`-LATIN1`/`-GENPUNCT`) routed by
`DISPATCH-GLYPH` via `WITHIN` range checks, per §27.6.3 — chosen over a flat xt-table
despite the table composing more cleanly with override (§27.6.5's finding). Every glyph
@@ -4474,6 +4474,46 @@ document and committing that amendment as its own item.*
least one codepoint from each of the six buckets, and falls through to `TOFU` (not a crash)
for a codepoint outside all six ranges. *Refs:* §27.6.3.
> **Done, 2026-08-09.** Blocks 49214924 in `capsules/fabric.4th` (lint-clean).
> `DISPATCH-GLYPH` and the six bucket words exactly as §27.6.3 specifies, plus `TOFU`
> (empty box via four `G-LINE` calls, advance `500` per the section's own proposal) and
> `DRAW-GLYPH ( codepoint x y size color -- adv )`.
>
> **Deliberately minimal, not the real glyph set.** The 113-glyph repertoire is item
> 4.3.6c's scope, not this one's — building it now would be jumping ahead per §25.0 rule
> two. Each of the six buckets got exactly one placeholder stroke word
> (`G-TEST-DIGIT`/`-UPPER`/`-LOWER`/`-PUNCT`/`-LATIN1`/`-GENPUNCT`, obviously-temporary
> names, each drawing one `G-LINE` and returning a distinct advance) — enough to prove the
> routing mechanism without designing any real letterforms. 4.3.6c will need to add the
> full `CASE` coverage to these same six bucket words; these placeholder entries are
> expected to be superseded there, not treated as finished glyph art.
>
> **A real block-format limit found while landing this item, not previously hit:**
> `mkcapsule`'s actual rule is **64 chars × 16 content lines per block**, and — not
> previously noticed — a blank separator line between blocks is charged to the
> *preceding* block's line count, not free. Item 4.3.6a's `DECODE-UTF8` block (4920) was
> already at exactly 16 lines with zero slack, so appending this item's blocks after it
> pushed it to 17 via the following blank line. Fixed by merging two adjacent, unrelated
> lines in that block (`ULEN ! UADDR !` / `UADDR @ C@ ULEAD !` → one line) — a one-line
> mechanical reformat with identical semantics, not a scope change; re-verified via the
> `DECODE-UTF8` regression check below before relying on it.
>
> **Verified live on amd64**, same temporary-probe pattern as prior 4.3.6x items: a
> regression check of `DECODE-UTF8` (`65`/`176`/`8212`, matching item 4.3.6a's own values
> — confirms the block-4920 line merge changed nothing) followed by `DRAW-GLYPH` called
> with one representative codepoint per bucket plus one out-of-range codepoint (`1`, a
> control character outside all six `WITHIN` ranges). All seven results matched expected
> exactly: digit `48``400`, upper `65``600`, lower `97``450`, punct `33``250`, latin1
> `176``550`, genpunct `8212``700`, out-of-range `1``500` (`TOFU`). Extraction required
> care — injected commands raced ahead of the verbose per-word execution trace in the log,
> so printed results appeared shifted relative to naive line-proximity matching; resolved
> by anchoring on each command's own echo line as an ordered marker and taking the last
> printed value before the next marker, not by assuming adjacency.
>
> Three-architecture acceptance boot clean, Stadium conservation unchanged:
> amd64 (`logs/20260809-191200`), aarch64 (`logs/20260809-191237`), riscv64
> (`logs/20260809-191327`).
- [ ] **4.3.6c — Default system font-set capsule.** The confirmed 113-glyph v1 repertoire
(95 ASCII printable + 11 Latin-1 Supplement + 7 General Punctuation, itemized in §27.6.4),
each glyph a stroke-drawing word in the 4.3.6 em-square convention returning its own