bepuphysics2
bepuphysics2 copied to clipboard
Unity & Deterministic
Yo,
I would like to thank you for this incredible project, it is very promising!
I believe that a great search for the library, can be for use within Unity, in search of determinism with a specific performance. Unfortunately, Bepu is not currently deterministic, no script says there will be a possibility, but is there any ETA to start development?
Currently it does not seem to work completely within Unity, but there is still considerable performance, there is a project available for testing:
https://github.com/AntoineCharton/Bepuphysics-Unity
Cheers.
It is locally deterministic when you set the Simulation.Deterministic flag to true (same initial states will result in the same outputs when run on the same or equivalent machine), but if you mean cross platform determinism, that's a big step further.
There are two main paths to cross platform determinism:
- Fixed point reimplementation of all math. Given that the majority of math is heavily vectorized, swapping it over to fixed point while retaining anything close to reasonable performance would be a pretty massive undertaking.
- Target a sufficiently constrained set of platforms such that you could guarantee bitwise identical output on all used operations. This may implicitly take a dependency on specific runtime versions, since changing optimizations could result in numerical differences. I have not done a deep dive to see how many potential sources of divergence there are, but a good assumption is "a lot".
Given the scale of the involved effort and the relatively low expected value, I have no plans to implement cross platform determinism any time soon, if at all, unless something magical happens and I figure out a low effort path.