Repository navigation
Conversation
What changed: - Added compiler regression tests for nested math in tags/text, text styles, unsupported commands, tag glue, and eqref labels. - Added math-layout width/style-size regression tests. What was run: - test result: FAIL (expected): CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-tag cargo test --manifest-path crates/compiler/Cargo.toml --test text_runs - test result: FAIL (expected): CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-tag cargo test --manifest-path crates/math-layout/Cargo.toml --test text_runs Next step: - Add the minimal text-run IR and parser/layout support. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
What changed: - Add compiler and math-layout TextRun/TextPiece IR while retaining plain Nucleus::Text output. - Parse nested dollar and parenthesized math, text faces, tags, starred tags, and custom eqref labels. - Lay out nested math in text-size hboxes and recurse through incremental/source-span paths. What was run: - test result: ok. 6 passed; 0 failed; compiler text_runs - test result: ok. 8 passed; 0 failed; supported_latex inventory - test result: ok. 12 passed; 0 failed; math-layout unit tests - test result: ok. 28 passed; 0 failed; math-layout golden tests - test result: ok. 2 passed; 0 failed; math-layout text_runs - test result: ok. 327 passed; 0 failed; compiler unit tests - test result: ok. 2 passed; 0 failed; corpus_gate - test result: ok. 4 passed; 0 failed; hw1_preamble - test result: ok. 1 passed; 0 failed; 1 ignored; hw2_gate - test result: ok. render-pipeline vendored build - test result: ok. pdflatex oracle widths 21.86809pt, 5.00002pt, 56.61810pt Next step: - Push this green PR1 step; leave render-pipeline rich display-list integration for PR2. Implementation-Agent: codex gpt-5.6-luna (max) Commit-Executor: codex (this session) Lane-Owner: daniel-parent (mac-m5pro-dq222)
This addresses the independent review of 25c63aa. - Restores main's 2-quad tag gap as INTERIM_TAG_GAP_EM until PR 2 places tags flush right, so \\tag{1} is no longer glued to the formula. - \\text inside math inside \\text shares MAX_MATH_DEPTH and is diagnosed at depth 40 instead of overflowing the stack. - \\eqref to a rich \\tag{hi $x^2$} resolves to the flattened tag text (hi x²). References carry strings, which is documented as a limitation. - End-to-end parser and layout tests: tag widths, \\textbf{$x$}, unbalanced $, an unsupported command inside $, \\tag* and \\eqref. The automatic equation number with \\tag is unchanged; main shows it too. What was run (full crates): cargo test --manifest-path crates/compiler/Cargo.toml and crates/math-layout/Cargo.toml. Every test result is ok (compiler lib 327 passed). Implementation-Agent: codex gpt-5.6-luna (max), session 01a0a148-e56e-7722-b0a8-0436a343ed75 (resumed) Commit-Executor: daniel-parent (the resumed Codex session cannot write .git) Lane-Owner: daniel-parent (mac-m5pro-dq222) Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ag-textrun # Conflicts: # crates/compiler/src/parser.rs
…ls and fractions; \\cref on tagged equations
This is the final fix round from the second independent review.
- \\tag* no longer strips parentheses, so \\tag*{(custom)} + \\eqref gives ((custom)).
- Flattening for \\eqref uses rendered glyphs where one exists (alpha_1 gives the Greek
letter with a subscript one) and falls back to source text for radicals and
fractions, never dropping them.
- Regression test: \\cref on a \\tag{A} equation gives eq. (A).
- The 24.88pt width assertion is labelled a legacy Core14 compiler-route pin, not
a pdflatex oracle (pdflatex 29.64589pt; the real comparison is PR 2).
What was run (full crates): cargo test for crates/compiler and crates/math-layout.
Every test result is ok (compiler lib 334 passed).
Implementation-Agent: codex gpt-5.6-luna (max), session 01a0a148-e56e-7722-b0a8-0436a343ed75 (resumed)
Commit-Executor: daniel-parent (the resumed Codex session cannot write .git)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ag-textrun # Conflicts: # crates/compiler/src/math.rs
…ipts)
What changed:
- `Atom::left_scripts: Option<LeftScripts>` (and `Atom::with_left_scripts`):
when set, the atom is laid out as amsmath.sty 921-929's
`\mathop{\box4\box6}`: box 0 is the operator alone in \displaystyle
(measured for height/depth), box 4 an empty vbox of that height/depth
carrying the left pair in \displaystyle (Rule 18a from the operator's
height and depth, both scripts left-aligned), box 6 `#3\nolimits#2` in
\displaystyle. The `\hbox to\dimen@{}` Ord and the `\kern-\dimen@` cancel;
the list builder supplies an empty Ord atom for the thin space.
- No new Nucleus variant, so no downstream exhaustive match breaks; the
unpacking, glue and accent patterns skip atoms that carry left scripts.
- tests/sideset.rs pins pdflatex \showbox numbers (inline and
\displaystyle): `\sideset{_a^b}{_c^d}\sum`, `\sideset{_{ab}^b}{}\sum`,
`x\sideset{}{'}\sum x`.
What was run:
- cargo test --test sideset: test result: ok. 3 passed; 0 failed
- cargo test (flashtex-math-layout): every binary `test result: ok.`, 0 failed
Next step: compiler \sideset parsing gated on amsmath; render-pipeline
conversion draft.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ucleus::SideSet)
What changed:
- `\sideset{#1}{#2}{#3}` (amsmath.sty 921-929) parses to two atoms, as
amsmath typesets it: an empty ordinary Group (`\hbox to\dimen@{}`) and a
`Nucleus::SideSet { operator, left_superscript, left_subscript }` atom of
class Op. `#2` attaches to the last atom of `#3` (`#3\nolimits#2`);
scripts after `#3` are the \mathop's own. Script groups take `_`, `^`
and primes (`\sideset{}{'}\sum`); other material and duplicate scripts
are diagnosed.
- Gated on amsmath: without it, "\sideset requires \usepackage{amsmath}"
(pdflatex: `! Undefined control sequence`).
- SideSet arms in every exhaustive match (reference text, span end,
atom class, approximate layout, shift_atom, shift tests, incremental
shift_math_list, siunitx respan_atom). `prime_script` factored out of
list parsing.
- Inventory: \sideset moves from known-unimplemented to supported; the
hw1 preamble test now expects it to typeset silently. Generated
artefacts regenerated with render_supported_latex.sh.
What was run:
- cargo test --lib sideset_tests: test result: ok. 5 passed; 0 failed
- cargo test (flashtex-compiler): 56 `test result: ok.` lines, 0 failed
Next step: render-pipeline conversion (feature-gated) and scratch re-pin
check against pdflatex.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… (needs re-pin) What changed: - New feature `amsmath-sideset` (off until vendor/compiler and vendor/math-layout are re-pinned past the compiler `Nucleus::SideSet` and math-layout `Atom::left_scripts` commits). - `convert_math_classed`: the compiler's SideSet atom becomes `#3`'s atom (class Op) carrying `#2` and `Atom::left_scripts` for `#1`; the empty ordinary Group before it is already converted as an Ord atom, which gives amsmath's thin Ord-Op space. Scripts after `#3` go on an Op atom around it (the \mathop's own, \displaylimits). - SideSet arms in hash_math, shift_math, math_grids, math_glue_em and math_approximations. - tests/amsmath_sideset.rs pins pdflatex \showbox positions (inline and display) for x\sideset{_a^b}{_c^d}\sum x, x\sideset{_{ab}^b}{}\sum x and x\sideset{}{'}\sum x: left script x/y, operator x, right script x, trailing x (total width). What was run (scratch copy; vendor/compiler and vendor/math-layout patched with the sideset-geometry commits; this repository's vendor/ untouched): - --test amsmath_sideset: test result: ok. 3 passed; 0 failed - --lib: test result: ok. 137 passed; 0 failed; 2 ignored - amsmath corpus oracle.py check: TOTAL 59/59 within 0.5 bp - In the worktree against the pinned vendor (feature off): cargo build --lib --tests: Finished Next step: at the re-pin, add `amsmath-sideset` to default features. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
daniel-parent independent review (subagent) Verdict: APPROVE (draft, correctly scoped; needs the disclosed re-pin before it can land, which the PR already says) Method: scratch copy of
No issues found in #582's own diff. The draft state (needs a real vendor re-pin, not in |
…he readiness merges What changed: - New docs/integration/repin-runbook.md covers the re-pin step by step: - the vendor copy commands for compiler, pdf, math-layout, tex-expansion, project-files and the new bibliography mirror; - the lockfile regeneration for render-pipeline and flashtex-cli (no Cargo.toml dependency line needed for bibliography); - the required default features: linebreak-skip, amsmath-sideset, compiler-text-run; - the optional features, the ignored test to restore, and the VENDORING.md rows to update; - the expected compile and test results, and the known remaining failures with owners. - docs/integration/daniel-parent-preview.md: - corrects the bibliography row: the compiler depends on ../bibliography since #558; - records the #569/#584/#599/#582/#585 conflict resolutions and the HSpace fix. What was run (scratch re-pin, vendor from c47e145, CARGO_BUILD_JOBS=4, never committed): - render-pipeline cargo test --release --no-fail-fast: all binaries ok, 466 passed, 0 failed, 3 ignored - page_para_control: test result: ok. 19 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s - flashtex-cli cargo test --release: ok. 31 passed; 0 failed / ok. 26 passed; 0 failed; 1 ignored - amsmath TOTAL 59/59 within 0.5 bp; amssymb TOTAL 38/39 within 0.5 bp; tabular TOTAL 128/128 (words 0.5 bp, rules 0.1 bp); display-placement TOTAL 47/48 within 0.5 bp Next step: - Integration lane applies the runbook after the queue merges. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ideset-pipeline What changed: - #581's compiler `Nucleus::SideSet` and math-layout `Atom::left_scripts` have landed on main by another route, so every conflicted hunk in crates/compiler and crates/math-layout was this branch's copy of material main already carries. All of them resolved to main's side. - crates/compiler/src/math.rs (6), parser.rs (1), vocabulary.rs (1), crates/math-layout/src/layout.rs (2). - crates/math-layout/src/cm.rs auto-merged a second copy of `fn text_space(&self, size: SizeClass)` (E0201, duplicate definition); the duplicate was removed so the file matches main. - Generated artefacts (docs/user/compiler.md, crates/compiler/supported/{supported-latex.json,coverage.md}, the bundled apps/mac copy) were taken from main and regenerated with `sh crates/compiler/scripts/render_supported_latex.sh`. - What survives from this branch is only its own payload: the pipeline-side consumption of math-layout's left scripts, feature `amsmath-sideset`. `git diff origin/main` is now exactly crates/render-pipeline/Cargo.toml, src/incremental.rs, src/typeset.rs and tests/amsmath_sideset.rs (4 files, +220). What was run: crates/math-layout: cargo build --lib -> Finished crates/render-pipeline: cargo build --lib --tests -> Finished crates/render-pipeline: cargo test --lib test result: ok. 164 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out amsmath_inline: test result: ok. 11 passed; 0 failed; 0 ignored displaystyle_switch: test result: ok. 3 passed; 0 failed; 0 ignored math_ellipsis: test result: ok. 5 passed; 0 failed; 0 ignored math_operator_limits: test result: ok. 6 passed; 0 failed; 0 ignored math_operator_thin_space: test result: ok. 3 passed; 0 failed; 0 ignored math_symbols: test result: ok. 18 passed; 0 failed; 1 ignored math_text: test result: ok. 7 passed; 0 failed; 0 ignored amsmath_sideset: test result: ok. 0 passed; 0 failed; 0 ignored (the whole file is behind `amsmath-sideset`, which is off until the re-pin) Next step: - Still blocked on the vendor/compiler + vendor/math-layout re-pin (#711); until it moves, the feature cannot be switched on by default and the end-to-end behaviour cannot be shown. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
Merged current How it resolved#581's
One non-conflicting hazard: Generated artefacts were taken from What survives is only this PR's own payload. Test results (post-merge,
|
|
flashtex-2a/opus-triage: this PR's renderer half is re-landed fresh on current main as |
|
Closed under the old-engine freeze (DESIGN.md D13): this is old-path feature or hand-port work, and the old engine retires at the P5 switch-over. The branch is kept; reopen it if it turns out to be a critical user-facing fix. — kabir-claude (Commander), nightly review 2026-09-30 |
Stacked on #581 (compiler
Nucleus::SideSet+ math-layoutAtom::left_scripts), which is itself stacked on #470. This branch contains both. Its own change is the last commit,render-pipeline: set amsmath \sideset ....Draft: this PR needs a
vendor/compilerandvendor/math-layoutre-pin past #581.What
amsmath-sideset, is off by default. With it off, the crate still builds against today's pinned vendor (cargo build --lib --tests: Finished).typeset::convert_math_classed: the compiler'sSideSetatom becomes#3's math-layout atom.#2, andAtom::left_scriptsholds#1.Groupin front already converts to an Ord atom, which gives amsmath's\hbox to\dimen@{}thin Ord-Op space.#3belong to the\mathop, so they go on an Op atom wrapped around it.SideSetarms are added tohash_math,shift_math,math_grids,math_glue_emandmath_approximations.tests/amsmath_sideset.rspins pdflatex positions within 0.02bp (the acceptance bound is 0.5bp), for$..$and\[..\]:x\sideset{_a^b}{_c^d}\sum x: left script x/y, operator x, right script x/y, and the trailingx(total width);x\sideset{_{ab}^b}{}\sum x: unequal left scripts;x\sideset{}{'}\sum x.\sum's origin stays on the baseline. Latin Modern Math's display variant stands on its baseline with the same ink as cmex10's raised glyph, as for a plain\[x\sum x\]. The corpus oracle compares extension glyphs by x for the same reason.Why
This makes the pipeline set
\sidesetexactly: box 4 and box 6 in\displaystyle, left scripts left-aligned, shifts taken from the display operator's height and depth. Before, the command was "not supported" in the compiler.Oracle
pdflatex
\showbox, 10ptarticle+amsmath. The full box is in the test's module comment. Rendered values, relative to the firstx, in bp:$x\sideset{_a^b}{_c^d}\sum x$ba∑d/cx$x\sideset{}{'}\sum x$∑xOverlap check
gh pr list --state open --search sideset: math: \sideset attaches script pairs to both sides of a large operator #512 (muse-lead, superseded) and compiler + math-layout: amsmath \sideset with pdflatex geometry — a left-scripts slot (stacked on #470) #581 (this stack's base).convert_math_classed(for example render-pipeline: mathtools' \vcentcolon family sits on the math axis (#468) #530 vcentcolon and render-pipeline: \textsuperscript/\textsubscript raised at sf@size (needs #507 re-pin) #508 textsuperscript) touch different arms. Any conflicts would be textual.coord.py claims: GH-SIDESET-GEOMETRY is held by daniel-parent.Test results
In a scratch copy of this crate, with
vendor/compilerandvendor/math-layoutpatched to #581's commits,--features amsmath-sideset, andFLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRS=apps/mac/Fonts. This repository'svendor/is untouched.--test amsmath_sideset:test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out--lib:test result: ok. 137 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out0 failedcrates/compiler/tests/amsmath_corpus/oracle.py check --render <scratch release flashtex-render> --fonts apps/mac/Fonts):TOTAL 59/59 within 0.5 bpcargo build --lib --tests:FinishedNot done
amsmath-sidesettodefaultinCargo.toml.TextRunarms belong to math: \tag{…} (and \text{…}) cannot contain math — \tag{hi $x^2$} fails with "math syntax is not supported inside \tag" #441's pipeline PR (PR 2 of 2).#3in display style (a limit on the\mathop) was not measured.🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz