Fix critical/high findings from whole-codebase audit - #32
Merged
Merged
Conversation
Thirteen correctness bugs, each with a regression test that fails on the old code: - auto_settings: settings only some presets define were blended over those presets alone, so one preset's value (galaxy coarse chroma, nebula aniso diffusion, pre_gradient_removal) applied to every target. Unlisted presets now vote for the baseline value. - frame_processor: pool workers never received scalar masters (dark_exptime), so mismatched-exposure darks were subtracted unscaled on the default parallel path. - cli: the calibration-analysis block reassigned the target-directory loop variable to the master dark, so hierarchical sessions with darks lost their info.json metadata. - photometry_core/color_calibrate: 3-axis WCS from the stacked cube made --photometry and --color-calibrate fail silently; the colour correction ratio was also self-normalised to exactly 1. - stacking: the patch-weighted path replaced median/linear_fit/ivw/ wavelet with an unrejected weighted mean under --auto. - registration: match_stars_affine subtracted the calculate_shift seed instead of adding it. - pipeline: phase-1/2 checkpoint resume skipped target inference and the auto-advisor (shared helper now used on every path). - psf_deconvolution: removed the broken blind-PSF "RL refinement" that flattened the PSF. - difference_imaging: ZOGY matched-filter kernel flux powers swapped. - utils/photometry*/pipeline: apply the FITS TIMEZONE to Origin's local DATE-OBS (obs_time_utc_iso), keep TIMEZONE in the stacked header, and decline a below-horizon zenith angle. - stacking + native fold_pixel: online sigma-clip froze pixels seeded by one sample; accept until 3 samples. astro_native 0.37.0. - frame_processor: GPU master cache keyed by host-array identity and checked per frame, so a later target can't reuse stale GPU masters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Fixes the 13 critical/high-severity bugs from a whole-codebase audit. Each fix has a regression test that fails on the old code. The one exception is #12's native path: that needs the old wheel to demonstrate, so only its numpy mirror was checked against the old code.
auto_settingsframe_processordark_exptimenever arrived, so mismatched-exposure darks were subtracted unscaled on the default parallel path.clid = masters['dark']overwrote the target-directory loop variable, so hierarchical sessions with darks lost theirinfo.json(Bayer, WCS, GPS, name).photometry_core,color_calibrate(3,H,W)cube broke Gaia projection, so--photometrynever produced results.color_calibratemedian(r / median(r))is always 1, so--color-calibratenever changed the image. Now usesmedian(expected / measured).stacking--autoat 15+ frames,median/linear_fit/ivw/waveletsilently became an unrejected patch-weighted mean.registrationmatch_stars_affinesubtracted thecalculate_shiftseed instead of adding it, so seeded affine failed for shifts over ~5 px.pipeline_infer_target_and_advisenow runs on every path.psf_deconvolutiondifference_imagingflux_new ≠ flux_ref.DATE-OBSis local time withTIMEZONEstored separately. The newutils.obs_time_utc_isoapplies it (dispersion zenith angle, photometry airmass, light-curve MJD), the stacked header now keepsTIMEZONE, and a below-horizon zenith angle returnsNone.stacking+ Rustfold_pixel--stream) froze pixels seeded by one sample. They now accept samples until they have 3. astro_native 0.36.0 → 0.37.0.frame_processorBehaviour changes to be aware of
--autooutput on most targets, including settings baked into saved_config.tomlfiles. Worth re-running a known real session before release.Test plan
pytest -q -n auto: 1723 passedruff check .clean;tools/lint_conventions.py0 errors (same 15 pre-existing warnings)--autoand compare against the 2.3.0 outputnativejob builds 0.37.0 and passes parity tests🤖 Generated with Claude Code