orbitersim / orbiter

Open-source repository of Orbiter Space Flight Simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Physics Instability Caused by 32 bit DLLs

n7275 opened this issue · comments

This issue is most noticeable when taking off from Mars in some of the default Delta Glider or Shuttle A scenarios. Reference: Piraxus/OrbiterSkyboltClient#8

I have noted similar issues randomly taking off from KSC, where the earth appears to slowly fall away from the vessel. Occasionally, semi-major axis will change as though there is a force being applied when no thrust is active.

Video: https://youtu.be/B3S6ZECeomk

I am not sure what the cause could be here, and I don't want draw the wrong conclusion.

Observations:
-Later MJDs seem to be better (or it might be a coincidence in what I observed).
-The "jumping" effect seems to be present only on Mars
-Sometimes it appears as though a phantom force is being applied to the vessel or planet (apparent acceleration).
-Reloading a scenario in Mars orbit, sometimes results in a drastically different Orbit.

Anything I can help test to make it more clear what the root cause is, let me know.

image

a (and atot) become NaN

a = grav[i]->Mass() / gpos->dist2 (grav[i]->GPos());

This seems to be caused by gpos->dist2 being NaN

@mschweiger,

Are you able to replicate this?

You could try doing a 32-bit build. Some of the Ephemeris modules won't work in x64 including Phobos which seems to be spiraling towards center of Mars. Maybe that will feed NaN's to the system.

I can confirm, this issue does not occur in 32 bit builds.

Are most developers targeting x86 at the moment in their builds?

Is there a reason why not every Ephemeris module is x64 ?
Here's a list (created with sysinternals sigcheck)

Path Machine Type
Modules\Celbody\Ariel.dll 32-bit
Modules\Celbody\Callisto.dll 64-bit
Modules\Celbody\Deimos.dll 32-bit
Modules\Celbody\Dione.dll 64-bit
Modules\Celbody\Earth.dll 64-bit
Modules\Celbody\Enceladus.dll 64-bit
Modules\Celbody\Europa.dll 64-bit
Modules\Celbody\Ganymede.dll 64-bit
Modules\Celbody\Hyperion.dll 64-bit
Modules\Celbody\Iapetus.dll 64-bit
Modules\Celbody\Io.dll 64-bit
Modules\Celbody\Jupiter.dll 64-bit
Modules\Celbody\Mars.dll 64-bit
Modules\Celbody\Mercury.dll 64-bit
Modules\Celbody\Mimas.dll 64-bit
Modules\Celbody\Miranda.dll 32-bit
Modules\Celbody\Moon.dll 64-bit
Modules\Celbody\Neptune.dll 64-bit
Modules\Celbody\Oberon.dll 32-bit
Modules\Celbody\Phobos.dll 32-bit
Modules\Celbody\Rhea.dll 64-bit
Modules\Celbody\Saturn.dll 64-bit
Modules\Celbody\Sun.dll 64-bit
Modules\Celbody\Tethys.dll 64-bit
Modules\Celbody\Titan.dll 64-bit
Modules\Celbody\Titania.dll 32-bit
Modules\Celbody\Triton.dll 32-bit
Modules\Celbody\Umbriel.dll 32-bit
Modules\Celbody\Uranus.dll 64-bit
Modules\Celbody\Venus.dll 64-bit

result.csv

Because not every module gets built: https://github.com/orbitersim/orbiter/tree/0326e4d077c5a4f880ae821e2d0c7d82dc10469c/Src/Celbody/Deimos

I don't believe we have the source code for these DLLs. They will need to be rewritten so that can be built during the x64 build process.

as far as I understand it

Thanks for the info! I found out myself after posting the list (oops).
So we have to wait until Martin (?!) can provide some source code for the 8 DLLs.

We don't have to wait, but someone will need to write them. I don't think for most of these, a simple cfg file would work. Would need ephemerides and a celbody module.

Not sure I have the time right now to be able to volunteer but it is very tempting...