Skip to content

Commit afe2cc5

Browse files
committed
docs: LLVM primary runtime and GPS/IMU/camera pipeline updates
Document --runtime selection, native-primary dispatch behavior, sensor hub env vars, and mark LLVM production-primary milestone complete in feature status.
1 parent 6539f3a commit afe2cc5

4 files changed

Lines changed: 33 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- **Cognitive live fusion:** `SPANDA_LIVE_FUSION_SENSORS=1` merges automotive proxy readings into
1616
entity sensory fusion via CLI-registered supplier.
1717
- **LLVM golden path:** `scripts/llvm_golden_path.sh` now includes `autonomous_rover/rover.sd`.
18+
- **LLVM primary runtime:** `spanda run` / `spanda sim` try native codegen first (`--runtime auto|native|interpreter`, `SPANDA_RUNTIME`); interpreter remains LTS fallback.
19+
- **GPS/IMU/camera pipelines:** `sensor_hub` with hub stubs and live CMD bridges (`SPANDA_LIVE_GPS/IMU/CAMERA`); packages `spanda-imu`, `spanda-camera`; `scripts/sensor_pipeline_golden_path.sh`.
1820
- **Docs:** [vscode-marketplace-publish.md](docs/vscode-marketplace-publish.md) — maintainer guide for
1921
VS Code Marketplace setup, PAT, publisher profile, local/CI publish, and troubleshooting.
2022

‎docs/compiler-backend-roadmap.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Supporting outputs today:
2323
|--------|---------|--------|
2424
| Diagnostics | `spanda check` | Implemented |
2525
| Compatibility report | `spanda verify` | Implemented |
26-
| Interpreted run | `spanda run` / `spanda sim` | Implemented |
26+
| Interpreted run | `spanda run` / `spanda sim` | Implemented (native-primary with interpreter LTS fallback) |
2727
| Formatted source | `spanda fmt` | Implemented |
2828
| Markdown docs | `spanda doc` | Implemented |
2929
| Skeleton codegen | `spanda codegen --target native\|wasm\|esp32` | Stubbed (SIR-aware template C/WASM/ESP32, not a real compiler) |
@@ -67,6 +67,8 @@ Spanda source (.sd)
6767
- HAL profiles and conditional compilation for Jetson vs ESP32 remain planned.
6868
- **`scripts/llvm_golden_path.sh`** exercises `hello_world.sd` and `examples/showcase/autonomous_rover/rover.sd`
6969
when `clang` is available (CI Nightly signal).
70+
- **`spanda run` / `spanda sim`** use native-primary dispatch (`ExecutionRuntime::Auto`); interpreter LTS
71+
when SIR is ineligible or clang is missing (`--runtime`, `SPANDA_RUNTIME`).
7072

7173
## Target platforms
7274

‎docs/feature-status.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ Stable. Simulated-only paths must say so explicitly.
135135
| **Certification metadata** | `certify ISO13849 { level PLd; }` | Verify-only metadata; `--strict-certify` / `--enforce-certify`; `spanda certify prove`; deploy plan proof summary |
136136
| **Nav2 / SLAM packages** | Registry adapter stubs + example packages | External Nav2/Gazebo/OpenCV not bundled; optional `SPANDA_NAV2_CMD` / `SPANDA_SLAM_CMD` bridges |
137137
| **ROS2 adapter** | Native `rclrs` cdylib, rclpy daemon, CLI bridge | Requires ROS Humble; not default transport |
138-
| **LLVM / native codegen** | `spanda ir`, `llvm-ir`, `compile-native`; `scripts/llvm_golden_path.sh` | Early stage; not primary execution path |
138+
| **LLVM / native codegen** | `spanda run --runtime auto\|native\|interpreter`; `llvm-ir`, `compile-native`; `scripts/llvm_golden_path.sh` | **Primary** execution path when SIR eligible; interpreter LTS fallback |
139+
| **GPS / IMU / camera pipelines** | `spanda-gps`, `spanda-imu`, `spanda-camera`; `SPANDA_LIVE_GPS/IMU/CAMERA`; `scripts/sensor_pipeline_golden_path.sh` | Hub stubs + env-gated CMD bridges; fusion via `SPANDA_LIVE_FUSION_SENSORS` |
139140
| **FFI** | `extern python`/`extern cpp` subprocess bridges; optional `cpp-native` in-process | PyO3 path is Tier 2 adoption unlock |
140141
| **World models** | `world_model { }` block parser; `fusion.read()` → belief hook; `world_model.update` / `belief` / `export`; Rust + TS typecheck parity | Minimal belief buffer; see [world_model_patrol.sd](../examples/showcase/world_model_patrol.sd) |
141142
| **Ledger / provenance** | `spanda-ledger` provider → `MockLedgerBackend` | Mock chain only; no production blockchain adapters |
@@ -167,7 +168,7 @@ Stable. Simulated-only paths must say so explicitly.
167168
| | Compliance export/digital thread/executive scorecard/PDF reports (E4); **Stable** tier |
168169
| | [enterprise-operations-roadmap.md](./enterprise-operations-roadmap.md) · [control-center.md](./control-center.md) |
169170
| **Enterprise operations (organizational gates)** | 30-day field soak completion (`enterprise_ops_field_soak_init.sh`); third-party security audit sign-off — tracked separately from tier promotion — [enterprise-ops-stable-promotion.md](./enterprise-ops-stable-promotion.md) |
170-
| **LLVM backend (production primary)** | Optimized native binaries replacing interpreter as default deploy path |
171+
| **LLVM backend (production primary)** | ✓ Auto-native dispatch on `spanda run`/`sim`; interpreter remains LTS fallback |
171172
| **Self-hosting compiler (full)** | Complete Spanda-authored compiler pipeline |
172173
| **ROS2 production adapter** | First-class, zero-config ROS2 deployment |
173174
| **VS Code Marketplace publish** | **Partial** — `VSCE_PAT` + publisher `spanda-lang` configured; VSIX on GitHub releases; public listing blocked by Marketplace scanner pending Microsoft review — [vscode-marketplace-publish.md](./vscode-marketplace-publish.md) |

‎docs/native-deploy.md‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
# Native deploy (LLVM)
22

3-
Spanda can emit a **linked native binary** for field deployment when the CLI is built with the
4-
`llvm` feature (default). This path complements the interpreter (`spanda run`) and WASM deploy
5-
manifest (`spanda deploy --target wasm`).
3+
Spanda uses **LLVM native codegen as the primary runtime** for `spanda run` and `spanda sim`
4+
when programs lower to eligible SIR and clang is available. The tree-walking interpreter
5+
remains the **long-term support (LTS)** path and is used automatically when native execution
6+
is unavailable or the program contains statements unsupported by native codegen.
7+
8+
## Runtime selection
9+
10+
| Mode | Flag / env | Behavior |
11+
|------|------------|----------|
12+
| **Auto** (default) | `--runtime auto` or `SPANDA_RUNTIME=auto` | Try native first; fall back to interpreter LTS with a warning |
13+
| **Native** | `--runtime native` or `SPANDA_RUNTIME=native` | Require native; error if unavailable |
14+
| **Interpreter LTS** | `--runtime interpreter` or `SPANDA_RUNTIME=interpreter` | Force interpreter only |
15+
16+
```bash
17+
spanda run --runtime auto examples/showcase/killer_demo.sd
18+
SPANDA_RUNTIME=interpreter spanda sim rover.sd
19+
```
20+
21+
Build the CLI with the `llvm` feature (default) for native-primary dispatch.
622

723
## Quick start
824

@@ -50,18 +66,21 @@ spanda compile-native --target-triple aarch64-unknown-linux-gnu \
5066

5167
| Runtime | Best for |
5268
|---------|----------|
53-
| `spanda run` / `spanda sim` | Development, triggers, agents, full language surface |
54-
| Native binary | Fixed behaviors, edge nodes with clang toolchain, HAL-tuned builds |
69+
| **Auto / native** (`spanda run`, `spanda sim`) | Production deploys, edge nodes with clang, eligible programs |
70+
| **Interpreter LTS** (`--runtime interpreter`) | Full language surface, triggers, agents, development |
71+
| **Prebuilt binary** (`compile-native`, `deploy --target native`) | Fixed behaviors shipped as standalone executables |
72+
| WASM (`deploy --target wasm`) | Browser and lightweight embed targets |
5573

5674
Native codegen covers a **subset** of the language today. Use `spanda check` and
57-
[known-limitations.md](./known-limitations.md) before relying on native output in production.
75+
[known-limitations.md](./known-limitations.md) before requiring native-only execution.
5876

5977
## CI
6078

6179
| Job | Script |
6280
|-----|--------|
6381
| `llvm-golden-path` | `scripts/llvm_golden_path.sh` |
6482
| `llvm-embedded-golden-path` | `scripts/llvm_embedded_golden_path.sh` |
83+
| `sensor-pipeline-golden-path` | `scripts/sensor_pipeline_golden_path.sh` |
6584

6685
## Related
6786

0 commit comments

Comments
 (0)