Skip to content

Execution Pipeline

Culsma runs source files through a staged execution pipeline.

ParseCompileValidatePlanRun

Stages

StageOutput
ParseAST for the source program.
CompileCanonical IR and compiler analysis.
ValidateSemantic diagnostics.
TypecheckUnit and dimension diagnostics.
PlanExecutable plan with steps and dependencies.
RuntimeFinal state, events, diagnostics, and user result.
ReplayReconstructed 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

A local protocol can be run through all stages with:

bash
python -m culsma run path/to/protocol.culs --artifacts-dir /tmp/culsma-docs-run

Successful runs report:

FieldValue
runtime_oktrue
failed_steps0
skipped_steps0
semantic/type/plan/runtime diagnostics0

The run writes:

text
summary.json
ast.json
ir.json
validate.json
typecheck.json
plan.json
run.json
output.json
result.json

See Artifacts for details.

Released under the Apache-2.0 license.