Skip to content

fix: stabilize border relocation for degenerate PCA axes - #446

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/border-relocator-degenerate-pca
Aug 14, 2026
Merged

fix: stabilize border relocation for degenerate PCA axes#446
Jammy2211 merged 1 commit into
mainfrom
feature/border-relocator-degenerate-pca

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

  • detect when the border covariance's PCA eigenvalues are equal within sqrt(machine epsilon) relative scale
  • select a deterministic axis-aligned frame only in that near-isotropic case
  • retain the ordinary PCA major axis for non-degenerate borders
  • add regression coverage for the degenerate branch and its anisotropic control

PCA eigenvectors are mathematically undefined for equal eigenvalues. NumPy and JAX can choose different valid orientations; deriving maximum ellipse extents along those arbitrary axes made border relocation backend-dependent. The deterministic branch removes that ambiguity without changing the public interface.

Evidence

The downstream full-FitImaging reproducer measured, before this fix:

  • relocated source-grid error: 2.835e-1
  • mapping-matrix error: 1.492e-1
  • curvature-system error: 8.690e-3
  • reconstruction error: 8.989e-3

With this patch applied locally at the worst one-ULP point:

  • curvature-system error: 1.583e-16
  • data-vector error: 1.331e-16
  • reconstruction error: 8.202e-11
  • figure-of-merit error: exactly zero
  • NumPy/JAX support masks: identical

Validation

  • 2 focused regression tests passed
  • direct JAX jit and vmap round-trips passed with deterministic phi=0
  • downstream NumPy/JAX full-likelihood parity reproducer passed
  • GitHub's Python 3.12/3.13 full test matrix is the merge gate

API Changes

None. No new configuration or public symbol.

Numerical Behavior

Only near-isotropic border covariances enter the deterministic-axis branch. Non-degenerate PCA behavior and all NNLS settings/algorithms are unchanged.

RED Gate Authorization

The user explicitly instructed this session to continue the work and merge each change once its CI is green. This PR will not be merged unless its own required checks succeed. No release is authorized or performed.

Closes #445

@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 14, 2026 — with ChatGPT Codex Connector
@Jammy2211
Jammy2211 merged commit 394514c into main Aug 14, 2026
2 checks passed
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.

fix: stabilize border relocation for degenerate PCA axes

1 participant