Skip to main content

Split Block Bloom Filter (Parquet SBBF) implementation with a generic-key facade. AVX2 and ARM NEON accelerated with a scalar fallback. Suitable both for reading and writing Parquet-format bloom filters and for in-process use over arbitrary key types via IHash64<T>. Targets netstandard2.0, net8.0, and net10.0.

Total Downloads
2.6K
2,566
Published
Jul 24, 2026
2mo ago

Get Started

dotnet add package Clast.BloomFilter --version 0.2.0
ProductVersions
.NET
net10.0net8.0
.NET Standard
netstandard2.0

README

Clast.BloomFilter

Parquet-format Split Block Bloom Filter (SBBF) with a generic-key facade. AVX2 and ARM NEON accelerated, with a scalar fallback.

NuGet CI License: Apache 2.0

Overview

Clast.BloomFilter provides a Split Block Bloom Filter laid out exactly the way the Apache Parquet specification does, so the bytes round-trip with Parquet column-chunk bloom filters and other SBBF implementations. Each block is 256 bits (8 Ă— uint32); a probe touches a single block so the entire query fits in one cache line.

  • Two layers. SplitBlockBloomFilter / SplitBlockBloomFilterBuilder work in raw bytes and pre-hashed ulong keys — the surface you serialize. BloomFilter<T> / BloomFilterBuilder<T> wrap it with an IHash64<T> for typed, in-process use over arbitrary key types.
  • SIMD accelerated. AVX2 on x86-64 and ARM NEON on ARM64 take the fast path; a portable scalar fallback runs everywhere else. Hashing is xxHash64.
  • Pluggable hashing. Hash64.Default<T>() mirrors EqualityComparer<T>.Default, with specializations for the common primitives and a GetHashCode-based fallback for anything else.

Example

using Clast.BloomFilter;

// Build a typed filter sized for ~1000 distinct keys at 1% FPP.
var builder = BloomFilterBuilder<string>.WithCapacity(
    expectedDistinct: 1000, fpp: 0.01, maxBytes: 1 << 20);

foreach (var key in keys)
    builder.Add(key);

var filter = builder.Build();

if (filter.MightContain("foo"))
{
    // Definitely-not vs. probably-yes — go look in the real index.
}

// Serialize the raw bitset to disk in Parquet SBBF wire format.
File.WriteAllBytes("filter.bin", filter.Inner.Data.ToArray());

// Round-trip.
var bytes = File.ReadAllBytes("filter.bin");
var loaded = new BloomFilter<string>(new SplitBlockBloomFilter(bytes));

Target frameworks

  • netstandard2.0
  • net8.0
  • net10.0

The SIMD-accelerated paths require net8.0 or later (they use the System.Runtime.Intrinsics APIs). The netstandard2.0 build uses the scalar implementation on every platform.

License

Licensed under the Apache License, Version 2.0.

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.