Version 1.20260803.0 - #591
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR bumps the library version, adds new benchmark harnesses/resources across C++/Python/JavaScript, and includes several runtime/solver improvements (notably around Emscripten/WASM function dispatch and KINSOL reuse), along with new regression/coverage tests.
Changes:
- Bump
VERSION.txtand add benchmark resources (SED-ML) and runners for C++/Python/JavaScript. - Extend solver and SED instance test coverage (KINSOL different system sizes; preserve issues after
run()). - Refactor runtime/solver internals (WASM function table usage, KINSOL object caching, logger issue counter fast-path, ORC JIT host CPU).
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION.txt | Version bump to 1.20260802.0. |
| tests/res/benchmark/tt04.sedml | Adds a benchmark SED-ML resource. |
| tests/res/benchmark/hypercapnea.sedml | Adds a benchmark SED-ML resource with parameter changes. |
| tests/res/api/solver/nla3.cellml | Adds a CellML model for larger NLA-system testing. |
| tests/CMakeLists.txt | Adds a native benchmark executable + benchmark target. |
| tests/bindings/python/test_solver_kinsol.py | Adds Python test for solving different NLA system sizes. |
| tests/bindings/python/test_sed_instance.py | Adds regression test: issues persist after run() on invalid instance. |
| tests/bindings/python/CMakeLists.txt | Generates Python benchmark script + adds python_benchmark target. |
| tests/bindings/python/benchmark.in.py | Implements Python benchmark driver. |
| tests/bindings/javascript/solver.kinsol.test.js | Adds JS test for solving different NLA system sizes. |
| tests/bindings/javascript/sed.instance.test.js | Adds regression test: issues persist after run() on invalid instance. |
| tests/bindings/javascript/res/res/libopencor.js | Adjusts JS resource loader to store libOpenCOR handle globally. |
| tests/bindings/javascript/CMakeLists.txt | Adds javascript_benchmark target. |
| tests/bindings/javascript/benchmark.js | Implements JavaScript benchmark driver. |
| tests/benchmark/benchmark.cpp | Implements C++ benchmark executable. |
| tests/api/solver/kinsoltests.cpp | Adds C++ unit test for different NLA system sizes. |
| tests/api/solver/coveragetests.cpp | Adds coverage test ensuring KINSOL objects are recreated/reused correctly across solves. |
| tests/api/sed/instancetests.cpp | Adds C++ regression test: issues persist after run() on invalid instance. |
| src/support/cellml/cellmlfileruntime.h | Adjusts runtime interface for WASM/table-based function dispatch. |
| src/support/cellml/cellmlfileruntime.cpp | Implements WASM table slot installation + per-thread base reuse. |
| src/support/cellml/cellmlfileruntime_p.h | Updates private runtime storage consistent with new dispatch approach. |
| src/solver/solverode.cpp | Caches compute-rates function pointer for faster calls. |
| src/solver/solverode_p.h | Stores cached compute-rates function pointer. |
| src/solver/solverkinsol.cpp | Adds KINSOL object caching + Emscripten objective-function slot resolution. |
| src/solver/solverkinsol_p.h | Adds cached KINSOL objects and associated state. |
| src/solver/solvercvode.cpp | Uses cached compute-rates function pointer via user-data. |
| src/solver/solvercvode_p.h | Stores cached compute-rates function pointer in CVODE user-data. |
| src/sed/sedinstancetask.cpp | Simplifies runtime calls via function-pointer getters. |
| src/sed/sedinstance.cpp | Restores initial task issues on run() and updates issue-count bookkeeping. |
| src/sed/sedinstance_p.h | Stores separate issue/error/warning snapshots for restoring on run. |
| src/misc/compiler.cpp | Tunes ORC JIT target machine builder to host CPU + aggressive opt. |
| src/logger/logger.cpp | Uses atomic counters for fast has*/*Count without locking. |
| src/logger/logger_p.h | Switches to std::mutex and adds atomic counters for issues/errors/warnings. |
Suppressed comments (4)
src/logger/logger.cpp:58
- Same memory-ordering issue as for issue counts:
hasErrors()/errorCount()are read without locking, so they should usememory_order_acquireto synchronize withmemory_order_releaseupdates in writer paths.
bool Logger::Impl::hasErrors() const
{
return mErrorCount.load(std::memory_order_relaxed) != 0;
}
size_t Logger::Impl::errorCount() const
{
return mErrorCount.load(std::memory_order_relaxed);
}
src/logger/logger.cpp:86
- Same memory-ordering issue as for issue counts:
hasWarnings()/warningCount()are read without locking, so they should usememory_order_acquireto synchronize withmemory_order_releaseupdates in writer paths.
bool Logger::Impl::hasWarnings() const
{
return mWarningCount.load(std::memory_order_relaxed) != 0;
}
size_t Logger::Impl::warningCount() const
{
return mWarningCount.load(std::memory_order_relaxed);
}
src/logger/logger.cpp:136
- The issue vectors are mutated under the mutex, but the corresponding counters are updated with
memory_order_relaxed, which permits reordering of the counter update ahead of the vector mutation as observed by lock-free readers. Usememory_order_releaseon these increments sohasIssues()/issueCount()(with acquire loads) won’t observe a non-zero count before the vectors are updated.
auto issue {IssuePtr {new Issue {pType, pDescription, pContext}}};
mIssues.push_back(issue);
mIssueCount.fetch_add(1, std::memory_order_relaxed);
src/logger/logger.cpp:168
removeAllIssues()updates the vectors and then resets the lock-free counters, butmemory_order_relaxedallows the compiler to reorder the counter reset before the vector clears as observed by other threads. Usememory_order_releasefor these stores so lock-free readers doing acquire loads won’t see zero counts while old issues are still visible.
void Logger::Impl::removeAllIssues()
{
const std::scoped_lock<std::mutex> lock(mMutex);
mIssues.clear();
mErrors.clear();
mWarnings.clear();
mIssueCount.store(0, std::memory_order_relaxed);
mErrorCount.store(0, std::memory_order_relaxed);
mWarningCount.store(0, std::memory_order_relaxed);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agarny
force-pushed
the
cleaning-up
branch
5 times, most recently
from
August 2, 2026 12:09
bfc39da to
dc4d6d3
Compare
…/warnings on SED-ML runs.
We can now call the same methods, no matter whether we use Emscripten or not. The implementation is still different though, obviously.
…lots, without JavaScript round trips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.