Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopping/restarting demographic models at boundaries of deme extinction leads to model errors. #775

Closed
molpopgen opened this issue Jun 15, 2021 · 1 comment · Fixed by #774
Labels
Milestone

Comments

@molpopgen
Copy link
Owner

#774 has uncovered a corner case bug. Situations where you start/stop evolution at different points of a demographic model can lead to runtime errors.

The root cause is not totally clear, and this stop/start is also tested elsewhere with non-demes models, which have all been passing.
Presumably, we need to parameterize those tests to stop/start at many more time points, to see if we can trigger similar issues.

@molpopgen molpopgen added the bug label Jun 15, 2021
molpopgen added a commit that referenced this issue Jun 16, 2021
at start of simulation.  If not, then we do NOT call the "model
updating" code path prior to entering the main loop.

CANDIDATE fix for #775
@molpopgen molpopgen changed the title Placeholder name: demographic event timings Stopping/restarting demographic models at boundaries of deme extinction leads to model errors. Jun 16, 2021
@molpopgen
Copy link
Owner Author

The details of this are that when an internal model state existed, we were always calling "update it" prior to entering the main loop. This was the wrong thing to do for this case. The fix is to add a bool in the C++ code asking if an internal state existed or not. This fix works, but it breaks a bizarre/rare use case of pickling/unpickling the model prior to starting the second call to evolvets.

@molpopgen molpopgen linked a pull request Jun 16, 2021 that will close this issue
molpopgen added a commit that referenced this issue Jun 16, 2021
population splits.

* When a migration lookup table is NULL, the exception
now reports the offspring deme index.

* Keep track of whether demographic_model_state pointer was null
  at start of simulation.  If not, then we do NOT call the "model
  updating" code path prior to entering the main loop.

  Fixes #775
  Causes #777
@molpopgen molpopgen added this to the 0.16.0 milestone Jun 16, 2021
molpopgen added a commit that referenced this issue Jun 16, 2021
…ation splits. (#774)

* When a migration lookup table is NULL, the exception
now reports the offspring deme index.

* Keep track of whether demographic_model_state pointer was null
  at start of simulation.  If not, then we do NOT call the "model
  updating" code path prior to entering the main loop.

  Fixes #775
  Causes #777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant