Determinism

Determinism

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

Post Reply
Heartman
Posts: 3
Joined: 09 Feb 2023, 14:52

Determinism

Post by Heartman »

Hi,

I am wondering how SpringRTS maintains determinism while it uses Streflop? Because Streflop mentions:

"If you want to use the hardware FPU in a controlled environment that can retain some reproducibility, then use this library."

So it seems it is not 100% deterministic, does this mean that things can get desynced during a regular network game for example?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Determinism

Post by Beherith »

In practice is has worked quite well for us in the past 15 years.
Heartman
Posts: 3
Joined: 09 Feb 2023, 14:52

Re: Determinism

Post by Heartman »

That's great!

I read on a blog that it was quite hard to implement was that in getting streflop to produce the desired results or in getting the Spring code to properly use it?
TarnishedKnight
Posts: 9
Joined: 13 Jun 2022, 17:39

Re: Determinism

Post by TarnishedKnight »

Determinism is a larger subject than just FPU-issues. For BAR we're using SSE in preference to x87, which tends to have fewer configuration conflicts. The engine regularly checks that the hardware FPU settings are correct and will flag when they are not. We haven't seen any such warnings being raised.

I recall claims from some developers in the past that you cannot achieve a deterministic simulation using hardware floating-point math, but then they seemed to be oblivious to Spring (and Supreme Commander.) They would likely claim you can't multi-thread either, but we have done that as well and it is working well for us.
Heartman
Posts: 3
Joined: 09 Feb 2023, 14:52

Re: Determinism

Post by Heartman »

Yeah that's what made me wonder, nice that it worked out!
Post Reply

Return to “General Discussion”