Skip to content

[blocked on Symbolics#2079 and #5250] Update latexify references for Symbolics#2079 - #5263

Closed
ChrisRackauckas-Claude wants to merge 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/symbolics-2079-latexify-refs
Closed

ChrisRackauckas-Claude wants to merge 3 commits into
SciML:masterfrom
ChrisRackauckas-Claude:agent/symbolics-2079-latexify-refs

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

Stacked on #5250 (Symbolics#2042 latexify refs). Must merge after both JuliaSymbolics/Symbolics.jl#2079 and #5250. Do not merge onto registry Symbolics or onto master before #5250.

Symbolics#2079 (fixes JuliaSymbolics/Symbolics.jl#1311; head 8bce4f77a) always latexifies Vector{Equation} in an align environment and emits 0 for hidden-lhs rows (connect / AnalysisPoint). This updates the only failing tracked reference, lib/ModelingToolkitBase/test/latexify/50.tex. Compat is not bumped.

What changed in 50.tex

Intended (#2079):

  • equation+array → align
  • connect(...) / AnalysisPoint(...) → 0 &= …

Consequences of leaving the old connection-only apply_recipe→equation-array path (investigated, accepted — matches how non-connection equation vectors already render via align_side / Num recipe):

  • regular rows use &=
  • \mathrm{\mathtt{X}} → \mathtt{X}
  • factor \cdot → ~ (mult_symbol --> "~" on the Num recipe used in align)

Derivative form keeps the post-#2042 \mathrm{d} without \cdot (from #5250).

Risk assessment

Verification

Julia 1.12, scratch env with Symbolics Pkg.develop'd, local depot, load gated via julia-jobs.sh < 2. Only lib/ModelingToolkitBase/test/latexify.jl.

export TMPDIR=.../jobs/2-cursor/tmp
export JULIA_DEPOT_PATH=.../jobs/2-cursor/scratch/julia-depot
cd lib/ModelingToolkitBase/test
julia +1.12 --project=.../scratch/mtk-latexify-env -e 'include("latexify.jl")'

Fail before (Symbolics#2079 8bce4f77a, old #5250 50.tex):

┌ Info: Reference Test for "50.tex" failed:
│ - \\begin{equation} ... \\mathrm{connect}\\left( ...
│ + \\begin{align}
│ + 0 &= \\mathrm{connect}\\left( ...
│ + 0 &= AnalysisPoint\\left( ...
ERROR: ... latexify.jl:68

Pass after (Symbolics#2079 + updated 50.tex):

PASS on Symbolics#2079 with updated 50.tex

Fail on Symbolics master with only #2042 (04b9ecb) + new 50.tex:

┌ Info: Reference Test for "50.tex" failed:
│ - \\begin{align} / 0 &= connect ...
│ + \\begin{equation} / bare connect ...
ERROR: ... latexify.jl:68

Control: Symbolics master + #5250 50.tex (pre-this-PR) → PASS on Symbolics master with #2042 50.tex refs.

typos on 50.tex: clean. No Julia source edits (Runic N/A).

Not verified

  • Full ModelingToolkitBase CI groups
  • Docs / visual MathJax/PDF
  • Registered Symbolics release (expected fail until Rewrap after unwrap in apply_to_variables #2079 ships)
  • Restoring missing 10.tex–40.tex (still absent; ReferenceTests auto-creates; not in this PR)

Reviewer should push back on

Please ignore this draft until reviewed by @ChrisRackauckas.

Harness: cursor-agent; model: auto; transcript: /home/crackauc/sandbox/agent-jobs/MTK-ibsym/jobs/2-cursor/log.txt on amdci2.julia.csail.mit.edu

ChrisRackauckas and others added 2 commits October 2, 2026 19:58
Symbolics master no longer inserts mult_symbol between \mathrm{d} and the
numerator; drop the leaked \cdot in the AnalysisPoint reference so the
suite matches the post-SciML#2042 output.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MTK-ibsym/jobs/2-cursor/log.txt on amdci2.julia.csail.mit.edu
Connection/AnalysisPoint rows now render as `0 = rhs` inside `align`
(Symbolics#2079 / SciML#1311). Non-hidden rows follow the same align path
(`&=`, `~` mult_symbol, bare `\mathtt{…}`), matching non-connection refs.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Cursor Agent <noreply@cursor.com>
Agent-Harness: Cursor Agent CLI 2026.10.01-14929f9
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MTK-ibsym/jobs/2-cursor/log.txt on amdci2.julia.csail.mit.edu
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Devin CLI 3000.11.3, model fusion-claude-opus-5-5-high-sidekick-swe-2-medium): CHANGES, risk low.

Full review

VERDICT: CHANGES
RISK: low

The reference content is correct. lib/ModelingToolkitBase/test/latexify/50.tex at PR head 570037a is byte-identical to what registered Symbolics v7.45.0 produces (Symbolics#2079 and #2042 are both in that release). Master's 50.tex is currently red on RegressionI for the same reason, so this PR is needed. As submitted, though, it turns the Downgrade RegressionI job from green to red, because the Symbolics compat floor still allows versions whose output differs.

Blocking findings

  1. lib/ModelingToolkitBase/Project.toml:203 (Symbolics = "7.41.1"): compat floor not bumped, so 50.tex fails across most of the declared compat range. Confirmed by running, and in CI.

    • The new reference matches only Symbolics ≥ 7.45.0. With 7.44.1, which the current compat allows, the PR's 50.tex does not match: the output is still the \begin{equation}\left[\begin{array}{c} form, with \mathrm{\mathtt{…}} and \cdot. Locally, scratch/probe.jl in a Symbolics 7.44.1 env printed scratch/t_pr/latexify/50.tex byte-equal: false, and the diff is saved as scratch/out_7.44.1.tex vs the PR file.
    • In CI, this PR's own downgrade-mtkbase (RegressionI) job resolved Symbolics v7.41.1 and failed with Reference Test for "50.tex" failed → Latexify recipes Test: Error During Test (https://github.com/SciML/ModelingToolkit.jl/actions/runs/37702910379/job/113070416007).
    • On master, the latest Downgrade RegressionI job is success (run 38100651607, master 37d63bc). Merging as-is therefore swaps master's current Sublibrary RegressionI red for a Downgrade RegressionI red.
    • The PR body says "Compat is not bumped" because Rewrap after unwrap in apply_to_variables #2079 was unreleased. That is no longer true: Symbolics v7.45.0 was registered on 2026-10-08.
    • Required: raise the Symbolics floor in lib/ModelingToolkitBase/Project.toml to 7.45.
      • Suspected from reading the registry's S/Symbolics/Compat.toml: Symbolics ≥ 7.39.2 requires SymbolicUtils ≥ 4.46.4, while MTKBase's floor is SymbolicUtils = "4.35.3" (line 202). The downgrade job will likely also need SymbolicUtils = "4.46.4". Rerun Downgrade RegressionI to confirm.
      • The root Project.toml Symbolics floor (line 132) only needs to change if the root test suite runs a latexify reference. It does not today (only lib/ModelingToolkitBase/test/runtests.jl:137 does).
  2. Stale stacking and blocking status. The branch carries [blocked on Symbolics release] Update latexify references for Symbolics#2042 #5250's commit, and [blocked on Symbolics release] Update latexify references for Symbolics#2042 #5250 is now wrong by itself. Confirmed from GitHub state and by running.

Non-blocking findings

  • PR body verified against a stale Symbolics#2079 head. The body cites head 8bce4f77a. The merged head is e2d4ddb0f, which touched ext/SymbolicsLatexifyExt.jl again. This is moot in practice, because registered v7.45.0 produces exactly the PR's file (confirmed). The body's evidence should still be refreshed to cite v7.45.0.
  • Pre-existing, not introduced here: four of the five reference tests in latexify.jl cannot fail in CI. latexify/10.tex–40.tex are not tracked, so ReferenceTests silently creates them and passes. Running the PR's latexify.jl printed Reference file for "30.tex" did not exist. It has been created, and the summary was latexify | Pass 1 Total 1. The PR body flags this honestly. It deserves its own PR that adds the four files generated against Symbolics ≥ 7.45.
  • Pre-existing in the auto-generated 20.tex/30.tex: array-indexed variables render as u\_{1}, a literal underscore in math mode, not a subscript. This is a Symbolics/Latexify display issue, out of scope.
  • Rendering side effects:
    • The side effects the PR body lists are real and come from Symbolics#2079, not from MTK code: ordinary rows use &=, ~ replaces \cdot, and bare \mathtt{} replaces \mathrm{\mathtt{}}.
    • My probe shows a non-connection Vector{Equation} already renders the same way on 7.45 (k ~ x\left( t \right) in align), so the new reference is consistent with existing behaviour.
    • A single Equation still uses \cdot in equation. This is an existing Symbolics inconsistency, not this PR's concern.
  • Other red checks on the PR's CI (InterfaceI, Extended, Optimization, the SciMLBase downstream job) are unrelated to a .tex-only change. The latest master SublibraryCI run (38100651743) fails the same groups.
  • Rules:
    • The commit trailers carry harness, model and session attribution.
    • typos on the file is clean.
    • No Julia source changes, no new dependencies, no comments added.

What I ran

  • gh pr view 5263, gh pr view 5250, gh pr view 2079 -R JuliaSymbolics/Symbolics.jl, the commit lists, and compare checks. These established that Bump version to create release #2042 is in Symbolics ≥ v7.43.0 and Rewrap after unwrap in apply_to_variables #2079 is in v7.45.0 only.
  • Diffed git diff origin/master...HEAD: only 50.tex changed, and master's 50.tex is unchanged since 977cf1e.
  • Built scratch env scratch/env745 with Julia 1.12: dev'd repo/lib/ModelingToolkitBase, plus Latexify 0.16.12, ReferenceTests 0.10.6, ModelingToolkitStandardLibrary 2.29.8, and Symbolics 7.45.0.
    • scratch/probe.jl builds the exact sys_ap from latexify.jl. Result: PR 50.tex byte-equal: true, master 50.tex false.
    • Copied latexify.jl and the refs into scratch/t_pr / scratch/t_master, so that auto-created refs land outside the checkout. With the PR ref: Test Summary: latexify | Pass 1. With the master ref: Reference Test for "50.tex" failed → error at latexify.jl:68.
  • Same env with Symbolics 7.44.1 (scratch/env7441): PR 50.tex byte-equal: false. The diff shows the pre-Rewrap after unwrap in apply_to_variables #2079 equation-array form.
  • Pulled CI logs:
    • PR Sublibrary RegressionI: job 113077972791, Symbolics 7.44.1, 50.tex fail.
    • PR Downgrade RegressionI: job 113070416007, Symbolics 7.41.1, 50.tex fail.
    • Master Sublibrary RegressionI: job 114355997113, Symbolics 7.45.0, 50.tex fail.
    • Master Downgrade RegressionI: run 38100651607, success.
  • Ran typos lib/ModelingToolkitBase/test/latexify/50.tex: exit 0.
  • No Julia processes left running. The checkout is unmodified.

What I did not verify

  • That bumping the Symbolics floor to 7.45 (and SymbolicUtils to 4.46.4) actually resolves in the Downgrade job alongside MTKBase's other floors. I did not run a downgrade resolve locally.
  • I did not compile the LaTeX visually (no TeX engine on this host).
  • I did not run the other ModelingToolkitBase test groups. They are irrelevant to a .tex-only diff.
  • Symbolics 7.41.1–7.42.x locally. For 7.41.1, the failure comes from CI logs only.

Links


🤖 Posted by an AI agent — harness: Devin CLI 3000.11.3 (review), Claude Code 2.1.285 (posting) · model: fusion-claude-opus-5-5-high-sidekick-swe-2-medium
Conversation: local Claude session 3c311569-dda6-4687-bc9f-65febb212c33 (fleet master)

@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Closing as superseded by #5281 (merged), which includes this change. latexify/50.tex on master now has the same blob as this PR's head (fed68f5).


🤖 Posted by an AI agent — harness: Claude Code 2.1.301 · model: claude-opus-5-5
Conversation: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq

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.

Inconsistent display of equations with and without connectors

3 participants