Skip to content

Main content

Random Bloom Filter Workload Generator

Deduplicate a supplied string universe, sample a distinct insertion set and controlled present/absent query pools, and delegate deterministic Bloom responses; report exact labels and observed false positives separately from the core's 8-significant-digit ideal-hash probability approximation, not a guaranteed error rate.

Loading tool…

Description

Deduplicate a supplied string universe, sample a distinct insertion set and controlled present/absent query pools, and delegate deterministic Bloom responses; report exact labels and observed false positives separately from the core's 8-significant-digit ideal-hash probability approximation, not a guaranteed error rate.

An operation trace pairs an ordered request stream with the state after each step. Empty operations, ties, evictions, and boundary indexes are part of the modeled contract rather than incidental display details.

Deduplicate a supplied string universe, sample a distinct insertion set and controlled present/absent query pools, and delegate deterministic Bloom responses; report exact labels and observed false positives separately from the core's 8-significant-digit ideal-hash probability approximation, not a guaranteed error rate.

When to use this tool

Use this generator to create reproducible bloom filter workload cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply universe, insertCount, queryCount, presentQueryProbability, bitCount, hashCount in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read inserted, queries, filter, summary. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Sample distinct inserted values and present/absent membership queries from a deduplicated universe. Delegate an insertion-only Bloom filter, compare each query with exact membership, and return estimated and observed false-positive diagnostics.1

Delegated operations used for this result: bloom filter. Their calculation or parsing conventions apply to the corresponding result fields.2

Input fieldMeaning and unitsAccepted input
universeUniverseRequired. Array of Text; maximum UTF-16 length 64.; minimum items 1; maximum items 512.
insertCountInsert CountRequired. Safe integer; minimum 0; maximum 512.
queryCountQuery CountRequired. Safe integer; minimum 1; maximum 128.
presentQueryProbabilityPresent Query ProbabilityRequired. Finite number; minimum 0; maximum 1.
bitCountBit CountRequired. Safe integer; minimum 8; maximum 65536.
hashCountHash CountRequired. Safe integer; minimum 1; maximum 16.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
insertedInsertedRequired. Array of Text; maximum UTF-16 length 64.; minimum items 0; maximum items 512.
queriesQueriesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 128.
queries[].queryQueryRequired. Text; maximum UTF-16 length 64.
queries[].exactlyPresentExactly PresentRequired. Boolean.
queries[].possiblyPresentPossibly PresentRequired. Boolean.
queries[].falsePositiveFalse PositiveRequired. Boolean.
filterFilterRequired. Object; no unknown keys.
filter.bitCountBit CountRequired. Safe integer; minimum 8; maximum 65536.
filter.hashCountHash CountRequired. Safe integer; minimum 1; maximum 16.
filter.setBitsSet BitsRequired. Safe integer; minimum 0; maximum 65536.
filter.estimatedFalsePositiveProbabilityEstimated False Positive ProbabilityRequired. Finite number; minimum 0; maximum 1.
summarySummaryRequired. Object; no unknown keys.
summary.truePositiveCountTrue Positive CountRequired. Safe integer; minimum 0; maximum 128.
summary.negativeQueryCountNegative Query CountRequired. Safe integer; minimum 0; maximum 128.
summary.falsePositiveCountFalse Positive CountRequired. Safe integer; minimum 0; maximum 128.
summary.observedFalsePositiveFractionObserved False Positive FractionRequired. Finite number; minimum 0; maximum 1. or Null.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "universe": [
      "a",
      "b",
      "c",
      "d"
    ],
    "insertCount": 2,
    "queryCount": 4,
    "presentQueryProbability": 0.5,
    "bitCount": 8,
    "hashCount": 2,
    "seed": 42
  },
  "output": {
    "inserted": [
      "a",
      "d"
    ],
    "queries": [
      {
        "query": "b",
        "exactlyPresent": false,
        "possiblyPresent": true,
        "falsePositive": true
      },
      {
        "query": "b",
        "exactlyPresent": false,
        "possiblyPresent": true,
        "falsePositive": true
      },
      {
        "query": "c",
        "exactlyPresent": false,
        "possiblyPresent": false,
        "falsePositive": false
      },
      {
        "query": "a",
        "exactlyPresent": true,
        "possiblyPresent": true,
        "falsePositive": false
      }
    ],
    "filter": {
      "bitCount": 8,
      "hashCount": 2,
      "setBits": 4,
      "estimatedFalsePositiveProbability": 0.15481812
    },
    "summary": {
      "truePositiveCount": 1,
      "negativeQueryCount": 3,
      "falsePositiveCount": 2,
      "observedFalsePositiveFraction": 0.6666666666666666
    },
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Possibly present is not exact membership. With this insertion-only model, inserted queries are cross-checked for no false negatives. Observed false-positive fraction is null if no negative queries occur and is not a guaranteed future rate.
  • A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Bloom Filter Workload Generator — tool.io

  2. Calculation or validation: data-structure/bloom-filter — tool.io

Similar or alternative tools

  • Random Counting Bloom Filter Workload Generator

    Generate with-replacement string insertions, remove only eligible remaining occurrences, and query a delegated counting Bloom filter against exact retained multiplicities; query estimates may overcount through collisions, and the fixed batch is not an arbitrary interleaved deletion trace.

  • Random Cardinality Sketch Workload Generator

    Construct a seeded shuffled stream with an exact caller-selected number of distinct strings and duplicate occurrences, then delegate the existing fixed-hash HyperLogLog estimate; report signed and relative errors separately from exact cardinality, with null duplicate/relative fractions when their denominator is zero.