Skip to content

Fix jit crt math symbols - #1489

Merged
luciansmith merged 8 commits into
developfrom
fix/jit-crt-math-symbols
Dec 3, 2026
Merged

luciansmith merged 8 commits into
developfrom
fix/jit-crt-math-symbols

Conversation

@luciansmith

Copy link
Copy Markdown

From @matthiaskoenig : ensure that calls to 'pow' and other functions always call the same thing. Added some tests to that PR; otherwise it's just from him.

matthiaskoenig and others added 6 commits November 25, 2026 23:42
…inks

The JIT resolved pow, exp, log and the other C library functions which
createCLibraryFunctions declares through the search of the symbols of the
process. On Windows ntdll.dll, ucrtbase.dll and msvcrt.dll all export them,
LLVM returns the export of the module loaded last, and the functions of
msvcrt and ucrtbase differ in the last bits for some arguments, so the
results of a model depended on the load order of the process. LLJit and
MCJit now bind them explicitly, as they do for the SBML support functions.
Add complete Python API typing and ty checks
We still hard-code a bunch of things that SWIG can't generate yet, but we generate what we can, which makes this approach more future-proof.  Generation is from 'complete_stub.py'.

Other fixes/changes:
* Slicing now keeps row/column names, as does vstack/hstack/concatenate.  If the labels conflict, that's an error; if one is there and the other is missing, we perform the join and un-label the result.
* More variants of python types can now be used in our functions.  Among other things, this fixes #1301.
* 'long' -> 'long long' is now correct.
* Requires new rr-libstruct, with zero-sized matrices now not causing crashes.
* Also, a bunch of skipped python tests are now unskipped.  Among other things, this involved adding new 'get' functions for getBoundary, getConstant, getReversible, getPersistent, and getTriggerInitialValue.
* setConstant now works on species references.
* Loading a document with no model no longer crashes; it throws or adds an empty model appropriately.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BCWJVGVzVqYawshjJodZN
Bind the C library math functions of the JIT to the ones roadrunner links
@luciansmith
luciansmith merged commit babeeb4 into develop Dec 3, 2026
53 of 95 checks passed
@luciansmith
luciansmith deleted the fix/jit-crt-math-symbols branch December 3, 2026 23:23
@luciansmith

Copy link
Copy Markdown
Author

Accidentally combined this with #1485, but both work, so hey.

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.

2 participants