Skip to content

Main content

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.

Loading tool…

Description

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.

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.

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.

When to use this tool

Use this generator to create reproducible counting 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, removalCount, queryCount, counterCount, 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, removed, remainingMultiplicities, queries, filter, summary. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Draw inserted occurrences, remove only sampled occurrences still present, and keep exact remaining multiplicities. Delegate counting-Bloom queries and return estimated multiplicities, possibly-present flags, nonzero counters, and observed false-positive counts.1

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

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.
removalCountRemoval CountRequired. Safe integer; minimum 0; maximum 512.
queryCountQuery CountRequired. Safe integer; minimum 1; maximum 128.
counterCountCounter 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.; maximum items 512.
removedRemovedRequired. Array of Text; maximum UTF-16 length 64.; maximum items 512.
remainingMultiplicitiesRemaining MultiplicitiesRequired. Array of Object; no unknown keys.; maximum items 512.
remainingMultiplicities[].valueValueRequired. Text; maximum UTF-16 length 64.
remainingMultiplicities[].countCountRequired. Safe integer; minimum 1; maximum 512.
queriesQueriesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 128.
queries[].queryQueryRequired. Text; maximum UTF-16 length 64.
queries[].exactMultiplicityExact MultiplicityRequired. Safe integer; minimum 0; maximum 512.
queries[].possiblyPresentPossibly PresentRequired. Boolean.
queries[].estimatedMultiplicityEstimated MultiplicityRequired. Safe integer; minimum 0; maximum 8192.
filterFilterRequired. Object; no unknown keys.
filter.counterCountCounter CountRequired. Safe integer; minimum 8; maximum 65536.
filter.hashCountHash CountRequired. Safe integer; minimum 1; maximum 16.
filter.nonzeroCountersNonzero CountersRequired. Safe integer; minimum 0; maximum 65536.
filter.successfulRemovalsSuccessful RemovalsRequired. Safe integer; minimum 0; maximum 512.
summarySummaryRequired. Object; no unknown keys.
summary.positiveQueryCountPositive Query 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.
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"
    ],
    "insertCount": 5,
    "removalCount": 2,
    "queryCount": 4,
    "counterCount": 8,
    "hashCount": 2,
    "seed": 42
  },
  "output": {
    "inserted": [
      "b",
      "b",
      "c",
      "c",
      "a"
    ],
    "removed": [
      "c",
      "b"
    ],
    "remainingMultiplicities": [
      {
        "value": "b",
        "count": 1
      },
      {
        "value": "c",
        "count": 1
      },
      {
        "value": "a",
        "count": 1
      }
    ],
    "queries": [
      {
        "query": "b",
        "exactMultiplicity": 1,
        "possiblyPresent": true,
        "estimatedMultiplicity": 2
      },
      {
        "query": "c",
        "exactMultiplicity": 1,
        "possiblyPresent": true,
        "estimatedMultiplicity": 1
      },
      {
        "query": "b",
        "exactMultiplicity": 1,
        "possiblyPresent": true,
        "estimatedMultiplicity": 2
      },
      {
        "query": "a",
        "exactMultiplicity": 1,
        "possiblyPresent": true,
        "estimatedMultiplicity": 2
      }
    ],
    "filter": {
      "counterCount": 8,
      "hashCount": 2,
      "nonzeroCounters": 4,
      "successfulRemovals": 2
    },
    "summary": {
      "positiveQueryCount": 4,
      "negativeQueryCount": 0,
      "falsePositiveCount": 0
    },
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • RemovalCount cannot exceed insertCount. Exact multiplicity and counter estimate differ because hashes collide; observed query rates are finite-workload diagnostics rather than a universal false-positive guarantee.
  • 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 Counting Bloom Filter Workload Generator — tool.io

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

  3. Calculation or validation: list/frequency — tool.io

Similar or alternative tools

  • 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.

  • 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.