Skip to content

Skip population_monotonicity fuzz when P 9 and P 10 are applied - #4224

Merged
stacktraceghost merged 2 commits into
mainfrom
4136-skip-p-9-and-p-10-in-population_monotonicity-target
Nov 5, 2026
Merged

stacktraceghost merged 2 commits into
mainfrom
4136-skip-p-9-and-p-10-in-population_monotonicity-target

Conversation

@cikzh

@cikzh cikzh commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What & why

Closes

During #4136 the fuzzer hit on a case where P 9 and P 10 were applied. When this happens in Abacus, the user will be presented a warning that this happened and that they should contact Kiesraad. See:

if has_p9 && has_p10 {
warnings.push(ApportionmentWarning::AbsoluteMajorityAndListExhaustion);
}

See for more explanation and context: #3219 and #1357

How to test

  1. Run the fuzzer, see that it fuzzes
  2. Download the artifact: crash-d38c2d9f596d7bbf84f8bff53b25d639b03a986b.zip and run:
cargo fuzz run population_monotonicity artifacts/population_monotonicity/crash-d38c2d9f596d7bbf84f8bff53b25d639b03a986b

See that it doesn't crash. It does crash when running this on main

@cikzh cikzh self-assigned this Nov 2, 2026
@cikzh cikzh added the backend Issues or pull requests that relate to the backend label Nov 2, 2026
@cikzh
cikzh requested a review from a team as a code owner November 2, 2026 11:25
@cikzh
cikzh marked this pull request as draft November 2, 2026 11:27
@cikzh
cikzh marked this pull request as ready for review November 2, 2026 11:28
@praseodym

Copy link
Copy Markdown
Contributor

I think we also need to check the if the second allocation has P 9 + P 10, not just the first allocation.

And we can check for AbsoluteMajorityAndListExhaustion in alloc.seat_assignment.warnings() instead of using the log.

@cikzh
cikzh marked this pull request as draft November 2, 2026 13:01
@cikzh
cikzh force-pushed the 4136-skip-p-9-and-p-10-in-population_monotonicity-target branch 3 times, most recently from fc483ce to 7675ef0 Compare November 2, 2026 13:48
@cikzh
cikzh force-pushed the 4136-skip-p-9-and-p-10-in-population_monotonicity-target branch from 7675ef0 to b5107d7 Compare November 2, 2026 13:59
@cikzh
cikzh marked this pull request as ready for review November 2, 2026 13:59
@cikzh
cikzh force-pushed the 4136-skip-p-9-and-p-10-in-population_monotonicity-target branch from b5107d7 to 0c14b7c Compare November 2, 2026 14:26
@cikzh cikzh changed the title Skip population monotonicity fuzz when P 9 and P 10 are applied Skip population_monotonicity fuzz when P 9 and P 10 are applied Nov 3, 2026

@jschuurk-kr jschuurk-kr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed code. Performed the steps in "How to test".

@stacktraceghost stacktraceghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, fuzz artifact works on this branch and not on main. Checked code.

@stacktraceghost
stacktraceghost added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 23a7d7f Nov 5, 2026
23 checks passed
@stacktraceghost
stacktraceghost deleted the 4136-skip-p-9-and-p-10-in-population_monotonicity-target branch November 5, 2026 15:11

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Issues or pull requests that relate to the backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants