# bochen2029-pixel/booster-lander-simulator architecture

> Architecture diagram of the GitHub repository bochen2029-pixel/booster-lander-simulator, 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/bochen2029-pixel/booster-lander-simulator
- Repository: https://github.com/bochen2029-pixel/booster-lander-simulator

## Overview

Booster Lander Simulator is a deterministic 6-DOF landing simulator with a native physics-and-guidance core, headless Monte Carlo runs, and a read-only telemetry cockpit. The principal flow is scenario/run selection → guidance and physics stepping → landing verdict and telemetry → browser decoding → scene, HUD, and audio observation. The graph also preserves the documented controller variants, learned-policy training path, and comparison cockpit. Several subsystem links rely on README-level architecture claims because their implementation files were not excerpted.

Main entry points: [`core/sim.c`](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/sim.c) (Fixed-step simulation), [`core/main.c`](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/main.c) (CLI and run modes), [`ui/src/net/decode.ts`](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/net/decode.ts) (Telemetry decoding), [`ui/src/net/client.ts`](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/net/client.ts) (WebSocket telemetry client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Simulation core"]
  node_scenario["Scenario and run setup<br/>[scenario.c]"]
  node_entry["CLI and run modes<br/>[main.c]"]
  node_sim["Fixed-step simulation<br/>[sim.c]"]
  node_plant["Dynamics and integration<br/>[dynamics.c]"]
  node_environment["Atmosphere and environment<br/>[atmosphere.c]"]
  node_contact["Landing contact<br/>[contact.c]"]
  node_protocol["Binary telemetry protocol<br/>[protocol.h]"]
end

subgraph group_guidance["Guidance and learning"]
  node_guidance_select["Guidance selection<br/>[sim.c]"]
  node_hoverslam["Hoverslam controller"]
  node_mppi["MPPI controller<br/>[guidance_mppi.c]"]
  node_other_guidance["Other guidance policies<br/>[guidance_cfly.c]"]
  node_neural["Neural policy<br/>[guidance_neural.c]"]
  node_trainer["Policy training and export<br/>[train_s0.py]"]
end

subgraph group_desktop["Desktop shell"]
  node_shell["Sidecar supervisor<br/>[supervisor.rs]"]
end

subgraph group_observer["Telemetry observers"]
  node_client["WebSocket telemetry client<br/>[client.ts]"]
  node_decoder["Telemetry decoding<br/>[decode.ts]"]
  node_cockpit["3D cockpit and HUD"]
  node_audio["Propagation audio<br/>[audioEngine.ts]"]
end

subgraph group_analysis["Run analysis"]
  node_analysis_app["Run comparison cockpit<br/>[app.ts]"]
  node_run_data["Run CSV comparison<br/>[runData.ts]"]
end

node_operator(("Operator"))

node_operator -->|"selects run"| node_entry
node_entry -->|"configures"| node_scenario
node_entry -->|"runs"| node_sim
node_sim -->|"dispatches"| node_guidance_select
node_guidance_select -->|"selects"| node_hoverslam
node_guidance_select -->|"selects"| node_mppi
node_guidance_select -.->|"selects"| node_other_guidance
node_guidance_select -->|"selects"| node_neural
node_sim -->|"integrates state"| node_plant
node_sim -->|"models conditions"| node_environment
node_sim -->|"evaluates landing"| node_contact
node_sim -->|"emits telemetry"| node_protocol
node_entry -->|"logs policy rows"| node_trainer
node_trainer -.->|"exports weights"| node_neural
node_shell -->|"spawns core"| node_entry
node_client -->|"receives stream"| node_protocol
node_client -->|"routes frames"| node_decoder
node_decoder -->|"supplies telemetry"| node_cockpit
node_decoder -->|"supplies telemetry"| node_audio
node_operator -->|"compares runs"| node_analysis_app
node_analysis_app -->|"loads and compares"| node_run_data

click node_scenario "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/scenario.c"
click node_entry "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/main.c"
click node_sim "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/sim.c"
click node_plant "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/dynamics.c"
click node_environment "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/atmosphere.c"
click node_contact "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/contact.c"
click node_guidance_select "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/sim.c"
click node_hoverslam "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_hoverslam.c"
click node_mppi "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_mppi.c"
click node_other_guidance "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_cfly.c"
click node_neural "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_neural.c"
click node_trainer "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/trainer/train_s0.py"
click node_protocol "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/protocol.h"
click node_shell "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/shell/src/supervisor.rs"
click node_client "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/net/client.ts"
click node_decoder "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/net/decode.ts"
click node_cockpit "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/scene/documentaryScene.ts"
click node_audio "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/audio/audioEngine.ts"
click node_analysis_app "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/constellation/app.ts"
click node_run_data "https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/constellation/runData.ts"

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_scenario,node_entry,node_sim,node_plant,node_environment,node_contact,node_protocol toneBlue
class node_guidance_select,node_hoverslam,node_mppi,node_other_guidance,node_neural,node_trainer toneAmber
class node_shell toneMint
class node_client,node_decoder,node_cockpit,node_audio toneRose
class node_analysis_app,node_run_data,node_operator toneIndigo
```

## Components

### Simulation core

- [Scenario and run setup](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/scenario.c): `core/scenario.c`
- [CLI and run modes](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/main.c): `core/main.c`
- [Fixed-step simulation](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/sim.c): `core/sim.c`
- [Dynamics and integration](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/dynamics.c): `core/dynamics.c`
- [Atmosphere and environment](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/atmosphere.c): `core/atmosphere.c`
- [Landing contact](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/contact.c): `core/contact.c`
- [Binary telemetry protocol](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/protocol.h): `core/protocol.h`

### Guidance and learning

- [Guidance selection](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/sim.c): `core/sim.c`
- [Hoverslam controller](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_hoverslam.c): `core/guidance_hoverslam.c`
- [MPPI controller](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_mppi.c): `core/guidance_mppi.c`
- [Other guidance policies](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_cfly.c): `core/guidance_cfly.c`
- [Neural policy](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/core/guidance_neural.c): `core/guidance_neural.c`
- [Policy training and export](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/trainer/train_s0.py): `trainer/train_s0.py`

### Desktop shell

- [Sidecar supervisor](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/shell/src/supervisor.rs): `shell/src/supervisor.rs`

### Telemetry observers

- [WebSocket telemetry client](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/net/client.ts): `ui/src/net/client.ts`
- [Telemetry decoding](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/net/decode.ts): `ui/src/net/decode.ts`
- [3D cockpit and HUD](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/scene/documentaryScene.ts): `ui/src/scene/documentaryScene.ts`
- [Propagation audio](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/audio/audioEngine.ts): `ui/src/audio/audioEngine.ts`

### Run analysis

- [Run comparison cockpit](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/constellation/app.ts): `ui/src/constellation/app.ts`
- [Run CSV comparison](https://github.com/bochen2029-pixel/booster-lander-simulator/blob/main/ui/src/constellation/runData.ts): `ui/src/constellation/runData.ts`

### Other components

- **Operator**

## Connections

- Operator → CLI and run modes: selects run (evidence: `README.md`)
- CLI and run modes → Scenario and run setup: configures (evidence: `core/main.c`)
- CLI and run modes → Fixed-step simulation: runs (evidence: `README.md`)
- Fixed-step simulation → Guidance selection: dispatches (evidence: `core/sim.c`)
- Guidance selection → Hoverslam controller: selects (evidence: `core/sim.c`)
- Guidance selection → MPPI controller: selects (evidence: `core/sim.c`)
- Guidance selection → Other guidance policies: selects (evidence: `core/sim.c`)
- Guidance selection → Neural policy: selects (evidence: `core/sim.c`)
- Fixed-step simulation → Dynamics and integration: integrates state (evidence: `README.md`)
- Fixed-step simulation → Atmosphere and environment: models conditions (evidence: `core/sim.c`)
- Fixed-step simulation → Landing contact: evaluates landing (evidence: `core/sim.c`)
- Fixed-step simulation → Binary telemetry protocol: emits telemetry (evidence: `README.md`)
- CLI and run modes → Policy training and export: logs policy rows (evidence: `core/main.c`)
- Policy training and export → Neural policy: exports weights (evidence: `README.md`)
- Sidecar supervisor → CLI and run modes: spawns core (evidence: `README.md`)
- WebSocket telemetry client → Binary telemetry protocol: receives stream (evidence: `README.md`)
- WebSocket telemetry client → Telemetry decoding: routes frames (evidence: `ui/src/net/client.ts`)
- Telemetry decoding → 3D cockpit and HUD: supplies telemetry (evidence: `ui/src/main.ts`)
- Telemetry decoding → Propagation audio: supplies telemetry (evidence: `ui/src/audio/audioEngine.ts`)
- Operator → Run comparison cockpit: compares runs (evidence: `ui/src/constellation/app.ts`)
- Run comparison cockpit → Run CSV comparison: loads and compares (evidence: `ui/src/constellation/app.ts`)
