Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Nov 25, 2025

  • Remove the old and faulty check for finiteness of x in Model::fxdot. Closes Incorrect check for finiteness of x in fxdot #3076.
  • The root cause of those NaNs in x was not CVODES. The problem is uncaught integer overflow during steady-state simulations and asking CVODES to integrate until t=inf. Catch that.
  • Add a dedicated error code
  • Add debug-level expectations to all integration functions of Solver

* Remove the old and faulty check for finiteness of `x` in `Model::fxdot`. Closes AMICI-dev#3076.
* The root cause of those NaNs in `x` was not CVODES.
  The problem is uncaught integer overflow during steady-state simulations.
  Catch that.
* Add a dedicated error code
* Add debug-level expectations to all integration functions of `Solver`
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.09%. Comparing base (47e2517) to head (faa42d2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3077      +/-   ##
==========================================
- Coverage   77.73%   77.09%   -0.65%     
==========================================
  Files         313      313              
  Lines       20668    20670       +2     
  Branches     1499     1500       +1     
==========================================
- Hits        16067    15935     -132     
- Misses       4592     4726     +134     
  Partials        9        9              
Flag Coverage Δ
cpp 71.18% <100.00%> (+<0.01%) ⬆️
cpp_python 37.24% <66.66%> (+<0.01%) ⬆️
petab 45.86% <0.00%> (-0.01%) ⬇️
petab_sciml 13.83% <0.00%> (-0.01%) ⬇️
python 69.83% <50.00%> (-0.02%) ⬇️
sbmlsuite-jax ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/amici.cpp 76.84% <ø> (ø)
src/forwardproblem.cpp 90.65% <100.00%> (+0.03%) ⬆️
src/solver.cpp 79.52% <100.00%> (+0.07%) ⬆️
src/solver_cvodes.cpp 72.25% <ø> (-0.15%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl dweindl marked this pull request as ready for review November 25, 2025 11:03
@dweindl dweindl requested a review from a team as a code owner November 25, 2025 11:03
@dweindl dweindl self-assigned this Nov 25, 2025
Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

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

👍

@dweindl dweindl merged commit e4374d8 into AMICI-dev:main Nov 25, 2025
25 of 26 checks passed
@dweindl dweindl deleted the fix-3076-t-overflow branch November 25, 2025 13:56
return AMICI_MAX_TIME_EXCEEDED;
}

if (t > 1e200
Copy link
Member

Choose a reason for hiding this comment

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

Ah, it would actually be nice to stop simulation early (which the code so far did not achieve) and rather than simulating nonsense until maxsteps is reached.

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't an issue anymore. Previously, model state became infinite only when asking CVODES to integrate until t=inf. This is now prevented at a higher level (EventHandlingSimulator::run_steady_state).

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.

Incorrect check for finiteness of x in fxdot

2 participants