ml_switcheroo.testing.fuzzer.core¶
Core Engine of the Input Fuzzer (Hypothesis Integration).
This module provides the InputFuzzer facade which now delegates generation logic to Hypothesis Strategies. It maintains backward compatibility for casual usage via generate_inputs.
Classes¶
Facade for creating Hypothesis strategies based on Semantic Spec. |
Module Contents¶
- class ml_switcheroo.testing.fuzzer.core.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.