GithubHelp home page GithubHelp logo

Comments (5)

Kimbatt avatar Kimbatt commented on May 20, 2024 2

Exactly, DOTS physics is only deterministic on the same machine, so it's not guaranteed that the physics simulation will be the same on PC, Android, WebGL, etc.
This project guarantees that the physics simulation will run exactly the same on every single platform.
See this reddit post for details.

from unity-deterministic-physics.

tigershan1130 avatar tigershan1130 commented on May 20, 2024

from my test, it seems to be deterministic on different platforms. I mean at least all 64-bit architecture would work, why would it be different when they are all using burst compiler. Is this proven? The Reddit post also doesn't explain on this matter.

from unity-deterministic-physics.

Kimbatt avatar Kimbatt commented on May 20, 2024

from my test, it seems to be deterministic on different platforms.

The video in the reddit post shows that they are different on pc, webgl, and android. It's possible that it's deterministic on most of the platforms, but the goal of this project is to be deterministic on all platforms, no matter what hardware is used.

why would it be different when they are all using burst compiler

Different platforms might implement low-level floating point operations differently.
For example, Floating point rounding mode may be different on different platforms. This means that a multiplication/division might be rounded differently on different machines, which breaks determinism. In the burst compiler, there is an option for this (FloatMode.Deterministic), but it's still not implemented.
Even if the burst compiler generated deterministic floating point operations, the mathematical functions (e.g. sqrt, trigonometry) would still not be deterministic, because those are usually implemented as hardware instructions or system calls. Also, they are usually implemented as an approximation (for performance reasons), which is good enough in 99.9% of the time (but not when trying to be deterministic).

from unity-deterministic-physics.

tigershan1130 avatar tigershan1130 commented on May 20, 2024

from my test, it seems to be deterministic on different platforms.

The video in the reddit post shows that they are different on pc, webgl, and android. It's possible that it's deterministic on most of the platforms, but the goal of this project is to be deterministic on all platforms, no matter what hardware is used.

why would it be different when they are all using burst compiler

Different platforms might implement low-level floating point operations differently. For example, Floating point rounding mode may be different on different platforms. This means that a multiplication/division might be rounded differently on different machines, which breaks determinism. In the burst compiler, there is an option for this (FloatMode.Deterministic), but it's still not implemented. Even if the burst compiler generated deterministic floating point operations, the mathematical functions (e.g. sqrt, trigonometry) would still not be deterministic, because those are usually implemented as hardware instructions or system calls. Also, they are usually implemented as an approximation (for performance reasons), which is good enough in 99.9% of the time (but not when trying to be deterministic).

That's totally understandable, I used math.sin operation over ECS testing, as long as burst compiler use the same IL2CPP on either X86 or ARM architecture, the result seems to be deterministic for me(this sorta opposite of what you said). The editor returns different results as it skips IL2CPP compiler and uses mono. (even on the same platform I get different results).

from unity-deterministic-physics.

tigershan1130 avatar tigershan1130 commented on May 20, 2024

Hi, Is it possible to release the auto generation unity code tool?

from unity-deterministic-physics.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.