docs(CuckooFilter): correct when IsFull clears - #293
Merged
Conversation
IsFull tracks _hasVictim. A successful Remove only clears it when it removes the parked victim itself, or frees a slot in one of the victim's two candidate buckets so RelocateVictimIfPossible can re-home it. A Remove elsewhere in the table leaves _hasVictim (and thus IsFull) true. The doc claimed any successful Remove clears it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR corrects the XML documentation for CuckooFilter.IsFull to accurately describe when the “full” state clears, aligning the docs with the victim-cache behavior implemented by _hasVictim and RelocateVictimIfPossible().
Changes:
- Reworded
IsFullsummary to clarify thatRemoveclears fullness only when it removes the parked victim or enables relocating it into one of its candidate buckets. - Removed the prior (over-broad) claim that any successful
RemoveclearsIsFull.
Coverage
Files below 100% line coverage
|
Benchmarks2 regressions Highlights
Collections (384)
Hashers (100)
Same-runner A/B (sharded 6-way): main ( |
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.
What
Corrected the
CuckooFilter.IsFullXML summary, which claimed "a successfulRemoveclears it." Reworded to state the precise condition under whichIsFull(i.e._hasVictim) actually clears.Why
IsFullreturns_hasVictim. On a successfulRemovethe filter only stops being full in two cases:_hasVictim && _victimFingerprint == fingerprint && ...branch clears it directly), orRelocateVictimIfPossible()can re-home the parked fingerprint.A
Removethat succeeds against an unrelated bucket leaves both victim-candidate buckets full, soRelocateVictimIfPossible()is a no-op and_hasVictim/IsFullstaystrue. The old wording ("a successful Remove clears it") implied any removal recovers the filter, which is not the case.Doc-only change; no behavioral impact.
Test plan
dotnet build— succeeds, 0 errors