CatColab v0.5: Sandpiper

CatColab
Author
Published

2026-03-23

Abstract

After 97 days and 96 merged pull requests, CatColab has gone from v0.4: Robin to v0.5: Sandpiper. In this post I’ll walk through some of the main additions, changes, and fixes.

Some of the new analyses in Sandpiper

Some of the new analyses in Sandpiper

After 97 days and 96 merged pull requests, CatColab has gone from v0.4: Robin to v0.5: Sandpiper. In this post I’ll walk through some of the main additions, changes, and fixes. You can find the changelog and complete release notes on GitHub:

Major new features

The three most evident new features highlight some of our work’s main focuses over the past three months, namely compositionality, ODE semantics, and database theory.

Composition of Petri nets

Two major features in the previous release were Petri nets and composing models of discrete theories. This release brings these two together! We have extended CatColab’s DoubleTT implementation to enable composing models of modal theories, which means in particular that Petri nets can now be composed along places. As a tiny example, we can start by instantiating the standard SIR model \mathtt{unvax} = \left\{ S \longrightarrow \boxed{\mathrm{infect}} \mathrel{\substack{ \textstyle\longleftarrow\\ \textstyle\longrightarrow\\ \textstyle\longrightarrow }} I \longrightarrow \boxed{\mathrm{recover}} \longrightarrow R \right\} and then add a new state and transition \mathtt{unvax}.S \longrightarrow \boxed{\mathrm{vaccinate}} \longrightarrow V to obtain an SIRV model.

Building a simple SIRV Petri net by instantiating an SIR model and adding a vaccination state and transition

Building a simple SIRV Petri net by instantiating an SIR model and adding a vaccination state and transition

Unbalanced mass-action ODE systems, and equation visualisation

When working with ODE semantics for a model, it’s useful to know which equations are actually being simulated. Doing this by hand is time consuming and error prone, and this is exactly the kind of task that computers are very good at doing. The mass-action dynamics analysis (available for stock-flow diagrams and Petri nets) will now show you the equations generated by your model, with either generic symbolic parameters or numerical parameter values from your simulation.

The mass-action dynamics analysis also has two new settings increasing its generality: mass conservation and rate granularity. This reflects a new (non-standard) capability for mass-action dynamics that do not preserve mass. You can read more about unbalanced mass-action in this blog post and its upcoming sequel.

Mass-action dynamics equations derived from a Petri net

Mass-action dynamics equations derived from a Petri net

SQL schema definitions

The mathematical history of CatColab can be traced in part to the categorical approach to database theory, as explained by David Spivak and Brendan Fong in Chapter 3 of Seven Sketches in Compositionality. Much of our recent focus has been on quantitative scientific modeling, but we do intend to keep expanding the database capabilities of CatColab. Thanks to Matt Cuffaro, you can now generate SQL schema definitions in several dialects from a schema model in a CatColab. You can read more about this feature in the schema help pages.

A schema model and the generated SQL schema definitions in PostgresSQL

A schema model and the generated SQL schema definitions in PostgresSQL

Other improvements and fixes

Improved graph layouts

To visualise models we make use of graph layout algorithms, which are notoriously sensitive to input data and parameters. Now, in addition to the Graphviz layout engine, you can choose to use ELK (via the package elkjs). This gives you another option to choose from. We have found that ELK’s layered algorithm is particularly well suited to Petri nets.

Rust backend

Following a backend re-architecture, syncing of Automerge documents is now provided by the new Rust crate samod instead of the Node package automerge-repo. This means that 100% of the CatColab backend is now written in Rust 🦀

Document corruption fix

There was a pretty terrible bug related to the rich text editor, which could result in Automerge documents becoming corrupted and thus un-openable. This bug was fixed upstream thanks to the Ink & Switch team. We also now have better systems in place to detect corrupted documents should similar problems arise in the future.

Leaving a comment will set a cookie in your browser. For more information, see our cookies policy.