Closed diazrenata closed 1 year ago
@jidec @ajrominger I am actually getting this error pretty frequently and I think it would be good to look into where it's coming from. Would one of you like to do that, or would you like me to do some digging?
yes, definitely would be good to figure this out! a few questions to help diagnose:
does the error happen with those same parameter values, but when you only make a list of length 1, e.g. like this:
params1 <- untbParams(individuals_local = 100, individuals_meta = 1000,
species_meta = 50,
speciation = 0.2,
dispersal_prob = 0.1, init_type = 'oceanic_island',
niter = 10000, niterTimestep = 100)
plist <- list(a= params1)
e <- roleExperiment(plist)
r <- runRole(e)
Does the error happen when you pass those same params to roleModel
instead of roleExperiment
?
If the errors don't happen in those cases that would be wonderful, cause it means the bug is somewhere outside the core loop, and rather somewhere in the setup/execution of the multi-model experiement.
But if the error happens everywhere, it's probably in the main loop.
That will be a bug fix for @jidec for sure! (though I can help starting on April 10)
Excellent questions! In response:
In short, it occurs in all of the cases (a roleExperiment with a params list of only one model, and running on a roleModel instead of a roleExperiment).
It also seems to be idiosyncratic even regarding seed. I can run the exact code in the first post in a clean R environment and sometimes get it and sometimes not.
Reminds me of an old quote from the quote wall: "Stochasticity! That's the Devil's middle name."
If I had to guess it's an in-loop augmentation bug - I will try to replicate and turn on loop print statements to try to figure out where this is happening - more soon!
It was an in-loop augmentation bug where some of the phylo objects weren't getting buffered, so when the speciation rate is high (0.2 in Renata's params) you can get index out of range. I pushed a fix for the one that Renata was encountering, but I found another one that happens much more infrequently (once every 300-400 models?) and have yet to fix, so I will leave this issue open.
fixed the known rare augmentation bug #d668db8
On my machine, this throws an Index out of Bounds error. I think it's seed (and maybe computer? IDK if it's in the loop 👀) dependent. Just documenting it here 😄