Repository navigation
compiler: em/ex follow the active font, \hspace keeps its trailing space, \global length prefixes - #587
Conversation
What changed: - Preserve font-relative metrics in expansion checkpoints and shifted incremental checkpoints. What was run: - test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s - test result: ok. 55 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s - test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.25s - test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s - test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Next step: - Integrate compiler font-relative dimension handling. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed: - Resolve em/ex dimensions from the active compiler class, size declaration, and known Core14 family metrics. - Preserve source interword glue around hspace and accept parser-owned global length prefixes, including table length names. - Add pdflatex-measured regression coverage for dimensions, register values, grouping, and invalid global setlength. What was run: - test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s - test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 321 filtered out; finished in 0.01s - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s - test result: ok. 339 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.48s Next step: - Integrate this branch into the parent branch. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
|
daniel-parent independent review (subagent) Verdict: CHANGES NEEDED Methodology: built 1. 10pt 2. 12pt 3. 10pt 4. 5. 6.
7. 8. Test counts — all confirmed exactly as claimed. Ran clean in
9. 10. Addendum: Summary: the |
…\setlength is valid Addresses the independent review on #587. What changed: - em/ex are the selected text font's \fontdimen6/\fontdimen5, not the class point size. src/text_fontdimens.rs (generated by scripts/gen_text_fontdimens.py from pdflatex) records them for OT1/T1 x CM/lmodern x rm/sf/tt x m/bx x n/it x the 12 LaTeX sizes. cmr12's quad is 11.74988pt, so 12pt 3em = 35.24963pt. - The parser path resolves \small/\large/\bfseries/\sffamily/\ttfamily/ italics/fontenc/lmodern through it, scaling with TeX's §455 arithmetic (0.65em in ecrm1095 = 7.07704pt). - tex-expansion tracks host font switches (\small, \bfseries, \textbf{..}, \emph, ...) as a grouped font selector and asks FontMetrics::quad_sp_in. Checkpoints keep the metrics provider, so restored engines match. - \global\setlength / \global\addtolength are passed to the parser and applied globally (pdflatex accepts them; \setlength is a macro). - \fboxsep=/\fboxrule= assignments work in the body with \global; a body \parskip= gets the same "not implemented" warning as \setlength. - Table lengths are documented as stateless; their test no longer claims to check scoping. What was run: - cargo test --manifest-path crates/compiler/Cargo.toml --no-fail-fast: 58 targets, all "test result: ok"; lib "ok. 339 passed; 0 failed"; em_global "ok. 11 passed; 0 failed"; preamble_lengths "ok. 13 passed; 0 failed"; expansion_incremental "ok. 2 passed; 0 failed" - cargo test --manifest-path crates/tex-expansion/Cargo.toml: "ok. 55 passed", "ok. 3 passed", "ok. 2 passed" Next step: independent re-review, then vendor re-pin after merge. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
daniel-parent (subagent): review fixes pushed in Every number below is pdflatex's Core:
Both paths match every cell: the engine to the printed digit, the parser within 1e-5pt. Other pinned values:
Findings → fixes
Tests (
Changed test expectations: Not done
|
Conflicts: crates/compiler/src/parser.rs (both sides added TABLE_LENGTHS; kept main's const/doc, updated main's dispatch arm to the branch's three-argument length_assignment with \global support) and crates/tex-expansion/src/registers.rs (kept branch's xn_over_d and scale_internal_dimen, dropped the branch's duplicate round_decimals in favour of main's public one, kept main's tests). Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
/#568) Conflicts: - crates/compiler/src/parser.rs: both sides appended P fields; kept both. - crates/compiler/src/expansion.rs: #610 replaced the halted/re-expand flag with recovered/resume-unexpanded and threads limits through build_cache; kept that structure and carried this branch's DocumentFonts cache key and configure_with_fonts init. - crates/tex-expansion/src/expand.rs, incremental.rs: kept both sides' new State/Checkpoint fields (font_switches/pending_font_switch/metrics and group/conditional_limit_reported/last_origin/peak_memory); dimen scanning combines main's clamped_number with this branch's scale_unit/scale_internal_dimen em/ex handling. Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
glue) Conflict: crates/compiler/src/parser.rs \vspace — #606 parses rubber glue (parse_glue_pt_at), this branch parses em/ex against the active font. Combined: parse_glue_pt_current parses each glue component with parse_dimen_pt_current. Updated #606's vspace glue test to the branch's pdflatex-verified em semantics (1em = cmr10 quad 10.00002pt, not BODY_SIZE_PT) and widened Block::VSpace patterns in this branch's tests for the new stretch/shrink fields. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
Parents #568/#583 are squashed on main; kept this branch's own mode-based horizontal-\pagebreak logic, comment and test over the squash state, and took main's #587 parser state fields (length_scopes, pending_global, latin_modern, preamble_latin_modern). Regenerated supported-latex artefacts. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
Merged the final 587 branch tip first, then main; main's squash of #587 is byte-identical to that tip for the four add/add files (font_units.rs, text_fontdimens.rs, em_global.rs, gen_text_fontdimens.py), so the branch side — 587 final plus this branch's slanted/small-caps fontdimens — is the resolution. All other files auto-resolved. Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
…rew the inventory docs/user/compiler.md (generated) conflicted again; took main's copy and regenerated via render_supported_latex.sh, sync --check clean. Main's #636 VSpace-pattern fix matches the one this branch already carried. Implementation-Agent: fable-rebase-a Commit-Executor: fable-rebase-a (direct; Cursor usage limit)
grew the inventory Generated artefacts conflicted again (docs/user/compiler.md, supported/supported-latex.json, coverage.md, Mac bundled copy); took main's copies and regenerated via render_supported_latex.sh so the math accents and main's additions both appear, sync --check clean. Implementation-Agent: fable-rebase-a Commit-Executor: fable-rebase-a (direct; Cursor usage limit)
…mens (stacked on #587) (#618) * tex-expansion: checkpoint font metrics What changed: - Preserve font-relative metrics in expansion checkpoints and shifted incremental checkpoints. What was run: - test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s - test result: ok. 55 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s - test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.25s - test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s - test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Next step: - Integrate compiler font-relative dimension handling. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222) * compiler: fix font-relative lengths and global prefixes What changed: - Resolve em/ex dimensions from the active compiler class, size declaration, and known Core14 family metrics. - Preserve source interword glue around hspace and accept parser-owned global length prefixes, including table length names. - Add pdflatex-measured regression coverage for dimensions, register values, grouping, and invalid global setlength. What was run: - test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s - test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 321 filtered out; finished in 0.01s - test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 7 filtered out; finished in 0.00s - test result: ok. 339 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.48s Next step: - Integrate this branch into the parent branch. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222) * compiler: em/ex from the active font's TFM quad and x-height; \global\setlength is valid Addresses the independent review on #587. What changed: - em/ex are the selected text font's \fontdimen6/\fontdimen5, not the class point size. src/text_fontdimens.rs (generated by scripts/gen_text_fontdimens.py from pdflatex) records them for OT1/T1 x CM/lmodern x rm/sf/tt x m/bx x n/it x the 12 LaTeX sizes. cmr12's quad is 11.74988pt, so 12pt 3em = 35.24963pt. - The parser path resolves \small/\large/\bfseries/\sffamily/\ttfamily/ italics/fontenc/lmodern through it, scaling with TeX's §455 arithmetic (0.65em in ecrm1095 = 7.07704pt). - tex-expansion tracks host font switches (\small, \bfseries, \textbf{..}, \emph, ...) as a grouped font selector and asks FontMetrics::quad_sp_in. Checkpoints keep the metrics provider, so restored engines match. - \global\setlength / \global\addtolength are passed to the parser and applied globally (pdflatex accepts them; \setlength is a macro). - \fboxsep=/\fboxrule= assignments work in the body with \global; a body \parskip= gets the same "not implemented" warning as \setlength. - Table lengths are documented as stateless; their test no longer claims to check scoping. What was run: - cargo test --manifest-path crates/compiler/Cargo.toml --no-fail-fast: 58 targets, all "test result: ok"; lib "ok. 339 passed; 0 failed"; em_global "ok. 11 passed; 0 failed"; preamble_lengths "ok. 13 passed; 0 failed"; expansion_incremental "ok. 2 passed; 0 failed" - cargo test --manifest-path crates/tex-expansion/Cargo.toml: "ok. 55 passed", "ok. 3 passed", "ok. 2 passed" Next step: independent re-review, then vendor re-pin after merge. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz * compiler: model slanted and small-caps font dimensions What changed: - Generate deterministic em/ex rows for upright, italic, slanted, and small-caps NFSS shapes across the existing setups. - Track slanted and small-caps styles on parser and expansion register paths, including bx/sc fallback coverage. - Pin pdflatex 10/11/12pt sl/sc and bfseries/sc values. What was run: - python3 crates/compiler/scripts/gen_text_fontdimens.py --texbin /Library/TeX/texbin - CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-sl-sc CARGO_BUILD_JOBS=4 cargo test --manifest-path crates/tex-expansion/Cargo.toml - CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-sl-sc CARGO_BUILD_JOBS=4 cargo test --manifest-path crates/compiler/Cargo.toml Next step: - Integrate this commit into the parent branch. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222) --------- Co-authored-by: GoKubar <[email protected]>
grew the inventory Generated artefacts (docs/user/compiler.md, coverage.md) conflicted again; took main's copies and regenerated via render_supported_latex.sh so \underbar and main's additions both appear, sync --check clean. Implementation-Agent: fable-rebase-a Commit-Executor: fable-rebase-a (direct; Cursor usage limit)
…on-token-limit-parity Conflicts were this branch's output-token-limit parity refinements vs the #610 squash and #587's font-units work arriving from main. Kept the branch's output_limit_message/is_output_limit semantics (step_limit_hit excludes output-limit stops, refined recovery notes, capacity shrink, its extended incremental_stops/expansion_incremental/expand_tests) and took main's #587 additions (font_switches, Checkpoint metrics, scale_unit dimen scanning, DocumentFonts cache key + configure_with_fonts init, with the limits binding the run loop needs). Regenerated supported-latex artifacts; bundled copy in sync. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
…rew the inventory docs/user/compiler.md (generated) conflicted again; took main's copy and regenerated via render_supported_latex.sh so the frame environment and main's additions both appear, sync --check clean. Implementation-Agent: fable-rebase-a Commit-Executor: fable-rebase-a (direct; Cursor usage limit)
Kept both sides of the environment-begin dispatch (main's sloppypar/samepage arms and #587 length-scope save; this branch's size-environment arm and its style application), both sides' supported.rs environment entries, and the union of removals from KNOWN_UNIMPLEMENTED_ENVIRONMENTS (main implemented dcases/rcases/sloppypar/samepage; this branch implements the size environments). Regenerated the supported-latex artefacts. Implementation-Agent: fable-rebase-c Commit-Executor: fable-rebase-c (direct; Cursor usage limit)
Combined this branch's \hskip glue with main's #587 font-units and space handling: Inline::HSpace carries both sides' fields (\hspace fills zero stretch/shrink, \hskip fills zero interword glue), the layout arm passes #587's space_before/after and keeps the branch's infinite-stretch fill mark, \hskip parses its base and plus/minus dimensions with the active font's em/ex (parse_fil_dimen_pt_current), and vocabulary drops both sides' now-implemented names. Updated the branch's plus/minus test to #587's em semantics (1em = cmr10 quad 10.00002pt, not BODY_SIZE_PT). docs/user/compiler.md regenerated. Implementation-Agent: fable-rebase-d Commit-Executor: fable-rebase-d (direct; Cursor usage limit)
What changed: - `crates/render-pipeline/Cargo.toml` declares a new off-by-default feature `compiler-node-surface`. It carries no behaviour of its own: every arm it adds is the inert answer the pipeline already gave for a compiler node the current pin (`c95977d6`) cannot produce. - The pipeline's exhaustive matches and node constructors now cover main's compiler surface behind that feature: `parser::Block::Penalty`/`Tabbing`, `parser::Inline::ThePage`/`PageNumbering`/`TabStop`/`TabJump`/`Marginpar`/ `Penalty`/`PagePenalty`/`Discretionary`, `VSpace`/`HSpace` glue components, `math::Nucleus::TextRun`/`SideSet`/`Lap` and `math::Accent::Mathring` (compiler flash-tex#549, flash-tex#551, flash-tex#555, flash-tex#568, flash-tex#581, flash-tex#583, flash-tex#587, flash-tex#606, flash-tex#616). `adapter::vspace_block` is a new cfg'd constructor beside the existing `line_break_inline`; the one open-coded `Inline::LineBreak { .. }` left in the `\opening` lowering now goes through `line_break_inline` too. - `tabbing` is lowered to flush-left paragraphs with one `unsupported_block` limitation, the way `LetterBlock` is, so no row is dropped by the re-pin. - `docs/integration/repin-runbook.md`: the exact re-pin commands, the three vendor directories that must move (`compiler`, `tex-expansion`, and a new `bibliography`), the lockfile and `#[ignore]` edits `--locked` CI needs, the measured test deltas and the PRs the pin unblocks. No file under `vendor/` is touched: the vendor swap used to measure all of this was scratch-only and reverted. `git diff --stat origin/main...HEAD` contains zero `vendor/` paths. What was run: Whole `crates/render-pipeline` suite, CARGO_BUILD_JOBS=4, --no-fail-fast: origin/main, pinned vendor, feature off: 469 passed, 13 failed this branch, pinned vendor, feature off: 469 passed, 13 failed (same 13) this branch, vendor re-pinned, feature on: 485 passed, 0 failed The 13 red-on-main tests (letter_class_geometry x5, frame_env, underline_sout x4, uline x2, xcolor_oracle) all pass after the re-pin. Two re-pin-gated #[ignore]s also pass against the re-pinned vendor: test frame_draws_a_rule_border_around_its_content ... ok test coloneqq_decomposes_like_mathtools ... ok crates/flashtex-cli against the same re-pinned vendor: test result: ok. 58 passed; 0 failed cargo check --all-targets on this branch at the current pin: 0 errors. Next step: The integration lane applies docs/integration/repin-runbook.md section 3 -- swap the three vendor trees, move `compiler-node-surface` (and `linebreak-skip`) into `default`, refresh both Cargo.locks, drop the two `#[ignore]`s, update vendor/VENDORING.md. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What
Two compiler and tex-expansion fixes, checked against pdflatex
\showthe:em/exunits are now the active text font's TFM quad (\fontdimen6) and x-height (\fontdimen5). Before, they were a fixed 12pt em.\tiny..\Huge,\bfseries, italics,\sffamily/\ttfamily,fontencT1 andlmodern.src/text_fontdimens.rs, generated from pdflatex byscripts/gen_text_fontdimens.py.2em: 24pt → 20.00003pt\setlength{\x}{3em}: 30pt → 35.24963pt (cmr12's quad is 11.74988pt)\small1ex: 4.30554pt → 3.87498pt (hard-coded before, now from cmr9's TFM)\bfseries1em: 11.49994pt\hspace{..}is kept (0pt → the layout's own word space).\globalprefix for length and register assignments:\global\parskip=1pt,\global\fboxsep=1pt,\global\setlength{..}{..}and\global\addtolength. Before, these gaveunknown_command.\parskip/\fboxsep/\fboxruleare group-scoped.\setlengthis a macro, so pdflatex applies\globalto the register, and so does this PR.\tabcolsep-style table lengths are accepted but have no compiler state.Why
The probes lane (#547) and the #526 review found both bugs. The independent review on this PR found that the first version used point sizes instead of TFM quads and wrongly rejected
\global\setlength. Fixes are listed finding by finding in the PR comments.Overlap check
TABLE_LENGTHS/is_table_length. Whichever lands second deletes the duplicate. The\tabcolsepstate, if either PR adds it, needsLengthScopearms.GH-COMPILER-EM-GLOBAL.Test results
test result: ok:ok. 339 passed; 0 failedem_global:ok. 11 passed; 0 failedpreamble_lengths:ok. 13 passed; 0 failedexpansion_incremental:ok. 2 passed; 0 failedtest result: ok. 55 passed; 0 failed,ok. 3 passed,ok. 2 passedNot done
vendor/compilerandvendor/tex-expansionre-pin before the pipeline sees it.\normalfontstill resets the size.\slshapeuses the italic TFM row, and small caps are not modelled.\parskipstays document-wide, as before.🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz