Skip to content

fix: stabilize border relocation for degenerate PCA axes #445

Closed

Description

@Jammy2211

Overview

The profiling chain in autolens_profiling#113/#115 proved that NumPy FNNLS and JAX PDIP agree when given the same system, then isolated the native backend gap to ellipse_params_via_border_pca_from. For a near-isotropic traced border, the covariance eigenvalues differ only at floating-point scale, so NumPy and JAX choose different valid PCA eigenvectors. The helper then derives maximum ellipse extents along that arbitrary angle, turning eigenvector non-uniqueness into different relocated grids.

Measured on the full FitImaging pixelization fixture:

  • raw traced source-grid error: exactly zero
  • relocated source-grid error: up to 2.835e-1
  • mapping-matrix error: up to 1.492e-1
  • curvature-system error: up to 8.690e-3
  • reconstruction error: up to 8.989e-3
  • with border relocation disabled: curvature error 1.595e-16
  • with a deterministic near-isotropic PCA axis: relocated-grid error exactly zero

Plan

  • In ellipse_params_via_border_pca_from, compute the covariance eigenvalue gap relative to its scale.
  • When that gap is no larger than sqrt(machine epsilon), select a deterministic axis-aligned frame before deriving ellipse extents.
  • Retain the ordinary PCA major axis for non-degenerate covariance.
  • Add NumPy unit coverage for the near-isotropic branch and the anisotropic control.
  • Validate the JAX xp path through the downstream full-likelihood parity reproducer.

Boundary

Do not change NNLS algorithms, solver tolerances, public APIs, configuration, or behavior for non-degenerate PCA borders.

Activity

  1. Jammy2211 commented on Aug 14, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped via PR #446, merged as 394514c09e4fc9fc774e9346e9119f7bb01203e2 after GitHub Actions run 31757530171 passed on Python 3.12 and 3.13 with coverage uploads. Direct JAX jit/vmap and downstream full-likelihood parity also passed. No API/config/NNLS change and no release was performed. Profiling reconciliation continues in autolens_profiling#117.

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