Files
texrra-engine/docs/NATIVE_FONT_FORMAT_GAPS.md
T

14 KiB
Raw Blame History

Native font and format gap audit — 2026-10-31

2026-11-03最新接续:S5b真实断行/零规格/普通脚本原生列表 已累积完整验收1384/0、CLI48;新增8作业/32页、24份报告/5436条遍次与决策行精确 一致,词框/墨迹零差异。原样完整入口与直接kernel同到657:3 tracinggroups,fmt=false。 其余compound数学field/迟写、格式/NFSS/镜像/article/会话仍未完成;下文切片数字和 启动行号为历史,以最新进度与边界为准。

2026-11-03最新接续:W3-S5a真实原生资源统计和分页代价诊断 已累积完整验收1377/0、CLI47;16作业/48页、216条分页诊断通过,词框/墨迹零差异, 追踪设置之间原生PDF字节相同。完整入口与直接kernel现同停656:3 tracingparagraphs, fmt=false;下文各切片数字和“下一统计”属于历史边界,以最新进度为准。

2026-11-03最新:W3-S4c真实PK字体设备累积完整验收1367/0、CLI45, 384字形独立位图/字宽/矩阵/偏移一致;43作业/86页位图/词框/纸张/墨迹零差异。 完整入口已通过原PK参数并进入latex.ltx,同直接kernel停654:3 tracingstats、fmt=false。 下一接真实统计和插入列表,完整NFSS/格式/镜像/article/会话等W4–W7仍保持原退出条件。 以下历史边界不代替当前状态,PK重编码/VF/配置解释/生成/Unicode仍有明确剩余范围。

2026-11-03当前:W3-S4b实际PDF配置/压缩/原始sp精度 累积完整验收1357/0、CLI43;28配置/56页和原设备15作业/29页逐词/纸张/墨迹零差异。 原样完整入口已推进至pdftexconfig.tex:19 pdfpkresolution;kernel仍654 tracingstats, fmt=false。下一PK字体须接实际查找/分辨率/解码/绘制/嵌入,真实NFSS/article/格式 仍未完成。以下数字/启动边界为历史记录,完整P2-M1目标与W4–W7退出条件保持。

2026-11-03最新:W2-S1–S4累积完整验收1311/0、CLI33; 真实动态字体/输出、断词重构 和数学字体程序/算子limits已接实际消费者。 真实NFSS/article与原样格式尚未执行成功;kernel529 overfullrule/完整入口pdfoutput 保持。下一批W3实际列表/页面/输出/PDF,W4–W7全保留。以下早期缺口均为历史。 2026-11-02 更新:G1 与 W1-S1–S7及W2-S1累积完整验收 1266 / 0、CLI28,见 P2-M1 进度 与 原始字节输入。 原样 kernel 仍529 overfullrule,完整入口仍 pdfoutput;格式尚未启动成功。 原生语言/断字已接通,W1字体单位与连字重构依赖W2。 整数TFM底座已验收,继续动态字体接线, 页面等W3–W7仍未完成。 以下较早验收和边界属于历史记录,以最新状态为准。

Current bounded text acceptance, 2026-11-02: native sfcode now consumes real character codes in list-owned spacefactor and spacing glue; 1204 tests and a sentence-spacing PDF gate pass. Punctuation ligatures, arbitrary fonts/sizes/fontdimen/NFSS and the existing template font gap remain open. The unchanged format still stops at errorcontextlines (526:1); G1 remains paused.

Additional direct audit, 2026-11-02: short-term goals reproduce actual native failures versus valid INITEX for cmr10 at12pt, scaled1200, cmr7 text, cmbx10 and mutable fontdimen. Current identifiers are fixed resource/master identities; adding a name mapping cannot close font size, shaping, metrics or NFSS behavior. Punctuation ligatures and mutable sfcode are smaller independent text goals. Forty paired probes and the unchanged-format re-probe add evidence, not implemented font coverage; LaTeX still stops at errorcontextlines (526:1). The new G1 is a bounded input-context/ diagnostic implementation plan, not a font/template-fidelity claim.

Current follow-up (2026-11-01): native box/list diagnostics passes 1200 workspace tests, 152 exact recursive-list/24 paragraph-list/24 byte printer cases and a five-show/19-word PDF gate. Font display names track the latest actual definition while physical resources/slot checks remain unchanged. This does not close arbitrary font/NFSS/VF/map/shaping or template fidelity. Unchanged LaTeX stops at errorcontextlines (526:1), full startup false. Next retain real input/macro contexts and consume the parameter in actual error printing, never a fabricated trace. Template font differences below persist.

Earlier follow-up (2026-11-01): native delimiters passes 1195 workspace tests, 452 exact DVI delimiter cases, actual scoped code/parameter/group readbacks, a 61-word PDF gate and extensible-delimiter ink gate. Delimiterfactor/shortfall consume actual measured lists; actual declared family masters and TFM variants/recipes determine every slot and component. Type1 delimiter metadata is extended without font substitution; full extension metadata/extraction and arbitrary font/NFSS/shaping closure remain open. Unchanged LaTeX stops at showboxbreadth (524:1), full startup false. Next actual box/list diagnostics must consume breadth/depth and real output channels. The transitional template font differences below remain.

Earlier follow-up (2026-11-01): native font state and accents passes 1191 workspace tests, 438 actual INITEX DVI geometry cases, 28 mutable- hyphen timing cases, a 54-word PDF gate and a whole-accent ink gate. Real first loads consume scoped defaults; global mutable skewchar/hyphenchar belong to actual resources and feed real mathaccent/discretionary/hyphenation consumers. Actual glyph names now map accent metadata; reference CMEX/vector legacy text still differs, so full extraction equivalence is not claimed. General mutable fontdimen, arbitrary fonts/sizes/VF/map/NFSS, text accents and XeTeX shaping remain open. Unchanged LaTeX stops at delimiterfactor (523:1), full boot false. Next implement actual delimiter fields/sizing and TFM variants/recipes; no unused parameter defaults. The transitional template font gap below remains.

Earlier follow-up (2026-11-01): native font diagnostics is accepted: 1187 workspace tests, 2816 slot predicates + four font queries, 61 diagnostic and 267 dimension/missing-count cases, a 25-word PDF gate and 128-slot OT1 raster. Native text now paints actual CMR10 slots (all 0..127); actual TFM existence and Type1 encoding determine diagnostics across ten CM resources/nullfont, with log/terminal/fatal delivery. No substitute is painted. Unchanged LaTeX stops at defaultskewchar (522:1); full startup is false. Next implement genuine mutable font integer state with a math-accent/skew consumer. Present characters outside CMR10 text shaping, arbitrary fonts/sizes, general VF/map/encoding/NFSS and XeTeX shaping remain open. Explicit char/^^ slot oracles do not certify the Unicode-scalar mouth as pdfTeX UTF-8 byte input. Earlier counts/boundaries below are historical; the transitional template font differences remain unchanged.

Earlier follow-up (2026-11-01): native display math is accepted: 1182 workspace tests, 58 vlist / 36 page / 24 quantity-mode-pack cases and a three-page PDF gate. Unchanged LaTeX now stops at tracinglostchars (508:1). Earlier counts/boundaries below describe their original slices.

Earlier follow-up (2026-11-01): native interline penalties are accepted: 1176 workspace tests, 100 vlist and 64 actual page-ownership cases; unchanged LaTeX now stops at displaywidowpenalty (502:1). Earlier acceptance counts/boundaries below describe their original slices, not current startup.

The accepted math atom/baseline slice does not establish full document font or LaTeX format fidelity. The strict native bootstrap executor and the current HTTP preview frontend also have different capability boundaries. The subsequent job/time and file-stream slice is accepted (1147 workspace tests); it does not change the font evidence below. The later native quantity slice passes 1153 tests and also leaves these font/layout gaps open; quantity values are not font selection.

Earlier follow-up, 2026-11-01: native inline math passes 117 list/geometry and 88 math paragraph-break comparisons and a 100-word PDF gate below 0.02bp (1171 workspace tests). It uses actual scoped three-size math families and the ten CM resources CMR/CMMI/CMSY 10/7/5 plus CMEX10, without implicit family setup. Latin math PDF descriptor metrics now come from TFM, fixing extracted word boxes without moving glyph baselines. Arbitrary resources/ sizes, full character mappings, symbol/extension metadata, NFSS and XeTeX shaping remain open. This does not change the transitional template font evidence below. Unchanged LaTeX advances to clubpenalty at 500:1; complete startup remains false.

Observed PDF differences

The current three-page arXiv comparison has different fonts in actual extracted text spans, not just unused PDF resources:

Role Fresh pdfTeX reference Transitional Route-D PDF
Roman / bold / italic NimbusRomNo9L Regu / Medi / ReguItal LiberationSerif / Bold / Italic
Bold italic NimbusRomNo9L-MediItal No separate used bold-italic face in this output
Monospace SFTT1000 LiberationMono
Small symbol face CMSY6 No used CMSY6 face in this output

Font identity differences alone do not quantify outline or metric errors, but they disprove a claim that the same document fonts have been selected. A similar looking substitute is insufficient for a native replacement. The prior word sequence audit is 0.924860 with 1243 reference / 1259 candidate words; headings, body spacing, headers and bibliography remain outside full-format acceptance. The reference uses the documented layout-oracle fixture preparation; it is not evidence that the unmodified template/packages have executed natively.

Reproduce using existing Poppler tools, without Python third-party packages:

python3 scripts/audit-pdf-fonts.py \
  --reference /tmp/texrra-math-d/reference/template.pdf \
  --candidate /tmp/texrra-etex/arxiv-regression.pdf \
  --json /tmp/texrra-etex/font-audit.json

The audit records used fonts separately from resources and removes PDF subset prefixes. XML sizes are rounded integer bp, so the size histogram is diagnostic, not a precise point-size gate. Font-name equality would not prove equal TFM/VF metrics, encoding, shaping, outlines, baselines or paragraph breaks.

Causes visible in the current implementation

  • Strict native execution now selects the real embedded CMR10 10pt resource, generates native glyph/glue nodes and exports frozen measured paragraphs. A real pdfTeX fixture agrees within 0.02bp word-box error. Other font resources/ sizes, full encoding/fontdimen and NFSS remain open; canvas/page settings are still host policy. This is separate from the current template preview path. See native paragraph evidence and the subsequent actual nested box/vpack slice. Those earlier paragraph/box fixtures use CMR10 only; they do not close the template font/NFSS differences.
  • src/route_d.rs still contains textual font/package interpretation, built-in family mapping and substitutions. In particular fontspec_family maps requested names by broad substrings to cmr/cmss/cmtt. HTTP/project endpoints have not migrated to native token execution. Extending these mappings is not the plan.
  • The math C/D gate uses real CM metrics/outlines and optical masters for its accepted atom slice. The later font-slot gate validates raw CMR10 OT1 painting, but not arbitrary text families, T1 or general encoding resolution, NFSS size substitutions, small symbols or a XeTeX fontspec profile.
  • General paragraph/display parameters, output routines, floats, headers, counters and bibliography must come from executed format/class/package code. Existing source recognizers cannot establish that fidelity.

Required product gates

  1. Continue the accepted native job/time and file-stream slice through remaining register/code-table primitives, dimensions/glue, macros, modes/lists with deferred shipout, full file closure resolution and format loading. Each new primitive needs independent INITEX semantics tests. Unmodified format source must run; do not insert documentclass or package simulations.
  2. pdfTeX font profile: own font identifiers and scoped selection; font/at/scaled, fontdimen, hyphenchar/skewchar, text/script/scriptscript math families; TFM design size and fixed-point arithmetic; VF programs, encoding and map resolution to the actual Type1 resources. Record the full file/font closure.
  3. Execute NFSS, fd, cls and sty code over those primitives. Preserve font identity and TeX sp measurements through native lists and the shared SVG/PDF results. Verify Roman/bold/italic/bold-italic/mono, optical sizes, ligatures/kerns, accents/encodings, mixed text/math and source mapping before template gates.
  4. XeTeX font profile: Unicode font lookup and shaping with actual requested fonts/features/fallback policy, independent oracles and pinned resources. Native fontspec execution cannot be replaced with substring family mapping.
  5. Compare an unmodified minimal article and pinned real templates at glyph, font identity, line/paragraph, page and raster levels. Keep the accepted math gate as one component. HTTP migration and v1 deletion require this corpus.

No runtime font substitutions, template adjustments or v1 fallback were added by this audit. Current font and format differences remain open product work.