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.

register_capabilities(dist_type, capabilities)[source]

Register capability metadata for a distribution class.

Parameters:
  • dist_type (type[Any])

  • capabilities (DistributionCapabilities)

Return type:

None

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, …]