Skip to content

NaN follow-ups after #45/#47: mcrg np.var pre-checks bypass autocorr; DBL_MAX spacing edge #48

Description

@marcohost33-maker

From the independent rounds on #45 (d46e768) and #47 (4436c1e), 2026-09-26:

  • Callers pre-check np.var(x) > 0 before calling autocorr (mcrg_matrix.py:341, mcrg_multirg.py:263/338/480/591): np.var of a NaN series is NaN, nan > 0 is False, so the series never reaches the new _require_finite gate and tau silently becomes 0.5. Same orientation class as NaN passes two rejection guards (autocorr var0, clt sigma2_g): fail-open orientation #46. Fix: validate finiteness first, or call the autocorr entry and let it fail closed.
  • rhat.py spacing floor at DBL_MAX: the docstring says the floor changes nothing for normal numbers; at folded_scale = DBL_MAX np.spacing overflows to inf (RuntimeWarning) and the verdict flips OK → DEGENERATE_FOLDED (fail-closed direction). Document or guard.
  • '234/400' in the rhat_defined docstring (rhat = 1.0 under DEGENERATE_FOLDED) was not reproduced by the second reviewer (165/400 with another distribution) — state it as distribution-dependent.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions