Public repo 2026 — present

Planetary Matrix

A headless Earth-scale simulation core, partitioned into shards that do not share memory.

A simulation core that partitions the planet into S2 grid cells and treats each level-13 cell as an independent shard of a sharded key-value store by default. Neighbouring cells are joined only by a graph of boundary ports, so a cell can be evicted from memory while its neighbour keeps running against a proxy horizon. A graphical client is deliberately not part of the simulation: it reads the state of the cell around the player over HTTP and draws it.

Documented example

The project's own gate, run on a clean build (abridged)

./scripts/check.sh
---- build
PASS  build
---- unit and fixture suite
PASS  unit and fixture suite
---- milestone 2 scenario
  PASS  the boundary scan married the two ports
  PASS  the neighbour still receives, and the flow is labelled synthesised
  PASS  the isolation check passes
milestone 2: all checks passed
SKIP  milestone 3 (scripts/serve-check.sh) — needs node, curl and a Chrome
check.sh: all stages passed

What it does

  • S2 cell-id implemented in-tree rather than linked against google/s2geometry, which would pull Abseil and OpenSSL into the build.
  • Cell payloads round-trip through a key-value interface with three backends — an in-memory map, a directory of one file per partition, and a clustered wide-column store over a token ring.
  • Cross-grid utility flow across an evicted cell, proven by a scenario: the boundary scan marries dangling ports, the source is written down and dropped, and the neighbour still receives labelled synthesised flow.
  • Utilities carry their own units through the flow report, and unserved demand is reported rather than absorbed.
  • An offline build gate (scripts/check.sh) that fetches nothing, so it behaves the same with network egress disabled.
  • A browser viewport against the same data layer, served by a second binary over a recorded HTTP contract.

Built with

  • C++
  • CMake
  • Flecs ECS
  • doctest
  • S2 geometry
  • sharded key-value store
  • WebGL

Writing