Abiogenesis
Self-replicating programs emerge spontaneously from random byte soups through symbiogenesis.
No fitness function. No design. Just random bytes, a 7-instruction interpreter, and time.
Install
pip install abiogenesis
Quickstart
from abiogenesis import Soup, compression_ratio
soup = Soup(n_tapes=512, tape_len=64, max_steps=10_000, seed=42)
for step in range(100_000):
soup.interact()
if (step + 1) % 25_000 == 0:
cr = compression_ratio(soup.get_state())
print(f"step {step + 1:>7,} compression={cr:.4f}")
step 25,000 compression=0.4892
step 50,000 compression=0.3575
step 75,000 compression=0.3044
step 100,000 compression=0.2872
Compression drops below 1.0 as structure self-organizes from noise.
How It Works
- Random initialization — 1024 tapes of 64 random bytes each
- Pairwise interaction — pick two tapes, concatenate into 128 bytes, execute as embodied BrainFuck, split back
- Symbiogenesis — two partial programs fuse into working programs (the K-term)
- Selection pressure — tapes that execute copy instructions replicate; others drift
- Mutation (optional) — random bit-flips sustain ecology and prevent crystallization
The interpreter uses 7 instructions (> < + - . [ ]) on a unified code/data tape. The . instruction copies tape[DP] to tape[WP], providing the replication primitive. No fitness function — replication emerges from the physics.
Results
Phase Diagram
Mutation rate is the sole control parameter. Four regimes discovered across 10M-interaction runs:
| Regime | Mutation Rate | Behavior |
|---|---|---|
| Crystal | 0 | Single replicator dominates, entropy collapses to 0.018 |
| Soft crystal | 1e-5 | Slow crystallization, low diversity |
| Ecology | 1e-3 | Sustained diversity, multiple replicator species coexist |
| Dissolution | 1e-1 | Too much noise, no structure persists (compression ~0.50) |
Replicator Emergence
Three types of self-replicators emerge and are classified automatically:
| Type | Condition | Meaning |
|---|---|---|
| Inanimate | executed ∩ written = ∅ | Passive — copied but not self-copying |
| Viral | executed ∩ written ≠ ∅, written ⊄ executed | Parasitic — partially self-copying |
| Cellular | written ⊆ executed | Autopoietic — fully self-replicating |
Symbiogenesis Depth
Complexity builds on itself — each interaction layer adds depth to the lineage tree:
API
| Class / Function | Description |
|---|---|
Soup(n_tapes, tape_len, max_steps, seed, mutation_rate) |
Primordial soup of byte tapes |
Experiment(config) |
Full experiment runner with checkpointing |
SwarmExperiment(config) |
Agent-oriented experiment with identity and provenance |
Agent(tape, name) |
Named tape with UUID, lineage, interaction count |
KTermFusion(max_steps) |
Concatenate-execute-split fusion engine |
CrystallizationProbe(window_size, critical_threshold) |
Diversity monitor — detects monoculture onset |
DiversityProbe(window_size, critical_threshold) |
Swarm-level diversity wrapper |
compression_ratio(soup) |
zlib compression ratio (lower = more structure) |
shannon_entropy(soup) |
Shannon entropy over tape distribution |
find_replicators(soup, min_length, min_count) |
Detect and classify self-replicating subsequences |
classify_replicator(sequence) |
Classify as inanimate, viral, or cellular |
execute(tape, max_steps) |
Run the embodied BF interpreter |
execute_traced(tape, max_steps) |
Execute with position tracking |
Examples
python examples/quickstart.py # Basic soup run
python examples/replicator_detection.py # Find and classify replicators
python examples/swarm_with_probes.py # Agent swarm with provenance
Development
git clone https://github.com/dopexthrone/abiogenesis.git
cd abiogenesis
pip install -e ".[dev]"
pytest tests/ # 92 tests
Citation
If you use this in research, please cite:
@software{roze2026abiogenesis,
author = {Roze, Alex},
title = {Abiogenesis: Self-Replicating Programs from Random Byte Soups},
year = {2026},
url = {https://github.com/dopexthrone/abiogenesis}
}
License
MIT — see LICENSE.
Metadata
Release files for abiogenesis 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| abiogenesis-0.1.0.tar.gz | 1.4 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abiogenesis-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.4 MB
Release files / abiogenesis-0.1.0.tar.gz
| Download URL | abiogenesis-0.1.0.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ba4076b104b4bf3901e3520cb64906d470ad7c7df0ae84d8fdf61debb056e87
|
|
BLAKE2b-256 checksum How to use checksums |
8bad390361ac2d59f8e2b8dda8f269c6281d39d2de626e7488a90641ccf0c693
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / abiogenesis-0.1.0-py3-none-any.whl
| Download URL | abiogenesis-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52127cb4d366f1e12526afc532c1b0f7f872e10b896953412339521263b7d75d
|
|
BLAKE2b-256 checksum How to use checksums |
e6692e520999db0e6b5e875db9939d37e118ba0f1249311cf58feb87c7870684
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for abiogenesis 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.