One deterministic universe simulation, all scales, one state.
Ontos simulates reality as a single state store evolving under scale-conditional physics: every region runs the finest dynamics its budget deserves, and totals (mass, energy, momentum) are conserved across every level boundary. Zoom in, a region promotes; zoom out, it demotes. There are no separate sims and no loading screens between scales.
simval ── verifies ──► ONTO ── state stream ──► light-system (viewer: see + hear)
(external oracle) (this repo) (draws frames, plays audio)
- simval (separate repo) is the external oracle. It replays Ontos's record streams against independently written references. It never learns Ontos exists; Ontos owns its adapter, dependency is one-way.
- light-system (separate repo) is the viewer app: camera samples the radiance field, listener samples the pressure field. Both are consumers of the stream; the sim never knows who is watching.
Phase 0 and Phase 1 closed; Phase 2 (gravity epoch) core mechanics landed, all simval-verified:
- Deterministic spine, promote/demote with population conservation, FNV state hashes, normative stream spec (version 1 = life, version 2 = gravity).
- Gravity epoch: leapfrog with exact-pair momentum ledger, Plummer-softened 2D gravity, Chebyshev degree-8 ephemeris windows for demoted regions (W=32, least-squares fits in the deterministic op closure +,-,*,/,sqrt), automatic window re-fits, one-sided fine<-coarse forces with bounded ledger drift.
- Verified by three independent implementations of
docs/STREAM_SPEC.md: the Rust sim, simval's Python reference (python3 -m simval.ontos), and a C++ spike (light-systemtools/ontos/ontos_stream_dump.cpp). All three agree bit-for-bit on both versions, including windowed runs. - CI proves bit-identical replay across macOS arm64 and Linux x86_64 against committed golden-stream corpora (life + gravity), and cross-verifies freshly generated streams with the simval oracle on every push.
Phase 2 closed 2026-09-07 (REBOUND anchor < 1e-4; zoom policy verified
in-stream). Phase 3 viewer v1: light-system ontos_view plays back
gravity streams. Phase 4 v1 (section 19): collapse-to-monopole with
deterministic reconstruction on expansion — bit-verified by three
implementations, error-bounded by simval. Phase 4 v2 (section 20,
2026-09-07): multipole reconstruction — every collapse additionally
freezes the dipole (mass-weighted position sums) and quadrupole (second
central moments) in a RegionMultipole record; expansion synthesizes
positions that close on the dipole exactly by residual and match the
quadrupole to rounding via a deterministic Cholesky whitening/coloring
transform of the frozen jitter (measured: dipole 0.0 relative,
quadrupole ~1e-15; synthesized-set energy delta improves 2-20x over
section 19; post-expansion deviation stays region-scale, < 40 measured,
tolerance 64). Section 19 streams (no multipole record) still verify.
Sections 21-22 (2026-09-07): contact physics + modal audio — impulsive,
perfectly inelastic, frictionless body-body contact between fine bodies
(single pinned pass per tick, no solver iteration; momentum ledger
conserved by axiom), Contact records in the stream, and audio as a pure
function of the stream (section 22: contact-excited damped resonators,
65536 Hz mono PCM16 WAV, FNV audio hash) — bit-verified by three
implementations including the synthesized samples. Section 23
(2026-09-08): radial-shape synthesis — every collapse in radial mode
additionally freezes its binding (the exact internal potential
statistic, RegionRadial record); expansion scales the section 20
displacements by a bisection-solved radial factor that closes the
synthesized internal potential on the record, plus a closed-form
spread scale that closes the synthesized kinetic energy on the recorded
total, driving the synthesized-set energy delta from O(1) to rounding
(measured 0.14-0.57 relative down to ~1e-14; dipole stays exact,
quadrupole reported and bounded <= 4.0 instead of exact — the honest
cost of pinning pair distances). Sections 25-26 (2026-09-08): per-shell
radial synthesis + collapse-on-coarse composition — collapses in shells
mode (--shells) additionally freeze each rank shell's intra-shell
binding (RegionShells record, tag 13: the section 23 total plus b0..b3
over S = min(4, n/3) equal-count radial groups), and expansion solves
one global scale closing the total plus one pinned bisection per shell
closing its binding (per-shell exact ~1e-14, dipole exact, energy
exact when the sigma target is reachable; total binding retained
<= 1.5, quadrupole <= 11.8, both reported and bounded — the honest
cost of pinning radial structure); collapsing a coarse region has
composed semantics (section 26): the region's window terminates
(out-of-box bodies materialize to unmanaged fine), membership follows
the demote rule on evaluated states (foreign windows are absorbed,
fits discarded), totals freeze from the materialized states, and no
window state thaws — the ledger keeps its section 17 bound across the
seam (measured pos 2.0e-4, mom 1.0e-3, energy 3.7e-5 on the
g_coarse_collapse corpus). Section 24 (2026-09-08): contact
extensions — restitution and Coulomb-clamped friction (ContactParams
record, tag 12), one-sided static impulses against frozen contactants
(ephemeris-coarse bodies, collapsed-region monopoles as disks of mass M
at com with the section 21 radius law, walls at the managed extent
[x=0, x=128, y=0, y=128]) named by pseudo body ids in Contact records;
fine-fine impulses still conserve the ledger exactly by axiom, static
impulses book it exactly like fc kicks (measured: all-fine e/friction
runs keep the ledger bit-exact; wall/monopole runs track the applied
impulses). Streams without the new records verify as sections 13-22.
See docs/DESIGN.md.
- Strict IEEE floats, no fast-math reassociation
- Fixed dt, fixed tick order, no wall-clock reads inside the tick
- All randomness from explicit seeded generators, never ambient state
- Two runs from the same seed produce bit-identical trajectories
cargo test
Golden-stream regression corpus lives in core/tests/golden/; the CLI is
cargo run --bin ontos -- --ticks N --seed S [--demote RX RY] [--promote RX RY] [--out FILE] (life) or --mode gravity [--bodies N] [--demote-at T RX RY] [--promote-at T RX RY] [--collapse-at T RX RY] [--expand-at T RX RY] [--observer OFFSET] [--contacts] [--radial] [--shells] [--restitution E] [--friction F] [--walls] [--wav FILE] [--out FILE].