Visitar URL original
Fix 64-bit Hamming distance in legacy TraceCmp by Sergane · Pull Request #2320 · google/fuzztest · GitHub
Skip to content

Fix 64-bit Hamming distance in legacy TraceCmp - #2320

Open
Sergane wants to merge 1 commit into
google:mainfrom
Sergane:fix/tracecmp-hamming_dist
Open

Sergane wants to merge 1 commit into
google:mainfrom
Sergane:fix/tracecmp-hamming_dist

Conversation

@Sergane

@Sergane Sergane commented Nov 10, 2026

Copy link
Copy Markdown

__builtin_popcount accepts an unsigned int, which is 32 bits on supported hosts. Using it on the 64-bit XOR of comparison arguments discards the upper half and can falsely report maximal closeness for arguments that differ there. Use __builtin_popcountll so the legacy coverage score counts all 64 bits.

Fixes #2319.

@google-cla

google-cla Bot commented Nov 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

__builtin_popcount accepts an unsigned int, which is 32 bits on supported hosts.
Using it on the 64-bit XOR of comparison arguments discards the upper half and can falsely report maximal closeness for arguments that differ there.
Use __builtin_popcountll so the legacy coverage score counts all 64 bits.

Fixes google#2319.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy TraceCmp truncates 64-bit Hamming distance to 32 bits

1 participant