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
{{ message }}
Repository navigation
fix(graphical): EP statistics fix batch — F1/F2/F4/F8 from #1332 #1350
Executes the remainder of the #1332 audit's recommended fix batch, now that the #1331 decision hub is resolved and shipped (#1345, #1348) and F3/F10 (#1349), F5 (#1334), F7(c) (#1345) have landed. Prompt: PyAutoMind/bug/autofit/ep_statistics_fix_batch.md.
Plan
F1 / F7(a) — MeanField.__truediv__ / __pow__ pass log_norm into the plates ctor slot (evidence silently dropped; a float lands in _plates). Fix the ctor calls; fix __pow__'s meaningless log_norm * other.log_norm branch.
F2 (+extended) — GammaMessage.kl and BetaMessage.kl compute KL(other‖self) while Normal/TruncatedNormal compute KL(self‖other); EPHistory.kl_divergence sums per-variable KLs, so mixed graphs mix directions. Contract: self.kl(other) = KL(self‖other), documented once on AbstractMessage.kl, aligned family-wide, enforced with a numerical property test (sample-based KL estimate per family).
F4 — AbstractMessage.update_invalid scalar branch is self-flagged broken (the BAD_PROJECTION recovery path). Fix + test both branches.
F8 — delete dead/suspect quasi-Newton variants in laplace/newton.py (diag_sr1_bfgs_update → returns None; bfgs1_update sign-disputed vs exported bfgs_update; diag_sr1_update_ unused).
Out of scope (parked with notes on #1332): F6 truncated-KL moments, F7(b) factor-evidence recording design, F9 private scipy import.
Validation: full suite; new unit tests per fix; autofit_workspace_test/scripts/graphical/ep_{parity,deterministic,exact}.py as integration smoke.
All four findings executed; one verdict flipped honestly: F4 is an exoneration, not a fix — the self-flagged scalar branch is empirically correct (messages iterate over parameters; all-or-nothing swap valid for ndim==0); the stale TODO is replaced and both branches pinned by tests.
Gate: suite 1465/14 with one pre-existing failure (test_full_hierachical — fails on clean main with this batch fully stashed, bisect-proven ×3; filed as bug/autofit/hierarchical_ep_test_flaky.md — notably the #1349 diagnostics artifacts are the right instrument for it) · EP integration smoke 3/3 PASS · KL direction certified per-family by Monte Carlo · Heart YELLOW, identical 6-reason acked set.
Activity
Jammy2211 commentedon Jul 10, 2026
Shipped at PR-open — #1351
All four findings executed; one verdict flipped honestly: F4 is an exoneration, not a fix — the self-flagged scalar branch is empirically correct (messages iterate over parameters; all-or-nothing swap valid for ndim==0); the stale TODO is replaced and both branches pinned by tests.
Gate: suite 1465/14 with one pre-existing failure (
test_full_hierachical— fails on clean main with this batch fully stashed, bisect-proven ×3; filed asbug/autofit/hierarchical_ep_test_flaky.md— notably the #1349 diagnostics artifacts are the right instrument for it) · EP integration smoke 3/3 PASS · KL direction certified per-family by Monte Carlo · Heart YELLOW, identical 6-reason acked set.Out-of-scope reminders parked on #1332: F6 (truncated KL moments), F7(b) (factor-evidence recording design), F9 (private scipy import). Merge stays human.
Jammy2211 commentedon Jul 10, 2026
Merged —
c5c50ccavia #1351 (merged-unchanged). Closing.