Skip to content

compiler: underline family — ulem \uline and \sout, kernel text \underline, pdflatex-matched (#312, #330) - #328

Closed
d-q222 wants to merge 7 commits into
mainfrom
agent/daniel-parent/uline-compiler
Closed

d-q222 wants to merge 7 commits into
mainfrom
agent/daniel-parent/uline-compiler

Conversation

@d-q222

@d-q222 d-q222 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Lane daniel-parent (Max 20x, mac-m5pro-dq222; not daniel-vpclaude), claim GH-312, assigned by the Commander on #2 at 05:23Z. This is part 1 of 2; the pipeline half is the stacked draft PR.

Change (crates/compiler and generated docs only; no vendor/ edits)

  • New inline: \uline{…} with \usepackage{ulem} becomes Inline::Underline { content, thickness_pt, span, space_before }.
  • No ulem loaded: \uline gives \uline needs \usepackage{ulem} and typesets the argument as plain text, instead of the old "not supported" error.
  • Package support: ulem counts as layout-neutral only with [normalem]. Without it, ulem redefines \emph as underline, which isn't implemented.
  • Unchanged: kernel text-mode \underline (latex.ltx: $\underline{\hbox{#1}}$, math-rule geometry); \sout and \uuline stay unsupported.
  • Compiler v1 layout: paints the rule item. Inventory and docs are regenerated.

Geometry, measured with pdflatex (TeX Live 2026, article, [normalem]{ulem})

10pt 12pt
\dp of \hbox{(j} 2.5pt 3.0pt
\ULdepth after \UL@setULdepth 2.9pt 3.4pt
\showbox rule \rule(-2.5+2.9) \rule(-3.0+3.4)

So the rule's top is 0.25em below the baseline (the ( depth in cmr/lmr) and its 0.4pt \ULthickness hangs below that.

Limitations (stated in code and docs)

  • The argument is one unbreakable fragment. ulem's leaders can break across lines.
  • apps/mac/Resources/supported-latex.json drifts until sync-supported-latex.sh runs (Mac lane).

Tests

  • daniel-parent, own run: compiler --lib 298/0, --test uline 3/0, --test supported_latex 8/0.
  • Worker: robustness 4/0 with the known pre-existing deeply_nested_input_does_not_blow_the_stack overflow skipped; it crashes identically on base.

After merge

The integration lane re-pins vendor/compiler; then the stacked pipeline PR builds and lands.

Provenance

Implemented by cursor-agent cursor-grok-4.6-high-fast over two runs; the split and geometry correction were requested in daniel-parent's review. daniel-parent reviewed the diff and re-ran the gate.

Update: #330 folded in (text-mode \underline and ulem \sout)

Before this, both dropped their argument; the words vanished. Inline::Underline now carries an UnderlineGeom, so this PR covers the whole underline family and needs one re-pin:

geometry command pdflatex 10pt pdflatex 12pt
UlemDescender \uline (unchanged, byte-identical) rule(-2.5+2.9) rule(-3.0+3.4)
MathUnderline kernel text \underline = $\underline{\hbox{}}$: θ = \fontdimen8\textfont3 = 0.39998pt, top at box depth + 3θ (kern 1.19994) rule(0.39998+0.0) below the kern same θ
Strike ulem \sout: \ULdepth=-.55ex (not \maxdimen, so \UL@setULdepth leaves it) rule(2.76805+-2.36806) rule(3.24167+-2.84167)

Compiler gate (daniel-parent re-run on 88fe70d4): --lib 298/0, underline_sout 4/0, uline 3/0, supported_latex 8/0.

Gaps:

  • The Core 14 v1 layout has no per-glyph TFM, so \underline's hbox depth is 0 there. The pipeline uses real TFM depth.
  • Both are single-line fragments.
  • \uuline is still unsupported.

Implemented by cursor-agent cursor-grok-4.6-high-fast (#330: d9fedc4a, e65487c5, 06966abc); daniel-parent reviewed and cherry-picked it here.

)

With ulem loaded, \uline{...} emits Inline::Underline and a 0.4pt rule
whose top sits at \dp of \hbox{(j} (max of '(' and 'j'; 0.25em for
cmr/lmr). Kernel text-mode \underline is unchanged (math-rule geometry).
Single-line unbreakable fragment; ulem leaders can wrap.

pdflatex (TeX Live 2026) \uline{word}: 10pt rule(-2.5+2.9); 12pt
rule(-3.0+3.4).

Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-uline):
- compiler lib: test result: ok. 298 passed; 0 failed
- compiler --test uline: test result: ok. 3 passed; 0 failed
- compiler --test supported_latex: test result: ok. 8 passed; 0 failed
- compiler --test robustness --skip deeply_nested_input_does_not_blow_the_stack:
  test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 and others added 2 commits September 13, 2026 23:31
Reproduction tests: \underline{under} and \usepackage[normalem]{ulem}
\sout{struck} currently drop their argument (unsupported recovery treats
the single lowercase word as a parameter). Tests require the text to
survive and a rule to be laid out. \uline geometry is unchanged.

pdflatex (TeX Live 2026, /Library/TeX/texbin/pdflatex):
- theta = \fontdimen8\textfont3 = 0.39998pt at both 10pt and 12pt (cmex10)
- \underline{under}: inner dp=0; kern 1.19994 (=3theta); rule(0.39998+0.0);
  outer dp=1.9999 (=5theta). 12pt same theta/kern/rule (cmex10 unscaled).
- \sout{struck}: 10pt rule(2.76805+-2.36806); 12pt rule(3.24167+-2.84167)
  (0.55ex + 0.4pt height, depth -0.55ex). ex 10pt=4.30554, 12pt=5.16667.
- \uline{word} still 10pt rule(-2.5+2.9), 12pt rule(-3.0+3.4).

Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-ulsout):
- control compiler --lib: test result: ok. 298 passed; 0 failed
- control compiler --test uline: test result: ok. 3 passed; 0 failed
- control compiler --test supported_latex: test result: ok. 8 passed; 0 failed
- compiler --test underline_sout: test result: FAILED. 0 passed; 4 failed
- control pipeline --tests: error[E0599] no variant Underline (vendor, expected)

Next: generalise Inline::Underline with kernel/\sout geometry; keep \uline
byte-identical. Pipeline paint in a later commit (no vendor/ edits).

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
Generalise Inline::Underline with UnderlineGeom rather than duplicating
the wrapper. \uline stays UlemDescender + 0.4pt (0.25em top); its tests
still pass. Kernel \underline is latex.ltx $\@@underline{\hbox{#1}}$
(TeXbook Rule 10 / tex.web §735): θ=0.39998pt from cmex10 \fontdimen8
(unscaled at 10pt and 12pt), rule top 3θ below hbox depth, extra depth
5θ. \sout is \ULdepth=-.55ex; \UL@setULdepth is a no-op when ULdepth is
not \maxdimen, so the rule is height 0.55ex+0.4pt depth -0.55ex.

pdflatex: \underline{under} kern 1.19994 rule(0.39998+0.0) outer dp
1.9999 at both sizes. \sout{struck} 10pt rule(2.76805+-2.36806), 12pt
rule(3.24167+-2.84167). \uline{word} still 10pt rule(-2.5+2.9), 12pt
rule(-3.0+3.4). Arguments are no longer dropped.

Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-ulsout):
- compiler --lib: test result: ok. 298 passed; 0 failed
- compiler --test uline: test result: ok. 3 passed; 0 failed
- compiler --test underline_sout: test result: ok. 4 passed; 0 failed
- compiler --test supported_latex: test result: ok. 8 passed; 0 failed
- compiler --test robustness --skip deeply_nested_input_does_not_blow_the_stack:
  test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out

Next: pipeline paint of kernel/\sout geometry (src|tests only; no vendor/).

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
@d-q222 d-q222 changed the title compiler: ulem \uline — an underline rule under its argument, pdflatex-matched geometry (#312) compiler: underline family — ulem \uline and \sout, kernel text \underline, pdflatex-matched (#312, #330) Sep 14, 2026
…mpiler inventory

The integration triage on #2 (5661305277) found this PR regenerates
crates/compiler/supported/supported-latex.json without the Mac bundled copy,
so CompletionTests.testBundledInventoryMatchesTheCompiler would fail once it
lands. Merged current main (which carries #327's sync), regenerated with
crates/compiler/scripts/render_supported_latex.sh, and copied the inventory
byte-for-byte to apps/mac/Sources/FlashTeXMac/Resources/supported-latex.json.
supported_latex 8/0.

Commit-Executor: Claude Code (daniel-parent, mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

daniel-parent (per the integration triage on #2): Mac bundled supported-latex.json is now synced on this branch. I merged current main (with #327) and regenerated, and the Mac copy is byte-identical to the compiler inventory; supported_latex 8/0. It test-merges cleanly with main. No separate sync follow-up is needed.

…em package entries; regenerate inventory and sync Mac copy

supported.rs conflict: #380 added the natbib PACKAGES entry where this branch
added ulem; kept both (alphabetical). Generated files regenerated with
render_supported_latex.sh; Mac bundled copy byte-identical.

Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
d-q222 added a commit that referenced this pull request Sep 14, 2026
@GoKubar

GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Superseded by #390: same commits rebased onto main after #317, #320, #331 and #339 landed. The only conflict was inside the generated block of docs/user/compiler.md, resolved by re-running crates/compiler/scripts/render_supported_latex.sh and apps/mac/scripts/sync-supported-latex.sh rather than hand-merging. Closing in favour of #390.

@GoKubar GoKubar closed this Sep 14, 2026
GoKubar added a commit that referenced this pull request Sep 14, 2026
…\underline`, pdflatex-matched (#312, #330) (rebase of #328) (#390)

* compiler: implement ulem \uline with pdflatex-matched 0.25em depth (#312)

With ulem loaded, \uline{...} emits Inline::Underline and a 0.4pt rule
whose top sits at \dp of \hbox{(j} (max of '(' and 'j'; 0.25em for
cmr/lmr). Kernel text-mode \underline is unchanged (math-rule geometry).
Single-line unbreakable fragment; ulem leaders can wrap.

pdflatex (TeX Live 2026) \uline{word}: 10pt rule(-2.5+2.9); 12pt
rule(-3.0+3.4).

Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-uline):
- compiler lib: test result: ok. 298 passed; 0 failed
- compiler --test uline: test result: ok. 3 passed; 0 failed
- compiler --test supported_latex: test result: ok. 8 passed; 0 failed
- compiler --test robustness --skip deeply_nested_input_does_not_blow_the_stack:
  test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

* wip(#330): failing tests for text-mode \underline and ulem \sout

Reproduction tests: \underline{under} and \usepackage[normalem]{ulem}
\sout{struck} currently drop their argument (unsupported recovery treats
the single lowercase word as a parameter). Tests require the text to
survive and a rule to be laid out. \uline geometry is unchanged.

pdflatex (TeX Live 2026, /Library/TeX/texbin/pdflatex):
- theta = \fontdimen8\textfont3 = 0.39998pt at both 10pt and 12pt (cmex10)
- \underline{under}: inner dp=0; kern 1.19994 (=3theta); rule(0.39998+0.0);
  outer dp=1.9999 (=5theta). 12pt same theta/kern/rule (cmex10 unscaled).
- \sout{struck}: 10pt rule(2.76805+-2.36806); 12pt rule(3.24167+-2.84167)
  (0.55ex + 0.4pt height, depth -0.55ex). ex 10pt=4.30554, 12pt=5.16667.
- \uline{word} still 10pt rule(-2.5+2.9), 12pt rule(-3.0+3.4).

Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-ulsout):
- control compiler --lib: test result: ok. 298 passed; 0 failed
- control compiler --test uline: test result: ok. 3 passed; 0 failed
- control compiler --test supported_latex: test result: ok. 8 passed; 0 failed
- compiler --test underline_sout: test result: FAILED. 0 passed; 4 failed
- control pipeline --tests: error[E0599] no variant Underline (vendor, expected)

Next: generalise Inline::Underline with kernel/\sout geometry; keep \uline
byte-identical. Pipeline paint in a later commit (no vendor/ edits).

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

* wip(#330): compiler text-mode \underline and ulem \sout

Generalise Inline::Underline with UnderlineGeom rather than duplicating
the wrapper. \uline stays UlemDescender + 0.4pt (0.25em top); its tests
still pass. Kernel \underline is latex.ltx $\@@underline{\hbox{#1}}$
(TeXbook Rule 10 / tex.web §735): θ=0.39998pt from cmex10 \fontdimen8
(unscaled at 10pt and 12pt), rule top 3θ below hbox depth, extra depth
5θ. \sout is \ULdepth=-.55ex; \UL@setULdepth is a no-op when ULdepth is
not \maxdimen, so the rule is height 0.55ex+0.4pt depth -0.55ex.

pdflatex: \underline{under} kern 1.19994 rule(0.39998+0.0) outer dp
1.9999 at both sizes. \sout{struck} 10pt rule(2.76805+-2.36806), 12pt
rule(3.24167+-2.84167). \uline{word} still 10pt rule(-2.5+2.9), 12pt
rule(-3.0+3.4). Arguments are no longer dropped.

Ran (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-ulsout):
- compiler --lib: test result: ok. 298 passed; 0 failed
- compiler --test uline: test result: ok. 3 passed; 0 failed
- compiler --test underline_sout: test result: ok. 4 passed; 0 failed
- compiler --test supported_latex: test result: ok. 8 passed; 0 failed
- compiler --test robustness --skip deeply_nested_input_does_not_blow_the_stack:
  test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out

Next: pipeline paint of kernel/\sout geometry (src|tests only; no vendor/).

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

* apps/mac: sync the bundled supported-latex.json with this branch's compiler inventory

The integration triage on #2 (5661305277) found this PR regenerates
crates/compiler/supported/supported-latex.json without the Mac bundled copy,
so CompletionTests.testBundledInventoryMatchesTheCompiler would fail once it
lands. Merged current main (which carries #327's sync), regenerated with
crates/compiler/scripts/render_supported_latex.sh, and copied the inventory
byte-for-byte to apps/mac/Sources/FlashTeXMac/Resources/supported-latex.json.
supported_latex 8/0.

Commit-Executor: Claude Code (daniel-parent, mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

---------

Co-authored-by: d-q222 <[email protected]>
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
…atex.sh

Fixes GH-SUPPORTED-SYNC-TOOL: four PRs today (#317, #328, #379, #380)
regenerated crates/compiler/supported/supported-latex.json without also
running apps/mac/scripts/sync-supported-latex.sh, so main's Mac CI
inventory-sync check kept going red after merges.

render_supported_latex.sh now invokes sync-supported-latex.sh (regenerate
mode, no --check) after rewriting supported-latex.json, coverage.md, and
docs/user/compiler.md, so a re-render can never leave the Mac bundled copy
stale. Both script paths derive from $compiler (absolute, caller-cwd-
independent), so this works from any current working directory. Explicit
--root passed for visibility at the call site even though the sync script's
own default already resolves correctly here. Fails loudly (exit 1, named
path) if the sync script is missing or if it errors -- no silent
continuation under set -eu.

Header comments in both scripts now point at each other. No README/docs
line described the two scripts as a separate manual two-step process, so
none needed changing.

Tests, all re-run independently by the reviewer after rebasing onto current
main:
- Ran the combined script from /tmp (a foreign cwd): exit 0, ends with
  "sync-supported-latex.sh: bundled copy is current". Verified
  crates/compiler/supported/supported-latex.json and the Mac bundled copy
  are byte-identical (sha256 e98c9845aad0...).
- apps/mac/scripts/sync-supported-latex.sh --check: exit 0.
- Implementer's own evidence (fake-change round trip, missing-script
  failure path, cargo test --test supported_latex 8/8) reproduced the same
  results on the rebased commit.

Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane render-sync-tool, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
Muse-Lane-Head: 6afb4ce7c69032e0f2835e2c1d4e90d7943effbf
Co-authored-by: d-q222 <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
…atex.sh

Fixes GH-SUPPORTED-SYNC-TOOL: four PRs today (#317, #328, #379, #380)
regenerated crates/compiler/supported/supported-latex.json without also
running apps/mac/scripts/sync-supported-latex.sh, so main's Mac CI
inventory-sync check kept going red after merges.

render_supported_latex.sh now invokes sync-supported-latex.sh (regenerate
mode, no --check) after rewriting supported-latex.json, coverage.md, and
docs/user/compiler.md, so a re-render can never leave the Mac bundled copy
stale. Both script paths derive from $compiler (absolute, caller-cwd-
independent), so this works from any current working directory. Explicit
--root passed for visibility at the call site even though the sync script's
own default already resolves correctly here. Fails loudly (exit 1, named
path) if the sync script is missing or if it errors -- no silent
continuation under set -eu.

Header comments in both scripts now point at each other. No README/docs
line described the two scripts as a separate manual two-step process, so
none needed changing.

Tests, all re-run independently by the reviewer after rebasing onto current
main:
- Ran the combined script from /tmp (a foreign cwd): exit 0, ends with
  "sync-supported-latex.sh: bundled copy is current". Verified
  crates/compiler/supported/supported-latex.json and the Mac bundled copy
  are byte-identical (sha256 e98c9845aad0...).
- apps/mac/scripts/sync-supported-latex.sh --check: exit 0.
- Implementer's own evidence (fake-change round trip, missing-script
  failure path, cargo test --test supported_latex 8/8) reproduced the same
  results on the rebased commit.

Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane render-sync-tool, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
Muse-Lane-Head: 6afb4ce7c69032e0f2835e2c1d4e90d7943effbf
Co-authored-by: d-q222 <[email protected]>
GoKubar added a commit that referenced this pull request Sep 14, 2026
…n `par-leading` on

`vendor/compiler` is re-pinned to `faa7d484` (WIP commit df05f74); this makes
the pipeline compile against what it finds there and switches `par-leading` on.

`par-leading` was inert: #437's `Block::Paragraph::leading_pt` needs #436's
`Parsed::block_par_leading`, which the old pin did not carry. Measured end to
end from a clean checkout, not inferred from a green build: `{\small ...\par}`
in an 11pt article now sets baselines 11.955 bp apart, exactly pdflatex's
11.955 bp (`\small` = 12pt in size11.clo); the old pin gave 13.549 bp, i.e.
`\normalsize`, wrong by 1.594 bp per line.

Three moved compiler APIs, none swallowed by a wildcard arm:

* `Inline::HFill { leader }` (#320). The glue is set exactly — `\hrulefill`
  and `\dotfill` are `\leavevmode\leaders<box>\hfill\kern\z@`, so all three
  parts are emitted. Both extras are load-bearing: `\leavevmode` keeps a lone
  `\hrulefill` paragraph from being dropped along with the `\vspace` before it
  (that took `enumitem-worksheet` from 3 pages to 2), and `\kern\z@` stops
  TeX's end-of-paragraph final-glue deletion (tex.web §816) from eating a
  trailing fill. The leader box is *not* painted — this pipeline has no
  leaders outside `typeset/toc.rs`, and paragraph-layout reports no per-glue
  set width — so every occurrence is lowered with a typed `unsupported_inline`
  warning naming the command. `fixtures/divergence-probes/min-hrulefill`, which
  recorded `Date:` 198.51 bp left of pdflatex, is now 0.55 bp from the oracle.
* `Diagnostic.labels`/`.notes`/`.help` (#346/#389). display-list-v2's
  diagnostic is `additionalProperties: false` over `{code, message, severity,
  sources}`, so rather than invent wire fields, `from_compiler` folds them onto
  the fields that already mean the same thing: label spans join `sources`,
  their texts plus notes and help become `[note: …]`/`[help: …]` clauses on
  `message`, and `help.replacement` back-fills `suggestion`. One line only —
  `flashtex-render --tex` prints `severity[code] message (line:col)` per line.
* `Inline::Underline` (#328/#390). PR #329 was written for this re-pin, is
  pipeline-only and applied cleanly; its only integration gap was a `VBlock`
  literal predating `broken_penalty`.

The pin itself also starts warning `unsupported_feature` for
`\usepackage{amsmath}`, which `e44d5917` did not. That line is user-visible on
every amsmath document and claims "not implemented" about constructs this
pipeline does set — a cross-crate disagreement for the owners, not something a
re-pin settles. `tests/amsmath_inline.rs` excludes that one wording by a
documented predicate and stays strict about everything else.

Gates: render-pipeline 295 passed / 0 failed / 2 ignored (254 before);
compiler 588 / 0 / 4; amsmath 59/59; tabular 106/106; HW1 and HW2 3 pages,
0 errors, 0 font-FAILURE diagnostics; corpus page counts 22/22.

Corpus geometry (rank.py, same pdf-exact, only the producer varying), before →
after: dx 85.74% → 85.61%, dy 75.04% → 75.73%, both 68.97% → 69.11%, aligned
words 15073 → 15099, reflowed 131 → 129. 21 of 22 fixtures are bit-identical;
all movement is `enumitem-worksheet` (dy +34.14 pp, aligned 332 → 357) plus one
word in `unicode-accents`. That fixture's dx percentage falls 2.75 pp while its
absolute count rises 157 → 159: 25 more words are measured, and the new ones
sit outside 0.5 bp because the leader rule is still unpainted.

No other vendor directory needed re-pinning; the four that differ from `main`
do so by their own rows' deliberate choices, and the vendored compiler
type-checks against them.

Implementation-Agent: Claude Opus 5 (lane vendor-repin-2, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 14, 2026
… catch the pipeline up to it (#451)

* WIP: vendor/compiler re-pinned to faa7d48 + par-leading enabled (does not compile yet)

* render-pipeline: build against the re-pinned vendor/compiler, and turn `par-leading` on

`vendor/compiler` is re-pinned to `faa7d484` (WIP commit df05f74); this makes
the pipeline compile against what it finds there and switches `par-leading` on.

`par-leading` was inert: #437's `Block::Paragraph::leading_pt` needs #436's
`Parsed::block_par_leading`, which the old pin did not carry. Measured end to
end from a clean checkout, not inferred from a green build: `{\small ...\par}`
in an 11pt article now sets baselines 11.955 bp apart, exactly pdflatex's
11.955 bp (`\small` = 12pt in size11.clo); the old pin gave 13.549 bp, i.e.
`\normalsize`, wrong by 1.594 bp per line.

Three moved compiler APIs, none swallowed by a wildcard arm:

* `Inline::HFill { leader }` (#320). The glue is set exactly — `\hrulefill`
  and `\dotfill` are `\leavevmode\leaders<box>\hfill\kern\z@`, so all three
  parts are emitted. Both extras are load-bearing: `\leavevmode` keeps a lone
  `\hrulefill` paragraph from being dropped along with the `\vspace` before it
  (that took `enumitem-worksheet` from 3 pages to 2), and `\kern\z@` stops
  TeX's end-of-paragraph final-glue deletion (tex.web §816) from eating a
  trailing fill. The leader box is *not* painted — this pipeline has no
  leaders outside `typeset/toc.rs`, and paragraph-layout reports no per-glue
  set width — so every occurrence is lowered with a typed `unsupported_inline`
  warning naming the command. `fixtures/divergence-probes/min-hrulefill`, which
  recorded `Date:` 198.51 bp left of pdflatex, is now 0.55 bp from the oracle.
* `Diagnostic.labels`/`.notes`/`.help` (#346/#389). display-list-v2's
  diagnostic is `additionalProperties: false` over `{code, message, severity,
  sources}`, so rather than invent wire fields, `from_compiler` folds them onto
  the fields that already mean the same thing: label spans join `sources`,
  their texts plus notes and help become `[note: …]`/`[help: …]` clauses on
  `message`, and `help.replacement` back-fills `suggestion`. One line only —
  `flashtex-render --tex` prints `severity[code] message (line:col)` per line.
* `Inline::Underline` (#328/#390). PR #329 was written for this re-pin, is
  pipeline-only and applied cleanly; its only integration gap was a `VBlock`
  literal predating `broken_penalty`.

The pin itself also starts warning `unsupported_feature` for
`\usepackage{amsmath}`, which `e44d5917` did not. That line is user-visible on
every amsmath document and claims "not implemented" about constructs this
pipeline does set — a cross-crate disagreement for the owners, not something a
re-pin settles. `tests/amsmath_inline.rs` excludes that one wording by a
documented predicate and stays strict about everything else.

Gates: render-pipeline 295 passed / 0 failed / 2 ignored (254 before);
compiler 588 / 0 / 4; amsmath 59/59; tabular 106/106; HW1 and HW2 3 pages,
0 errors, 0 font-FAILURE diagnostics; corpus page counts 22/22.

Corpus geometry (rank.py, same pdf-exact, only the producer varying), before →
after: dx 85.74% → 85.61%, dy 75.04% → 75.73%, both 68.97% → 69.11%, aligned
words 15073 → 15099, reflowed 131 → 129. 21 of 22 fixtures are bit-identical;
all movement is `enumitem-worksheet` (dy +34.14 pp, aligned 332 → 357) plus one
word in `unicode-accents`. That fixture's dx percentage falls 2.75 pp while its
absolute count rises 157 → 159: 25 more words are measured, and the new ones
sit outside 0.5 bp because the leader rule is still unpainted.

No other vendor directory needed re-pinning; the four that differ from `main`
do so by their own rows' deliberate choices, and the vendored compiler
type-checks against them.

Implementation-Agent: Claude Opus 5 (lane vendor-repin-2, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

* render-pipeline: an appended `[help: …]` clause must not defeat the package supersede

Regression in this branch, found in review of #451. `from_compiler` appends the
compiler's structured `help`/`notes` to `message` as ` [help: …]` clauses;
`packages::supersede_message` ends its match with

    strip_suffix(" are recognised but not implemented")

so with a clause on the end the match failed, the `else` branch returned the
message unchanged, and every superseded `\usepackage` diagnostic leaked into the
render output. Not just amsmath: every package in `implemented_by_pipeline` —
amsfonts, lmodern, microtype, geometry, graphicx, tikz — and the mixed list too,
where `packages amsmath, booktabs, …` should be trimmed to `booktabs` and was
instead shown in full, telling the reader this pipeline does not implement things
it does.

`split_clauses` now peels trailing clauses off the body before matching and
re-attaches them to whatever survives a trimmed list. It keys on the clause
*shape* — ` [<label>: <text>]` with a plain-word label, bracket-depth aware so
clause text may contain brackets and a body merely ending in `]` is not eaten —
rather than on the two labels that exist today, so a third kind appended later
needs no further fix. `preamble_command_superseded` reads the body too: `lib.rs`
calls it on the compiler's diagnostic *before* the conversion, so it was not
leaking, but it compares the whole message for equality and would the moment that
call moved.

Measured on the owner's fixtures, before → after: HW1 6 → 4 diagnostics, HW2
9 → 7, `unsupported_feature` leaks 2 → 0 in each; what remains is
`math_resource_profile`, which is informational.

This also retracts a wrong conclusion in the previous commit. I had reported the
amsmath warning as purely a consequence of the re-pin and loosened
`tests/amsmath_inline.rs` to tolerate it. The pin does newly emit it, but it never
reaches a consumer — the supersede drops it — so it was visible only because of
the bug above. That test is restored to `main`'s strict assertion and passes 11/11
on its own.

Tests: `packages` unit tests for a superseded message with a clause (each of the
eight packages), the mixed list with a clause, several clauses, clause text
holding brackets, and bodies that merely end in `]`; plus two end-to-end tests in
`compiler_diagnostic_forward` covering the real render path, which is where the
clause actually gets appended. The existing `supersede_message` tests all used
bare messages, which is why this got through.

Gates re-run: render-pipeline 303 passed / 0 failed / 2 ignored; amsmath 59/59;
tabular 106/106; HW1 and HW2 3 pages, 0 errors, 0 font-FAILURE diagnostics;
corpus page counts 22/22. Corpus geometry is unchanged by this commit (dx 85.61%,
dy 75.73%, both 69.11%, aligned 15099) — the supersede moves diagnostics, not
glyphs.

Implementation-Agent: Claude Opus 5 (lane vendor-repin-2, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

---------

Co-authored-by: Claude Opus 5 <[email protected]>
@GoKubar
GoKubar deleted the agent/daniel-parent/uline-compiler branch September 16, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants