Skip to content

Version 1.20260803.0 - #591

Merged
agarny merged 14 commits into
opencor:mainfrom
agarny:cleaning-up
Aug 2, 2026
Merged

Version 1.20260803.0#591
agarny merged 14 commits into
opencor:mainfrom
agarny:cleaning-up

Conversation

@agarny

Copy link
Copy Markdown
Contributor

No description provided.

CopilotAI review requested due to automatic review settings August 2, 2026 07:13

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.txt and 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
FileDescription
VERSION.txtVersion bump to 1.20260802.0.
tests/res/benchmark/tt04.sedmlAdds a benchmark SED-ML resource.
tests/res/benchmark/hypercapnea.sedmlAdds a benchmark SED-ML resource with parameter changes.
tests/res/api/solver/nla3.cellmlAdds a CellML model for larger NLA-system testing.
tests/CMakeLists.txtAdds a native benchmark executable + benchmark target.
tests/bindings/python/test_solver_kinsol.pyAdds Python test for solving different NLA system sizes.
tests/bindings/python/test_sed_instance.pyAdds regression test: issues persist after run() on invalid instance.
tests/bindings/python/CMakeLists.txtGenerates Python benchmark script + adds python_benchmark target.
tests/bindings/python/benchmark.in.pyImplements Python benchmark driver.
tests/bindings/javascript/solver.kinsol.test.jsAdds JS test for solving different NLA system sizes.
tests/bindings/javascript/sed.instance.test.jsAdds regression test: issues persist after run() on invalid instance.
tests/bindings/javascript/res/res/libopencor.jsAdjusts JS resource loader to store libOpenCOR handle globally.
tests/bindings/javascript/CMakeLists.txtAdds javascript_benchmark target.
tests/bindings/javascript/benchmark.jsImplements JavaScript benchmark driver.
tests/benchmark/benchmark.cppImplements C++ benchmark executable.
tests/api/solver/kinsoltests.cppAdds C++ unit test for different NLA system sizes.
tests/api/solver/coveragetests.cppAdds coverage test ensuring KINSOL objects are recreated/reused correctly across solves.
tests/api/sed/instancetests.cppAdds C++ regression test: issues persist after run() on invalid instance.
src/support/cellml/cellmlfileruntime.hAdjusts runtime interface for WASM/table-based function dispatch.
src/support/cellml/cellmlfileruntime.cppImplements WASM table slot installation + per-thread base reuse.
src/support/cellml/cellmlfileruntime_p.hUpdates private runtime storage consistent with new dispatch approach.
src/solver/solverode.cppCaches compute-rates function pointer for faster calls.
src/solver/solverode_p.hStores cached compute-rates function pointer.
src/solver/solverkinsol.cppAdds KINSOL object caching + Emscripten objective-function slot resolution.
src/solver/solverkinsol_p.hAdds cached KINSOL objects and associated state.
src/solver/solvercvode.cppUses cached compute-rates function pointer via user-data.
src/solver/solvercvode_p.hStores cached compute-rates function pointer in CVODE user-data.
src/sed/sedinstancetask.cppSimplifies runtime calls via function-pointer getters.
src/sed/sedinstance.cppRestores initial task issues on run() and updates issue-count bookkeeping.
src/sed/sedinstance_p.hStores separate issue/error/warning snapshots for restoring on run.
src/misc/compiler.cppTunes ORC JIT target machine builder to host CPU + aggressive opt.
src/logger/logger.cppUses atomic counters for fast has*/*Count without locking.
src/logger/logger_p.hSwitches 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 use memory_order_acquire to synchronize with memory_order_release updates 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 use memory_order_acquire to synchronize with memory_order_release updates 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. Use memory_order_release on these increments so hasIssues()/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, but memory_order_relaxed allows the compiler to reorder the counter reset before the vector clears as observed by other threads. Use memory_order_release for 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.

Comment threadtests/res/benchmark/hypercapnea.sedml
Comment threadsrc/sed/sedinstance.cpp Outdated
Comment threadsrc/sed/sedinstance.cpp Outdated
Comment threadsrc/logger/logger.cpp
@agarny
agarnyforce-pushed the cleaning-up branch 5 times, most recently from bfc39da to dc4d6d3CompareAugust 2, 2026 12:09
@agarnyagarny changed the title Version 1.20260802.0Version 1.20260803.0Aug 2, 2026
@agarny
agarny merged commit 423a252 into opencor:mainAug 2, 2026
24 checks passed
@agarny
agarny deleted the cleaning-up branch August 2, 2026 15:41
Sign up for freeto 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

@agarny