What is the problem?
We test for strict equality when deciding which candidates to eliminate.
Testing equality on floats can lead to inconsistent results.
One way to deal with this is test whether floats are within a specified epsilon of one another.
For example, you can see below that candidates 10, 11 and 12 are eliminated due to having the lowest number of votes (82). Candidate 9 is shown as also having 82 votes, but is not eliminated at the same time. This is arguably correct, as Candidate 9 has slightly more than 82 votes (by ~4.8E-17) (Tally on beta):
In another example, Candidate 9 is eliminated first, even though they technically have more votes than 10, 11 and 12 (SecurePoll resultsLog reports that Candidate 9 "earned" ~5.15E-15 votes in round 3). (Tally on beta):
Steps to reproduce problem
- https://vote.wikimedia.beta.wmflabs.org/wiki/Special:SecurePoll/tally/1677 (blt file)
- https://vote.wikimedia.beta.wmflabs.org/wiki/Special:SecurePoll/tally/1663 (blt file)
- https://vote.wikimedia.beta.wmflabs.org/wiki/Special:SecurePoll/tally/1649 (blt file)
- https://vote.wikimedia.beta.wmflabs.org/wiki/Special:SecurePoll/tally/1449 (blt file)
Environment
Wiki(s): https://vote.wikimedia.beta.wmflabs.org SecurePoll 3.0.0 (ab0903e) 06:24, 20 August 2021.