Skip to content

complete: natural-logpdf-clamps-neginf (PyAutoFit#1534) - #352

Merged
Jammy2211 merged 2 commits into
mainfrom
claude/loggaussian-prior-support-ngh59x
Aug 27, 2026
Merged

complete: natural-logpdf-clamps-neginf (PyAutoFit#1534)#352
Jammy2211 merged 2 commits into
mainfrom
claude/loggaussian-prior-support-ngh59x

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Mind state for the last task in the loggaussian-prior-support lineage. Two commits, no code.

1. Filed (6965533). draft/bug/priors/natural_logpdf_clamps_neginf.md — the loose end noted in PyAutoFit#1532's Shipped comment and not filed at the time.

2. Completed (4545add). PyAutoFit#1534 merged as 5c391fd, issue #1533 closed; record written, prompt retired.

What the bug was

AbstractMessage.natural_logpdf called nan_to_num with nan=-inf but default posinf/neginf, so a genuine -inf was clamped to -1.7976931348623157e+308. The call did the opposite of its intent for exactly the inputs that already had the right answer.

The asymmetry is what named the mechanism, on LogGaussianPrior(0.4, 1.3):

message.logpdf(-1.0) = -inf                       # log(-1) is NaN -> nan=-inf applies
message.logpdf( 0.0) = -1.7976931348623157e+308   # log(0) is -inf -> default neginf clamps

Two out-of-support points, two different answers, from one line — and the clamped value is exactly -sys.float_info.max. It matters because that value is finite, and isfinite is what optax.apply_if_finite and non_linear/clipper.py branch on to detect a lane leaving the prior support.

Sweep

draft/research/graphical_ep/transformed_message_declares_support.md carried this as an open, "probably harmless, unverified" observation, and its measurement table's 0.0 row is now stale on main from 5c391fd. Repointed to the fix and the record, with a note to re-run the probe rather than trust the printed value.

The prompt's conclusion is unaffected — EP was protected by the message returning a clean -inf at negative values, which is the row that mattered, not the 0.0 row — so it stays open at its reduced priority rather than being retired.

A process note in the record

complete/2026/08/natural-logpdf-clamps-neginf.md closes with three stale-API misreadings from this session's CI waits, because they cost more time than the fix did. GitHub's PR check endpoints repeatedly served data an hour behind reality, producing one false "stall", one false "no CI configured", and one false hang diagnosis that wrongly implicated the fix itself. The reliable read is list_workflow_jobs with per-step completed_at timestamps, compared against elapsed wall-clock.

Checks

  • lifecycle.py check — OK
  • lifecycle.py index --check — OK (1160 records)
  • intake dashboard --checkdashboard.md + dashboard.html are current

Generated by Claude Code

claude added 2 commits August 27, 2026 17:44
The loose end noted in PyAutoFit#1532's Shipped comment and not filed at the
time. `AbstractMessage.natural_logpdf` reduced through
`nan_to_num(..., nan=-inf)` with `posinf`/`neginf` left at their defaults, so a
genuine `-inf` became `-1.7976931348623157e+308` -- the opposite of the call's
intent, for the inputs that already had the right answer.

Measured: LogGaussianPrior(0.4, 1.3).message.logpdf(0.0) was exactly
-sys.float_info.max, while logpdf(-1.0) was -inf. The asymmetry is the proof of
mechanism -- log(0) is -inf and gets clamped, log(-1) is NaN and is mapped
correctly.

It matters because -1.8e308 is finite, and isfinite is what
optax.apply_if_finite and non_linear/clipper.py branch on to detect a lane
leaving the prior support.

Issued as PyAutoFit#1533; PR PyAutoFit#1534 is open and NOT merged -- its two
JAX CI legs have been in "Run tests" for over an hour while the nojax leg
passed in 58s, which is unresolved. The prompt stays in draft/ until that is
settled.

Dashboard regenerated; intake dashboard --check current; lifecycle.py check OK.

Co-Authored-By: Claude <noreply@anthropic.com>
PyAutoFit#1534 merged as 5c391fd; issue #1533 closed. Record written, prompt
folded out of active/.

natural_logpdf called nan_to_num with nan=-inf but default posinf/neginf, so a
genuine -inf became -1.7976931348623157e+308 -- the opposite of the call's
intent, for the inputs that already had the right answer. It matters because
that value is finite, and isfinite is what optax.apply_if_finite and
non_linear/clipper.py branch on to detect a lane leaving the prior support.

Also repoints draft/research/graphical_ep/transformed_message_declares_support.md,
which carried this as an open, "probably harmless" observation and whose
measurement table's 0.0 row is now stale. Its conclusion is unaffected -- EP was
protected by the -inf at negative values, not by the 0.0 row -- but the prompt
now says so rather than leaving a falsified number for the next reader.

complete/index.md refreshed (1160 records), dashboard regenerated,
intake dashboard --check current, lifecycle.py check OK.

Co-Authored-By: Claude <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 8a40d7e into main Aug 27, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the claude/loggaussian-prior-support-ngh59x branch August 27, 2026 17:51
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