Skip to content

test: move positions_threshold fixture off the symmetry axis #860

Closed

Description

@Jammy2211

Overview

The positions_threshold pins in test_autolens/analysis/test_result.py::test__positions_threshold_from sit on a solver tie-break: the lens centre (0.1, 0.0) and source (0.0, 0.0) both lie on the x = 0 grid axis, so the on-axis deflection is exactly 0.0 and the point solver's branch is chosen by floating-point noise. PyAutoArray#519 flipped it once already (PyAutoLens#721).

Reproduced on main 2deeab94:

lens centre threshold factor=5
(0.1, 0.0) 0.000989832 0.00494916
(0.1, 1e-15) 0.0000228167 (×43 smaller) 0.000114083

Plan

  • Move the lens centre off every grid symmetry line (x=0, y=0, y=±x) to (0.06, 0.08).
  • Re-pin the two threshold values once against it.
  • Replace the knife-edge comment with one saying why the fixture is off-axis.
  • Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary
Detailed implementation plan

Affected repositories

  • PyAutoLens (test only)

Work classification

Library (test-only)

Branch survey

Repository Current Branch Dirty?
./PyAutoLens main paper_jax/paper.md only (another task)

Suggested branch: feature/positions-threshold-fixture-off-axis
Worktree root: ~/Code/PyAutoLabs-wt/positions-threshold-fixture-off-axis/

Implementation steps

  1. test_autolens/analysis/test_result.py::test__positions_threshold_from: lens centre=(0.06, 0.08); re-pin positions_threshold_from() and factor=5.0.
  2. Measured candidate: threshold 0.0012770598, two images at (±0.5996, ±0.7995); ±1e-6 nudges in x and y keep both images bit-identical and move the threshold by ≤ 2.5e-8 relative; ±1e-5 by ≤ 9.3e-7.

Out of scope

test__positions_likelihood_from__mass_centre_radial_distance_min carries the same on-axis fixture and knife-edge position pins; not touched here (Witness names only the threshold pins). Can follow up.

Witness

The positions_threshold fixture sits off the lens symmetry axis, the two pins are re-pinned once, and a 1e-6 nudge changes neither the solved branch nor the pinned thresholds beyond 1e-6 relative.

Prompt: PyAutoMind/active/positions_threshold_fixture_off_axis.md

Activity

  1. Jammy2211 commented on Nov 14, 2026

    @Jammy2211
    CollaboratorAuthor

    PR opened: #861 (tier glance — ends at PR-open; the shift close-out runs the witness and merges on green). Workspace impact: none (test-only diff, option iii). Gate: tests 1021 passed · smoke n/a · independent review CLEAN · adversary nothing falsified · Heart dev-ship GREEN.

  2. Jammy2211 commented on Nov 14, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped

    • PR: test: move positions_threshold fixture off the symmetry axis #861 (merged d9a2274, 2026-11-14)
    • test__positions_threshold_from: lens centre moved from (0.1, 0.0) (on the x = 0 axis) to (0.06, 0.08), off every grid symmetry line; the two thresholds were re-pinned once (0.0012770598, factor=5 → 0.0063852988; tolerance unchanged at 1e-4).
    • Independently re-checked at the PR head (unattended glance close-out, shift 2026-11-14-pm2): ±1e-6 nudges in x and y leave both image positions identical and move the thresholds by at most 2.51e-8 relative. Control: a 1e-6 nudge of the old fixture flips the solver branch and moves the threshold 98%.
    • Out of scope: test__positions_likelihood_from__mass_centre_radial_distance_min still uses the on-axis tracer. It can follow up separately.
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