Skip to content

fix: R6 pre-release — JAX weak visualization (#614) and mixed factor graphs under setup="auto" #895

Done

Description

@Jammy2211

Overview

Two pre-release fixes found by the R6 phase B sweep, both needed before the release that carries R6 phase A (PyAutoLabs/PyAutoGalaxy#759): JAX weak-lensing fits crash in visualization (#614), and FactorGraphModels mixing dataset types fail check_setup_agreement because each default-constructed factor resolves its own setup="auto".

Plan

  • Weak (PyAutoLens): fix Weak-lensing visualization crashes on JAX path: fit.shear_yx lacks .grid #614 so a JAX AnalysisWeak fit visualizes — the plotter receives a raw JAX array for shear_yx; build/convert the visualization fit with NumPy structures (as the imaging/interferometer visualizers do) rather than special-casing the plotter. AnalysisWeak keeps setup="auto".
  • Factor graphs (PyAutoFit + PyAutoGalaxy): a factor whose setup was DEFAULTED (not passed) adopts one shared backend inside a FactorGraphModel: if the defaulted factors' auto setups disagree, they fall back to the manual path on the graph's backend (FactorGraphModel(use_jax=...), or JAX when the graph does not say). Explicit setups are unchanged and must still agree. PyAutoFit gets a generic hook (no-op on af.Analysis); PyAutoGalaxy's AnalysisSetupMixin implements it.
  • Tests: JAX weak fit + visualization; mixed imaging+interferometer and imaging+point graphs with default analyses pass modify_before_fit; explicit disagreeing setups still raise.
  • Same branch feature/likelihood-lifecycle-r6d-prerelease-fixes in Fit/Galaxy/Lens; merge Fit → Galaxy → Lens; pending-release.

Tier + merge mode: effective level: supervised; merge mode: human /prm

Original Prompt

Click to expand starting prompt

Likelihood lifecycle R6 pre-release fixes: JAX weak plotting (#614) and mixed factor graphs under setup="auto"

Type: feature
Target: PyAutoFit
Repos:

  • PyAutoFit
  • PyAutoGalaxy
  • PyAutoLens
    Themes:
  • hpc-gpu
    Difficulty: medium
    Autonomy: supervised
    Priority: high
    Status: draft
    Consequence: judge
    Witness: (1) al.AnalysisWeak(dataset) with the default setup fits and visualizes on the JAX path without the shear_yx.grid AttributeError; (2) a FactorGraphModel of a default-constructed al.AnalysisImaging and al.AnalysisInterferometer (or imaging + point) passes modify_before_fit / check_setup_agreement with no use_jax= pins.
    Epic: likelihood-lifecycle
    Phase: 6 (R6 rollout, pre-release fixes)
    Parent: draft/research/autolens_profiling/likelihood_lifecycle_epic.md
    Filed: 2026-11-26

Human rulings (2026-11-26)

Context

Found by the R6 phase B sweep (autolens_workspace#692, autogalaxy_workspace#285 pin use_jax in the affected examples). Must merge before the release that carries R6 phase A (PyAutoArray#715, PyAutoFit#1800, PyAutoGalaxy#760, PyAutoLens#894).

Activity

  1. Jammy2211 commented on Nov 26, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    Merged in order: PyAutoLabs/PyAutoFit#1801 (68075ce48; CI re-run once — Zeus conformance flake, not reproducible locally on 1 or 4 CPUs) → PyAutoLabs/PyAutoGalaxy#761 (5bdbfcbd0) → #896 (e318465). All pending-release. JAX weak fits visualize (#614 closed); factors left on the default setup adopt one shared backend in a FactorGraphModel. The workspace pins added by the R6 phase B sweep (mixed graphs use_jax=True, weak use_jax=False) can come out after the release — follow-up draft filed.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions