You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release run 28784914443
(PyAutoHeart #27, the first real release-profile validation) reported 42 script failures, split
across seven sibling prompts in PyAutoMind/draft/bug/health_fixes/. This task owns nine of
them: two autofit_workspace cookbooks failing with emcee's ValueError: Probability function returned NaN on a bounded LogUniformPrior, and seven autofit_workspace_test database/output
scripts reporting empty aggregators, stale/mismatched scraped search metadata and changed
likelihood assertions.
The premise is 6+ weeks stale and independently suspect, so this issue is deliberately
reproduction-gated: Phase 1 establishes what still fails on current main from a genuinely clean
state under the real release profile, and only the survivors get fix PRs.
Plan
Phase 1 (gate). Re-run all nine scripts on current main from a clean output/ under each
workspace's config/build/profile_release.yaml, resolving each script's env with PyAutoHands'
own resolver. Post a nine-row pass/fail/exception table here.
Decide from the gate. 0/9 failing → park the prompt like its sibling and close with the
evidence, no PR. Failures matching the prompt → Phases 2–4 for those only. Failures with a different shape → re-diagnose from the real error, never apply the prompt's prescribed fix.
Phase 2. Fix the Emcee / bounded-prior NaN in PyAutoFit source (not in the cookbooks).
Phase 3. Audit and fix the database directory/scrape/grid/sensitivity/minimal-output paths in
PyAutoFit; change a script assertion only where the documented contract intentionally changed.
Phase 4. Add regression coverage for each real defect, run PyAutoFit pytest, re-run all nine
scripts clean, then ship library-first.
Detailed implementation plan
Work Classification
Both (library + workspace) → /start_library first; workspace follow-up only if Phase 3 needs
a script change.
Affected Repositories
PyAutoFit (primary)
autofit_workspace
autofit_workspace_test
Branch Survey
Repository
Current Branch
Dirty?
./PyAutoFit
main
clean
./autofit_workspace
main
clean
./autofit_workspace_test
main
clean
No worktree conflicts — the live active.md claims cover PyAutoGalaxy, autolens_workspace_developer, autolens_profiling and PyAutoHands only.
Suggested branch:feature/autofit-sampler-database Worktree root:~/Code/PyAutoLabs-wt/autofit-sampler-database/ (created by /start_library)
Why this is reproduction-gated
The sibling prompt from this exact cluster was parked as not-reproducing. samples_parameter_paths.md (9 scripts, fix(autofit): resolve sample parameter-path KeyError under release profile #1327) passed every leg on current main — in-memory
and via true from-disk reload. Root cause was judged stale cached output/ in the release
run, not a library defect. Its planned.md entry ends: "Sibling health_fixes/ prompts from
the same run are suspect too."
A second sibling already shipped — aggregator_output_contracts (2026-07-07, fix: restore aggregator output contracts #1324 plus
three workspace PRs) touched result/aggregator prerequisites and generated paths, i.e. machinery
adjacent to several scripts here.
None of the nine scripts is parked in either workspace's config/build/no_run.yaml, so they
are live in validation. The currently-green per-PR "Smoke Tests" gate runs the smoke profile
over a curated subset and is not evidence about release-profile behaviour.
Implementation Steps
Phase 1 — clean-state reproduction under the release profile (the gate)
Resolve each script's environment with PyAutoHands/autobuild → build_env_for_script, run
with the workspace as CWD, so both the profile defaults and the in-file __Env__ / # ENV: real_search declarations are honoured. Do not hand-roll env vars.
Workspace
profile_release.yaml defaults
autofit_workspace (2 cookbooks)
PYAUTO_TEST_MODE=1 (reduced real sampler), PYAUTO_SKIP_{FIT_OUTPUT,VISUALIZATION,CHECKS}=0, PYAUTO_DISABLE_JAX=0, JAX_ENABLE_X64=True
autofit_workspace_test (7 scripts)
PYAUTO_TEST_MODE=0 (full real searches), PYAUTO_DISABLE_JAX=0, JAX_ENABLE_X64=True
Five of the seven test scripts carry an in-file ENV: real_search declaration
(database/{directory,scrape}/general.py, database/{directory,scrape}/multi_analysis.py, features/minimal_output.py); database/scrape/grid_search.py and database/scrape/sensitivity.py do not — check what they resolve to before running.
Clean-state rules (these are precisely what made the sibling prompt's failures evaporate):
Move output/ aside per workspace before each run — keep it for comparison, don't delete.
Database scripts need all three paths cleared: output/database/, output/database.sqlite, output/database.info. database.sqlite is a sibling of output/database/, so clearing only the directory leaves the aggregator reading the previous
run's rows — a false PASS, or inverted, a false stale-metadata FAIL.
Run the directory and scrape scripts in the documented order, one at a time, never against a
prior run's products.
Record per script: pass/fail, exact exception + file:line, and whether the failure shape
matches the prompt's claim. Post the table to this issue.
Phase 2 — Emcee / bounded-prior NaN (only if reproduced)
Locus is PyAutoFit source. emcee's stretch move proposes points whose LogUniformPrior
(1e-2 … 1e2, autofit_workspace/scripts/cookbooks/result.py:289) transform yields a
non-finite log-probability; emcee raises rather than treating it as zero-probability.
Investigate autofit/non_linear/search/mcmc/emcee/ plus the shared Fitness NaN guard (docs: pin Fitness's NaN guard contract — value-only, never gradient #1391
pinned the contract: value-only, never gradient). The fix is to return the resample sentinel
emcee understands for out-of-bounds/NaN evaluations, and to confirm the initializer never seeds
walkers outside the bounded prior support.
Fix the library, not the cookbook — cookbooks/{result,samples}.py are user-facing docs and
must not gain injected env vars, hard-coded paths or silent guards.
Phase 3 — database directory/scrape/grid/sensitivity (only if reproduced)
For each surviving script, audit against current PyAutoFit: output paths and unique identifiers,
session lifecycle, Aggregator.from_directory vs from_database + add_directory, grid-search
and sensitivity metadata writes, minimal_output expectations.
Fix the library where the contract is broken. Change a script assertion only where the
documented output contract intentionally changed, citing the changing commit/PR inline here.
Phase 4 — coverage, tests, re-run
Add a PyAutoFit unit/integration test per defect actually fixed — one that fails on the parent
commit. Run PyAutoFit pytest.
Re-run all nine scripts from clean state under the release profile. No new no_run.yaml
parkings may be introduced to reach green.
/ship_library (PyAutoFit) → /ship_workspace for any workspace edits.
Key Files
autofit_workspace/scripts/cookbooks/result.py — Emcee at L104/L258, LogUniformPrior at L289
autofit_workspace/scripts/cookbooks/samples.py — second Emcee NaN cookbook
*/config/build/profile_release.yaml — the release-fidelity env profiles
*/config/build/no_run.yaml — confirm none of the nine is parked (currently none is)
Cost warning
autofit_workspace_test runs at PYAUTO_TEST_MODE=0 — full searches, release cap 1800s/script.
Seven of those (including multi_analysis, grid_search, sensitivity, each running many fits)
plausibly means multiple hours for one clean pass. Phase 1 should run detached and sequentially.
Verification
Phase 1: the nine-row reproduction table posted here, produced from a moved-aside output/ and a
cleared database.sqlite/.info.
Phases 2–3: each fix has a PyAutoFit test that fails on the parent commit.
Phase 4: pytest green; all nine scripts green from clean state under profile_release.yaml.
Original Prompt
Click to expand starting prompt
Fix Autofit release sampler and database regressions
Release run 28784914443 failed two @autofit_workspace cookbooks and seven
@autofit_workspace_test scripts. The cookbook failures reproduce on current main:
Emcee proposes invalid LogUniform values and raises ValueError: Probability function returned NaN. Database failures include empty aggregators, stale/mismatched scraped
search metadata, and changed likelihood assertions.
Reproduce each script from a clean output/database state using the exact release
profiles; directory and scrape scripts must not consume prior local runs.
Fix Emcee initialization/proposal handling so bounded priors cannot emit NaN
probabilities during reduced release-mode sampling.
Audit database directory and scrape paths, identifiers, session lifecycle, grid and
sensitivity metadata, and minimal-output expectations against current PyAutoFit.
Fix library defects in PyAutoFit. Change script assertions only when the documented
output contract intentionally changed, with an explicit explanation.
Add unit/integration coverage, run PyAutoFit pytest, and rerun all nine scripts.
Overview
Release run
28784914443(PyAutoHeart #27, the first real release-profile validation) reported 42 script failures, split
across seven sibling prompts in
PyAutoMind/draft/bug/health_fixes/. This task owns nine ofthem: two
autofit_workspacecookbooks failing with emcee'sValueError: Probability function returned NaNon a boundedLogUniformPrior, and sevenautofit_workspace_testdatabase/outputscripts reporting empty aggregators, stale/mismatched scraped search metadata and changed
likelihood assertions.
The premise is 6+ weeks stale and independently suspect, so this issue is deliberately
reproduction-gated: Phase 1 establishes what still fails on current
mainfrom a genuinely cleanstate under the real release profile, and only the survivors get fix PRs.
Plan
mainfrom a cleanoutput/under eachworkspace's
config/build/profile_release.yaml, resolving each script's env with PyAutoHands'own resolver. Post a nine-row pass/fail/exception table here.
evidence, no PR. Failures matching the prompt → Phases 2–4 for those only. Failures with a
different shape → re-diagnose from the real error, never apply the prompt's prescribed fix.
PyAutoFit; change a script assertion only where the documented contract intentionally changed.
pytest, re-run all ninescripts clean, then ship library-first.
Detailed implementation plan
Work Classification
Both (library + workspace) →
/start_libraryfirst; workspace follow-up only if Phase 3 needsa script change.
Affected Repositories
PyAutoFit(primary)autofit_workspaceautofit_workspace_testBranch Survey
No worktree conflicts — the live
active.mdclaims coverPyAutoGalaxy,autolens_workspace_developer,autolens_profilingandPyAutoHandsonly.Suggested branch:
feature/autofit-sampler-databaseWorktree root:
~/Code/PyAutoLabs-wt/autofit-sampler-database/(created by/start_library)Why this is reproduction-gated
samples_parameter_paths.md(9 scripts, fix(autofit): resolve sample parameter-path KeyError under release profile #1327) passed every leg on currentmain— in-memoryand via true from-disk reload. Root cause was judged stale cached
output/in the releaserun, not a library defect. Its
planned.mdentry ends: "Sibling health_fixes/ prompts fromthe same run are suspect too."
aggregator_output_contracts(2026-07-07, fix: restore aggregator output contracts #1324 plusthree workspace PRs) touched result/aggregator prerequisites and generated paths, i.e. machinery
adjacent to several scripts here.
crashes on empty PrimaryHDU),
9f887a9b1(tolerate data-less HDUs in the scrape),8f6f4ef7d(sqlite slicing + direct-write
samples_summary), fix: exercise + assess the sqlite results database (scrape + direct-write) — aggregator Phase D #1377 (exercise/assess the sqlite resultsdatabase, scrape + direct-write), fix: Aggregator.from_directory is not test-mode-aware (interpolate tutorial IndexError) #1401 (
Aggregator.from_directorynot test-mode-aware), fix: three cadence/update bugs from the PR#1421 review (emcee+blackjax crash, double final update, stale stop_reason) #1422(emcee crash + cadence bugs), fix: expose valid stored sample pairs #1470/fix(autofit): reconstructing a stored sample raises through ignore_assertions=True #1486 (stored-sample recovery), docs: pin Fitness's NaN guard contract — value-only, never gradient #1391 (pin
Fitness'sNaN-guard contract: value-only, never gradient).
mainis at Release 2026.8.20.1.config/build/no_run.yaml, so theyare live in validation. The currently-green per-PR "Smoke Tests" gate runs the smoke profile
over a curated subset and is not evidence about release-profile behaviour.
Implementation Steps
Phase 1 — clean-state reproduction under the release profile (the gate)
Resolve each script's environment with
PyAutoHands/autobuild→build_env_for_script, runwith the workspace as CWD, so both the profile defaults and the in-file
__Env__/# ENV: real_searchdeclarations are honoured. Do not hand-roll env vars.profile_release.yamldefaultsautofit_workspace(2 cookbooks)PYAUTO_TEST_MODE=1(reduced real sampler),PYAUTO_SKIP_{FIT_OUTPUT,VISUALIZATION,CHECKS}=0,PYAUTO_DISABLE_JAX=0,JAX_ENABLE_X64=Trueautofit_workspace_test(7 scripts)PYAUTO_TEST_MODE=0(full real searches),PYAUTO_DISABLE_JAX=0,JAX_ENABLE_X64=TrueFive of the seven test scripts carry an in-file
ENV: real_searchdeclaration(
database/{directory,scrape}/general.py,database/{directory,scrape}/multi_analysis.py,features/minimal_output.py);database/scrape/grid_search.pyanddatabase/scrape/sensitivity.pydo not — check what they resolve to before running.Clean-state rules (these are precisely what made the sibling prompt's failures evaporate):
output/aside per workspace before each run — keep it for comparison, don't delete.output/database/,output/database.sqlite,output/database.info.database.sqliteis a sibling ofoutput/database/, so clearing only the directory leaves the aggregator reading the previousrun's rows — a false PASS, or inverted, a false stale-metadata FAIL.
prior run's products.
Record per script: pass/fail, exact exception +
file:line, and whether the failure shapematches the prompt's claim. Post the table to this issue.
Phase 2 — Emcee / bounded-prior NaN (only if reproduced)
LogUniformPrior(
1e-2 … 1e2,autofit_workspace/scripts/cookbooks/result.py:289) transform yields anon-finite log-probability; emcee raises rather than treating it as zero-probability.
Investigate
autofit/non_linear/search/mcmc/emcee/plus the sharedFitnessNaN guard (docs: pin Fitness's NaN guard contract — value-only, never gradient #1391pinned the contract: value-only, never gradient). The fix is to return the resample sentinel
emcee understands for out-of-bounds/NaN evaluations, and to confirm the initializer never seeds
walkers outside the bounded prior support.
cookbooks/{result,samples}.pyare user-facing docs andmust not gain injected env vars, hard-coded paths or silent guards.
Phase 3 — database directory/scrape/grid/sensitivity (only if reproduced)
session lifecycle,
Aggregator.from_directoryvsfrom_database+add_directory, grid-searchand sensitivity metadata writes,
minimal_outputexpectations.documented output contract intentionally changed, citing the changing commit/PR inline here.
Phase 4 — coverage, tests, re-run
commit. Run PyAutoFit
pytest.no_run.yamlparkings may be introduced to reach green.
/ship_library(PyAutoFit) →/ship_workspacefor any workspace edits.Key Files
autofit_workspace/scripts/cookbooks/result.py— Emcee at L104/L258,LogUniformPriorat L289autofit_workspace/scripts/cookbooks/samples.py— second Emcee NaN cookbookautofit_workspace_test/scripts/database/directory/{general,multi_analysis}.pyautofit_workspace_test/scripts/database/scrape/{general,grid_search,multi_analysis,sensitivity}.pyautofit_workspace_test/scripts/features/minimal_output.pyautofit/non_linear/search/mcmc/emcee/— Emcee search + fitness wiringautofit/database/— scrape, session lifecycle, aggregator queries*/config/build/profile_release.yaml— the release-fidelity env profiles*/config/build/no_run.yaml— confirm none of the nine is parked (currently none is)Cost warning
autofit_workspace_testruns atPYAUTO_TEST_MODE=0— full searches, release cap 1800s/script.Seven of those (including
multi_analysis,grid_search,sensitivity, each running many fits)plausibly means multiple hours for one clean pass. Phase 1 should run detached and sequentially.
Verification
output/and acleared
database.sqlite/.info.pytestgreen; all nine scripts green from clean state underprofile_release.yaml.Original Prompt
Click to expand starting prompt
Fix Autofit release sampler and database regressions
Type: bug
Target: health_fixes
Difficulty: too-large
Autonomy: supervised
Priority: high
Status: formalised
Context
Release run
28784914443failed two @autofit_workspace cookbooks and seven@autofit_workspace_test scripts. The cookbook failures reproduce on current
main:Emcee proposes invalid LogUniform values and raises
ValueError: Probability function returned NaN. Database failures include empty aggregators, stale/mismatched scrapedsearch metadata, and changed likelihood assertions.
Primary library: @PyAutoFit.
Scripts
autofit_workspace/scripts/cookbooks/result.pyautofit_workspace/scripts/cookbooks/samples.pyautofit_workspace_test/scripts/database/directory/general.pyautofit_workspace_test/scripts/database/directory/multi_analysis.pyautofit_workspace_test/scripts/database/scrape/general.pyautofit_workspace_test/scripts/database/scrape/grid_search.pyautofit_workspace_test/scripts/database/scrape/multi_analysis.pyautofit_workspace_test/scripts/database/scrape/sensitivity.pyautofit_workspace_test/scripts/features/minimal_output.pyRequired work
profiles; directory and scrape scripts must not consume prior local runs.
probabilities during reduced release-mode sampling.
sensitivity metadata, and minimal-output expectations against current PyAutoFit.
output contract intentionally changed, with an explicit explanation.