Repository navigation
fix: quick update tolerates an out-of-disk max-likelihood instance - #1568
Merged
Merged
Conversation
…1567) `Fitness.manage_quick_update` called `model.instance_from_vector` on the running max-likelihood vector unguarded, inside the likelihood call the sampler drives. An unphysical vector (out-of-disk `ell_comps`, magnitude 1.009) raised `ModelParameterException` from the profile constructor and killed a 36 h Nautilus run at its first quick update (RAL 342301 task 3). Guard instance construction: log the skip with the traceback, bypass the visual on both the background-submit and synchronous branches, still write the model.results text, still reset the cadence counter. The synchronous render also gains the `except Exception` protection the background worker already had. Regression test fails on the unguarded code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5K4AXFBYMCPhbNFYA24YX
2 of 3 tasks
Collaborator
Author
|
Pipeline leg: PyAutoLabs/euclid_strong_lens_modeling_pipeline#53 (merge this library PR first). |
Jammy2211
deleted the
feature/quick-update-tolerates-invalid-instance
branch
September 7, 2026 17:14
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
A quick update is a convenience render inside the likelihood call the sampler is driving; nothing in it may terminate a search.
Fitness.manage_quick_updatecalledmodel.instance_from_vectoron the running max-likelihood vector unguarded, so when that vector mapped to an unphysical instance (an out-of-diskell_comps, magnitude 1.009, raising PyAutoGalaxy'sModelParameterExceptionfrom the profile constructor) the exception unwound throughnautilus.sampler.evaluate_likelihoodand killed a 36 h Euclid DR1 run 3m52s in, before any partial result existed (RAL array 342301 task 3). Closes #1567.The guard now wraps instance construction: on failure the skip is logged with the traceback, the visual (both the background-worker submit and the synchronous render) is skipped, the
model.resultstext is still written from the parameter vector, and the cadence counter still resets so the update does not re-fire on every later evaluation. The synchronous render also gains theexcept Exceptionprotection the background worker (BackgroundQuickUpdate._process_pending) already had.Exceptionis caught rather thanaf.exc.FitExceptionalone: the contract is "a render never kills a search", and this makes the synchronous path match the background one.Channel map: #1487 closed the results-write channel (
Result.instancefalls back toSamples.max_log_likelihood()); #1538 / PyAutoGalaxy#589 shipped the opt-in joint disk projection, which only gradient searches consume (Nautilus has no clipper hook); this PR closes the quick-update channel. The pipeline leg (euclid_strong_lens_modeling_pipeline, same issue) bounds the source MGEell_compsbox inside the unit disk so the unphysical region is not sampled in the first place.API Changes
None — internal. Behaviour change only: a quick update whose max-likelihood vector cannot be turned into a model instance, or whose synchronous visual raises, now logs and skips instead of propagating out of the likelihood call.
Test Plan
test_autofit/non_linear/test_quick_update_invalid_instance.py: the regression case fails on unfixed code (theValueError/FitExceptionpropagates) and passes with the guard; positive control (valid vector still renders); synchronous visual that raises is swallowed and logged.pytest test_autofit/non_linear: 803 passed, 1 skipped.Full API Changes (for automation & release notes)
Removed
Added
Changed
autofit.non_linear.fitness.Fitness.manage_quick_update— model-instance construction and the synchronousperform_quick_updatecall are guarded; failures log (logger.exception) and skip the visual; the search continues andmodel.resultsis still written.Migration
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code
https://claude.ai/code/session_01P5K4AXFBYMCPhbNFYA24YX