Repository navigation
Fix float16 inequality comparing raw bits as an integer - #529
Closed
taking-lying-flat wants to merge 1 commit into
Closed
taking-lying-flat wants to merge 1 commit into
taking-lying-flat wants to merge 1 commit into
Conversation
Author
|
Consolidated into #527 to keep these small Gloo correctness fixes in one review. The same one-line float16 inequality fix is included there as a separate commit, with the comparison checks rerun on the combined version. Closing this duplicate PR. |
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.
float16::operator!=currently passesrhs.xtooperator==. This selects the integer overload and converts the right operand's raw bit pattern as a numeric integer, instead of comparing the twofloat16values.For example:
Pass
rhsitself to the existing equality operator. This one-line change makes inequality its logical complement and preserves the current equality semantics, including its treatment of special bit patterns.Validation against the actual modified header, compiled with GCC 15.2.0, C++20 and
-O2:(a != a) == !(a == a): 65,533 inconsistencies before, zero after.clang-format 18.1.8 --dry-run --Werror gloo/types.handgit diff --checkpassed.Only this production line is changed; no test files are included. The comparison checks ran on CPU; the full repository suite and CUDA build were not run.