ml_switcheroo.testing.fuzzer¶

Fuzzer Package.

This package provides the input generation engine for verification tests. It exposes the main InputFuzzer class which orchestrates the generation of random inputs (Arrays, Scalars, Containers) based on semantic type hints and constraints.

Submodules¶

Classes¶

InputFuzzer

Facade for creating Hypothesis strategies based on Semantic Spec.

Package Contents¶

class ml_switcheroo.testing.fuzzer.InputFuzzer¶

Facade for creating Hypothesis strategies based on Semantic Spec.

build_strategies(params: List[str], hints: Dict[str, str] | None = None, constraints: Dict[str, Dict] | None = None) → Dict[str, hypothesis.strategies.SearchStrategy]¶

Constructs a dictionary of Hypothesis strategies for the given parameters. Automatically handles shared symbolic dimensions (e.g. Array[‘N’]).

Parameters:
  • params – List of argument names.

  • hints – Mapping of name -> type string.

  • constraints – Mapping of name -> dict constraints (min, max, etc).

Returns:

Strategies ready to be fed into @given.

Return type:

Dict[str, Strategy]

adapt_to_framework(kwargs: Dict[str, Any], framework: str) → Dict[str, Any]¶

Delegates to Framework Adapter to convert Numpy/Native inputs to Tensors.

Parameters:
  • kwargs – Dictionary of input values.

  • framework – Target framework key (e.g. ‘torch’).

Returns:

Dict with converted values.