Skip to content

Bound Nautilus sampling time across updates - #1793

Merged
Jammy2211 merged 4 commits into
mainfrom
feature/sed-waveband-search-cap
Nov 24, 2026
Merged

Jammy2211 merged 4 commits into
mainfrom
feature/sed-waveband-search-cap

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

A single slow Euclid waveband can exhaust its tile’s 12-hour job allocation. PyAutoFit now lets a Nautilus fit share one time budget across sampler updates. This is the library change for Euclid #136.

API Changes

af.Nautilus(timeout=seconds) accepts a finite positive time budget. The default remains unbounded. Nautilus checks time between batches, so an in-flight likelihood evaluation or bound update can finish after the deadline. An intermediate PyAutoFit update spends the same budget. Setup and finalization sit outside the sampling deadline.

When a budget stops sampling with usable samples, result.samples.samples_info["termination_reason"] records timeout or n_like_max. A cap before any posterior samples raises af.exc.SearchBudgetExceeded, exposes the same reason and leaves the model editable. Ordinary convergence takes precedence when it coincides with a limit.

Test Plan

  • Exercised the real Nautilus sampler with a controlled clock on Python 3.13, including zero and one completed batch, both CPU paths, archived metadata and a recoverable empty result. Checked shared deadlines across updates, convergence coincident with a cap, existing unbounded calls and legacy identifiers. The Nautilus and single-CPU modules passed 34 tests with one expected failure. The focused Python 3.12 budget cases passed all 14 tests.

  • Ran a real two-band plateau-plus-spike experiment through the proposed Euclid consumer at a reduced 50-call budget. Both bands returned partial samples and emitted the correct cap status.

  • Independent review identified a frozen model after the empty-posterior exception. The fix and regression are included.

  • Covered the full 4,328-case PyAutoFit collection across successive runs. After updating the API expectations and keeping the search module within its existing line limit, all failed cases passed on rerun. Two tests skipped and one expected failure remained. Final Nautilus and conformance verification: 141 passed and one expected failure.

  • Scoped Heart dev-ship gate: GREEN. Advisories: PyAutoFit: 4 commit(s) behind origin; PyAutoGalaxy: 4 commit(s) behind origin; PyAutoLens: 4 commit(s) behind origin; test run status unknown (no report.json); release validation incomplete: no rehearsal for current source.

Full API Changes (for automation & release notes)

Added

  • af.Nautilus(timeout=None) accepts an optional budget in seconds.
  • af.exc.SearchBudgetExceeded is a subclass of SearchException. Its termination_reason identifies the exhausted budget when there is no posterior.
  • Samples.samples_info["termination_reason"] records the reason for early budget termination when there are samples.

@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: Euclid #140 applies this budget to each non-VIS band, consumes the two termination reasons and flags capped fits in the catalogue. The pipeline's 511 fast tests and nine smoke scripts passed locally. The real tile rerun is tracked in Euclid #136.

@Jammy2211
Jammy2211 merged commit 08eeecd into main Nov 24, 2026
6 checks passed
@Jammy2211
Jammy2211 deleted the feature/sed-waveband-search-cap branch November 24, 2026 12:53
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 25, 2026
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