class Crowbar::Evolution::UniquenessFilter

Overview

Radix/LRU Deduplication and Uniqueness Filter. Tracks 64-bit FNV-1a digests of generated test cases in a bounded ring buffer. Prevents redundant duplicate emissions and verifies output diversity.

Defined in:

crowbar/evolution/uniqueness_filter.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(capacity : Int32 = 10000) #

Class Method Detail

def self.hash_buffer(buf : Buffer) : UInt64 #

def self.hash_bytes(slice : Bytes) : UInt64 #

Fast 64-bit FNV-1a hashing of byte slices


Instance Method Detail

def add(hash : UInt64) : Nil #

Adds a hash digest to the filter, evicting the oldest when at capacity


def add(buf : Buffer | Bytes) : UInt64 #

def capacity : Int32 #

def capacity=(capacity : Int32) #

def clear : Nil #

def filter(buf : Buffer | Bytes) : Bool #

Tests and records a buffer: returns true if unique (added), false if already seen


def load_hashes(hashes : Array(UInt64)) : Nil #

Import hashes from serialized state


def ring_order : Deque(UInt64) #

def seen?(hash : UInt64) : Bool #

Checks if a hash digest has already been recorded


def seen?(buf : Buffer | Bytes) : Bool #

def seen_hashes : Set(UInt64) #

def size : Int32 #

def to_a : Array(UInt64) #

Export hashes for serialization