A dispatch service uses approximate membership to avoid unnecessary index reads. Build four filters against one authoritative exact set or multiset in the test process. The exact structure is the oracle, not part of the bounded filter. Add and remove known insertions from a counting filter, grow a layered filter past its first capacity, send uneven key batches through a blocked filter, and fill a fingerprint table until its bounded insertion rejects a key. After every accepted mutation, every live exact key must still receive a possible-member answer. A false positive is allowed; a false negative for an accepted live key is not. Keep the identity of rejected cuckoo additions separate so a failed insertion does not become a supposed member.
Project: audit approximate-membership mutations
Acceptance trace
Insert pump-47 twice and valve-19 once into the counting filter, remove one known pump insertion, and check both keys. Insert fifteen unique IDs into a layered filter starting at capacity four; it should have three generations and retain the first and last IDs. Insert several codes into a sixteen-block filter, then inspect occupancy per block rather than a global average alone. Use a small cuckoo table to force relocation and eventual rejection; copy its buckets before a rejected add and assert the buckets match afterward. Finally, verify every previously accepted ID still receives a positive filter answer.
Expected review record
known-removal=balanced layered-generations=3
rejected-insert=rolled-back accepted-keys=possibly-presentBoundary and cost review
Try repeated hashes within one counting key, absent-key deletion attempts, duplicate additions that consume layer capacity, a saturated hot block, fingerprint collisions, and a relocation loop that reaches the kick limit. Make the exact oracle responsible for authorizing deletions. State separately the memory bound of each filter and the extra test-only exact state. Measured false-positive rates depend on size, hash distribution, and load; the demonstration's fixed examples do not certify a rate. If the application cannot tolerate a false positive, it must query the authoritative record before acting.
Common Mistakes
- Do not infer deletion authority from a positive approximate lookup.
- Do not discard old layers when capacity grows.
- Do not hide a saturated block behind average occupancy.
- Do not leave a failed relocation chain partly applied.
