<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: BearPack Salzy</title>
    <description>The latest articles on Forem by BearPack Salzy (@bearpacksalzy).</description>
    <link>https://forem.com/bearpacksalzy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3829961%2Fd2c11480-8e5e-4040-ba8e-a61be2e0b635.png</url>
      <title>Forem: BearPack Salzy</title>
      <link>https://forem.com/bearpacksalzy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bearpacksalzy"/>
    <language>en</language>
    <item>
      <title>Why I built determinism into a physics engine from day one (and what I learned)</title>
      <dc:creator>BearPack Salzy</dc:creator>
      <pubDate>Tue, 17 Mar 2026 19:30:18 +0000</pubDate>
      <link>https://forem.com/bearpacksalzy/why-i-built-determinism-into-a-physics-engine-from-day-one-and-what-i-learned-4n7a</link>
      <guid>https://forem.com/bearpacksalzy/why-i-built-determinism-into-a-physics-engine-from-day-one-and-what-i-learned-4n7a</guid>
      <description>&lt;p&gt;Most physics engines treat determinism as an optional feature. I wanted to build one where it was the constraint everything else was designed around.&lt;br&gt;
The core problem&lt;br&gt;
Floating point math isn't deterministic by default across compilers, platforms, or even optimization levels. For lockstep multiplayer or replay verification, that's a dealbreaker.&lt;br&gt;
What bitwise determinism actually requires&lt;br&gt;
Getting identical results across runs on the same binary means controlling three things:&lt;/p&gt;

&lt;p&gt;FP evaluation mode — MSVC needs /fp:precise, GCC/Clang need -ffp-contract=off&lt;br&gt;
Memory allocation order — any non-deterministic allocator breaks replay&lt;br&gt;
Execution order — multithreading requires a deterministic parallel mode&lt;/p&gt;

&lt;p&gt;UPE enforces all three. State is CRC64-hashed every frame. Proof logs are generated as part of CI. If the hash drifts, the build fails.&lt;br&gt;
What this unlocks&lt;br&gt;
Once you have a deterministic sim, rollback networking becomes dramatically simpler — you're not reconciling floating point divergence, you're just rewinding and replaying authoritative inputs. Time-travel debugging also becomes trivial: snapshot state at frame N, replay from there, get identical results every time.&lt;br&gt;
What's in the engine&lt;br&gt;
Beyond the determinism core, UPE covers rigid body (6DOF), XPBD cloth and rope, SPH fluids, fracture mechanics, N-body orbitals, and more. Zero dependencies, pure C++20, clean C API surface. CI-verified across Windows, Linux, and macOS.&lt;br&gt;
The source is for sale&lt;br&gt;
I'm selling the full source as a per-seat purchase — one payment, unlimited commercial use, no subscriptions or royalties. Aimed at engineers who want a physics foundation they fully own.&lt;br&gt;
Full details and purchase: &lt;a href="https://bearpackonline.gumroad.com/l/szlvvo" rel="noopener noreferrer"&gt;https://bearpackonline.gumroad.com/l/szlvvo&lt;/a&gt;&lt;br&gt;
Happy to go deeper on any of the determinism implementation in the comments.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>gamedev</category>
      <category>networking</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
