libCellML: Seventeen Findings From a Conformance Corpus

Platform: libCellML · Type: Findings / validation · Status: Open, waiting for a reply (opened November 2, 2026) · Issue: #1517 · Follow-up: comment

Context

My CellML 2.0 conformance corpus has one small model for each case of each rule in release 2.0.1 of the specification, and a runner that checks how several CellML tools read every file.

In my real numbers work, the maintainer warmly welcomed my help. Since then, the corpus has found quite a few more things for libCellML. Rather than open many issues at once, I gathered them in one place and asked how the team would like them.

Same Meaning, Same Verdict

Rule 1.2.3.3 of the specification says some changes never change what a file means: a comment, a namespace declaration or prefix, and whitespace. XML 1.1 adds a few more, such as the order of attributes. So a tool should give the same outcome for a file however it is written.

I added a check to the corpus that does exactly that, described in my ADR-016. It rewrites every file in 14 ways, in four groups, and expects each tool to give the same outcome as for the file as written. Before a rewrite is used, it's proven to keep the file's meaning, and the corpus's own self-check must see no difference either.

On the first run, 9 of the 14 rewrites changed nothing for any tool. The other five changed 262 outcomes across libCellML and libOpenCOR, which builds on it. Every one is listed in the report's Same meaning, same verdict section.

What I Found

I narrowed the changed outcomes down to eight single changes, each on a small file. Together with the cases the corpus files show as written, that gave seventeen findings, all with libCellML 0.7.2 from PyPI.

From the rewrites

# The one change What libCellML does
1 A comment before a variable name in ci, where no such variable exists The Validator accepts the model
2 The same comment in a valid model The Analyser ends with a segmentation fault
3 A comment inside a valid e-notation number The number is reported as having no valid text
4 A comment just before <diff/> A variable is reported as overconstrained
5 An unused namespace declaration on math, or MathML written with a prefix W3C MathML DTD error
6 A reset's math relying on a namespace declared on model The namespace is reported as not defined
7 An empty cn inside degree The Analyser ends with a segmentation fault
8 order written before variable on a reset The right error, but naming the variable as ''

From the files as written

# The case What libCellML does
9 1e999 as a number, and a reset order of 20 digits Reported as out of range, though the specification sets no range
10 _x as a name Accepted, though a name begins with a letter
11 id="" Accepted
12 An empty interface, prefix or cn type Accepted
13 A model that imports itself Accepted
14 Three variable mappings that form a cycle Accepted
15 A second math where only one belongs, and three similar cases about what may appear where Accepted, apart from one warning
16 A file that declares XML 1.1 Reported as an unsupported version, which may come from libxml2

A follow-up

# The case What libCellML does
17 A cycle among units, such as a units element that includes itself The Validator and the Analyser report it clearly, but four other calls end with a segmentation fault

My Contribution

Issue #1517 lists the findings in two short tables, each with its small file, and names the existing issues that come close. It asks the maintainer whether he would like them as separate issues, as one issue, or only some of them.

I first posted rows 1 to 8, then edited the issue the same night to add rows 9 to 16, so that everything for libCellML is in one place. Rows 1 to 8 stayed exactly as they were, so their numbers never change. Two earlier findings are named rather than repeated: the real numbers in #1505, and the import location in my comment on #303.

Finding 17 came last, as a comment with a five-line model and a short Python example that shows the crash.

Process

What's Next

Once the maintainer has answered, I'll open the findings in whichever shape suits the team, with their small files attached. Finding 9 is the range question he suggested a separate issue for in #1505, so it's ready to stand on its own either way.

Reflection

A comment is meant to be invisible. The most surprising result was that one comment, in one particular place, could turn a valid model into a crash. A check that rewrites files in ways that keep their meaning finds this kind of thing very quickly, because the file as written already gives the answer to compare against.

Asking first how the team would like the findings matters just as much. Seventeen issues arriving at once would be a lot to sort through. One clear list with a question lets the people who know the code decide what's most useful.