Repository navigation
Preserve the high bit in 32-bit Gray code conversion - #7761
Open
naveenkumar982 wants to merge 1 commit into
Open
naveenkumar982 wants to merge 1 commit into
naveenkumar982 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7761 +/- ##
=========================================
Coverage 82.42% 82.42%
Complexity 8508 8508
=========================================
Files 847 847
Lines 26289 26289
Branches 5133 5133
=========================================
Hits 21670 21670
Misses 3828 3828
Partials 791 791 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
naveenkumar982
marked this pull request as ready for review
November 18, 2026 09:23
naveenkumar982
requested review from
DenizAltunkapan,
alxkm and
yanglbme
as code owners
November 18, 2026 09:23
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.
Closes #7760.
Use unsigned right shifts so the 32-bit reflected Gray code keeps its most significant bit. Decoding now continues until every bit has shifted out, including when the Gray word has its high bit set.
Two regression tests check encoding and decoding against known patterns. Both tests failed on the base revision. A separate deterministic check on 100,000 32-bit inputs verified that decoding recovers the input and that consecutive inputs have Gray codes differing by one bit.
I used OpenAI Codex to help prepare and test this change. The two changed Java files were formatted with the repository's clang-format configuration.