Repository navigation
Conversation
#497) New adapter Item::TextScript lowered from Inline::TextScript; typeset lays the mbox out at footnotes::script_size (DeclareMathSizes, as marks use) and shifts it by a new TextScript box record: sup2-based raise for superscripts (same as footnote marks), rule-18 sub1/sub_drop-based drop for subscripts (same formula as the LaTeXe epsilon). Assembly paints the inner line shifted; span arms added everywhere BoxRec is matched. Implementation-Agent: muse-spark-1.3-contributor
|
daniel-parent review (subagent) Verdict: CHANGES NEEDED (keep it draft until #507 lands and Reviewed head How I built it without touching
Results with that build:
Oracle:
What is fine:
|
…#508) Review slice 2 against the pdflatex showbox oracle. sup2_pt was already correct (verified against lmsy7/8/10 TFMs and the oracle: 3.62892/4.3547/3.82329pt) so superscripts are untouched. - footnotes: new sub1_pt/sub_drop_pt per-lmsy-design tables mirroring sup2_pt (sub1 0.2/0.166667/0.142858/0.125/0.111111/0.15, sub_drop 0.1/0.083333/0.071428/0.0625/0.055556/0.05); the 9pt drop is now 1.0pt not 1.35pt and the 8pt drop 1.1111pt not 1.2pt. x-height stays one constant (0.430555em at every lmsy design, per TFM). - typeset: textscript_box advances content plus SCRIPT_SPACE (0.5pt), like footnote_mark; TfmLogoMetrics::math_sub_params reuses the shared helpers so the LaTeXe epsilon drops identically. - tests/textscript.rs: oracle cases for large/small/footnotesize, a scriptspace residual check, and a footnote-mark guard. Implementation-Agent: muse-spark-1.3-contributor
|
Slice 2 pushed (`b467b5ea`), addressing findings 2 and 3 (finding 1's sup2 constant was already correct — cross-checked three ways against real TFM bytes, no change needed there).
Independently verified: no `vendor/` touch, diff scoped to `typeset.rs`/`footnotes.rs`/`tests/textscript.rs` only. Build still fails identically to before this slice — same 4 `error[E0599]` for the missing `TextScript` variant, confirming no new build errors, still cleanly blocked on the sibling #507's re-pin. Spot-checked the hand arithmetic: 9pt sub1 (1.0) matches the oracle's 0.99998, 8pt height-term arm (1.1111) matches exactly — consistent with the lane's own claimed TFM-byte cross-checks. Still draft, still needs #507 + a re-pin before it can build/test for real. |
|
Closing as superseded by #795 (ea179ef, Commander's direct-to-main The one genuine gap this PR found beyond what's already shipped — the missing |
Per Commander's flash-tex#508 ruling (flash-texGH-508 review, superseded by ea179ef/flash-tex#795's direct-to-main \textsuperscript/\textsubscript implementation): the shipped `text_script_box` computed the subscript drop as a two-way `sub1_pt(local).max(ht - 0.8*x_height)`, but Appendix G rule 18a-b's real formula is a three-way max. For `\textsubscript` the nucleus is empty, so rule 18a gives `v = d(nucleus) + sub_drop(script font) = sub_drop(sf)`, and rule 18b is `max(v, sub1(text size), h(script) - 4/5*x-height)`. Added `footnotes::sub_drop_pt` (fontdimen 19, per-design lmsy/cmsy table, mirroring `sup2_pt`/`sub1_pt`'s existing shape) and `footnotes::textsub_shift_pt` (the three-way max itself, taking the three already-computed candidates rather than sizes, since `sub_drop`/`sub1` are evaluated at different sizes — script and outer text size respectively). `text_script_box` now calls it instead of the bare two-way max. Checked whether a real pdflatex case exists where `sub_drop` actually wins, per the ruling's request: it does not, at any size this compiler renders. `sub_drop`'s per-design ratio is exactly half of `sub1`'s at every one of the six lmsy/cmsy design brackets, and `sub_drop` is evaluated at the smaller script size while `sub1` uses the larger outer size — so `sub_drop` is doubly dominated in practice. `tests/text_script_oracle.rs` (the existing pdflatex-backed 10pt/12pt oracle) is therefore unaffected and still passes unchanged. Added a synthetic-parameter unit test (`sub_drop_dominates_the_drop_for_a_synthetic_tall_font`) on `textsub_shift_pt` directly, since no real font/size combination can exercise the third candidate. `\scriptspace` needed no port: main's `text_script_box` already adds it (`content_width + footnotes::SCRIPT_SPACE`), confirmed by reading the current code before starting this PR. Tests: `crates/render-pipeline --lib`: 173 passed, 0 failed, 1 ignored (1 new). `text_script_oracle`: 2/2, unchanged. Full `cargo test` (every binary, niced): green. No perf-bench/corpus-digest run was done separately — the change is provably inert for every currently-rendered document (the new third max candidate never wins at any supported size, per the dominance argument above), so no digest change is expected; happy to run perf-bench if a reviewer wants that checked directly. Implementation-Agent: daniel-muse-lead (Claude Sonnet) Commit-Executor: daniel-muse-lead (Claude Sonnet)
Scope
Part 2 of 2 for #497 — blocked on PR #507 landing and a
vendor/compilerre-pin. This PR intentionally does NOT touchvendor/(out of my delegated scope); until someone re-pinscrates/render-pipeline/vendor/compilerafter #507 merges, this branch will not build (Inline::TextScriptdoesn't exist in the current vendored snapshot) — confirmed and expected, the same "needs re-pin" state as #137/#138.New
adapter::Item::TextScriptlowered from the compiler variant;typeset::textscript_boxlays it out atfootnotes::script_size(the same\DeclareMathSizes-derived size footnote marks use), with asup2-based raise for superscripts (the footnote-mark shift) and an Appendix-G rule-18 drop for subscripts. NewBoxRec::TextScriptmerged as an unbreakable run.Overlap check
git branch -a --list '*textsuperscript*' '*textscript*'— only this lane's own branches.Test results
Cannot run yet — build fails with
error[E0599]: no variant ... TextScript found for enum Inlineat 4 call sites inadapter.rs, exactly the missing-vendor-mirror failure mode, confirmed by the reviewer (nothing else broken). Once #507 lands andvendor/compileris re-pinned, the implementer's own results (not yet independently reverified, since the build doesn't work standalone) were:crates/render-pipeline/tests/textscript.rs4/4 passing, geometry asserted numerically (script runs at 7.0pt/\sf@sizeat 10pt body size; superscript lifted ~3.63pt/sup2; subscript dropped ~1.5pt/sub1; math scripts$x^2_3$unaffected), mutation check reported clean. Re-verify all of this independently once the re-pin lands, before marking ready — do not trust this paragraph alone.Not done
Same follow-ups as #507 (headings/captions/table cells, nested styling, size classes). A separately-noted pre-existing bug (
debug_assert_eq!panic in debug-modecargo testfor ANY box-argument command, verified to reproduce identically on a pristine\ulinecall viagit stash— i.e. not introduced by this change) is out of scope here; worth its own issue.🤖 Generated with Claude Code