Skip to content

fix: preserve guarded sample lifecycle - #1466

Merged
Jammy2211 merged 1 commit into
mainfrom
fix/guarded-sample-lifecycle
Aug 11, 2026
Merged

fix: preserve guarded sample lifecycle#1466
Jammy2211 merged 1 commit into
mainfrom
fix/guarded-sample-lifecycle

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Keep the new model-parameter guards, while making every stored-sample consumer treat guard failures as rejected historical points instead of fatal infrastructure errors.

This addresses the two independent regressions behind the blocked nightlies:

Changes

  • Preserve samples.model, the concrete samples class, and samples_info when test-mode recovery replaces a rejected final sample.
  • For instance materialization, fall back from an invalid maximum-likelihood historical point to the next valid point.
  • Retry PDF draws rejected by FitException, with a bounded attempt limit and a clear SamplesException if no valid point exists.
  • Skip FitException-invalid points in weighted aggregator replay while keeping samples and weights aligned.
  • Reconstruct aggregator points through the stored model so shared factor-graph children remain intact.
  • Catch only FitException; unrelated programming errors still propagate.

The PyAutoGalaxy guards themselves are unchanged.

Regression coverage

Adds coverage for:

  • factor-graph per-analysis children
  • preservation of sampler subtype and metadata
  • invalid historical maximum-likelihood fallback
  • bounded PDF redraw and all-invalid failure
  • weighted aggregator filtering and weight alignment
  • shared factor-graph children during aggregator replay
  • propagation of non-FitException errors

Validation

  • Focused regression suite: 48 passed
  • Full PyAutoFit suite: 1723 passed, 2 skipped
  • git diff --check: clean

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