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
checked_mean returns a rounding residue for deltas that cancel on Python < 3.12 because it uses plain sum() #772
dokimi/eval/finite_delta.py:68checked_mean computes sum(values) / len(values). Before Python 3.12 sum() adds left to right without compensation, so for large values the partial sums round and a set that cancels exactly gives a residue: [1e307] * 6 + [-1e307] * 6 gives -2.079e290 on Python 3.11 (the value in the CI log of #770) and 0.0 on 3.12+ (compensated). The repo compare summary mean (sign_flip_summary) therefore differs by Python version, while the interval uses math.fsum. Reproduced here by running checked_mean with sum replaced by a left-to-right loop (no 3.11 interpreter on the host). Fix: use math.fsum for the finite case (after check_sum_range) and check the tests that compare against sum(...) / n.
Activity