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
numpy_impl share_comps produces NaN mu/beta and reports success #240
Two RuntimeWarning: invalid value encountered in divide fire during the fit, at numpy_impl/core.py:1225 (dmu_n/dmu_d) and :1231 (dbeta_n/dbeta_d). The fit then returns normally: A is clean, gm is clean, and nothing surfaces the NaNs.
Why
Merging a column across models leaves the merged-away column with no responsibility mass, so its mixture denominators go to zero and the update is 0/0.
The PyTorch backend already handles exactly this: merged-away columns are frozen, "avoiding 0/0 NaN that Fortran tolerates behind its comp_used mask" (AGENTS.md, issue #60). Fortran survives it because comp_used masks the dead columns. In numpy_impl neither guard is present, and comp_used stays all-True, so nothing masks them and nothing reports them.
Why it matters
This is a silent failure of the kind the project rules single out: a degenerate result presented as a successful fit. The AMICA wrapper's degenerate-fit contract (#50) is torch-only, so AMICA_NumPy has no equivalent refusal.
Not a regression. Found while adding share_comps coverage for #219; the gm-ordering change there touches dAk only and cannot affect mu/beta.
Work
Freeze merged-away columns in numpy_impl as the PyTorch backend does, or mask them via comp_used as Fortran does. Pick one and match a reference rather than inventing a third behavior.
Whichever is chosen, a fit that ends with non-finite mixture parameters must not report success.
Cross-backend test that share_comps leaves finite parameters in both backends (.rules/backend_parity.md).
Activity
Gate every write on one finiteness check
Test that checkpoints never persist NaN
Fix numpy_impl share_comps A-update and NaN mixture parameters (#257)
Add MLX sharing edge-case tests
Phase 2: port share_comps to the MLX backend (#268)
Complete 0.3.3 changelog for release (#302)