# Font compiler discrepancies and limitations

This is the working checklist for the font-only compiler. A fix is tied to its
recorded reproduction and test scope; it is not a claim of universal tokenizer
or browser equivalence. Tests compare reference IDs, counts, and advances
separately. No live Claude calls are used.

## Compiler discrepancies

| ID | Issue | Current status and evidence |
| --- | --- | --- |
| B1 | **GLM loses merge paths, regex boundaries and whole-piece shortcuts.** | **Repaired in the opt-in production backend.** Final font passes all 5,493 Gutenberg passages and 4,000 non-Unicode fuzz cases with exact IDs and advances. All 1,000 Unicode fuzz cases have missing source coverage. Ranked selection, overlap removal and whole-piece shortcuts preserve the covered paths; excess non-shortcut inputs show `[BPE limit]`. Browser font loading, single-run widths and history tests pass; full browser compilation now passes after streaming feature construction. The UI uses the repaired backend. [Final results](glm-priority-production-audit.md). |
| B2 | **Kimi's first-available merge-path conversion is wrong.** `hello` became `he + l + lo`. | **Fixed for tested ordinary text.** Byte-rank canonical reconstruction plus the original regex now passes all 5,493 Gutenberg chunks and all 4,000 non-Unicode fuzz cases, including token advances. The 1,000 Unicode cases include 999 unsupported by Inter and one renderer-normalization discrepancy. Corrected preset enabled in UI. [Results](kimi-pathway-audit.md). |
| B3 | **Qwen, GLM, Kimi and Llama omit their original regex.** Qwen had 304 Gutenberg mismatches attributable to this. GLM/Llama use older cl100k-style whitespace branches. | **Regex implementation verified; integration continuing.** All four automata match their original patterns on 10,493 inputs each, plus 505 actual-GSUB boundary cases per profile. Kimi integrated; Qwen integrated and audited; GLM/Llama are integrated in the opt-in priority backend and pass their full native corpus audits. `tests/test_hf_boundaries.py`. |
| B4 | **Qwen's NFC normalizer is omitted.** Removing NFC alone changes 733 fuzz cases. | **Bounded font-only NFC implemented and audited.** All 5,493 Gutenberg and 4,000 covered fuzz cases pass IDs and widths; all 1,000 Unicode fuzz cases contain unsupported source characters. [Full-font results](qwen-pathway-repaired.md). 4,163 actual-GSUB tests cover Inter closure characters, compositions and combining runs. Explicit eight-nonstarter bound after NFD; longer sequences show `[NFC limit]`. Semantic closure glyphs do not falsely expand cmap coverage. Missing normalized outlines are reported. [NFC results](browser-domain-nfc.json). |
| B5 | **Original Llama 3 has the same conversion losses as GLM.** | **Repaired in the opt-in production backend.** All 5,493 Gutenberg passages and 4,000 non-Unicode fuzz cases pass exact IDs and advances. Unicode fuzz retains 999 missing-coverage cases and one renderer-normalization discrepancy: actual IDs equal the reference on NFC-normalized input, rather than the original bytes. All 39 long-banner shortcuts pass. The UI now selects the repaired backend; the shared browser compiler passes the full GLM build. [Final results](llama3-priority-production-audit.md). |
| B6 | **Full GLM compilation fails in the browser runtime during feature construction.** | **Repaired.** Streaming completed feature-tree blocks preserves all 16 non-head tables in the full native GLM build and has scope and memory-retention regression tests. The full browser build succeeds in 707 seconds; the generated font loads and passes 10/10 native width comparisons. [Successful build](browser-domain-production-worker-result.json). The initial worker failure is retained for comparison. [Original failure](browser-domain-production-worker-before-streaming.json). |
| B7 | **Trinity and Laguna discarded their native preprocessing stages.** | **Repaired.** Exact native-profile recognition preserves right-aligned digit groups/script isolation for Trinity and newline staging/single-number splitting for Laguna. Each passes all 5,493 Gutenberg and 4,000 non-Unicode fuzz cases; 1,610 covered directed cases and three spacing checks pass per font. Full browser builds load and pass 12/12 reference widths each. [Trinity](trinity-pathway-repaired.md), [Laguna](laguna-pathway-repaired.md). |
| C1 | **ctok v3 was restricted to 6,000, then 39,919 pieces.** The repertoire projection discarded multilingual vocabulary. | **Full vocabulary now fits; verification continuing.** Sparse presentation states and shared edge tables include all 48,332 v3 and 14,819 v4.7/v4.8 entries. All 5,493 Gutenberg cases pass for each of v3, v4.7 and v4.8; all 2,103 covered printable Inter singletons also pass. Visible input coverage still depends on the source font. |
| C2 | **ctok's finite search could silently overflow.** v4.7 `~` × 256 exceeded the 256-step budget once framing was included. | **Failure behavior fixed and useful capacity expanded.** Proven graph cuts create independent components without crossing any possible vocabulary edge. Budget is 256 steps per component; unfinished regions show `[limit]`. Whole-paragraph prose can exceed 256 characters while remaining exact. An arbitrary connected component remains bounded. |
| C3 | **ctok long-paragraph layout can be slow.** Old 1,300-character forced browser layout took 50.8 seconds. | **Improved, still a limitation.** New measured times: 130 characters 70.3 ms (was 412.9 ms); 1,300 characters 5.81 s. One sample each, 24px font, 320px column, pre-wrap. Preserving absorbed whitespace clusters was tried and rejected because it worsened both latency and wrapping. [Measurements](ctok-browser-performance-fixes.json). |
| C4 | **Normalized-empty v3/v4.7 inputs lost framing cells.** A space/CR differs from a truly empty string. | **Nonempty cases repaired.** Normalization aliases preserve appropriate content-frame behavior. A zero-character input supplies no glyph on which a font can operate; see E6. |

## Rendering constraints and representation

| ID | Constraint | Resolution or explicit contract |
| --- | --- | --- |
| E1 | **The renderer can erase original Unicode spelling before GSUB.** `cafe\u0301` and `café`, or `A\u030A` and `Å`, can become identical. Byte-level tokenizers distinguish them. | **Unavoidable with the tested font-only/browser interface.** Disabling `ccmp`, disabling `mark`/`mkmk`, and deleting composed cmap entries did not recover the distinction. A font cannot recover information already discarded. Qwen's own NFC semantics are different: they deliberately normalize and can be implemented within a bound. [Tests and explanation](browser-domain-mitigations.md). |
| E2 | **A font cannot inspect outside its shaping run.** An internal bold span changes tokenization of `antidisestablishmentarianism`. Scripts, bidi, fallback, hard breaks and styles can also divide runs. | **Per-run contract.** Uniform typography can reduce style splits, but cannot guarantee whole-message equivalence. Runtime text preprocessing would change the font-only requirement. Browser wrapping is separately tested; whole-run HarfBuzz agreement does not prove correct line layout. The experimental GLM shortcut font also shows a leading ` rd` pre-wrap span at 120px where one native shaping run is 60px; internal `Hello world.` remains 180px. This browser-only difference is retained in `browser-domain-priority-result.json` and is not yet diagnosed as a fixable compiler error. |
| E3 | **Full vocabulary is not full glyph coverage.** Inter lacks many CJK and emoji outlines. Ordinary fallback does not have token advances. | **Legitimate invisible coverage expanded.** 113 whitespace/control/format characters now have explicit semantic input glyphs; 452 tests pass IDs/widths. Optional compiled fallback now adds missing Noto text outlines and Mutant Standard emoji while preserving token widths and primary line metrics. It selects decoded-vocabulary characters plus the emoji source’s non-PUA repertoire; unsupported visible characters remain reported. With Noto, all 1,000 Trinity Unicode fuzz cases have source coverage, while 443 Laguna cases still lack some characters. Coverage does not imply canonical byte equivalence or complex-script shaping. See [Trinity Noto](trinity-noto-repaired.md) and [Laguna Noto](laguna-noto-repaired.md). NFC closure-only characters stay out of cmap and are separately reported when outlines are missing. |
| E4 | **Complex script shaping and variation selectors are not universally covered.** An engine can consume selectors or itemize emoji before substitutions. | **VS16 restoration added; renderer scope remains limited.** Emoji variation mappings restore explicit selectors before tokenization and keep supported emoji in the compiled font. Browser emoji/text run splitting still prevents cross-run merges; see [measurements](browser-mutant-run-results.md). Do not infer complex-script correctness from Latin/LTR tests, or describe a missing-cmap soft-hyphen/ZWJ example as a proven covered-input BPE bug. Unicode/fallback classifications stay in all denominators. |
| E5 | **Independent character drawing discarded source kerning; ctok v3 quote folding changed outlines.** | **Supported kerning and quote outlines repaired.** Default-instance horizontal Latin/DFLT pair advances are baked into atomic/composite tokens and applied to shared parts through required positioning; pads retain 3em token totals. Tests cover TKSP 0/250/500 and prevent cross-token kerning. Unsupported contextual positioning/mark shaping is reported. Equal token widths still intentionally condense long tokens. |
| E6 | **Fonts cannot draw a framing token for actual empty input.** | **Explicit limitation.** There are no input glyphs to substitute. ctok message overhead remains excluded; counts are not a billing estimate. |
| E7 | **ctok is not confirmed Claude segmentation.** Count agreement permits multiple minimum-cost segmentations. | **Reference qualification.** Report exactness against ctok's inferred count model, never hidden Claude token boundaries. No live Claude testing in this audit. |
| E8 | **Special/chat/multimodal framing is outside ordinary-text audits.** | **Explicit scope.** Audits disable automatic special handling and templates. Ordinary source text and model request framing are different inputs. BPE's explicitly supported added-token mode is not evidence of universal chat-template support. |
| E9 | **The old top-level Inter font duplicates tokens at wraps.** | **Retired.** Legacy specimen/downloads are labeled and point to current compiler/default artifacts. The historical binary was not silently replaced. Current default and rebuilt o200k pass the narrow-column reproduction. |
| E11 | **Some tokens contain incomplete UTF-8 bytes.** Even a covered character such as 🙂 can span multiple tokens. | **Emoji repair added; other split-byte text remains limited.** The emoji presentation stage reconstructs source-supported emoji across token cells and embeds Mutant Standard color artwork, retaining tokenizer IDs and advances. Joined sequences require source artwork. Non-emoji split-byte characters can still draw hexadecimal labels. Earlier failures remain in [browser specimens](browser-noto-specimens-result.json); current validation is summarized in [testing results](testing-results.md). |
| E10 | **Unicode property versions affect regex classification and normalization.** | **Versioned diagnostics.** Build reports identify the runtime Unicode version; NFC reports its version and bound. Native and browser runtimes must not be assumed equivalent for newly assigned characters without testing. |

| E12 | **Google fonts repeated visible words at soft wraps.** | **Fixed in normal and lite builds.** Absorbed leading spaces retain inkless clusters; shared, epoch-guarded merge helpers and bounded pair tables fit the complete reachable vocabulary. Fresh fonts pass all 5,493 Gutenberg chunks per mode and the browser reproductions. Narrow 180px overhang around “absurdity” remains a separate layout limitation. [Validation](google-wrap-validation.md). |

## Whitespace audit additions (2026-09-26)

- **W1, fixed:** Emoji catalogues accepted ordinary whitespace/Cc controls from source fonts. This caused false emoji joining and glyph-cap overflow. The compiler now filters them centrally; the bundled default was already protected by source cleanup.
- **W2, open:** DeepSeek uses Python whitespace classification for U+001C–U+001F, disagreeing with its tokenizer regex. Two spaces + U+001C incorrectly merge into one space token. 59/2,984 directed checks fail; Trinity and Laguna each pass all 2,984.
- **W3, open:** ctok invisible format characters can suppress internal word boundaries; v3/v4.7 head-quote framing also crosses them. v3/v4.7 can absorb a leading space before strip/fold normalization exposes a longer run. Tests retain count/width failures separately from semantic-only failures.
- **W4, host limitation:** A leading space under `pre-wrap`/`break-spaces` forms a separate run and can add a cell. Tabs and hard breaks follow CSS layout, not whole-buffer token advances. Checked soft-wrap examples do not repeat the previous duplicate-ink defect.

[Consolidated report](whitespace-audit.md), [BPE results](whitespace-bpe-audit.md),
[ctok findings](ctok-whitespace-findings.md), [browser findings](browser-domain-whitespace-results.md).

## Current priority work

GLM/Llama ordinary-text discrepancies are repaired in the opt-in production
compiler backend. Both final fonts pass all **5,493 Gutenberg passages** and
**4,000 prose/code/whitespace/punctuation fuzz strings** with exact reference IDs
and token advances. Each fuzz string has exactly 32 reference tokens. See
[GLM results](glm-priority-production-audit.md) and
[Llama results](llama3-priority-production-audit.md).

Two independent causes were fixed: a persistent HarfBuzz coverage-cache collision
([diagnosis](harfbuzz-coverage-compatibility.md)), and overlapping parallel merge
selections. The latter explains `===>` and repeated-CRLF errors. Whole-piece
shortcuts now include all 39 previously skipped long Llama punctuation banners.
The 35 priority regression tests pass; the expanded UI suite has 37 passing tests.

Both final fonts pass binary packing/checksum checks and load in the browser.
Ten single-run width samples and six rendering-history checks pass per font;
visually checked narrow-column examples have no duplicated tokens. Three
leading-whitespace samples differ under `pre-wrap`, retained as a shaping-run
limitation. Streaming feature construction fixes the full GLM browser build:
it completes in 707 seconds (about 11.8 minutes), produces a 65,557,944-byte font,
and passes all ten native width comparisons. These are one-machine measurements.
The repaired GLM and Llama presets are enabled in the UI, with explicit capacity
and compile-time disclosures. The 33 UI tests pass. See
[browser build](browser-domain-production-worker-result.json) and
[streamed native table equivalence](priority-streamed-table-equivalence.json).
The earlier failure remains in `browser-domain-production-worker-before-streaming.json`.

Remaining directed limits are explicit: 127/129 spaces and 128/129/256 repeated
`a`s produce `[BPE limit]`; four CJK examples lack source glyph coverage. The
non-shortcut bound is 64 input bytes and 32 merge rounds. Unicode fuzz retains
1,000 missing-coverage cases for GLM, and 999 missing-coverage plus one canonical
normalization case for Llama. These remain in the test denominator.

## Earlier repairs retained in regression coverage

- OpenAI's four regex frontends, including long-ſ contraction folding: all
  Gutenberg regex controls and actual-GSUB directed/random boundary tests pass.
- OpenAI leading-space clusters prevent the old soft-wrap duplication.
- Inert GPOS and explicit glyph classes prevent fallback mark positioning from
  collapsing token advances; ctok's standalone combining-mark case is covered.
- ctok ideographic spaces, CRLF, punctuation/case seams and leading apostrophe +
  CAPS are covered by follow-up tests.
- All three ctok versions and o200k passed the original Gutenberg repair audit
  before these latest extensions. [Historical repair results](gutenberg-font-fixes.md).
- DeepSeek's latest repaired build passes 5,493 Gutenberg and 4,000 non-Unicode
  fuzz cases; 999 unsupported Unicode and one normalization difference remain.
  [Release verification](deepseek-release-verification.md) uses an immutable compiler snapshot.

## Test inventory and provenance

Each pathway uses all **5,493 contiguous Gutenberg chunks** and **5,000 seeded
fuzz strings verified as exactly 32 reference tokens**, 1,000 each from prose,
code, whitespace, Unicode and punctuation. Unsupported/incomplete cases remain
in the denominator. Raw strings, reference/adapted/font IDs and advances are
retained in compressed JSONL artifacts.

- [Consolidated results](testing-results.md) and [reproduction](pathway-audit.md).
- [Kimi reference verification](kimi-reference-verification.json): pinned
  official Moonshot ranks and regex independently agree on all 10,493 cases.
- [Llama reference verification](llama3-reference-verification.json): original
  Meta algorithm plus public-mirror ranks agrees on all cases. Meta's gated rank
  bytes were not independently authenticated; this is original Llama 3, not 3.1.
- [Browser constraints](browser-domain-mitigations.md), [browser cases](browser-domain-findings.md),
  [OpenAI adversarial baseline](bpe-domain-audit.md).

The current user-set cap is six combined testing/build threads across all
agents. Builds and audit workers share that budget; shared compiler edits remain
coordinated.

## Trinity/Laguna Noto follow-up

Both Noto-augmented fonts retain exact IDs and widths on all 5,493 Gutenberg
passages and 4,000 non-Unicode fuzz cases. Trinity adds 4,093 source characters;
Laguna adds 1,798. The 1,000 Unicode fuzz cases per model now classify as:

| Model | Exact original IDs and widths | Missing source coverage | Renderer-normalization difference |
| --- | ---: | ---: | ---: |
| Trinity + Noto | 246 | 0 | 754 |
| Laguna + Noto | 159 | 443 | 398 |

Every covered mismatch matches the independent reference after NFC normalization;
none is an unexplained merge discrepancy. These are still discrepancies against
the original text and remain failures in the raw reports. Noto supplies outlines,
not missing contextual script shaping. The original Inter-only reports remain
available, separate from these expanded-coverage results.
