Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Do not userangeHash whenrangeDiff is 0 [ci: last-only]#10912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lrytz merged 1 commit intoscala:2.13.xfromFriendseeker:range-hash-fix
Nov 12, 2024

Conversation

@Friendseeker
Copy link
Contributor

@scala-jenkinsscala-jenkins added this to the2.13.16 milestoneNov 5, 2024
@Friendseeker

This comment was marked as outdated.

@Friendseeker

This comment was marked as outdated.

@Friendseeker

This comment was marked as outdated.

@SethTisue

This comment was marked as resolved.

@SethTisue

This comment was marked as outdated.

@FriendseekerFriendseeker changed the titleDo not userangeHash whenrangeDiff is 0Do not userangeHash whenrangeDiff is 0 [ci: last-only]Nov 5, 2024
@lrytz
Copy link
Member

LGTM. Can we changehashCode in a minor release?

@SethTisueSethTisue added the release-notesworth highlighting in next release notes labelNov 5, 2024
@SethTisue
Copy link
Member

SethTisue commentedNov 5, 2024
edited
Loading

LGTM. Can we change hashCode in a minor release?

Yes, as documented since 2020, as per#9051 andscala/bug#11646 . Admittedly that issue and PR didn't attract much attention/discussion. But they also haven't attracted any pushback, either at the time or in the years since. cc @scala/collections@Ichoran

Let's release-note it regardless (especially since the 2.13.16 release notes won't be that long).

In a Scala 3 context, it's a bit less clear-cut. Normally Scala 3 takes our standard libraryminor version bumps in their Scala LTSpatch version bumps. Does that change the answer here? I would argue it doesn't, because

  • it's documented as being fair game (though I admit there is some ambiguity around the "patch version" wording; we normally say that Scala 2 versions are "epoch.major.minor" not "major.minor.patch", so the doc can be read as referring to Scala 2 minor versions even if it literally says "patch")
  • it's a bugfix or refinement, not a feature addition or design change. we are bringing the implementation in line with an intention that has not changed
  • people realllllllly shouldn't be relying on this stuff not changing — so if it changes once in a while (for a good reason), it's a good reminder of that

I don't doubt that some codebases will see some test failures because they were (perhaps inadvertently) relying on hash order, but IMO our stance should be that those tests were overly sensitive to begin with and it's normal to ask users to either 1) make them less sensitive, or 2) leave them sensitive for convenience but with the awareness that as a consequence they may need adjusting at Scala version bump time.

@OndrejSpanel
Copy link
Member

How will this cope withSeq(17) compared to17 to 17?

@sjrd
Copy link
Member

sjrd commentedNov 5, 2024

How will this cope withSeq(17) compared to17 to 17?

In the changed code paths, we already know thesize >= 2, soSeq(17) is not affected by this PR.

OndrejSpanel reacted with thumbs up emoji

@lrytz
Copy link
Member

@Friendseeker could you squash the changes in a single commit?

@Friendseeker
Copy link
ContributorAuthor

@Friendseeker could you squash the changes in a single commit?

Done!

@lrytzlrytz merged commit7649050 intoscala:2.13.xNov 12, 2024
3 checks passed
@FriendseekerFriendseeker deleted the range-hash-fix branchNovember 12, 2024 17:30
hamzaremmal pushed a commit to hamzaremmal/scala3 that referenced this pull requestMay 2, 2025
Do not use `rangeHash` when `rangeDiff` is 0 [ci: last-only]
hamzaremmal pushed a commit to scala/scala3 that referenced this pull requestMay 7, 2025
Do not use `rangeHash` when `rangeDiff` is 0 [ci: last-only]
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

release-notesworth highlighting in next release notes

Projects

None yet

Milestone

2.13.16

Development

Successfully merging this pull request may close these issues.

MurmurHash3 produces the same hash for lists of repeated values, regardless of list length

6 participants

@Friendseeker@SethTisue@lrytz@OndrejSpanel@sjrd@scala-jenkins

[8]ページ先頭

©2009-2025 Movatter.jp