Repository navigation
[release/11.0] Fix paired span sorting with struct comparers - #136614
Merged
Merged
Conversation
The paired span specialization for a concrete struct comparer selects a median pivot but starts partitioning without moving it to `hi - 1`. Even already sorted keys `0..16` can become `0..7, 15, 8..14, 16`. Restore the paired pivot exchange identified in the issue, matching the neighboring partitioners. The regression explicitly selects the value-type comparer overload and checks both keys and their associated items at lengths 16, 17, and 499 with ascending and reversed input. Resolves #136274 > [!NOTE] > This change, its tests, and this description were prepared with Codex and are AI-generated.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
@eiriktsarpalis Could you please take this through the libraries servicing process? |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-memory |
Member
|
Approved over email |
Member
|
/ba-g test failures unrelated |
eiriktsarpalis
approved these changes
Nov 4, 2026
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.
Backport of #136333 to release/11.0
/cc @jkotas @xgbtxy
Customer Impact
MemoryExtensions.Sort<TKey, TValue, TComparer> overload does not produce sorted output in some situations
Regression
Introduced by #116109
Testing
Targeted regression test
Risk
Low