Skip to content

MINOR: Add a fuzzer for the uniform2 consumer group assignor - #5

Closed
dajac wants to merge 2 commits into
uniform2-rackfrom
uniform2-fuzzer
Closed

dajac wants to merge 2 commits into
uniform2-rackfrom
uniform2-fuzzer

Conversation

@dajac

@dajac dajac commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Uniform2AssignorFuzzTest runs the assignor over seeded random groups
and sequences of events (members joining and leaving, alone or in
bulk, partitions added, subscriptions changing, replicas and racks
moving) generated by Uniform2FuzzScenario, and checks the documented
properties at every step: completeness, spread and balance, order
independence of members, topics and partitions, fixed point with the
same partition set instances, the rack mode equivalences, movement
bounds for single joins and leaves, and rack alignment within a small
gap of a max-flow upper bound. For tiny groups, a brute force oracle
enumerates every assignment having the properties and checks that the
number of moved partitions is the smallest, or one above it. Failures
print the seed, the event and a dump of the scenario, so that they can
be reproduced in a unit test.

The default run covers 2000 seeds with 12 events each in a few
seconds. The budget can be raised with uniform2.fuzz.seeds, one seed
can be replayed with uniform2.fuzz.seed, uniform2.fuzz.events lengthens
the event sequences for soak runs, and uniform2.fuzz.reference adds a
comparison with the uniform assignor to the summary.

Review PR on the fork, stacked on uniform2-assignor. The first commit is the fuzzer, the second its rack aware oracle.

  • ef324b059f MINOR: Add a fuzzer for the uniform2 consumer group assignor
  • 0909a67581 MINOR: Check the rack aware uniform2 movement against a minimum cost flow in the fuzzer

🤖 Generated with Claude Code

@dajac
dajac force-pushed the uniform2-fuzzer branch 5 times, most recently from d1c087f to 0909a67 Compare September 17, 2026 13:24
@dajac
dajac force-pushed the uniform2-fuzzer branch 2 times, most recently from 24db529 to 3019427 Compare September 18, 2026 07:39
@dajac
dajac changed the base branch from uniform2-assignor to uniform2-rack September 18, 2026 07:40
dajac and others added 2 commits September 18, 2026 16:17
Uniform2AssignorFuzzTest runs the assignor over seeded random groups
and sequences of events (members joining and leaving, alone or in
bulk, partitions added, subscriptions changing, replicas and racks
moving) generated by Uniform2FuzzScenario, and checks the documented
properties at every step: completeness, spread and balance, order
independence of members, topics and partitions, fixed point with the
same partition set instances, the rack mode equivalences, movement
bounds for single joins and leaves, and rack alignment within a small
gap of a max-flow upper bound. For tiny groups, a brute force oracle
enumerates every assignment having the properties and checks that the
number of moved partitions is the smallest, or one above it. Failures
print the seed, the event and a dump of the scenario, so that they can
be reproduced in a unit test.

The default run covers 2000 seeds with 12 events each in a few
seconds. The budget can be raised with uniform2.fuzz.seeds, one seed
can be replayed with uniform2.fuzz.seed, uniform2.fuzz.events lengthens
the event sequences for soak runs, and uniform2.fuzz.reference adds a
comparison with the uniform assignor to the summary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…flow in the fuzzer

The fuzzer gains a per topic oracle for tiny groups using racks: a
minimum cost flow from the partitions to the members, for the quotas
of the result, gives the largest number of aligned partitions and the
fewest moves reaching it. A topic reaching that alignment must move at
most 8 partitions more than the fewest, and over a run the excess is
at most 5% of the topics checked. The tolerance cannot be one move as
for the plain oracle: the remaining excess comes from the maximum flow
choosing between the groups able to serve a rack, and between the
members of a rack, without looking at who could take a leftover back.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant