Skip to content

repo compare: sign_flip_summary warns (overflow) computing mde for deltas near the float maximum #769

Open

Description

@antonwolfy

repos/compare.py sign_flip_summary computes mde as min_detectable(sd, n) (repos/compare_reach.py:26, (t.ppf(...) + t.ppf(...)) * sd / sqrt(n)) and rounds it with _round (round(value, 6) on a numpy float64). For a spread near the float maximum the product leaves the range.

Repro (offline, warnings.simplefilter("error")): sign_flip_summary([{"task": "t", "baseline": 0.0, "treatment": x, "delta": x} for x in [sys.float_info.max, 1.0, 1.0, 1.0, 1.0, 1.0]]) raises RuntimeWarning: overflow encountered in scalar multiply at compare_reach.py:26; with twelve deltas of plus and minus 1e307 it raises RuntimeWarning: overflow encountered in multiply in _round (compare.py:756) for an mde of 9.3e306. Without -W error the mde is inf or the unrounded value. The interval search itself no longer warns for these rows.

repo compare drops task values past 1e150, so the CLI does not reach this; a caller of sign_flip_summary does.

Fix options: compute the mde on a scaled sd as the interval search does, or leave mde as None when the product is not finite; round with float(value) so the rounding cannot overflow.

Found while fixing #725. The fix's PR is #770.

Activity

  1. self-assigned this
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions