Architecture¶
dag-ml is a control engine. It coordinates ML execution without owning the
heavy data buffers or fitted model objects.
For the short normative product contract, read docs/COORDINATOR_SPEC.md first.
That document resolves the controller/splitter boundary and is the alignment
source for implementation work.
Layers¶
Layer |
Owned here |
Not owned here |
|---|---|---|
Graph contract |
|
DSL syntax sugar |
Planning |
phase order, edge validation, data-plan requests |
source storage and representation search |
Execution control |
fold identity, OOF joins, scheduler decisions |
model fitting internals |
Stores |
lineage/cache/artifact references and portable artifact metadata |
artifact byte formats owned by hosts |
ABI |
controller/data vtables, handles, release contracts |
host object allocation |
Crates¶
Crate |
Responsibility |
|---|---|
|
Pure Rust contracts and invariant checks. No host runtime dependency. |
|
Stable Rust facade for downstream crates and bindings. |
|
C ABI entry points, vtable definitions and header. |
|
Local validation utilities for specs and fixtures. |
Runtime Flow¶
COMPILE -> PLAN -> FIT_CV -> SELECT -> REFIT -> PREDICT -> EXPLAIN
The first implementation should make PLAN and the leakage-sensitive subset of
FIT_CV concrete:
validate a
GraphSpec;ask
dag-ml-datafor compatibleDataPlanblobs where data is consumed;execute splitters over identity tables;
call controller vtables with opaque data/model handles;
store validation predictions as identity-aligned prediction blocks;
join OOF predictions by sample id for downstream meta-models.
Boundary With dag-ml-data¶
dag-ml-data describes data possibilities and produces data plans. dag-ml
decides when those plans execute and whether using their outputs would violate
ML invariants.
The control core may inspect:
sample ids, group ids, target ids and origin ids;
prediction tables;
y_truetables for scoring;canonical JSON descriptors and fingerprints.
The control core must not inspect:
feature matrices;
images, spectra, time series or graph buffers;
fitted operator internals.
Heterogeneous Multi-Source Units¶
When one physical sample carries several observations per source with asymmetric
cardinalities, unit domains are named by an EntityUnitLevel (physical_sample,
source_sample, observation, combo). Combos are relation-backed derived
observations (component_observation_ids, origin_sample_id), not a public
PredictionLevel; the core plans RepresentationPlan / ReductionPlan /
FitInfluencePolicy contracts and host handles only, and never materializes
combo feature buffers. The frozen vocabulary and migration ledger live in
docs/adr/ADR-19-multisource-unit-vocabulary.md; see docs/COORDINATOR_SPEC.md
for the unit and prediction-level rules.