Revolutionary-Games / Thrive

The main repository for the development of the evolution game Thrive.
https://revolutionarygamesstudio.com/
Other
2.82k stars 500 forks source link

Editor auto-evo prediction (can fail also in general) calculation fails with collection modified error #3006

Open hhyyrylainen opened 2 years ago

hhyyrylainen commented 2 years ago

Got a log from a player with a bunch of errors like:

Background task caused an exception: System.AggregateException: One or more errors occurred. (Collection was modified; enumeration operation may not execute.) ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at MicrobeInternalCalculations.CalculateSpeed (System.Collections.Generic.IEnumerable`1[T] organelles, MembraneType membraneType, System.Single membraneRigidity) [0x000aa] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at MicrobeSpecies.get_BaseSpeed () [0x00006] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at HeterotrophicFoodSource.FitnessScore (Species species, AutoEvo.SimulationCache simulationCache) [0x0002f] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.PopulationSimulation.SimulatePatchStep (AutoEvo.SimulationConfiguration simulationConfiguration, Patch patch, System.Collections.Generic.IEnumerable`1[T] genericSpecies, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00196] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00057] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.FindBestMutation.TryVariant () [0x00066] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at MicrobeInternalCalculations.CalculateSpeed (System.Collections.Generic.IEnumerable`1[T] organelles, MembraneType membraneType, System.Single membraneRigidity) [0x000aa] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at MicrobeSpecies.get_BaseSpeed () [0x00006] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at HeterotrophicFoodSource.FitnessScore (Species species, AutoEvo.SimulationCache simulationCache) [0x0002f] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.PopulationSimulation.SimulatePatchStep (AutoEvo.SimulationConfiguration simulationConfiguration, Patch patch, System.Collections.Generic.IEnumerable`1[T] genericSpecies, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00196] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00057] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.FindBestMutation.TryVariant () [0x00066] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <a4ccd80a610a4c1eac57bb911b092060>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 <---
hhyyrylainen commented 2 years ago

I think this can happen when the auto-evo prediction run doesn't manage to finish before placing another organelle. I made a PR that makes the auto-evo prediction run be cancelled before the species is modified https://github.com/Revolutionary-Games/Thrive/pull/3020 That should make this issue much less likely to appear.

If this still does appear then a proper fix would be to have a list of auto-evo prediction used microbe objects and we would keep track of which are still in use by a run. Then newly started runs would pick a species object that is not currently being used, modify it, and start the run.

hhyyrylainen commented 2 years ago

Bunch more stack traces about this:

Background task caused an exception: System.AggregateException: One or more errors occurred. (Collection was modified; enumeration operation may not execute.) ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at AutoEvo.HeterotrophicFoodSource.FitnessScore (Species species, AutoEvo.SimulationCache simulationCache) [0x00144] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.SimulatePatchStep (AutoEvo.SimulationConfiguration simulationConfiguration, Patch patch, System.Collections.Generic.IEnumerable`1[T] genericSpecies, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x001de] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00057] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMutation.TryVariant () [0x00066] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at AutoEvo.HeterotrophicFoodSource.FitnessScore (Species species, AutoEvo.SimulationCache simulationCache) [0x00144] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.SimulatePatchStep (AutoEvo.SimulationConfiguration simulationConfiguration, Patch patch, System.Collections.Generic.IEnumerable`1[T] genericSpecies, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x001de] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00057] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMutation.TryVariant () [0x00066] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 <---

Background task caused an exception: System.AggregateException: One or more errors occurred. (Collection was modified; enumeration operation may not execute.) ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Linq.Enumerable.Sum[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] selector) [0x00038] in <f207d09b447b44ee87e39069887ea94e>:0 
  at MicrobeSpecies.get_BaseHexSize () [0x0000b] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.HeterotrophicFoodSource..ctor (Patch patch, MicrobeSpecies prey) [0x00029] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.SimulatePatchStep (AutoEvo.SimulationConfiguration simulationConfiguration, Patch patch, System.Collections.Generic.IEnumerable`1[T] genericSpecies, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00169] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00057] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMigration.TryVariant () [0x0006d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Collections.Generic.List`1+Enumerator

sadly without line numbers as well...

hhyyrylainen commented 2 years ago

Here's a log excerpt showing when it happens:

MicrobeEditor: applying changes to edited Species
MicrobeEditorReportComponent: applying changes of component
MicrobeEditorPatchMap: applying changes of component
CellEditorComponent: applying changes of component
Edited species name is now Primum Masterum
MicrobeEditor: updated organelles for species: Primum Masterum
Applying patch (Ituronese — Естуар) settings
Number of clouds in this patch = 8
hydrogensulfide spawn density is 0. It won't spawn
oxygen spawn density is 0. It won't spawn
carbondioxide spawn density is 0. It won't spawn
nitrogen spawn density is 0. It won't spawn
sunlight spawn density is 0. It won't spawn
Number of chunks in this patch = 3
Number of species in this patch = 6
Jukebox now playing from: MicrobeStage
Jukebox: starting track: res://assets/sounds/microbe-theme-5.ogg position: 27,73624
Jukebox: starting track: res://assets/sounds/soundeffects/microbe-ambience.ogg position: 27,6898
Move to editor pressed
Starting microbe editor with: 10 organelles in the microbe
Editor going to freebuild mode because player has activated freebuild
Jukebox now playing from: MicrobeEditor
Jukebox: starting track: res://assets/sounds/microbe-editor-theme-2.ogg position: 143,8883
Background task caused an exception: System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object) ---> System.NullReferenceException: Object reference not set to an instance of an object
  at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0001c] in <f207d09b447b44ee87e39069887ea94e>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00045] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMigration.TryVariant () [0x0006d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object
  at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0001c] in <f207d09b447b44ee87e39069887ea94e>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00045] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMigration.TryVariant () [0x0006d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 <---

Auto-evo failed with an exception: System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object) ---> System.NullReferenceException: Object reference not set to an instance of an object
  at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0001c] in <f207d09b447b44ee87e39069887ea94e>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00045] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMigration.TryVariant () [0x0006d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at TaskExecutor.RunTasks (System.Collections.Generic.IEnumerable`1[T] tasks, System.Boolean runExtraTasksOnCallingThread) [0x0009e] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.Step () [0x0011c] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.Run () [0x00018] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object
  at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0001c] in <f207d09b447b44ee87e39069887ea94e>:0 
  at AutoEvo.PopulationSimulation.RunSimulationStep (AutoEvo.SimulationConfiguration parameters, System.Collections.Generic.List`1[T] species, System.Collections.Generic.IEnumerable`1[T] patchesToSimulate, System.Random random, AutoEvo.SimulationCache cache, AutoEvoConfiguration autoEvoConfiguration) [0x00045] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.PopulationSimulation.Simulate (AutoEvo.SimulationConfiguration parameters) [0x00080] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.FindBestMigration.TryVariant () [0x0006d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvo.VariantTryingStep.RunStep (AutoEvo.RunResults results) [0x0002d] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun.RunSingleStepToCompletion (AutoEvo.IRunStep step) [0x00008] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at AutoEvoRun+<>c__DisplayClass55_0.<Step>b__1 () [0x00000] in <ad00bee9547f4acaa40fe9a5efa407f9>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x0000f] in <1400ea11d6fd49d4939be686a9549fb4>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <1400ea11d6fd49d4939be686a9549fb4>:0 <---

Elapsing time on editor entry
TimedWorldOperations: running effects. elapsed: 1 total passed: 800000000
Applying auto-evo results. Auto-evo run took: 00:00:07.3066743
Extinct species Primum Masterum (1) had an external effect, ignoring the effect

seems like it may be related to having the option to run auto-evo during gameplay turned off as it seems the error is triggered while the editor is started to be entered. Perhaps we could "fix" this by causing the auto-evo run to start a tiny bit earlier when moving to the editor? Perhaps when fading out the stage?

hhyyrylainen commented 2 years ago

So this seems to also happen with the normal auto-evo, so this isn't entirely related to just the auto-evo prediction. I didn't realize when making my last comment so I'm pointing this out now.

RacerBG commented 2 years ago

Here is a save file which I created today where I get constant Auto-Evo errors:

Pliceae_Irritatpiun.zip

hhyyrylainen commented 2 years ago

I can't get any auto-evo errors to happen with that save. The save needs to be done before the auto-evo error appears. Once the error has appeared making a save just saves the fact that an error happened, it doesn't help any in debugging this issue.

hhyyrylainen commented 2 years ago

Starting auto-evo while fading into the editor as mitigation for this issue causes findTooManyChunksTask.Wait(); to get stuck until auto-evo is complete if there's just one background thread. So the previous mitigation for this cannot be used (unless we increase the min background thread count to 2 always).