Repository navigation
Document and test ultra-narrow float bins (no output change) - #87
Merged
Merged
Conversation
Bins no float64 value can fall in may share a centre; add reachable_float_bins and centres_map_back to state and test the invariant. No output changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
guijacquemet
marked this pull request as ready for review
November 9, 2026 05:55
This was referenced Nov 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #86
Takes the first option of the issue: document, test, and change no output. The bin count is not reduced; bins, counts and representatives are bit-identical to
main.What is documented
bin_centres.float_bin_centresdocstring anddocs/contract.md(histogram section),CHANGELOG.md,AGENTS.mdmap.[lo, hi]holds fewer representable floats than bins ([0, 5e-324], 4 bins: centres0, 0, 5e-324, 5e-324), bins no float64 value can fall in may share a centre.[0, 3*5e-324], 3 bins: bin 1 holds only5e-324, its midpoint1.5*5e-324rounds to2*5e-324, in bin 2). This is slightly weaker than "every reachable bin maps back", which is false in that case; it is documented and tested rather than changed.New module
bin_reachability.py(histogram.py is not touched)float_bin_indices: the histograms' binning as a function.reachable_float_bins: exact bisection over ordered float64 values (position is monotone), about 64 vectorised steps.centres_map_back.Tests (
tests/test_bin_reachability.py)[0, 3*5e-324]one-value-bin case.Comparison with
maintools/dump_outputs.py --corpusdumps histograms of every pixel type over extreme, subnormal, one-ulp, narrow, ordinary and wide ranges, 2 to 1024 bins (4 to 256 for integers), min-max and robust, whole and in blocks (4764 lines, bit-exact viafloat.hex). Run withPYTHONPATH=<base>/srconmain(0811bca) and on this branch: botha4c37fdfc41d640db1f8849803b59ffbc47d91cdd3125ed96d91beeb4548be2d. The default dump is unchanged,dfd5e740e04e16057bc6a017e844ae62cb94025690531b443a9489f52900537eon both.🤖 Generated with Claude Code
https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc