Open
Conversation
Generated as part of an ecosystem-wide audit for one-arg hash methods. The `hash(arg::LowerOrUpperIndex)` method only defined a one-arg `Base.hash`, which means the two-arg fallback `hash(x, h::UInt)` uses `objectid`-based hashing instead. This can cause correctness issues (equal objects hashing differently) and performance problems (excessive invalidation). With Julia 1.13+, the default hash seed is changing from `zero(UInt)` to a random value, which will make the one-arg method produce different results on each session. Fix by converting to a proper two-arg method that chains the seed `h` through the hash computation. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Generated as part of an ecosystem-wide audit for one-arg hash methods.
Summary
The
hash(arg::LowerOrUpperIndex)method insrc/index.jlonly defines a one-argBase.hash. This means the two-arg fallbackhash(x, h::UInt)usesobjectid-based hashing instead, which can cause:DictorSetzero(UInt)to a random value, so the one-arg method will produce different results each sessionFix
Convert to a proper two-arg
hash(arg::LowerOrUpperIndex, h::UInt)that chains the seed through the computation.Test plan
This PR was generated with the assistance of generative AI.
Co-Authored-By: Claude noreply@anthropic.com