Anti-Harassment Tools/SecurePoll Improvements/Test Results/20 6 5000 698142105

Comments
Case: All but one seat filled, one hopeful candidate, rest of candidates eliminated.

SecurePoll and OpenSTV agree on final results.

Election setup

 * Candidates: 20
 * Seats: 6
 * Votes: 5000

Actual
Output from SecurePoll : array(3) { ["elected"]=> array(6) { [0]=>   int(1) [1]=>   int(2) [2]=>   int(3) [3]=>   int(4) [4]=>   int(5) [5]=>   int(6) } ["eliminated"]=> array(0) { } ["rounds"]=> array(3) { [0]=>   array(8) { ["round"]=> int(1) ["surplus"]=> int(0) ["rankings"]=> array(20) { [1]=>       array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [2]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [3]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [4]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(857) ["total"]=> int(857) }       [5]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(858) ["total"]=> int(858) }       [6]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(714) ["total"]=> int(714) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [8]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [9]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [10]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [11]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [12]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [13]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [14]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [15]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [16]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [17]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [18]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [19]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [20]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }     }      ["totalVotes"]=> int(5000) ["keepFactors"]=> array(20) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) [8]=>       int(1) [9]=>       int(1) [10]=>       int(1) [11]=>       int(1) [12]=>       int(1) [13]=>       int(1) [14]=>       int(1) [15]=>       int(1) [16]=>       int(1) [17]=>       int(1) [18]=>       int(1) [19]=>       int(1) [20]=>       int(1) }     ["quota"]=> int(715) ["elected"]=> array(0) { }     ["eliminated"]=> array(0) { }   }    [1]=>    array(8) { ["round"]=> int(2) ["elected"]=> array(5) { [0]=>       int(1) [1]=>       int(2) [2]=>       int(3) [3]=>       int(4) [4]=>       int(5) }     ["eliminated"]=> array(0) { }     ["surplus"]=> int(711) ["keepFactors"]=> array(20) { [1]=>       int(1) [2]=>       int(1) [3]=>       int(1) [4]=>       int(1) [5]=>       int(1) [6]=>       int(1) [7]=>       int(1) [8]=>       int(1) [9]=>       int(1) [10]=>       int(1) [11]=>       int(1) [12]=>       int(1) [13]=>       int(1) [14]=>       int(1) [15]=>       int(1) [16]=>       int(1) [17]=>       int(1) [18]=>       int(1) [19]=>       int(1) [20]=>       int(1) }     ["quota"]=> int(715) ["rankings"]=> array(20) { [1]=>       array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [2]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [3]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [4]=>        array(3) { ["votes"]=> int(857) ["earned"]=> int(0) ["total"]=> int(857) }       [5]=>        array(3) { ["votes"]=> int(858) ["earned"]=> int(0) ["total"]=> int(858) }       [6]=>        array(3) { ["votes"]=> int(714) ["earned"]=> int(0) ["total"]=> int(714) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [8]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [9]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [10]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [11]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [12]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [13]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [14]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [15]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [16]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [17]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [18]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [19]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [20]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }     }      ["totalVotes"]=> int(5000) }   [2]=>    array(8) { ["round"]=> int(3) ["elected"]=> array(1) { [5]=>       int(6) }     ["eliminated"]=> array(0) { }     ["surplus"]=> float(611) ["keepFactors"]=> array(20) { [1]=>       float(0.8343057176196) [2]=>       float(0.8343057176196) [3]=>       float(0.8343057176196) [4]=>       float(0.8343057176196) [5]=>       float(0.83333333333333) [6]=>       int(1) [7]=>       int(1) [8]=>       int(1) [9]=>       int(1) [10]=>       int(1) [11]=>       int(1) [12]=>       int(1) [13]=>       int(1) [14]=>       int(1) [15]=>       int(1) [16]=>       int(1) [17]=>       int(1) [18]=>       int(1) [19]=>       int(1) [20]=>       int(1) }     ["quota"]=> int(613) ["rankings"]=> array(20) { [1]=>       array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [2]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [3]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [4]=>        array(3) { ["votes"]=> int(857) ["earned"]=> float(-142) ["total"]=> float(715) }       [5]=>        array(3) { ["votes"]=> int(858) ["earned"]=> float(-143) ["total"]=> float(715) }       [6]=>        array(3) { ["votes"]=> int(714) ["earned"]=> int(0) ["total"]=> int(714) }       [7]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [8]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [9]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [10]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [11]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [12]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [13]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [14]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [15]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [16]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [17]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [18]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [19]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }       [20]=>        array(3) { ["votes"]=> int(0) ["earned"]=> int(0) ["total"]=> int(0) }     }      ["totalVotes"]=> float(4289) } } }

Expected
Output from OpenSTV: Loading ballots from file 20_6_5000_698142105.blt. Ballot file contains 20 candidates and 5000 ballots. No candidates have withdrawn. Ballot file contains 5000 non-empty ballots.

Counting votes for ElectionTitle using Meek STV. 20 candidates running for 6 seats.

R|1         |2          |3          |4          |5          |6 |---+---+---+---+---+--- |7          |8          |9          |10         |11         |12           |---+---+---+---+---+---  |13         |14         |15         |16         |17         |18           |---+---+---+---+---+---  |19         |20         |Exhausted  |Surplus    |Threshold

=
============================================================= 1| 857.000000| 857.000000| 857.000000| 857.000000| 858.000000| 714.000000 |   0.000000|   0.000000|   0.000000|   0.000000|   0.000000|   0.000000  |   0.000000|   0.000000|   0.000000|   0.000000|   0.000000|   0.000000  |   0.000000|   0.000000|   0.000000| 714.571425| 714.285715  |---  | Count of first choices. Candidates 1, 2, 3, 4, and 5 have reached the | threshold and are elected.

=
============================================================= 2| 714.286361| 714.286361| 714.286361| 714.286361| 714.285858| 714.000000 |           |           |           |           |           |             |           |           |           |           |           |             |           |           | 714.568698| 612.204470| 612.204472  |---  | Count after transferring surplus votes. Keep factors of candidates who | have exceeded the threshold: 1, 0.833473; 2, 0.833473; 3, 0.833473; 4, | 0.833473; and 5, 0.832501. Candidate 6 has reached the threshold and | is elected.

Winners are 1, 2, 3, 4, 5, and 6.

Files
array ( 1 =>   array ( 'count' => 857, 'rank' => array (     1 => 1,    ), ), 4 =>   array ( 'count' => 857, 'rank' => array (     1 => 4,    ), ), 2 =>   array ( 'count' => 857, 'rank' => array (     1 => 2,    ), ), 5 =>   array ( 'count' => 858, 'rank' => array (     1 => 5,    ), ), 3 =>   array ( 'count' => 857, 'rank' => array (     1 => 3,    ), ), 6 =>   array ( 'count' => 714, 'rank' => array (     1 => 6,    ), ), )
 * blt: https://github.com/dominic998/SecurePoll-Test-Data/blob/main/test_data/20_6_5000_698142105.blt
 * php:

Environment

 * Where you tested: local docker using phpunit
 * Version of SecurePoll: commit 271145d5f3cae3b0a1b76d0f5dfeb609615d60b7 (patch 16 from https://gerrit.wikimedia.org/r/c/mediawiki/extensions/SecurePoll/+/704454/)