Advance native LaTeX execution and preview

This commit is contained in:
gloamxun committed 2026-11-18 22:17:21 +08:00
1 parent 91f9d76b16
commit 2741546ca8
414 files changed
+99872 -933

No files matched your search

+102
View File
@@ -6,6 +6,108 @@ LuaLaTeX, or pdfLaTeX. The web frontend is a separate repository,
[`texrra-web`](https://git.iloveuulove.me/gloamxun/texrra-web), served by this
engine as static files.
## Native execution bootstrap
Route-D's native token/state kernel has a strict developer entry. Its target is
portable, complete LaTeX execution and real-time compilation; the web interface
is a test client. The full [P2-M1 stage](docs/NATIVE_FORMAT_ARTICLE_STAGE.md)
is active and incomplete; [current progress](docs/P2_M1_PROGRESS.md) records the
accepted components and remaining work.
Native fonts come from an explicit resource World. For the checked-in examples,
configure the actual TFM/PFB directories and an installed font-map directory:
```sh
export TFMFONTS="$PWD/crates/texrra-tex-core/assets"
export T1FONTS="$PWD/assets/fonts"
# Example TeX Live map directory on this development system; configure yours.
export TEXFONTMAPS=/var/lib/texmf/fonts/map/pdftex/updmap
cargo run --release -- native examples/native-bootstrap/main.tex /tmp/bootstrap.pdf
cargo run --release -- native --initex --etex examples/native-bootstrap/dynamic-fonts.tex /tmp/fonts.pdf
cargo run --release -- native --job --initex --etex examples/native-bootstrap/native-job.tex /tmp/native-job.pdf
cargo run --release -- native --job --initex --etex examples/native-bootstrap/device.tex /tmp/device.pdf
```
`--job` selects actual online native page/output/shipout execution. It exports
only boxes really shipped by the token executor; deferred I/O runs when its
original material is shipped. Each shipout captures its actual paper,
origin/offsets and mag; zero paper dimensions use the real box's dimensions.
The logical box and actual font resources are retained, with a common physical
transform for PDF/SVG. [Native mag/true and device state](docs/NATIVE_DEVICE.md)
records the supported semantics and remaining PDF configuration/precision work. The entry without
`--job` remains a list-measurement tool for existing algorithm gates; its host
canvas does not certify native pagination. There is no automatic fallback
between these targets. See [native pages and remaining device work](docs/NATIVE_PAGES.md).
INITEX starts with actual nullfont and zero layout dimensions. Non-INITEX
bootstrap also loads its initial cmr10 through World. Missing resources fail;
the kernel does not silently use bundled fonts or run an external TeX process.
Use `--texmf-root`, resource search environment variables and `--input-policy`
for distribution/project resources; `--resource-manifest` records actual reads,
versions and negative lookups, including failed jobs. The CLI defaults to TeX
8-bit input; `--input-profile unicode` selects scalar decoding without claiming
XeTeX fonts or shaping.
This entry executes native tokens, expansion, scoped state, real streams,
measured h/v/math lists, paragraph breaking and display transitions without v1
or source preprocessing. It now carries actual sized FontId resources through
text, math, geometry, SVG and PDF. Live fontdimen and em/ex affect their real
consumers; output uses actual map/encoding/PFB resources. See
[native font execution and boundaries](docs/NATIVE_FONT_EXECUTION.md).
HTTP/project routes still use the older implementation and have not migrated
to this kernel.
The e-TeX profile remains partial. Unmodified latex.ltx currently stops at
657:3, tracinggroups, using the actual native job target; the complete
pdflatex.ini entry now enters latex.ltx and stops at the same boundary. Neither
is a successful format boot. [Streaming TFM keep/pass/boundary execution](docs/NATIVE_FONT_PROGRAMS.md) is
connected to actual lists. [Owned discretionary branches and actual ligature
hyphenation/reconstitution](docs/NATIVE_DISCRETIONARIES.md) now feed line breaking,
packing, diagnostics and output. [Two-pass mathematical noad ligature/kern and
operator limits/display/rebox execution](docs/NATIVE_MATH_PROGRAMS.md) also use
actual font instances and list consumers. [Canonical raw paragraph line boxes,
running rules/overfull markers, actual shifts/unboxing/lastbox and native math
subboxes](docs/NATIVE_LISTS.md) are connected. Nested boxes suspend and restore
actual math/display frames; output and math reuse the same raw-list traversal.
[Original-list vert_break/vsplit, live split parameters and per-class split marks](docs/NATIVE_SPLITTING.md)
now execute. Paragraph/adjusted-hbox/display marks migrate at actual pack time;
mark expansion retains real input contexts and byte diagnostics.
[Online page contributions, real output groups/shipout, page marks and deferred
file I/O](docs/NATIVE_PAGES.md) now execute natively. The four-page reference
job matches all 174 words, actual auxiliary bytes and all four raster pages.
Real mag/true, actual true font sizes and per-shipout paper/origin/offsets now
execute; the 15-job/29-page device oracle passes. [Real PDF file state, versions,
compression, object streams/xref and original-sp precision](docs/NATIVE_PDF_CONFIG.md)
now execute. The new 28-configuration/56-page and retained device matrices have
zero word-box, paper and raster XOR differences. Independent 105-page object
stream rollover also passes. Native binary DVI export is explicitly unsupported.
[Actual PK resolution, bitmap decoding, Type3 output and shared text cursor](docs/NATIVE_PK_FONTS.md)
now execute; 384 independent glyphs and a 43-job/86-page oracle pass with zero
bitmap/word-box/paper/raster differences. Missing devices/resources fail.
[Actual native ownership/resource statistics and page-break diagnostics](docs/NATIVE_STATISTICS_PAGE_TRACE.md)
now execute; 16 jobs/48 pages match reference ink and 216 exact page diagnostics.
Trace controls preserve native PDF bytes. [Actual paragraph traces, canonical-zero glue
and owned ordinary side-script lists](docs/NATIVE_PARAGRAPH_TRACE.md) also execute;
8 jobs/32 pages have 24 exact reports and 5436 pass/decision lines with zero word/raster
differences. Other tracing consumers, compound math fields, insertions, format images, real
NFSS/article and compile sessions remain required by P2-M1. Unsupported commands and resources are explicit errors.
Component contracts and independent reference checks:
- [Input contexts/show](docs/NATIVE_INPUT_CONTEXT.md), [input profiles](docs/NATIVE_INPUT_PROFILE.md),
[job time/file streams](docs/NATIVE_JOB_IO.md), [quantities](docs/NATIVE_QUANTITIES.md).
- [Paragraphs](docs/NATIVE_PARAGRAPHS.md), [boxes/vpack](docs/NATIVE_BOXES.md),
[interline penalties](docs/NATIVE_INTERLINE_PENALTIES.md), [sfcode](docs/NATIVE_SFCODE.md),
[case/language data](docs/NATIVE_LANGUAGE_DATA.md).
- [Inline math](docs/NATIVE_MATH_EXECUTION.md), [display transitions](docs/NATIVE_DISPLAY_MATH.md),
[accents](docs/NATIVE_FONT_STATE_ACCENTS.md), [delimiters](docs/NATIVE_DELIMITERS.md),
[box/list diagnostics](docs/NATIVE_BOX_DIAGNOSTICS.md).
- [Integer TFM](docs/NATIVE_TFM_LOADING.md), [font catalog](docs/NATIVE_FONT_CATALOG.md),
[font program work remaining](docs/NATIVE_DYNAMIC_FONTS.md).
The UI and compatibility features described below belong to the existing
application; they do not certify native token-kernel LaTeX portability.
## Repository layout
Clone both repositories as siblings so the engine can discover the frontend: