{"id":44343409,"url":"https://github.com/pplmx/primordium","last_synced_at":"2026-02-28T06:45:11.221Z","repository":{"id":333702899,"uuid":"1138357243","full_name":"pplmx/primordium","owner":"pplmx","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-05T03:43:53.000Z","size":1781,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T14:41:31.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pplmx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-20T15:14:19.000Z","updated_at":"2026-02-05T03:43:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pplmx/primordium","commit_stats":null,"previous_names":["pplmx/primordium"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pplmx/primordium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplmx%2Fprimordium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplmx%2Fprimordium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplmx%2Fprimordium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplmx%2Fprimordium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pplmx","download_url":"https://codeload.github.com/pplmx/primordium/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pplmx%2Fprimordium/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29333170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T12:42:24.625Z","status":"ssl_error","status_checked_at":"2026-02-11T12:41:23.344Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-11T13:11:09.938Z","updated_at":"2026-02-11T13:11:10.723Z","avatar_url":"https://github.com/pplmx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Primordium (原初之境) 🧬\n\n\u003e A massive-scale biological simulation engine powered by Rust, ECS, and NEAT neural networks.\n\u003c!-- Automated check 2 --\u003e\n\n[简体中文](./docs/README_zh.md) | [Changelog](./CHANGELOG.md)\n\n\u003e *Evolution in silicon, powered by your machine*\n\n**Primordium** is a hardware-coupled artificial life simulation that lives in your terminal. It bridges the gap between your physical computer and a digital ecosystem, where the laws of nature are shaped by your machine's real-time performance.\n\n![Status](https://img.shields.io/badge/Status-Stable-brightgreen)\n![Built with Rust](https://img.shields.io/badge/Built%20with-Rust-orange)\n![License](https://img.shields.io/badge/License-MIT-blue)\n\n---\n\n## 🎯 Vision\n\nPrimordium is an experiment in **emergent complexity**. It transforms your host machine into a digital god:\n\n- **CPU Workload** becomes the environmental climate.\n- **RAM Pressure** controls resource scarcity.\n- **Neural Networks** evolve as organisms adapt to your hardware's unique signature.\n\n---\n\n## 🌊 Core Mechanics: Hardware Resonance\n\nThe simulation environment is directly coupled to your computer's real-time metrics.\n\n### 🌡️ Climate (CPU-Coupled)\n\nYour CPU usage dictates metabolic speed. High machine load forces life to burn energy faster.\n\n| CPU Usage | Climate State | Metabolism | Effect |\n| ----------- | ---------------- | ------------- | --------- |\n| 0-30%     | 🌡️ Temperate  | ×1.0       | Baseline survival |\n| 30-60%    | 🔥 Warm       | ×1.5       | Increased energy burn |\n| 60-80%    | 🌋 Hot        | ×2.0       | High metabolic stress |\n| 80-100%   | ☀️ Scorching  | ×3.0       | Rapid starvation risk |\n\n### 🌾 Resource Scarcity (RAM-Coupled)\n\nMemory usage determines food availability. High RAM usage simulates a resource-famine environment.\n\n---\n\n- [User Manual (English)](./docs/MANUAL.md)\n- [用户手册 (中文)](./docs/MANUAL_zh.md)\n- [Web Guide](./www/README.md)\n\n## ✨ Features\n\n### 🧠 Neural Awakening \u0026 Selection\n\nEach entity possesses a **dynamic Graph-based (NEAT-lite)** brain. Through natural selection, organisms learn to hunt, coordinate, and manage energy.\n\n- **Evolvable Topology**: Brains can grow new neurons and connections to adapt to complex environments.\n- **Efficiency Pressure**: Complexity carries a metabolic cost (0.02/node + 0.005/conn), preventing network bloat.\n- **Kin Recognition**: Entities sense the relative centroid of their lineage members (**KX**, **KY**), enabling collective herding behaviors.\n- **Semantic Language**: Active chemical signaling (**SA**, **SB**) provides a substrate for evolved social coordination.\n- **Linguistic Evolution (Phase 48)**: Entities possess **Hearing** (Input) and **Vocalization** (Output) channels. Real-time acoustic ripples propagate through the `SoundGrid`, allowing for the emergence of alarm calls and swarming behaviors.\n- **Macro-Intelligence (Phase 60)**: Lineages share a persistent **Collective Memory**. Environmental goals and threats are reinforced across the entire ancestry, influencing neural bias globally.\n- **Lifetime Learning (Phase 47)**: Hebbian plasticity allows brains to adapt weights in real-time based on reinforcement signals (Food/Pain).\n- **Massive Parallelism (Phase 41)**: Powered by **Rayon** and a \"Proposal Unzipping\" pipeline, supporting 10,000+ entities with zero-jitter performance on multi-core systems.\n\n### 👥 Social \u0026 Life History\n\n- **Specialized Castes (Phase 53)**: Entities evolve into **Soldiers** (high damage, high cost), **Engineers** (efficient terraforming), or **Providers** (efficient sharing) based on their lifetime activities and genetic bias.\n- **Planetary Engineering (Phase 62)**: Tribes actively manage the atmosphere. Forests owned by advanced lineages sequestrate CO2 at 2.5x speed, enabling collective control over global warming.\n- **Civilizational Tiers (Phase 61)**: Lineages that build and connect **Outpost Networks** gain civilization bonuses and accumulate **Ancestral Traits** that persist through mass extinctions.\n- **R/K Selection Strategies**: Organisms evolve trade-offs between many weak offspring (Strategy R) or few high-investment heirs (Strategy K).\n- **Metabolic Niches**: Specialized digestion for Green vs Blue food types coupled to terrain geography.\n- **Interspecies Symbiosis (Phase 54)**: Mutualistic bonds can form between different lineages, granting metabolic bonuses and enabling **Interspecies Hybridization** (sexual crossover).\n- **Group Defense**: Proximity to same-lineage members reduces incoming predation damage.\n- **Persistent Lineages**: Success is tracked globally in the **Lineage Registry**.\n\n### 🦠 Pathogens \u0026 Parasites\n\n- **Dynamic Emergence**: Pathogens naturally emerge and mutate, affecting host health and energy.\n- **Parasitic Manipulation (Phase 55)**: Advanced pathogens can hijack host neural circuits, forcing specific behaviors (e.g., forced aggression or vocalization) to facilitate their own spread.\n- **Immunity Evolution**: Entities gain resistance after recovery and pass it to offspring with minor mutations.\n\n### ⚡ Divine Interface v2\n\n- **Terrain Editor**: Use **Mouse Drag** to paint Mountains, Rivers, and Walls directly onto the world.\n- **Targeted Intervention**: Manually **Mutate (M)**, **Smite (K)**, or **Reincarnate (P)** selected organisms.\n- **Archeology \u0026 Fossils (Phase 40)**: Persistent **Fossil Record** (`logs/fossils.json.gz`) preserves extinct legendary genotypes with high storage efficiency. Periodic **History Snapshots** enable time-travel browsing of macro-evolutionary trends.\n- **God Mode Overrides**: Induce global Heat Waves, Resource Booms, or Mass Extinctions via keyboard macros.\n\n### 🦁 Apex Predators \u0026 Sexual Reproduction\n\n- **Predatory Dynamics**: Organisms can evolve aggression to hunt others. **Soldier castes** and **War Zones** apply lethal damage multipliers.\n- **Genetic Crossover**: Sexual reproduction enables neural trait exchange. Bonded partners can reproduce inter-lineage hybrids.\n- **HexDNA Protocol**: Export (`C`) and import (`V`) organism genomes as portable text files.\n\n### 📊 The Omniscient Eye\n\n- **Tree of Life (Phase 34)**: Real-time ancestry visualization using `petgraph`. Trace the branching history of the top 5 dominant dynasties.\n- **Era System**: Population-driven narrative engine tracks world epochs (Genesis, Expansion, Decline, etc.).\n- **Hall of Fame**: Real-time leaderboard of the top 3 fittest organisms.\n- **Advanced Analytics**: Brain entropy, average lifespan, and dual-sparkline population dynamics.\n- **Specialization Visualizer**: Real-time TUI brain view mapping 11 outputs and caste progression meters.\n\n### 🏔️ Ecosystem Dynamics\n\n- **Terrain System**: Mountains (▲ slow), Rivers (≈ fast, hydrating), Oases (◊ food-rich).\n- **Emergent Architecture (Phase 52)**: Entities can **Dig** canals or **Build** protective **Nests** (Ω). Nests provide metabolic recovery and nursery bonuses for offspring.\n- **Hydrological Coupling**: Artificial canals boost nearby soil fertility, enabling biological terraforming.\n- **Season Cycle**: Spring, Summer, Fall, Winter affecting metabolism and food availability.\n- **Geographic Pressure**: Migration patterns emerge from terrain-based resource distribution.\n\n### 👥 Social Structures\n\n- **Pheromone System**: Food trails attract foragers, danger pheromones warn of predators.\n- **Tribe Formation**: Color-similar entities form protective tribes (no intra-tribe attacks).\n- **Territorial Behavior**: Entities are more aggressive near their birth location.\n- **Energy Sharing**: High-energy entities can share with starving neighbors (♣).\n- **Advanced Hierarchy (Phase 49)**: Alphas influence movement; overcrowded tribes fracture.\n\n### 🌌 Global Hive \u0026 Networking\n\n- **P2P Multiverse**: Entities migrate between simulation instances via a high-performance **Axum** relay server.\n- **Peer Discovery**: Automated peer awareness with real-time REST APIs for global monitoring.\n- **HexDNA Protocol**: Unified genetic protocol ensuring 100% fidelity migrations across simulation versions.\n- **Global Altruism (Phase 60)**: Cross-universe P2P relief transfers allow thriving civilizations to support struggling kin in remote realities.\n- **Networked Crises (Phase 61)**: Global events (Solar Flares) are synchronized across all connected peers, forcing Hive-wide adaptive radiations.\n\n### 📜 The Ledger \u0026 Blockchain\n\n- **History Logging**: Continuous streaming of life events to JSONL.\n- **Immutable Proof**: Datasets are anchored to the **Bitcoin blockchain** via OpenTimestamps for cryptographic proof of evolution.\n\n### ⚡ Performance \u0026 Stability\n\n- **Component-Based Entity (CBE)**: Logical grouping of attributes into Physics, Metabolism, Health, and Intel.\n- **Systemic Decomposition**: Monolithic update logic split into specialized systems (Perception, Action, Biological, Social).\n- **Multi-threaded Pipeline**: Fully parallel updates supporting 10,000+ entities with zero-jitter performance.\n- **Strict Quality Gate**: 100% Clippy compliance and 40+ tests ensuring digital stability.\n- **Spatial Hashing**: Optimized lock-free sensory lookups for high-density populations.\n\n**Performance Scale**:\n| Entity Count | Tick Time (avg) | Recommendations |\n|-------------|----------------|----------------|\n| 100-500 | \u003c5ms | Any hardware setup |\n| 500-1,000 | \u003c15ms | Modern multi-core CPU preferred |\n| 1,000-5,000 | \u003c50ms | Requires 4+ cores, 32GB+ RAM suggested |\n| 5,000-10,000+ | \u003c100ms | Needs 8+ cores, 64GB+ RAM, SSD storage |\n\n**Memory Usage**:\n- Base: ~50MB (program overhead)\n- Per entity: ~5KB (including brain, activations, snapshot copy)\n- 10,000 entities: ~50MB base + ~50MB data = ~100MB total resident memory\n\n**Performance Regression Gate**:\nNew code changes must not exceed 1500ms average tick time for the perf_gate test (100 entities, 200 ticks). Run with `cargo test --test perf_gate` to verify.\n\n\n---\n\n## 🚀 Quick Start\n\n```bash\n# Clone and enter\ngit clone https://github.com/pplmx/primordium.git\ncd primordium\n\n# Run Standard Mode\ncargo run --release\n\n# Run Screensaver Mode\ncargo run --release -- --mode screensaver\n```\n\n---\n\n## ⌨️ Controls\n\n| Key | Action |\n| ----- | --------- |\n| `Q` | Quit simulation |\n| `Space` | Pause / Resume |\n| `A` | Toggle **Ancestry View** (Tree of Life) |\n| `Shift+A` | Export Ancestry Tree (DOT format) |\n| `Y` | Toggle **Archeology \u0026 Fossil Record** |\n| `[` / `]` | **Time Travel** (Navigate History Snapshots) |\n| `B` | Toggle Neural Brain Heatmap |\n| `H` | Toggle Help Overlay |\n| `X` | Trigger **Genetic Surge** (Global Mutation) |\n| `M` | Mutate selected organism |\n| `K` | Smite (Remove) selected organism |\n| `P` | Reincarnate (Randomize DNA) selected organism |\n| `! @ # $ % ^` | Select Terrain Brush (Plains, Mt, River, Oasis, Wall, Barren) |\n| `Shift+K` | Toggle **Heat Wave** Disaster |\n| `F` | Send **Relief Energy** to selected lineage |\n| `L` | Trigger **Mass Extinction** (90% wipe) |\n| `R` | Trigger **Resource Boom** (100x Food) |\n| `+` / `-`| Increase / Decrease time scale |\n| `Left Click` | Select organism / **Hold \u0026 Drag to Paint Terrain** |\n| `Right Click`| Inject Food Cluster |\n\n---\n\n## 🌱 Philosophy\n\nEvery run of Primordium is unique. Your specific hardware workload creates a one-of-a-kind evolutionary pressure. Every lineage is precious, and every extinction is a lesson in the primordial soup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpplmx%2Fprimordium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpplmx%2Fprimordium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpplmx%2Fprimordium/lists"}