Skip to content

fix: single-image recovery blind to inf-padded JAX solver output - #772

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/padded-single-image-recovery
Oct 7, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/padded-single-image-recovery

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Result.image_plane_multiple_image_positions decided whether to run the inward-walk single-image recovery with multiple_images.shape[0] <= 1. Under a JAX analysis (xp=jnp) the point solver returns a static-shape array padded with (inf, inf) rows, so that test was never true and the recovery could not fire; since #765 a 1-image JAX solve then raised PositionsException at PositionsLH construction (discussion https://github.com/orgs/PyAutoLabs/discussions/30). The padded rows were also written into the cached files/multiple_image_positions.json.

Fix: a small _finite_multiple_images_from helper drops non-finite rows, and both image_plane_multiple_image_positions and the inward walk in image_plane_multiple_image_positions_for_single_image_from now count finite rows. Only finite rows are returned, so PositionsLH and the JSON cache never see the padding. The explanatory comment (zero-images case) is kept and extended.

Pin risk: none for finite inputs — the NumPy solver already removes non-finite rows, so the filter is the identity there; no numerical pins move.

Closes #771.

API Changes

None to the public API — behaviour fix: inf-padded (JAX) solver output now triggers single-image recovery and is stripped of padding before being returned/cached. Adds private static helper Result._finite_multiple_images_from.
See full details below.

Test Plan

  • New tests in test_autolens/analysis/test_result.py (solver solve monkeypatched): padded 1-image array triggers recovery; padded 2-image array returns exactly the 2 finite rows; unpadded 2-row array unchanged; inward walk counts finite rows
  • Witness: on unfixed source 3 of the 4 new tests fail (the unpadded control passes); with the fix all pass
  • python -m pytest test_autolens/analysis -q — 101 passed
  • Full test_autolens suite — 831 passed, 1 xfailed (10.5 min)

Heart readiness at ship: YELLOW (release validation stale; manifest drift; Hands "PyAuto Release" and Heart "Workspace Smoke" red) — acknowledged by the human for development PRs.

Full API Changes (for automation & release notes)

Removed

  • None

Added

  • Result._finite_multiple_images_from(multiple_images) (private, static) — drops non-finite solver rows

Migration

  • None

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Count finite point-solver rows, not array rows, before deciding whether
the inward-walk single-image recovery runs, both in
image_plane_multiple_image_positions and inside the walk itself. Only the
finite rows are returned, so PositionsLH and the cached
files/multiple_image_positions.json never see the (inf, inf) padding the
JAX solver adds. Identity for NumPy solver output (no pins move).

Closes #771

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 7, 2026
@Jammy2211
Jammy2211 merged commit 384e86e into main Oct 7, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/padded-single-image-recovery branch October 7, 2026 07:54
Jammy2211 pushed a commit that referenced this pull request Oct 7, 2026
…; retrigger CI after PyAutoGalaxy#641 merged)
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 2026
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.

fix: single-image recovery blind to inf-padded JAX solver output

1 participant