ml_switcheroo.testing.bisector ============================== .. py:module:: ml_switcheroo.testing.bisector .. autoapi-nested-parse:: Semantics Bisector: Automated Spec Repair. This module implements a feedback loop ("Bisector") that attempts to fix failing verification tests by incrementally relaxing the constraints in the ODL specifications. It closes the loop between Testing and Definition. Capabilities: 1. **Tolerance Relaxation**: If a test fails on numeric comparison, the bisector retries with looser `rtol`/`atol` values. 2. **Suggestion Generation**: Returns a mutated OperationDef dict that passes tests, which can be used to patch the Knowledge Base. Classes ------- .. autoapisummary:: ml_switcheroo.testing.bisector.SemanticsBisector Module Contents --------------- .. py:class:: SemanticsBisector(runner: ml_switcheroo.testing.runner.EquivalenceRunner) Automated tool to find working constraints for an operation. Iterates through progressively relaxed constraints (e.g., tolerances) to find a configuration where the operation passes verification across frameworks. .. py:attribute:: runner .. py:attribute:: logger .. py:method:: propose_fix(op_name: str, op_def: Dict[str, Any]) -> Optional[Dict[str, Any]] Attempts to satisfy verification by mutating verification parameters. Strategies: 1. Increase tolerances (1e-3 -> 1e-2 -> 1e-1). :param op_name: Name of the operation. :param op_def: The definition dictionary from SemanticsManager. :returns: A patched version of op_def if a fix was found, else None. :rtype: Dict