Repository navigation
Description
Overview
The prior-support Clipper (#1477) does not enter the search identifier, so two runs differing only in prior-support enforcement — which demonstrably changes the answer — share one output directory, and with the .completed short-circuit the later run silently returns the earlier one's numbers (this bit the phase-2 validation campaign, which worked around it with unique per-arm names). Decision recorded in PyAutoMind (2026-08-18, human): the clipper enters the identifier, scoped to the searches that consume one; nested-sampler and MCMC identifiers must stay byte-for-byte identical.
Plan
- Declare the clipper an identifier field on the two clipper-consuming search families (multi-start gradient and BFGS), so runs with different clippers get different output directories.
- Leave the nested samplers, MCMC searches, and
Drawercompletely untouched — their identifiers must not re-key. - Pin the nested-sampler identifiers with regression tests captured on
mainbefore the change, plus a structural tripwire so a future refactor cannot silently put the clipper within their reach. - State plainly in the release notes that existing multi-start / (L)BFGS output directories re-key (orphaned on disk, not deleted).
Detailed implementation plan
Affected Repositories
- PyAutoFit (primary, only)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoFit | main @ c302f51 | clean |
Suggested branch: claude/clipper-search-identifier-4cowi2
Mechanism (verified at c302f51)
- The identifier hashes
[search, model](+unique_tag) —autofit/non_linear/paths/abstract.py:279-283. - An object declaring
__identifier_fields__contributes only those attributes plus its class name —autofit/mapper/identifier.py:113-121; an empty tuple contributes the class name only. NonLinearSearch.__identifier_fields__ = tuple()(abstract_search.py:318) and neitherAbstractMultiStartGradientnorAbstractBFGSoverrides it — so today only their class name hashes, which is why the clipper (and everything else on them) never entered.clipperis resolved onAbstractMLE.__init__(mle/abstract_mle.py:16-22); the nested samplers and MCMC searches contain zero clipper references and declare their own explicit__identifier_fields__tuples, so they are unchanged by construction.
Implementation Steps
autofit/non_linear/search/mle/multi_start_gradient/search.py— add__identifier_fields__ = ("clipper",)toAbstractMultiStartGradient(coversMultiStartAdam/ADABelief/Lion/Prodigy).autofit/non_linear/search/mle/bfgs/search.py— add__identifier_fields__ = ("clipper",)toAbstractBFGS(coversBFGS/LBFGS).Draweruntouched: it inherits theclipperattribute but never uses it (zero references inmle/drawer/search.py) — a setting that cannot affect the result must not re-key it. Its__identifier_fields__ = ("total_draws",)stands.- No change under
nest/ormcmc/.
Tests
test_autofit/database/identifier/test_identifiers.py::test_dynesty_static(line 389) pins DynestyStatic's exact hash list — must pass unchanged; it is the existing guard for the hard constraint.- Add sibling hash-list pins for
NautilusandDynestyDynamic(ideally Emcee/Zeus/NUTS too), captured onmainbefore the change and asserted after. - Structural tripwire: nested samplers have no
clipperattribute (assert not hasattr(af.Nautilus(), "clipper")) — trips if a refactor hoistsclipperfromAbstractMLEtoNonLinearSearch. - MLE side:
MultiStartAdam()vs explicitclipper=ClipperNone()identical; vsClipperPriorBox()different; twoClipperPriorBoxmargins different; same trio onLBFGS.
Key Files
autofit/non_linear/search/mle/multi_start_gradient/search.py— first identifier-fields declarationautofit/non_linear/search/mle/bfgs/search.py— second identifier-fields declarationtest_autofit/database/identifier/test_identifiers.py— pins + tripwire + MLE separation tests
Question for the human at PR time
Because these searches' __identifier_fields__ is empty today, n_starts, total_steps, learning_rate etc. also collide. This PR re-keys the MLE directories anyway, so widening the tuple now would pay the orphaning cost once instead of twice — but that widens scope beyond the recorded decision. Default is clipper-only; if widening is declined, it gets filed as its own prompt.
Accepted cost (for the release notes)
Every existing MultiStart* / BFGS / LBFGS output directory re-keys, including default-ClipperNone runs (the hash gains the clipper field itself). Stored results are orphaned on disk, not deleted; re-running recomputes into a fresh directory. Nested-sampler and MCMC results are unaffected.
Original Prompt
Click to expand starting prompt
PyAutoMind active/clipper_in_search_identifier.md (formerly draft/feature/autofit/) — the decided revision of the prompt, recorded 2026-08-18. See that file for the full decision record, the rejected options, and the grounding audit.
Decision, verbatim: "The clipper enters the search identifier — but only on the searches that consume one, and the nested samplers' identifiers must stay byte-for-byte identical."
Activity
Jammy2211 commentedon Aug 18, 2026
Library PR created: #1494 (branch
claude/clipper-search-identifier-4cowi2,pending-release).__identifier_fields__ = ("clipper",)onAbstractMultiStartGradientandAbstractBFGS— nothing else touched.Nautilus,DynestyStatic,DynestyDynamic), MCMC (Emcee,Zeus) andDraweridentifiers byte-identical to their pre-change captures;ClipperNonedefault does not fork;ClipperPriorBoxand its margins do.test_nautilus.py::test__single_core_builds_no_pool(reproduced identically on a clean tree)./start_workspacefollow-up needed.__identifier_fields__beyondclipperin the same re-key event, or file separately (default).Merge stays human.
Generated by Claude Code