Experimental deterministic artificial-life simulator in which autonomous mathematical organisms consume binary data as FOOD, maintain internal state, grow structural bodies, metabolize resources, reproduce, die, and interact with a sandbox environment.
Experimental research project. It is not a biological model and not a production data-processing system.
Compost is a sandbox for deterministic artificial-life and complex-systems experiments. It runs autonomous entities over binary input and records the resulting world state and telemetry.
The project explores whether relatively simple deterministic local rules for food, energy, metabolism, growth, maintenance, territory, reproduction, death, and resource competition can generate interesting global or emergent behaviour without a central controller. It does not claim to prove biological realism, life, or evolutionary theory.
The terms organism, food, metabolism, body, death, reproduction, and territory are simulator abstractions. They describe state and rules in this model; they do not imply biological realism.
- FOOD is binary input prepared for consumption in an experiment-owned world.
- Energy and metabolism describe the simulator's resource accounting.
- Bodies and territory are structural and spatial bookkeeping within the sandbox.
- Reproduction and death are deterministic lifecycle transitions.
Input files placed in an inbox are copied into experiment-owned storage and partitioned into FOOD. The runtime advances organisms using local rules, persists world state, and writes observational telemetry. The observer reports state; it does not make biological decisions.
Python 3.11 or newer is required.
python -m pip install .The installed console command is compost.
Create an inbox and place one or more binary files in it:
sandbox/
inbox/
example.bin
Then start the autonomous runtime:
python -m mathematical_organism run sandboxThe runtime creates the remaining directories itself:
sandbox/
inbox/ user-provided binary input
world/ prepared FOOD and runtime state
telemetry/ read-only snapshots
Use a bounded observation run when needed:
python -m mathematical_organism run sandbox --workers 4 --max-seconds 30Use copies of files you are willing to supply to an experiment.
Inspect the most recent snapshot without changing the world:
python -m mathematical_organism status sandbox
python -m mathematical_organism status sandbox --organismsThe observer reports FOOD accounting, population, body mass and bite sizes, organism reserve/debt/gut state, territories, corpses, and runtime throughput. Telemetry is observational and may be eventually consistent while workers run.
src/mathematical_organism/ simulator package
native/ C17 deterministic core and CTest suite
tests/ test suite and fixtures
tools/ experiment and diagnostic scripts
examples/ small usage example
experiments/ captured, versioned research runs
docs/native/ migration boundary, determinism, and audit reports
The Python implementation remains the behavioral reference oracle. The
versioned native C ABI is opt-in through the Python native and
native-population backends; it currently covers bounded deterministic core
checkpoints and explicit environment inputs. Filesystem FOOD discovery,
world/corpse orchestration, telemetry, and the existing parallel runtime
remain Python responsibilities while native parity is validated. The sandbox
can optionally emit replayable NativeAction traces for the validated
external-gut, queued-gut, corpse-energy, and bounded lifecycle prefixes; this
does not imply complete live_step replacement. Python validation code can
drive those traces through the reusable NativeSandboxReplay boundary while
retaining the Python sandbox as oracle and filesystem owner.
To run the bounded deterministic checkpoint explicitly through the native library, provide the library path:
python -m mathematical_organism checkpoint ABCD --backend native \
--library path/to/libcompost_native.so --steps 1 --jsonThe serial public sandbox can also opt into the validated native replay boundary. It remains single-worker and keeps filesystem discovery and telemetry in Python:
python -m mathematical_organism run SANDBOX --backend native --workers 1 \
--library path/to/libcompost_native.soThe default checkpoint backend remains python. An explicitly requested
native backend reports library, ABI, argument, and execution failures; it does
not silently fall back to the Python oracle. Use the Python backend for the
reference behavior and the native backend for validated differential
experiments.
Captured 1m runs live under experiments/1m. They are
intentional reproducibility artifacts, not build output. See
experiments/README.md for the historical labels and
available context.
Run the complete suite with:
python -m pytestThis remains a research project. Performance scaling and population dynamics
are active research questions. Results are specific to the implemented rules,
parameters, and captured inputs; no optimality, security, or scientific proof
is claimed. The native migration is not yet a complete replacement for the
Python sandbox lifecycle; see docs/native/FINAL_NATIVE_AUDIT.md
for the current release-readiness verdict.
Version 0.1.0 is experimental and intended for artificial-life and
complex-systems exploration rather than production use.
This project is released under the MIT License.