Execution Pipeline
Culsma runs source files through a staged execution pipeline.
ParseCompileValidatePlanRun
Stages
| Stage | Output |
|---|---|
| Parse | AST for the source program. |
| Compile | Canonical IR and compiler analysis. |
| Validate | Semantic diagnostics. |
| Typecheck | Unit and dimension diagnostics. |
| Plan | Executable plan with steps and dependencies. |
| Runtime | Final state, events, diagnostics, and user result. |
| Replay | Reconstructed state from event stream. |
Each stage owns the failures it can decide earliest. For example, unit dimension failures belong before runtime, while insufficient runtime material belongs to material-state execution.
Artifact Flow
The minimal example was verified with:
bash
python -m culsma.cli run \
--input examples/minimal/public_minimal.culs \
--artifacts-dir /tmp/culsma-docs-minimal-runResult:
| Field | Value |
|---|---|
runtime_ok | true |
total_steps | 5 |
completed_steps | 5 |
failed_steps | 0 |
skipped_steps | 0 |
| semantic/type/plan/runtime diagnostics | 0 |
The run writes:
text
summary.json
ast.json
ir.json
validate.json
typecheck.json
plan.json
run.json
result.jsonSee Artifacts for details.
