-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vectorize System.Collections.Generic.Dictionary #110701
base: main
Are you sure you want to change the base?
Conversation
…upt our internal state
Various cleanups
…rehash, 124 is closer
Tagging subscribers to this area: @dotnet/area-system-collections |
Looks like scalar suffix search is broken somehow, but the vectorized suffix search appears to work on wasm and arm64. |
PartitionedRateLimiterTests.Create_PassedInEqualityComparerIsUsed is asserting that we don't call GetHashCode when TryGetValue is invoked on an empty Dictionary. The other assertions in it will potentially break too since vectorized dictionary doesn't cache full hashcodes. |
Copilot
AI
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/libraries/System.Collections/tests/Generic/Dictionary/HashCollisionScenarios/OutOfBoundsRegression.cs:320
- Changing the loop condition to iterate until
_collidingStrings.Count
may cause an IndexOutOfRangeException if_collidingStrings
has fewer elements than expected. Ensure_collidingStrings
has at least 110 elements before this loop.
for (int i = 100; i < _collidingStrings.Count; i++)
Tip: Turn on automatic Copilot reviews for this repository to get quick feedback on every pull request. Learn more
@@ -364,7 +364,8 @@ public void ComparerImplementations_Dictionary_WithWellKnownStringComparers() | |||
() => GetStringHashCodeOpenDelegate("GetNonRandomizedHashCodeOrdinalIgnoreCase")); | |||
|
|||
// n.b., must be initialized *after* delegate fields above | |||
private static readonly List<string> _collidingStrings = GenerateCollidingStrings(110); | |||
// FIXME: This can't generate more than 124 colliding strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment indicates a limitation in the GenerateCollidingStrings
method. Ensure that the test cases account for this limitation or update the method to handle more cases if necessary.
This comment was generated based on a coding guideline created by a repository admin.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
A lot of the libraries tests still fail on my machine even on a fresh checkout of main, so this is to see how many regressions this actually produces.
Locally at present System.Collections.Tests has a total of 4 failures (in the concurrent modification detection, because the old way of corrupting the dictionary doesn't work anymore.)