# bobertneek/a-life architecture

> Architecture diagram of the GitHub repository bobertneek/a-life, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bobertneek/a-life
- Repository: https://github.com/bobertneek/a-life

## Overview

A-Life is a research alpha for persistent embodied organisms, with a narrower implemented product boundary: the production voxel frontend starts and ticks GPU-authoritative cognition while the world remains authoritative over legal actions and outcomes. The user-facing loop spans save selection, world perception and candidate generation, GPU cognition, world action execution, and visual projection; the frontend also exposes save/load and inspection controls. The README documents these boundaries, but most application wiring was not sampled, so edges are limited to documented relationships. Semantic and archival capabilities are represented without asserting unverified integration.

Main entry points: [`crates/alife_world/src/organism.rs`](https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/organism.rs) (World state), [`crates/alife_gpu_backend/src/closed_loop_pipeline.rs`](https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_pipeline.rs) (Closed-loop dispatch), [`crates/alife_game_app/src/gpu_live_runtime.rs`](https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/gpu_live_runtime.rs) (GPU live runtime), [`crates/alife_archive/src/bundle.rs`](https://github.com/bobertneek/a-life/blob/main/crates/alife_archive/src/bundle.rs) (Creature archive)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Production app"]
  node_shell["Production shell<br/>[bevy_shell.rs]"]
  node_voxel["Voxel frontend"]
  node_renderer["Voxel renderer"]
  node_inspector["Camera and inspector"]
end

subgraph group_world["World simulation"]
  node_worldsim["World state<br/>[organism.rs]"]
  node_sensing["World perception"]
  node_candidates["Candidate generation"]
  node_ecology["Ecology and habitat<br/>[ecology.rs]"]
  node_bevy_senses["Bevy sensory adapter<br/>[sensory.rs]"]
end

subgraph group_cognition["GPU cognition"]
  node_gpu_runtime["GPU live runtime"]
  node_gpu_dispatch["Closed-loop dispatch"]
  node_gpu_buffers["GPU brain buffers<br/>[buffers.rs]"]
  node_gpu_memory["GPU memory"]
  node_gpu_kernels["GPU kernel set<br/>[closed_loop_v11.rs]"]
end

subgraph group_persistence["Persistence and lineage"]
  node_archive[("Creature archive<br/>[bundle.rs]")]
  node_lineage["Lineage display"]
  node_saves[("World persistence<br/>[persistence.rs]")]
end

subgraph group_learning["Learning and semantics"]
  node_rollout["Training rollout"]
  node_school["Lessons and curriculum<br/>[curriculum.rs]"]
  node_semantic["Semantic providers<br/>[providers.rs]"]
  node_local_prior["Local SLM prior<br/>[local_slm_prior.rs]"]
end

node_user(("Player"))

node_user -->|"starts game"| node_shell
node_shell -->|"ticks runtime"| node_gpu_runtime
node_gpu_runtime -.->|"dispatches cognition"| node_gpu_dispatch
node_gpu_dispatch -.->|"uses buffers"| node_gpu_buffers
node_gpu_dispatch -.->|"runs WGSL"| node_gpu_kernels
node_gpu_dispatch -.->|"updates memory"| node_gpu_memory
node_gpu_runtime -.->|"reads world state"| node_worldsim
node_worldsim -.->|"grounds perception"| node_sensing
node_sensing -.->|"generates candidates"| node_candidates
node_worldsim -.->|"advances ecology"| node_ecology
node_bevy_senses -.->|"converts observations"| node_sensing
node_gpu_runtime -->|"projects live state"| node_renderer
node_worldsim -->|"supplies transforms"| node_renderer
node_renderer -.->|"renders scene"| node_voxel
node_user -.->|"inspects scene"| node_voxel
node_voxel -.->|"opens inspector"| node_inspector
node_user -->|"saves or loads"| node_saves
node_saves -->|"provides selected save"| node_shell
node_archive -.->|"imports founders"| node_worldsim
node_worldsim -.->|"archives creatures"| node_archive
node_archive -.->|"supports lineage display"| node_lineage
node_school -.->|"teaches through perception"| node_worldsim
node_semantic -.->|"offers local provider"| node_local_prior
node_rollout -.->|"trains against runtime"| node_gpu_dispatch

click node_shell "https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/bevy_shell.rs"
click node_voxel "https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/production_voxel_frontend.rs"
click node_renderer "https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/production_voxel_renderer.rs"
click node_inspector "https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/camera_inspector.rs"
click node_worldsim "https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/organism.rs"
click node_sensing "https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/grounded_sensing.rs"
click node_candidates "https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/candidate_enumerator.rs"
click node_ecology "https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/ecology.rs"
click node_bevy_senses "https://github.com/bobertneek/a-life/blob/main/crates/alife_bevy_adapter/src/sensory.rs"
click node_gpu_runtime "https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/gpu_live_runtime.rs"
click node_gpu_dispatch "https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_pipeline.rs"
click node_gpu_buffers "https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/buffers.rs"
click node_gpu_memory "https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_memory.rs"
click node_gpu_kernels "https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_v11.rs"
click node_rollout "https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/training_rollout.rs"
click node_school "https://github.com/bobertneek/a-life/blob/main/crates/alife_school/src/curriculum.rs"
click node_semantic "https://github.com/bobertneek/a-life/blob/main/crates/alife_semantic/src/providers.rs"
click node_local_prior "https://github.com/bobertneek/a-life/blob/main/crates/alife_semantic/src/local_slm_prior.rs"
click node_archive "https://github.com/bobertneek/a-life/blob/main/crates/alife_archive/src/bundle.rs"
click node_lineage "https://github.com/bobertneek/a-life/blob/main/crates/alife_archive/src/legacy_lineage_display.rs"
click node_saves "https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/persistence.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_shell,node_voxel,node_renderer,node_inspector toneBlue
class node_worldsim,node_sensing,node_candidates,node_ecology,node_bevy_senses toneAmber
class node_gpu_runtime,node_gpu_dispatch,node_gpu_buffers,node_gpu_memory,node_gpu_kernels toneMint
class node_archive,node_lineage,node_saves toneRose
class node_rollout,node_school,node_semantic,node_local_prior,node_user toneIndigo
```

## Components

### Production app

- [Production shell](https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/bevy_shell.rs): `crates/alife_game_app/src/bevy_shell.rs`
- [Voxel frontend](https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/production_voxel_frontend.rs): `crates/alife_game_app/src/production_voxel_frontend.rs`
- [Voxel renderer](https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/production_voxel_renderer.rs): `crates/alife_game_app/src/production_voxel_renderer.rs`
- [Camera and inspector](https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/camera_inspector.rs): `crates/alife_game_app/src/camera_inspector.rs`

### World simulation

- [World state](https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/organism.rs): `crates/alife_world/src/organism.rs`
- [World perception](https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/grounded_sensing.rs): `crates/alife_world/src/grounded_sensing.rs`
- [Candidate generation](https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/candidate_enumerator.rs): `crates/alife_world/src/candidate_enumerator.rs`
- [Ecology and habitat](https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/ecology.rs): `crates/alife_world/src/ecology.rs`
- [Bevy sensory adapter](https://github.com/bobertneek/a-life/blob/main/crates/alife_bevy_adapter/src/sensory.rs): `crates/alife_bevy_adapter/src/sensory.rs`

### GPU cognition

- [GPU live runtime](https://github.com/bobertneek/a-life/blob/main/crates/alife_game_app/src/gpu_live_runtime.rs): `crates/alife_game_app/src/gpu_live_runtime.rs`
- [Closed-loop dispatch](https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_pipeline.rs): `crates/alife_gpu_backend/src/closed_loop_pipeline.rs`
- [GPU brain buffers](https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/buffers.rs): `crates/alife_gpu_backend/src/buffers.rs`
- [GPU memory](https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_memory.rs): `crates/alife_gpu_backend/src/closed_loop_memory.rs`
- [GPU kernel set](https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/closed_loop_v11.rs): `crates/alife_gpu_backend/src/closed_loop_v11.rs`

### Persistence and lineage

- [Creature archive](https://github.com/bobertneek/a-life/blob/main/crates/alife_archive/src/bundle.rs): `crates/alife_archive/src/bundle.rs`
- [Lineage display](https://github.com/bobertneek/a-life/blob/main/crates/alife_archive/src/legacy_lineage_display.rs): `crates/alife_archive/src/legacy_lineage_display.rs`
- [World persistence](https://github.com/bobertneek/a-life/blob/main/crates/alife_world/src/persistence.rs): `crates/alife_world/src/persistence.rs`

### Learning and semantics

- [Training rollout](https://github.com/bobertneek/a-life/blob/main/crates/alife_gpu_backend/src/training_rollout.rs): `crates/alife_gpu_backend/src/training_rollout.rs`
- [Lessons and curriculum](https://github.com/bobertneek/a-life/blob/main/crates/alife_school/src/curriculum.rs): `crates/alife_school/src/curriculum.rs`
- [Semantic providers](https://github.com/bobertneek/a-life/blob/main/crates/alife_semantic/src/providers.rs): `crates/alife_semantic/src/providers.rs`
- [Local SLM prior](https://github.com/bobertneek/a-life/blob/main/crates/alife_semantic/src/local_slm_prior.rs): `crates/alife_semantic/src/local_slm_prior.rs`

### Other components

- **Player**

## Connections

- Player → Production shell: starts game (evidence: `README.md`)
- Production shell → GPU live runtime: ticks runtime (evidence: `README.md`)
- GPU live runtime → Closed-loop dispatch: dispatches cognition
- Closed-loop dispatch → GPU brain buffers: uses buffers
- Closed-loop dispatch → GPU kernel set: runs WGSL
- Closed-loop dispatch → GPU memory: updates memory
- GPU live runtime → World state: reads world state
- World state → World perception: grounds perception
- World perception → Candidate generation: generates candidates
- World state → Ecology and habitat: advances ecology
- Bevy sensory adapter → World perception: converts observations
- GPU live runtime → Voxel renderer: projects live state (evidence: `README.md`)
- World state → Voxel renderer: supplies transforms (evidence: `README.md`)
- Voxel renderer → Voxel frontend: renders scene
- Player → Voxel frontend: inspects scene
- Voxel frontend → Camera and inspector: opens inspector
- Player → World persistence: saves or loads (evidence: `README.md`)
- World persistence → Production shell: provides selected save (evidence: `README.md`)
- Creature archive → World state: imports founders
- World state → Creature archive: archives creatures
- Creature archive → Lineage display: supports lineage display
- Lessons and curriculum → World state: teaches through perception
- Semantic providers → Local SLM prior: offers local provider
- Training rollout → Closed-loop dispatch: trains against runtime (evidence: `crates/alife_gpu_backend/src/closed_loop_pipeline.rs`)
