Skip to content

fix: restore zero-contour compatibility with JAX 0.11 - #623

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/euclid-jax-contour-compat
Sep 18, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/euclid-jax-contour-compat

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

JAX 0.11.2 passes a plain callable through custom_root which jax-zero-contour 2.0.0 then carries in a while-loop state, raising TypeError: functools.partial is not a valid JAX type. Use a lazily loaded, cached solver subclass to normalize that callable to a JAX pytree Partial at both LensCalc construction sites.

Refs #622; unblocks PyAutoLabs/euclid_strong_lens_modeling_pipeline#90.

API Changes

None — internal changes only. Optional-dependency behavior, signatures, numerical algorithms and cached solver reuse are preserved. No global monkey patch or module-level JAX import.

Test Plan

  • PyAutoGalaxy NumPy suite: 1,236 passed.
  • New workspace regression on JAX 0.10.2 and 0.11.2, both with jax-zero-contour 2.0.0: analytic circle values, jit, bounded vmap and gradients; both LensCalc paths and cache reuse.
  • Previously failing Euclid latent trace test passes on both JAX versions.
  • Full Euclid suite under JAX 0.11.2: 230 passed.
  • Full workspace smoke under JAX 0.11.2: 41/41 passed (existing 40 plus new regression).
  • Independent Sol review: CLEAN (including import laziness and upstream non-mutation).

Scope and limitations

The upstream solver still does not promise vmap support for arbitrary terminated contours. The existing Einstein-radius reverse-gradient shape error reproduces on unmodified PyAutoGalaxy with JAX 0.10.2; this patch does not claim to repair it. No test was skipped or downgraded and no dependency cap was lowered.

Readiness

Human-authorized development-only Heart RED override — 2026-09-18

The live user replied “I authorize” to: “Authorize the development-only Heart override for #622’s repair PRs, acknowledging these reasons, and their green-CI merges?”

Exact current RED: release validation FAILED (stage integrate).
Exact current YELLOW: manifest drift: remote-session blocks (generated) — 2 mismatch(es) vs PyAutoMind/repos.yaml.

Passed branch gates: 1236 library tests; both-version JAX integration and Euclid regression; 230 full Euclid tests under JAX 0.11.2; 41/41 workspace smoke scripts; independent Sol review CLEAN.

Scope: commit, push and pending-release PRs for euclid-jax-contour-compat / #622, then merge only with every required GitHub CI check green, library first. Heart remains RED for releases. No release, failed-check bypass, protection override or SLURM submission is authorized. Existing modelling-script hold remains.

Generated by the PyAutoLabs agent workflow.

@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace integration PR: PyAutoLabs/autogalaxy_workspace_test#123. Library-first merge gate applies. Local validation and live development-only Heart override are recorded in both PR bodies and issue #622.

@Jammy2211
Jammy2211 merged commit 90e757d into main Sep 18, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/euclid-jax-contour-compat branch September 18, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant