mixle.experimental.typed_runtime.compiler module¶
Side-effect-free compiler from a model tree to a typed update graph.
- class ContractRegistry[source]
Bases:
objectExplicit contract adapters for models that cannot declare a hook.
Registries are caller-owned rather than process-global. Compiling a test or plugin therefore cannot silently change another run’s semantics.
- register(model_type, contract, *, estimator_type=None)[source]
Register one immutable, already constructed contract for a model/estimator pair.
- compile_update_graph(model, estimator=None, *, nobs=1.0, backend='local', registry=None, bindings=None, contract_overrides=None, measurements=None)[source]
Compile a model into an immutable typed update and invalidation graph.
Compilation reads inert instance/class dictionaries only. It never calls factories, descriptors, capability predicates, contract hooks,
parameters(), scoring/sampling methods, estimators, or accumulators. Child estimators are aligned from the supplied estimator’s stored child objects where the binding is unambiguous; otherwise the child contract isUNKNOWN/frozen unless an explicit path binding is supplied.- Parameters:
- Return type:
UpdateGraph
- infer_update_contract(model, estimator)[source]
Return a static/audited contract or an explicit
UNKNOWNcontract.No factories, descriptors, methods, capability predicates, scoring functions, or estimator hooks are called. Names and method presence are not semantic evidence.