mixle.stats.compute.capabilities module

Distribution capability metadata for engine and planner decisions.

The registry records which distribution families can execute on each compute engine, which kernels are generic or specialized, and why some families remain intentionally NumPy-only.

delegated_engine_ready(child_engine_ready)[source]

Engines a delegating wrapper (Weighted/Ignored/Transform) may report: the child’s engines capped to the composition-safe set. A no-op for numpy/torch children; it only drops leaf-only engines the wrapper kernel has not been verified to support.

Parameters:

child_engine_ready (tuple[str, ...])

Return type:

tuple[str, …]

class DistributionCapabilities(engine_ready=('numpy',), kernel_status='generic', numpy_only_reason=None)[source]

Bases: object

Runtime capability metadata for a distribution family.

Parameters:
  • engine_ready (tuple[str, ...])

  • kernel_status (str)

  • numpy_only_reason (str | None)

supports_engine(engine)[source]

Return whether this metadata allows execution on engine.

Parameters:

engine (Any)

Return type:

bool

property is_permanently_numpy_only: bool

Return true for families intentionally excluded from tensor engines.

class CapabilitiesNotApplicable(reason)[source]

Bases: object

Explicit hook result requesting registry/default capability lookup.

Parameters:

reason (str)

register_capabilities(dist_type, capabilities)[source]

Register capability metadata for a class, rejecting accidental replacement.

Parameters:
  • dist_type (type[Any])

  • capabilities (DistributionCapabilities)

Return type:

None

replace_capabilities(dist_type, capabilities)[source]

Explicitly replace capability metadata already registered for dist_type.

Parameters:
  • dist_type (type[Any])

  • capabilities (DistributionCapabilities)

Return type:

None

unregister_capabilities(dist_type)[source]

Remove and return capability metadata registered directly for dist_type.

Parameters:

dist_type (type[Any])

Return type:

DistributionCapabilities

registered_capability_types()[source]

Return distribution classes with explicitly registered capabilities.

Return type:

tuple[type[Any], …]

numpy_only_distribution_types()[source]

Return families intentionally kept on the NumPy execution path.

This excludes transitional legacy_numpy families: those may gain backend declarations later. The returned families have permanent distribution-owned reasons explaining why generic tensor engines are not a good fit.

Return type:

tuple[type[Any], …]

capabilities_for(x)[source]

Return registered capabilities for a distribution instance or class.

Parameters:

x (Any)

Return type:

DistributionCapabilities

intersect_engine_ready(children, preferred_order=COMPOSITION_ENGINES)[source]

Return the engine names supported by every child distribution.

Parameters:
Return type:

tuple[str, …]

compute_capabilities_from_hook(x)[source]

Compatibility helper for callers that need a direct hook result.

Parameters:

x (Any)

Return type:

DistributionCapabilities

supported_engines(x)[source]

Return engine names supported by a distribution instance or class.

Parameters:

x (Any)

Return type:

tuple[str, …]