Mindwerks / worldengine

World generator using simulation of plates, rain shadow, erosion, etc.
MIT License
988 stars 129 forks source link

Negative Delta #122

Open esampson opened 9 years ago

esampson commented 9 years ago

This is the very first time I've ever seen this error:

$ python worldengine -s 24483
Unable to load GDAL support, no heightmap export possible.
Worldengine - a world generator (v. 0.18.0)
-----------------------
 operation         : world generation
 seed                 : 24483
 name                 : seed_24483
 width                : 512
 height               : 512
 number of plates     : 10
 world format         : pickle
 black and white maps : False
 step                 : full
 greyscale heightmap  : False
 rivers map           : False

starting (it could take a few minutes) ...
Problem during update: (Mass::incMass) a negative delta is not allowed: -0.1421, resulting mass: -0.0284592
Segmentation fault (core dumped)
(venv)
psi29a commented 9 years ago

Nice! This needs to go upstream to plate-tectonics, possibly related to this: https://github.com/Mindwerks/plate-tectonics/issues/30

ftomassetti commented 9 years ago

Yes, unfortunately it could happen that mass becomes negative because of rounding in floating point operations. However -0.14 seems a lot.

tcld commented 8 years ago

I have had this happen, too. Also by quite a large margin - I didn't store the seed, though I think that I just reused the same seed and the program succeeded. (But I may be wrong...I will keep my eyes open next time.)

An error of this magnitude would be very unlikely to happen out of floating-point noise. This and the strange rivers (https://github.com/Mindwerks/worldengine/issues/119) I will probably look at next.

cycloverid commented 8 years ago

It's 100% happening because of the float round-off error accumulation. I'm not sure what convinced you that such an event was unlikely.

tcld commented 8 years ago

I didn't see this could be caused by platec. Here is another one:

 operation         : world generation
 seed                 : 250375195
 width                : 256
 height               : 256
 number of plates     : 11

Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
Assertion `0` failed in cpp_src/mass.cpp line 81 Message: A negative mass is not allowed
ftomassetti commented 8 years ago

Distance to sun: 0.9607221912973465, ecliptic offset: -0.037417404120896766 ? Are you building something extremely cool :D ?

tcld commented 8 years ago

I edited that so nobody would see it. :P Just added another bit of randomness to the temperature map and had forgotten that there was a print() letting me know which values were chosen. If I can separate it from the numpy-stuff, I will create another pull-request soon to discuss this a bit.