docs: clarify BloomFilter contract after invert - #202
Merged
Conversation
- qualify the module- and type-level no-false-negative and false-positive guarantees as applying before invert() only - state in invert()'s documentation that after inversion both guarantees lapse and is_empty/bits_used/load_factor report raw bit state - document is_empty() in terms of bit state rather than insertion history - remove the unreachable BloomFilterBuilder::build panic documentation; both public constructors always produce a configured builder
Renkai
marked this pull request as ready for review
August 16, 2026 03:40
Signed-off-by: tison <wander4096@gmail.com>
Member
|
cc @leerho I wonder if a BloomFilter gets |
Member
|
Thanks for your contribution @Renkai! |
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.
This closes #194
Summary
Documentation-only clarification of the BloomFilter contract around
invert(), addressing #194:invert()only (mod.rs#L31-L33)invert()'s documentation that after inversion neither the no-false-negative nor the false-positive guarantee holds, and thatis_empty()/bits_used()/load_factor()then describe the raw bit state rather than insertion history (sketch.rs#L241-L245)is_empty()in terms of bit state (num_bits_set == 0), which is what the implementation actually observes (sketch.rs#L265-L268)BloomFilterBuilder::buildpanic documentation: the builder has no public default constructor, and both public entry points always produce a valid configuration (builder.rs#L157)Design questions from #194
This PR makes the current semantics honest without committing to the open API decisions:
union()/intersect()). Whether to move it to a raw/diagnostic API remains open in Clarify BloomFilter semantics after invert and correct builder documentation #194; the documentation added here is accurate under either outcome.Validation