How it’s tested

The Python tests are in tests/ and run in under a minute with pytest; the MATLAB tests are in matlab/tests/. They check the guarantees rather than the outputs alone:

  • Soundness: the true system lies inside the learned map on thousands of random queries, for random monotone functions and sign patterns.

  • Minimality: the bounds are attained by monotone functions consistent with the data.

  • Fast algorithms against brute force: the grid sweep equals the theorem’s formula exactly, on random non-uniform partitions with data on cell edges and outside the box. Safety and reach-avoid fixed points equal the textbook iterations (sets, step counts and allowed inputs) on random abstractions in dimensions 1–4, with every index type, in both backends.

  • Bounded-derivative models: all five approaches are sound for random functions with bounded derivatives, with data outside the box and a known part g. The growth-cone vertex values equal the set-membership bounds computed by brute force over all data, and the cell bounds equal their definition; restricted to two sign matrices, the all-matrix model equals the two-matrix one; update equals a refit on all data; the windowed update tightens exactly the window. The linear-programming final steps are certified by weak duality, so solver tolerances cannot make them unsound.

  • Original implementation: the grid algorithm reproduces the original MATLAB implementation (Data2Sigma0 + ApproximationMonotoneSystemData3) bit for bit on random problems.

  • Backends and languages: the C++ and NumPy backends are bit-identical. The MATLAB code, both pure .m and MEX, reproduces the Python results exactly (map, abstraction, safety, reach-avoid; the five bounded-derivative models to within 1e-15, and their online updates), and the MEX fixed points equal the .m ones on random 1-D to 3-D abstractions. CI runs it under Octave and in MATLAB R2023b on Linux, Windows and macOS.

  • Safe envelopes: the monotone search equals brute-force enumeration; the closed-form pair bound equals an LP solver; every certified corner or box is pushed through the true dynamics with random inputs and worst-case disturbances, and closed loops from thousands of certified states never leave the envelope (Python and MATLAB, MATLAB checked against Python).

  • Assumption monitor: correct assumptions never raise an alarm (all model types and methods); a wrong sign, a too-small derivative bound, a missing dependence and a larger disturbance are each detected, and the computed smallest change matches the true value; it is exact (equal to bisection with a full consistency check, and to brute force over all pairs). check_data equals brute force and finds corrupted points; each level detects what it should; checking later with flush() gives the same result as checking every step; quarantine prevents follow-up alarms; the widening limit switches to fallback. C++ (with and without pruning, any number of threads), NumPy and MATLAB (.m and MEX) give the same bits; MATLAB draws the same random samples as Python.

  • Threads: every learning kernel gives the same bits with 1, 2 and all threads and with every way of sharing the work among them, in Python and MATLAB, and the same bits as the earlier single-threaded kernels. The compiled abstraction equals the NumPy and .m code on every kind of model, g, assumption and partition, for any number of threads. CI builds with and without OpenMP (on demand also on macOS and Windows).

  • Documentation: the tutorials are executed on every CI run (a failing cell or a Sphinx warning fails the build), their MATLAB snippets run under Octave, and every public Python name must have a docstring.

  • Reported numbers: reproductions/check_numbers.py runs the examples and paper reproductions (Python, and the MATLAB examples under Octave) and compares everything they print, apart from timings and file paths, with the references in reproductions/expected/. A changed safe-set percentage, violation count or µ value fails CI. CI runs the quick set (about 2 minutes) on every push and everything (about 10 minutes) on manual runs. After an intended change, --update rewrites the references, and git diff reproductions/expected shows which numbers moved.

  • Closed loop: simulated trajectories under the synthesized controllers and the safety filter never leave the safe set and always reach the target.

  • Packages: every pre-built wheel runs the whole test suite in CI and is installed again on a clean machine; the MATLAB toolbox is installed in a fresh MATLAB and calls a MEX function.