Repository navigation
fix(eval): checked_mean sums floats exactly, not by the version's sum() #823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
249f63e
fix(eval): checked_mean sums floats exactly, not by the version's sum…
antonwolfy 66447ef
fix(eval): checked_mean keeps integer contributions beside floats
antonwolfy 3ded3db
fix(eval): checked_mean refuses a total only the exact sum sees beyon…
antonwolfy cbafa13
fix(eval): check_sum_range sums the magnitudes of integers exactly
antonwolfy 5dcaf03
fix(eval): pin the exact-total refusal and the integer case on inputs…
antonwolfy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ### Fixed | ||
|
|
||
| - **Mean of float deltas no longer depends on the Python version** — `checked_mean`, which gives the `repo compare` summary mean (`sign_flip_summary`) and the per-question means of the model comparison, added floats with `sum()`, which compensates only from Python 3.12: `[1e307] * 6 + [-1e307] * 6` gave `-2.079e290` on 3.11 and `0.0` on 3.12. It now sums with `math.fsum` (exactly rounded), so the mean is the same on every version and agrees with the interval. Integer-only inputs are still summed as exact integers, and integers mixed with floats as exact fractions (`[2**53 + 1, -(2**53), 0.0]` gives `1 / 3`, not `0.0`). A mean that is not affected by rounding is unchanged. The range check on the sum of magnitudes is exact too, so values whose exact total passes the float range (`0x1.fffffffffffffp+1023, 2**969, 2**969`) raise the requested error with its context on Python 3.11, not a bare `OverflowError`. With an integer among the values that range check sums the magnitudes exactly too, so integers whose exact total fits the float range are taken (`fsum` would round each to a float first and overflow; `main` refused them when a float came first, as in `[0.0, m - 2**970 + 1, 2**970 - 1]` with `m` the largest float). The mixed `[m, 2**969, 2.0**969]`, whose exact total passes the range, is refused now, where `main` returned the mean of the rounded total. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.