Skip to content

Docs build fails on Julia 1.13: lincomp doctest pins Dict iteration order #559

Closed

Description

@ChrisRackauckas-Claude

Summary

The linear_compartment_model doctest in src/lincomp.jl:35-44 pins the printed order of
the ODE equations, and that order changes on Julia 1.13. The Documentation CI job runs
Julia 1.13.0, so the docs build fails there.

Observed

Unmodified master (90f8452a61109fe29e434d604bd22ad80d474fdd), same package versions
(Nemo v0.56.1, AbstractAlgebra v0.50.2, Groebner v0.10.8, RationalFunctionFields v0.3.5):

using StructuralIdentifiability
show(linear_compartment_model([[2, 4], [1, 3], [2, 4], [1, 3]], outputs = [1], inputs = [2], leaks = [2, 3]))
julia 1.12.7    -> x1'  x3'  x2'  x4'  y1     # what the doctest documents
julia 1.13.0-rc4 -> x4'  x3'  x1'  x2'  y1

and CI on Julia 1.13.0 printed the 1.13 order:

┌ Error: doctest failure in src/lincomp.jl:35-44
│   diff =
│    x1' x4' = -x1*a_2_1 - x1*a_4_1 + x2*a_1_2 + x4*a_1_4
│    ...

https://github.com/SciML/StructuralIdentifiability.jl/actions/runs/34498007776/job/102941309041

Cause

linear_compartment_model returns the system with x_equations as a
Dict{QQMPolyRingElem, ExtendedFraction{QQMPolyRingElem}}, and show(::ODE) iterates that
dict. Dict iteration order is an implementation detail and changed in Julia 1.13, so the
doctest pins something the language does not promise.

Why it is only surfacing now

The docs build currently dies earlier, on
#556 (three
power_series_solution doctest failures), so this one is unreachable on master. It becomes
the first failure once #556 is fixed (see #558).

Suggested fix

Make the output order deterministic rather than dict-dependent — e.g. have show(::ODE)
print x_equations in x_vars order (which is already stored on the struct) instead of in
dict order. That fixes the doctest on every Julia version and makes the printed system
stable for users, rather than re-pinning a new arbitrary order in the docstring.


🤖 Investigated and filed by an AI agent (Claude Code, model claude-opus-5[1m]) on behalf of @ChrisRackauckas.
Session: https://claude.ai/code/session_01GdSpCLd7NBZuuePJmcDzU7

Activity

  1. ChrisRackauckas-Claude commented on Oct 1, 2026

    @ChrisRackauckas-Claude
    MemberAuthor

    Taking this — Cursor Agent CLI 2026.09.28-64d2043, model auto (local job 559-cursor on amdci2.julia.csail.mit.edu).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions