Repository navigation
Require strictly increasing patch indices - #11181
Merged
Merged
Conversation
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
robert3005
approved these changes
Nov 3, 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.
Summary
Patches::newnow checks, in debug builds, that patch indices are strictly increasing instead of only sorted. Nothing in the workspace produces repeated indices; only hand-built tests did. The paths that handle them also disagree:search_indexreturns the first patch at a repeated index, while decoding keeps the last.Changes
Patches::newassertsis_strict_sorted; thenew_uncheckedsafety contract says "strictly increasing".append_patch_walk_to_varbin, and the repeated-position checks inexecute_sparse_listsandlists::can_use_native_list.test_append_utf8_with_duplicate_patch_indicesand therepeated_positioncases from the sparse list tests added in Reuse compact elements when canonicalizing sparse lists #11173; addtest_new_rejects_repeated_indices.Testing
test_new_rejects_repeated_indices(debug builds only).