Repository navigation
perf: symmetric row-restricted direct_conv curvature kernel - #636
Merged
Merged
Conversation
Serial numba interferometer curvature F = A^T W~ A now has a symmetric, row-restricted kernel, curvature_direct_conv_symmetric. Source columns are ranked by their top extent row (ymin, stable, empty columns last); each column convolves only the extent rows later-ranked columns span, clipped to each row's mask x-range, gathers the ranked upper triangle with a branch-free ranked-CSC sweep, then mirrors. Computed entries are bit-identical to curvature_direct_conv. The kernel runs when numba is serial and its geometry work fraction f is at or below Settings.interferometer_direct_conv_symmetric_max_work_fraction (packaged 0.7; 0 disables; null means the default). Non-finite mapping weights fall back to the full kernel. The route cost model scales t_dc by min(1, 1.32 f), so the factory routes on the cheaper kernel (real_space_mask_from passes the mask). RAL witness (euclid-ral-compute-1, ral partition, exclusive, 1 thread): synthetic Aris-512 geometry 1.83/1.86/1.90x at S 1,428/2,540/5,712; real Aris SPT2319-55 512x512, 1,459 Delaunay vertices, f 0.511: curvature 22.43 -> 15.08 s (1.49x), log likelihood and figure of merit bit-identical. Closes #635 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QBeyBLN7ntDChx9v1fmt6M
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With serial numba, the interferometer curvature matrix
F = Aᵀ W̃ Acan now be built by a new symmetric, row-restricted kernel,curvature_direct_conv_symmetric.ymin, stable sort, empty columns last).curvature_direct_conv.Routing.
fis at or belowinterferometer_direct_conv_symmetric_max_work_fraction. The packaged default is 0.7.t_dcbymin(1, κf)with κ = 1.32, so the factory routes on the kernel that will actually run.real_space_mask_frompasses the mask, and only on NumPy.Human decision (2026-10-16, on #635): rank by ascending
ymin(not centroid) and raise the default gate from 0.5 to 0.7. The model says the kernel wins while κf < 1 (f < 0.76). Real Aris Delaunay columns are tall because of multiple imaging: the median span is 90 of 341 rows, against 15 on the synthetic geometry. That puts f at about 0.50–0.51, which the old 0.5 gate excluded.Campaign: PyAutoLabs/PyAutoPulse#62 (task
interferometer_large_mask_aris, lever L2).Closes #635
API Changes
These are additive. The default behaviour changes only in speed: serial numba interferometer inversions with f ≤ 0.7 use the new kernel, with F identical to round-off.
Settings(interferometer_direct_conv_symmetric_max_work_fraction=...)and thegeneral.yamlkey of the same name (default 0.7; 0 disables;nullmeans the default).curvature_direct_conv_symmetric,symmetric_restriction_inputs_from,symmetric_work_fraction_from,SYMMETRIC_KERNEL_KEYS,DIRECT_CONV_SYMMETRIC_WORK_FACTOR.curvature_route_seconds_fromgains an optionalwork_fractionargument.See full details below.
Witness (RAL,
euclid-ral-compute-1,ralpartition,--exclusive, 1 thread, load ≤ 1.0 during timing)Software: PyAutoArray
e59d5fa9plus this diff (v3 patch), PyAutoNerves7f3055b, PyAutoFit9b394e73, PyAutoGalaxy9f9ac947, PyAutoLens4723668a; numba 0.65.1, numpy 2.2.6. Compile time is excluded: each figure is the minimum of two repeats with a warm numba cache.Real Aris SPT2319-55 data (5,516,930 visibilities, 512×512 mask, extent 341², regular overlay Delaunay mesh, ConstantSplit). Jobs 412490, 412491 (FFT arm), 412492 and 412493 (control).
Synthetic Aris-512 geometry (341² extent, 91,361 px, 3-NN, nnz 274,083), ymin order, job 412490:
The ranked triangle is bit-identical in all three, and the full-matrix max relative difference is ≤ 1.3e-15, which equals the full kernel's own asymmetry.
Heart
pyauto-heart readiness --json(canonical, 2026-10-17T11:48:54Z): STALE, score 85.red_reasons: []. The stale reason is "release validation incomplete: no rehearsal for current source". STALE passes for development shipping, so no RED override was needed.Test Plan
test_curvature_direct_conv_symmetric.pyhas 21 tests.pyauto-heart smoke, local library roots): 165/165 passed across autofit, autogalaxy, autolens, autolens_test, euclid and howtolens. The autocti and autocti_test environments failed to build before execution because GSL headers are missing on the laptop; that is unrelated to this change, which does not touch CTI.Full API Changes (for automation & release notes)
Added
Settings(interferometer_direct_conv_symmetric_max_work_fraction: Optional[float] = None)and the property of the same name. Default 0.7 fromgeneral.yamlinversion.interferometer_direct_conv_symmetric_max_work_fraction;0always uses the full kernel; negative raisesValueError.inversion_interferometer_numba_util.curvature_direct_conv_symmetric(..., order, rank, ylo_suffix, xlo_row, xhi_row): the serial symmetric kernel.inversion_interferometer_numba_util.symmetric_restriction_inputs_from(iy, ix, cscptr, csc_row, ny, nx, pix_pixels): ordering, row restriction, x-ranges andwork_fraction.inversion_interferometer_numba_util.symmetric_work_fraction_from(...): f from the mapper triplets, used by the router.SYMMETRIC_KERNEL_KEYSandDIRECT_CONV_SYMMETRIC_WORK_FACTOR = 1.32.InversionInterferometerSparseNumba.symmetric_restriction_inputsand.use_symmetric_kernel.interferometer.abstract.real_space_mask_from(dataset).Changed
curvature_route_seconds_from(source_pixels, nnz, extent_shape, work_fraction=None):t_dcis scaled bymin(1, κ·work_fraction)when the argument is given.Migration
interferometer_direct_conv_symmetric_max_work_fraction: 0.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QBeyBLN7ntDChx9v1fmt6M