Repository navigation
Conversation
Wkhanex
reviewed
Oct 13, 2026
There was a problem hiding this comment.
I ran 1,200 deterministic mixed add/discard/indexed-pop operations against an ordered unique-list model (seed 577179184). After every mutation, iteration matched the model, and every remaining actual[i] and actual.index(item) agreed with the expected forward/reverse positions. The initial set had 100 items; mutations used values 0–149 and positive/negative pop indices. I used Python 3.12.14 against commit 2c4327c.
All checks passed against the fetched setutils module. This adds mutation-sequence coverage to the focused fragmented-tail regression and checks that trimming dead intervals preserves subsequent index translation. I used standalone assertions, not the full pytest suite.
This branch has not been deployed
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.
The change
Trim all dead-index intervals belonging to a removed
IndexedSettail, rather than only the final interval. Adjacent intervals can remain separate, so trimming the entire tail while retaining an earlier interval makes later additions return incorrect scalar and inverse indices.Reproducer on current master:
The fix leaves interval creation, compaction thresholds, and slice semantics unchanged. It removes only intervals entirely within the tail already removed from storage. Six regression/control cases cover
removeanddiscard, tails spanning two or three intervals, the already-merged control case, and positive/negative/inverse indexing after each addition.Verification on macOS / CPython 3.14.6:
test_socketutils_netstringandtest_socketutils_netstring_timeout: they require loopback sockets and fail withPermissionErrorunder the network-denying sandbox on both unchanged and patched source. No unrestricted/full-suite success is claimed.git diff --checkpassed. Other Python/OS matrix jobs were not run locally.Targeted issue/PR searches found no matching tail-trimming fix. This does not change the
popindex validation in #535, iterator set operations in #503, multi-input updates in #494, or slicing fixed by #424.The backstory
This contribution comes from Igor Stadnyk's explicitly AI-assisted open-source maintenance workflow. Boltons was selected for its self-contained infrastructure utilities and documented standard-library consistency. The defect was found through public-source inspection and independently reproduced locally, not through a production incident or claimed long-term use of Boltons. No independent human code review is claimed.
AI assistance
The supplied source snapshot was master
4e5faa3d7e4008d89e0d8bf1ea87b6d9a061a16d.