Skip to content

RFC: gth_solve — consolidate or test the pure-Python fallback #887

Description

@mmcky

Problem

markov/gth_solve.py implements the GTH algorithm twice: the Numba-jitted _gth_solve_jit, and a pure-Python duplicate behind use_jit=False (lines 79–99). Coverage shows the file at 52% with exactly the fallback untested — the classic dual-implementation trap: the untested twin silently diverges from the tested one.

Proposed change

Pick one:

A (preferred): delete the pure-Python branch and the use_jit parameter (with a deprecation cycle if it counts as documented API — it appears in the signature docs). Numba is a hard dependency; a no-numba escape hatch that is never exercised protects nobody.

B: keep it, and parametrize the existing gth_solve tests over use_jit=[True, False] so both paths are pinned to identical outputs.

Related context: #480 (repeated logic).

Acceptance criteria

  • markov/gth_solve.py coverage ≳95%, or the fallback is gone
  • If A: use_jit removal noted in the changelog with a deprecation-path decision

From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions