Author Topic: Total freeze up with new speciation feature  (Read 4677 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Total freeze up with new speciation feature
« on: October 02, 2008, 08:09:14 AM »
A couple of times today my sim got permanently frozen, which I guess is the calculation of the speciation autofork getting stuck. It was not in internet mode. Maybe it happens when it tries to make a new species.
The internet is corrupt and controlled by criminally minded people.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Total freeze up with new speciation feature
« Reply #1 on: October 02, 2008, 12:13:50 PM »
How many bots?  How many species?  How long did it freeze?  Was the cycle count on a multiple of 100?  How about a sim?

If your going to file a bug and expect me to do something about it, it would help if you actually gave me enough information to do something about it.

It's almost certainly not frozen forever but on your machine, which I assume isn't the fastest, it might seem that way.  The work to decide if speciation should occur is very cpu intensive and it does block the sim while it is being done.  It is also very sensitive to the size of species.  For the same number of bots, if you have few species with a large number of members, it will take longer than a larger number of species each with fewer members.  On my fairly fast machine, it takes maybe 15 seconds (on a sim of 2000 members) to update the speciation graphs and/or do the work to see if speciation should occur.

In 2.44.1, the schedule for checking if speciation should occur is configurable.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Total freeze up with new speciation feature
« Reply #2 on: October 02, 2008, 01:45:41 PM »
Could you spread the calculation over the full 100 cycles or whatever?  You might miss some bots that get killed or born in the interim, but you won't have it seem to freeze.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Total freeze up with new speciation feature
« Reply #3 on: October 02, 2008, 02:25:32 PM »
Quote from: Numsgil
Could you spread the calculation over the full 100 cycles or whatever?  You might miss some bots that get killed or born in the interim, but you won't have it seem to freeze.

Not easily.  I'm maintaining an ancestor list 500 ancestors long for every extant bot.  The set of extant bots changes as bots die and are born.   I pretty much need the rob array locked while I do this.  

Doing the calculation involves finding the most recent common ancestor between every pair of bots in the species O(n*log(n)), calculating the distances and finding the max(s).    I can optimize the algorithm some.  One idea is do the comparisons using youngest bots first.  This allows me to ignore any extant direct ancestors since their generational distance will be lower.  I can't really do this for mutational distance though.

The biggest thing I think it just not to do it very often.  The auto-fork interval is configurable in the next drop.   There really isn't a need to check very often except for graphing and I'm working on graph-specific update intervals to address that.

Any ideas are of course welcome.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Total freeze up with new speciation feature
« Reply #4 on: October 02, 2008, 02:44:01 PM »
Hmm... maybe make a raw copy of the robarray every X cycles.  Then you could make calculations at leisure.

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
Total freeze up with new speciation feature
« Reply #5 on: October 02, 2008, 08:40:28 PM »
I didn't think it was sim specific, that's why I didn't upload a sim. I feel reluctant flooding the forum with files if not necessary, but here's a screenshot and a sim showing what's happening when opening the various graphs and connecting to internet.
The internet is corrupt and controlled by criminally minded people.

Offline ikke

  • Bot Destroyer
  • ***
  • Posts: 300
    • View Profile
Total freeze up with new speciation feature
« Reply #6 on: October 03, 2008, 02:20:44 AM »
I have switched back to the old version to increase performance. I like the feature, but every 40 sec my sim would freeze for 20 sec. I haven't had time to look at configuring options, but can I turn it on and off?

Offline Commander Keen

  • Bot Builder
  • **
  • Posts: 91
    • View Profile
Total freeze up with new speciation feature
« Reply #7 on: October 03, 2008, 02:30:05 AM »
I think EricL is going to implement that in 2.44.1...

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Total freeze up with new speciation feature
« Reply #8 on: October 03, 2008, 11:03:22 AM »
You should be able to turn it on or off in 2.44.  2.44 should have no perf differences relative to 2.43.1M if this is off.   It should be off by default, but check on the Speciation dialog.  Objects->Species


Another perf optimization I thought of over night is that I don't currently ignore species where there is only a single subspecies.  That is, if you have a non-mutating species (with no virus infections of members) I can ignore speciation for that species since I already know they all have the same genome.  Would help where people run evo sims with non-mutating veggies or in IM mode where some bots mutate and others don't.
« Last Edit: October 03, 2008, 11:00:19 AM by EricL »
Many beers....