Skip to content

chore(engine): remove the dead, broken JAX MC backend#99

Merged
jam-sudo merged 2 commits into
mainfrom
chore/remove-dead-jax-backend
Jul 5, 2026
Merged

chore(engine): remove the dead, broken JAX MC backend#99
jam-sudo merged 2 commits into
mainfrom
chore/remove-dead-jax-backend

Conversation

@jam-sudo

@jam-sudo jam-sudo commented Jul 4, 2026

Copy link
Copy Markdown
Owner

The engine's JAX Monte-Carlo backend was dead and doubly broken — verified before removal:

  • solve_mc_jax built a batched JaxParams with 18 of the 20 required fields (missing node_fu_correction_applicable, drug_fu_correction_liver) → TypeError on construction.
  • jax / diffrax are not project dependencies (absent from pyproject.toml + requirements-lock.txt), so importing solver_jax raised ImportError first.
  • No caller ever selected backend="jax" (production defaults to scipy); every JAX test skipped via importorskip since jax isn't installed.

Labelled "UDE roadmap Phase 0", but UDE is an enumerated dead-end, so the scaffold has no live consumer.

Removed (−1539 lines)

  • engine/solver_jax.py, params_jax.py, rhs_jax.py
  • the backend=="jax" branch in uncertainty.py (scipy + surrogate backends remain; docstrings updated)
  • test_solver_jax.py, test_jax_scipy_parity.py, test_rhs_jax_unsupported_flux.py
  • the two skipped JAX-vs-SciPy parity tests inside test_active_transport*.py

The surrogate backend (a separate subsystem, also imports jax) is intentionally untouched — out of scope. SciPy is and remains the only production MC backend.

Verification

test_active_transport.py + test_active_transport_direction.py + test_uncertainty.py15 passed; ruff clean; no residual references to the deleted modules.

The engine's JAX Monte-Carlo backend was dead and doubly broken:

- solve_mc_jax built a batched JaxParams with only 18 of the dataclass's 20
  required fields (missing node_fu_correction_applicable, drug_fu_correction_liver)
  → TypeError on construction.
- jax / diffrax are not project dependencies (absent from pyproject and
  requirements-lock), so importing solver_jax raised ImportError first.
- No caller ever selected backend="jax" (production defaults to scipy); every
  JAX test skipped via importorskip since jax isn't installed.

It was labelled "UDE roadmap Phase 0", but UDE is an enumerated dead-end, so the
scaffold has no live consumer. Removed the whole engine JAX subsystem:

- delete engine/solver_jax.py, params_jax.py, rhs_jax.py
- drop the backend=="jax" branch in uncertainty.py (scipy + surrogate remain)
- delete test_solver_jax.py, test_jax_scipy_parity.py, test_rhs_jax_unsupported_flux.py
- remove the two skipped JAX-vs-SciPy parity tests in test_active_transport*.py

The surrogate backend (a separate subsystem) is untouched. SciPy is and remains
the only production MC backend. tests/unit/test_active_transport*.py +
test_uncertainty.py pass (15).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33c59ed02d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,363 +0,0 @@
"""JAX/Diffrax-based ODE solver — differentiable alternative to SciPy LSODA.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the OATP probe before deleting solver_jax

In this revision, running the tracked CLI PYTHONPATH=src python scripts/probe_oatp_phase2a_per_drug.py pravastatin 0.1 fails immediately because scripts/probe_oatp_phase2a_per_drug.py:26 still imports sisyphus.engine.solver_jax. Since this script is the per-drug Phase 2A stiff-ODE diagnostic, deleting the module without switching the probe to SciPy or removing the script leaves a documented tool broken.

Useful? React with 👍 / 👎.

(V2-compatible).
backend: Solver backend to use (``"scipy"``, ``"jax"``, or
``"surrogate"``).
backend: Solver backend to use (``"scipy"`` or ``"surrogate"``).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject removed JAX backend instead of falling through

When an existing caller or experiment config still passes backend="jax", this change no longer takes the JAX path or raises; after the surrogate branch it falls through into the SciPy loop. That silently changes the requested backend and can mislabel performance/results comparisons, so unsupported backend values should be rejected explicitly before the SciPy default path.

Useful? React with 👍 / 👎.

@jam-sudo
jam-sudo enabled auto-merge (squash) July 4, 2026 22:41
@jam-sudo
jam-sudo merged commit 7842e8d into main Jul 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant