Skip to content

record: EP initializer-exception task shipped; fold the misfiled "EP nan" prompt - #130

Merged
Jammy2211 merged 4 commits into
mainfrom
claude/ep-nan-likelihood-bug-ugkj79
Aug 5, 2026
Merged

record: EP initializer-exception task shipped; fold the misfiled "EP nan" prompt#130
Jammy2211 merged 4 commits into
mainfrom
claude/ep-nan-likelihood-bug-ugkj79

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Mind-side bookkeeping for PyAutoFit#1454 (merged, f02ea7e).

Two commits

1. Fold graphical_ep_nan_likelihood_release_leg.md into the initializer prompt.

The 2026-08-03 release-leg failure was filed as an all-nan likelihood bug. It is not one. The message it quoted is the body of InitializerException, and the guard that raises it is np.allclose over the figures of merit — which is False for nan, and figure_of_metric discards nan draws before the check anyway. The condition detected is all-equal, finite likelihoods: PyAutoFit#1405's defect 2, on a non-hierarchical graph.

Folded rather than issued as a fourth EP issue, carrying the three things the release-leg run added: it is not HierarchicalFactor-specific (ep.py shares a prior across two AnalysisFactors and failed; hierarchical.py passed in the same shard), it can only surface on the release leg (smoke bypasses the sampler), and the misleading nan line should be corrected as part of the fix — which it was.

2. Advance the prompt to complete/2026/08/ via lifecycle.py record.

Its PR is merged. No separate issue existed — the work sat under the #1405 umbrella, which stays open for follow-up 2 (the scale-collapse basin, untouched).

On the record's shape

It leads with traps rather than outcome, because that is where this task's cost went:

  • the nan red herring above, which sent the original triage after something that could not exist;
  • Status's third positional parameter is updated, not flag — so every errored factor step was written to ep_history.csv as a success, and any "EP looks healthy" read off those CSVs pre-2026-08 is suspect;
  • a returned StatusFlag.FAILURE is routine (the Laplace optimiser emits one per failed line search) and must not be counted as a failure;
  • a consecutive-failure tally cannot catch the case #1405 asked it to, because zero KL between identical sweeps reads as convergence and ends the run before any count matters;
  • a warm output/ hides the bug entirely by resuming past initialisation — a 12-run loop showed nothing until the directory was cleared each run, after which 2 of 8 runs hit it naturally.

Also recorded: the posture change from #1405's "abort" to a loud warning that still returns, and the pre-existing HowToFit tutorial_5 bug found along the way (parked as NEEDS_FIX; PR on that repo's matching branch).

lifecycle.py check and lifecycle.py index --check both pass.


Generated by Claude Code

claude added 4 commits August 5, 2026 05:38
The 2026-08-03 nightly release leg failed `autofit_workspace_test
scripts/graphical/ep.py` with the PyAutoFit initializer diagnostic, and was
filed as an all-`nan` likelihood bug. It is not one.

The exception lists "always returning `nan`" as a possible cause, but the guard
that raises it is `np.allclose(fom[0], fom[1:])`, and `np.allclose` defaults to
`equal_nan=False` — an all-`nan` figure-of-merit list returns False and cannot
raise it. The detected condition is all-*equal* finite likelihoods, i.e. the
degenerate factor state already characterised as defect 2 of PyAutoFit#1405.

So this is that defect, not a fourth one. Folded into the follow-up-1 prompt
rather than issued separately, carrying three things the release-leg run adds:

- It is not hierarchical-specific. `ep.py` shares a `centre` prior across two
  `AnalysisFactor`s with no `HierarchicalFactor`, while `hierarchical.py`
  passed in the same shard — so scope the fix and its test to the per-factor
  update site in general.
- It is release-profile-only: the smoke gate bypasses the sampler, so the
  initializer is never reached there.
- The misleading `nan` line in the exception text should be corrected as part
  of the fix, at both raise sites (`samples_from_model` and `samples_jax`).

Also carries forward the folded prompt's objection — that degrading the crash
would turn the release leg green while EP still degenerates — as a loudness
requirement rather than a reason to leave the crash in place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSBb1i58cNhTx64yxBGPfs
PyAutoFit#1454 merged (f02ea7e), so the prompt advances draft/ -> complete/
via lifecycle.py record. No separate issue was ever cut for it — the work sat
under the PyAutoFit#1405 umbrella, which stays open for follow-up 2 (the
scale-collapse basin, untouched).

The record carries the traps rather than just the outcome, because most of the
cost of this task was in them: the `nan` in the exception text is a red herring
(np.allclose is False for nan, and nan draws are discarded before the check);
`Status`'s third positional parameter is `updated`, not `flag`, so errored
factor steps were logged to ep_history.csv as successes; a returned
StatusFlag.FAILURE is routine and must not be counted; a consecutive-failure
tally cannot catch the case it was written for, because zero KL between
identical sweeps reads as convergence and ends the run first; and a warm
output/ hides the whole bug by resuming past initialisation.

Also records the posture change from #1405's "abort" to a loud warning that
still returns, and the pre-existing HowToFit tutorial_5 bug found along the way
and parked as NEEDS_FIX.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSBb1i58cNhTx64yxBGPfs
Main gained a completion record (pr-ci-for-own-test-suite) after this branch
was cut, so the index generated here was stale against the merge result even
though it was fresh on the branch — which is what the drift check caught.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSBb1i58cNhTx64yxBGPfs
@Jammy2211
Jammy2211 merged commit 905c93b into main Aug 5, 2026
1 check passed
Jammy2211 pushed a commit that referenced this pull request Aug 15, 2026
PyAutoBrain#130's stated close-condition named two remaining human decisions,
and both turn out to be already answered: the scheduled-nightly standing grant
was made 2026-07-09 (PyAutoBrain/AUTONOMY.md, predating the issue and live every
night since), and the memory-system question is decided in the design doc's own
§6 -- "memory earns its keep as consult-on-purpose context and fails reliably as
guard-at-the-moment", with the conversion policy that follows from it.

What was genuinely still open is a different §9 item: mitigation 6 shipped with
a commitment to "review whether it went rote after ~10 ships", and nothing in
the Mind tracked it -- no draft, active, planned, parked or ideas entry. Filing
it here so closing #130 does not drop it.

Filed through the Intake Agent (research / PyAutoBrain / small / safe); the body
is expanded from intake's single-paragraph capture into the investigation
sections, including the rubber-stamping signature to look for and a
validate-the-instrument note, since a low firing rate and a broken lifter look
the same from the outside (the D1 null-result-as-finding trap).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FTzN9AEF8DY2jTX2qxVHRk
Jammy2211 pushed a commit that referenced this pull request Aug 18, 2026
PyAutoBrain#130's stated close-condition named two remaining human decisions,
and both turn out to be already answered: the scheduled-nightly standing grant
was made 2026-07-09 (PyAutoBrain/AUTONOMY.md, predating the issue and live every
night since), and the memory-system question is decided in the design doc's own
§6 -- "memory earns its keep as consult-on-purpose context and fails reliably as
guard-at-the-moment", with the conversion policy that follows from it.

What was genuinely still open is a different §9 item: mitigation 6 shipped with
a commitment to "review whether it went rote after ~10 ships", and nothing in
the Mind tracked it -- no draft, active, planned, parked or ideas entry. Filing
it here so closing #130 does not drop it.

Filed through the Intake Agent (research / PyAutoBrain / small / safe); the body
is expanded from intake's single-paragraph capture into the investigation
sections, including the rubber-stamping signature to look for and a
validate-the-instrument note, since a low firing rate and a broken lifter look
the same from the outside (the D1 null-result-as-finding trap).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FTzN9AEF8DY2jTX2qxVHRk
@github-actions
github-actions Bot deleted the claude/ep-nan-likelihood-bug-ugkj79 branch August 25, 2026 14:02
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.

2 participants