DEV Community

Cover image for I built a physics engine where gravity is just a floating-point budget error
Christopher Hildebrand
Christopher Hildebrand

Posted on

I built a physics engine where gravity is just a floating-point budget error

The Bug: Modern physics crashes when you divide by zero (Black Holes).
The Fix: A cellular automata engine that runs on a "budget" instead of linear addition.


Hi Devs!

I’ve spent the last few years working on a massive open-source project called Logos of Aether. It started as a theoretical physics manuscript (yes, I wrote 500+ pages of axioms), but I realized that to prove it works, I need to stop writing and start coding.

I am looking for contributors interested in Cellular Automata, Python (NumPy/JAX), or Simulation Logic to help me build the reference implementation.

The Core Concept: "The Universe Hates Zero"

In standard game physics (and real physics), if you add enough energy to a single point, you eventually hit infinity. In a game engine, this crashes the server. In the universe, it creates a singularity.

I wanted to see if I could build a system where "crashes" are mathematically impossible.

The "Patch": Plenum Addition

Instead of standard addition (1 + 1 = 2), my engine uses a saturating formula called Plenum Addition (⊕). It works like velocity addition in Special Relativity, but for information density.

Here is the logic in Python:

import numpy as np

def plenum_add(x, y, limit=np.pi):
    """
    Adds two distinction values (x, y) but saturates
    at the limit (pi) to prevent singularities.
    """
    numerator = x + y
    denominator = 1 + (x * y) / (limit ** 2)
    return numerator / denominator

# Even if you add huge numbers, you never break the grid:
print(plenum_add(1000, 1000)) 
# Output: 3.14159... (Approaches Pi, never exceeds it)
Enter fullscreen mode Exit fullscreen mode

The Project: "The Rattle"

We are building a simulation called The Rattle.

  • The Grid: A 1D or 2D cellular automaton.
  • The Agents: Monads (cells) that trade "distinction" with their neighbors using the formula above.
  • The Goal: To show that "Matter" (clumps of high distinction) and "Gravity" (attraction between clumps) emerge naturally from these rules, without hard-coding them.

Why I need help

I have the math derived (I even derived the Electron Mass as a geometric resonance of this grid), but I am moving from "Paper" to "Engine."

I need help with:

  1. Optimization: Making the grid update step fast using JAX or CUDA.
  2. Visualization: Rendering the "density" of the grid in real-time.
  3. Architecture: Setting up a clean Agent-Based Model (ABM) structure.

Links

If you are tired of building CRUD apps and want to try simulating a universe where DivideByZero is illegal, come check out the repo.

Happy coding!

Top comments (0)