Skip to content

test: Delaunay pixel-area known-answer tests + areas_for_magnification docstring (#522) - #523

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/delaunay-area-magnification-audit
Sep 4, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/delaunay-area-magnification-audit

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Phase 8 of the euclid-dr1-prep epic (refs #522): a source audit of the Delaunay pixel-area and magnification code paths. This PR lands the audit's test deliverable and corrects one docstring; it changes no behaviour.

  • MeshGeometryDelaunay.areas_for_magnification had no direct test anywhere. Three known-answer tests now pin what it computes: a 5×5 unit lattice (interior cells exactly 1.0, hull cells zeroed, sum (n-2)²), the fact that bounded boundary cells are kept (only unbounded Voronoi regions are zeroed), and that repeat calls agree without writing the -1 sentinel back.
  • barycentric_dual_area_from gets four tests: single-triangle A/3, sum equals the convex-hull area exactly, exact integration of a linear field, and NumPy-vs-JAX in-graph parity (pinned through the split-point observable).
  • The areas_for_magnification docstring now says what the code does: Voronoi cell areas from voronoi_areas_numpy, only unbounded cells zeroed, bounded boundary cells kept, and that these are not the barycentric dual areas the Delaunay interpolator uses, so Σ reconstruction × areas is not the integral of the reconstruction.

The audit itself found a real defect on this path (the Voronoi denominator biases magnification; the exact quadrature weight for the barycentric-linear mapper is the dual area) and a second, independent one in the magnification latent for pixelized sources. Both are filed as separate bug prompts and are not fixed here; the full audit is posted on #522. The two tests that pin the current semantics carry comments saying a fix must flip them deliberately.

API Changes

None — internal changes only (tests and a docstring).
See full details below.

Test Plan

  • pytest test_autoarray/inversion -q — 475 passed
  • pytest test_autoarray -x in the task worktree (ship gate)
  • CI green on this PR
Full API Changes (for automation & release notes)

Changed Behaviour

  • None.

Added

  • Tests only: test_autoarray/inversion/pixelization/mesh_geometry/test_delaunay.py (+3), test_autoarray/inversion/pixelization/interpolator/test_delaunay.py (+4).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rb8WYoovPNvwCj1AD7QpBq

…_magnification semantics (#522)

Phase 8 of the euclid-dr1-prep epic: source audit of the Delaunay
area / magnification paths. Lands the missing direct tests for
MeshGeometryDelaunay.areas_for_magnification and
barycentric_dual_area_from, and rewrites the areas_for_magnification
docstring to what the code actually does (Voronoi cell areas; only
unbounded cells zeroed; not the interpolant's dual areas). No
behavioural change. Two tests deliberately pin the current, flagged
semantics so the follow-up fix flips them on purpose.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rb8WYoovPNvwCj1AD7QpBq
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Sep 4, 2026
@Jammy2211
Jammy2211 merged commit 548ff1e into main Sep 4, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/delaunay-area-magnification-audit branch September 4, 2026 22:13
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 26, 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.

1 participant