Page MenuHomePhabricator

SecurePoll: Once a candidate is declared elected, make sure they remain elected [M]
Open, MediumPublicBUG REPORT

Description

What is the problem?

There are circumstances in which a candidate can be declared elected in one round but not be considered elected in a later round.

The declareWinners() method calculates the winners from scratch each time. In one round, if we have calculated the keep factor for a previously elected candidate in such a way that they have fewer votes than the quota, they will not be considered elected.

I can see at least two possible solutions:

  1. Don't recalculate winners from scratch each round. For example, have an array of winners which we append to. declareWinners() only looks at candidates who are not already in this array. I think this is something OpenSTV does (see here).
  2. Do some mathematical magic to make sure elected candidates are always declared elected by declareWinners(). This might be harder. Also, according to 2.9 in meekm.pdf, calculation of the keep factor can put elected candidates votes below the quota.

See T290027#7379765 for an example of where this is happening, where it leads to infinite recursion/iteration.

blt files to reproduce problem
Environment

Wiki(s): SecurePoll 3.0.0 (dcbad8c) 06:35, 27 September 2021.

Event Timeline

@STran @TThoabala I would like your input on this ticket. Do you think we should be prioritizing this ticket?

Niharika triaged this task as Medium priority.Oct 19 2021, 4:36 PM
ARamirez_WMF renamed this task from SecurePoll: Once a candidate is declared elected, make sure they remain elected to SecurePoll: Once a candidate is declared elected, make sure they remain elected [M].Oct 20 2021, 4:13 PM
ARamirez_WMF renamed this task from SecurePoll: Once a candidate is declared elected, make sure they remain elected [M] to SecurePoll: Once a candidate is declared elected, make sure they remain elected [L].Oct 20 2021, 4:16 PM
ARamirez_WMF renamed this task from SecurePoll: Once a candidate is declared elected, make sure they remain elected [L] to SecurePoll: Once a candidate is declared elected, make sure they remain elected [M].Oct 20 2021, 4:27 PM