Repository navigation
Description
Release-blocking regression
Stage 3 rehearsal 31517075410 uses PyAutoFit b499d4367cfdf344af32d686246ded234f1ad74b (#1466), PyAutoGalaxy be61b8d0546c5d933ff9ef4bf9d445ba4595e03b (#568), TestPyPI 2026.8.11.1.dev71002, and the release profile (PYAUTO_TEST_MODE=1).
Valid factor-graph scripts still fail with child results missing per-analysis attributes such as .centre and .galaxies.
Root cause
start_resume_fit reads samples_summary.instance during test-mode validation, caching the global factor-graph instance in _instance. SamplesSummary.subsamples and Samples.subsamples shallow-copy the object and rebind it to a factor model, but retain that cached global instance. Child results therefore expose the global factor-index structure rather than the per-analysis model.
#1466's regression covered rejected final samples. Recovery creates a fresh summary, so it missed this valid-sample cache-warming path.
Plan
High level
- Invalidate cached instances whenever samples are rebound to a different model.
- Add direct cache-invalidation tests for summary and full samples.
- Add an end-to-end valid factor-graph regression in test mode.
- Preserve the PyAutoGalaxy parameter guards and the narrow
FitExceptionrejection contract. - Run focused tests, the complete PyAutoFit suite, CI, and the complete Stage 3 rehearsal.
Detailed
- Update
SamplesSummary.subsamplesandSamples.subsamplesin the samples interface implementation to clear_instanceafter copying and before/while rebinding the model/path metadata. - Audit the adjacent
with_paths/without_pathsrebinding helpers for the same stale-cache invariant and cover/fix them if applicable. - Add unit tests that first warm the global
.instance, then derive a child samples object and assert its instance is reconstructed using the child model and is not the global cached object. - Extend the existing fix: preserve guarded sample lifecycle #1466 factor-graph test area with a valid final-sample
PYAUTO_TEST_MODE=1case whose child results expose their expected per-analysis structure. - Retain existing tests proving non-
FitExceptionprogramming errors propagate.
Suggested branch: fix/factor-graph-subsamples-cache.
Activity