Fix heading/float block boundaries and record the web trial

The curated trial exposed two parser losses: a heading followed on the next
line by body text dropped the body, and consecutive figure/table/equation
blocks without blank lines swallowed each other. Headings are now separated
from following text and later headings, and the block splitter understands
display environments plus headings, so article-basic keeps its body, figure,
table and equation while arxiv-template moves from 2 to the expected 3 pages.

WEB_ROUTE_D_EXPERIMENT.md now records the three-project results (article-basic,
unicode-mixed, arxiv-template), the Edge smoke test, the go/no-go and the
updated P0 backlog: SVG preview image embedding, .bib data, vector figures and
table-cell math. Test counts move to 1065 (431 engine, 442 core, 64 server).
This commit is contained in:
gloamxun committed 2026-10-27 12:46:48 +08:00
1 parent 8d70868781
commit 254fd4a9a1
5 files changed
+250 -30

No files matched your search

+43 -14
View File
@@ -1,7 +1,8 @@
# Route-D web experiment
Status: contract fixes landed (engine `1058122` + `2194341`, web `cecad51`),
curated trial pending.
Status: contract fixes and the curated three-project trial are complete
(engine contract `1058122`, web `cecad51`); the go/no-go and P0 backlog are
recorded below.
Audit baseline: engine `c49afbd`, web `24c9593`; 2026-10-27.
## Verdict
@@ -45,7 +46,7 @@ now means route-D.
| Area | Route-D | Evidence / impact |
| --- | --- | --- |
| Article/report basics: title, sections, lists, TOC, page numbers | Supported | corpus and 1063-test suite |
| Article/report basics: title, sections, lists, TOC, page numbers | Supported | corpus and 1065-test suite |
| Inline/display math, equations, tags, cleveref | Supported | math tests, oracle fixtures |
| Floats, captions, tables, booktabs | Supported | table/math tests, corpus |
| PNG/JPEG/BMP `\includegraphics` | Supported | project image tests |
@@ -59,25 +60,53 @@ now means route-D.
| Complex scripts | **Not supported** | no shaping fallback; outside pdfLaTeX's own scope |
| Footnotes, marks, running heads | Partial | marks are document-level, not per-page |
| `\parbox` wrapping | Partial | width argument does not wrap |
| Raster images in the SVG preview | Placeholder | the SVG painter draws a grey rectangle; the PDF embeds the real image |
| Inline math in table cells | **Not supported** | trial table shows literal `$\mu$m`, `$\sim$`, `$10^6$` |
| Nested-table images, `\valign` alignments | Not supported/partial | documented engine limits |
| Token stream/catcodes beyond `@`/`%` | Partial | textual expander, not a TeX token stream |
## Curated trial (next)
## Curated trial results
1. `article-basic`: title, sections, PNG figure, table, math, references,
inline bibliography.
2. `arxiv-template`: the checked-in `fixtures/arxiv-template` with local
class/style/input files, images and inline bibliography.
3. `unicode-mixed`: accents, Greek math, colors, TOC + footnotes.
All three projects were created through the project API and rendered with both
engines. Durations are the server's `durationMs` (client HTTP elapsed in
parentheses); PDFs were checked for `%PDF-`.
For each project record page count, warnings, preview/PDF duration, PDF magic
and any fallback. Any project that needs `.bib`, vector figures or arbitrary
packages must be marked as a v1 fallback case, not a silent failure.
| Project | Route-D | v1 | Notes |
| --- | --- | --- | --- |
| `article-basic` | 1 page, 0 warnings, 502 ms (624 ms), PDF 633 ms / 466 KB | 1 page, 1449 ms (1456 ms), PDF 2701 ms / 488 KB | TOC, figure, table, equation and inline bibliography all present; figure raster is a grey placeholder in SVG |
| `unicode-mixed` | 1 page, 0 warnings, 442 ms (510 ms), PDF 656 ms / 174 KB | **422**, `undefined control sequence \'` | Route-D handles accents, Greek math, colours and footnotes; v1 cannot compile the source |
| `arxiv-template` | 3 pages, 0 warnings, 1448 ms (1514 ms), PDF 1572 ms / 448 KB | 3 pages, 4280 ms (4308 ms), PDF 4677 ms / 5.2 MB | Route-D is faster, but `.bib` citations render `[?]`, `References` is absent, table-cell math is literal and `orcid.pdf` is a placeholder |
The first pass of this trial also exposed a parser bug: a heading followed on the
next line by body text (no blank line) dropped the body, and consecutive
display blocks without blank lines swallowed each other. Both were fixed before
the table above was recorded:
- headings are separated from following text and from later headings;
- `figure`, `table`, `equation`, `align`, `gather` and `multline` blocks split
from surrounding text and from each other.
A headless Edge smoke test of `article-basic` confirmed the editor loads, the
toolbar shows **Route-D (实验)**, and the preview contains the body, table,
equation and captions. It also confirmed the remaining visual gap: the PNG
figure is a grey rectangle in the SVG preview (the exported PDF embeds it).
## Go/no-go
- **Go**, limited to text/table/math documents: Route-D is the faster default
and handles accents that v1 rejects.
- **Conditional no-go** for image-heavy or BibTeX-based papers: the SVG preview
does not draw raster images, `.bib` data is not resolved, PDF/vector figures
are unsupported, and table-cell math is literal.
- Keep the explicit v1 escape hatch: v1 is not a universal fallback (it failed
the Unicode trial), so the UI must continue to show the actual engine and
warnings/fallbacks instead of assuming v1 always recovers.
## Backlog after the trial
- **P0**: `.bib`/BibTeX citation data; PDF/vector figure support; capability and
warning UI; project-level trial coverage.
- **P0**: SVG preview raster-image embedding; `.bib`/BibTeX citation data;
PDF/vector figure support; inline math/formatting in table cells; visible
capability warnings for unsupported content.
- **P1**: two-column/multicols layout; fontspec/system-font loading; common
TikZ/package execution; longtable page splitting.
- **P2**: full catcode/token stream; nested-table images; per-page marks;