Skip to content

Vectorize System.Collections.Generic.Dictionary - #110701

Closed
kg wants to merge 12 commits into
dotnet:mainfrom
kg:vectorized-dictionary
Closed

Vectorize System.Collections.Generic.Dictionary#110701
kg wants to merge 12 commits into
dotnet:mainfrom
kg:vectorized-dictionary

Conversation

@kg

@kg kg commented Dec 13, 2024

Copy link
Copy Markdown
Contributor

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.)

@kg kg added NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it labels Dec 13, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

@kg

kg commented Dec 13, 2024

Copy link
Copy Markdown
Contributor Author

Looks like scalar suffix search is broken somehow, but the vectorized suffix search appears to work on wasm and arm64.

@kg

kg commented Dec 13, 2024

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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


// 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

Copilot AI Dec 17, 2024

Copy link

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 uses AI. Check for mistakes.
@kg
kg force-pushed the vectorized-dictionary branch from 307fce9 to f992cef Compare January 6, 2025 15:31
@kg kg closed this Jan 7, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Collections NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants