lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.09k stars 2.24k forks source link

Swiss pairings incorrect #7353

Closed ddugovic closed 3 years ago

ddugovic commented 4 years ago

There are some issues with the Swiss tournaments.

I have run about twenty events so far and these are serious.

Before I go on , I want to thank Lichess for creating the Swiss feature , it's absolutely cool.

First of all for some reason when games start sometimes some of the pieces are missing from the original position. Often there are no knights for one side visible.

I often have to change tabs and reopen the game to get the board to display correctly.

More importantly we have a major Swiss pairing issue.

The Lichess pairing system is pairing the rounds by seeding the players according to their tiebreaks during the ongoing tournament.

This is not okay. Pairings must be made solely based on points firstly and then by rating.

You do not do pairings taking ongoing tiebreaks into consideration.

Tiebreak or bucholtz system or whatever is strictly meant for determining final ranking and or prize place.

Please consider fixing this issue !

Sladgie

https://lichess.org/forum/lichess-feedback/swiss-system-tournament-bugs-and-fixes

ornicar commented 4 years ago

For missing knights, use a modern browser.

Pairings are handled by https://github.com/BieremaBoyzProgramming/bbpPairings which implements the official FIDE dutch system.

ddugovic commented 3 years ago

I now believe Lichess handled pairings correctly. Members of a shogi discord are helping me contextualize IM Paschall's comment at https://www.youtube.com/watch?v=ljp9rxW973s&t=47m17s (a video not mentioned in the forum comment).

Paschall believes standings ordering and player seed are the same, because in round 3 of https://lichess.org/swiss/ptPqenn9 expected opponent Youssef_Amad, My theory is that pairings were modified (for example, to prevent a rematch, or for one of FIDE's many other Dutch rules https://handbook.fide.com/chapter/C0403) so he didn't receive the pairing he predicted. This seems extremely unlikely but right now I lack evidence to prove that pairings are incorrect.

image

ornicar commented 3 years ago

You can download the TRF of any lichess swiss tournament by adding .trf to its URL:

https://lichess.org/swiss/ptPqenn9.trf

Then you can edit it to get back to any round and reproduce the pairings with https://github.com/BieremaBoyzProgramming/bbpPairings or http://www.rrweb.org/javafo/JaVaFo.htm or anything implementing the FIDE rules

ddugovic commented 3 years ago

Thanks!

If I download that file I see that sparklehorse(2417) seed# (Startingrank-Number) is 3 and that dkguy(2228) seed# is 2, which is odd (TRF spec. https://www.fide.com/FIDE/handbook/C04Annex2_TRF16.pdf). Given the rating disparity, I would expect that at the beginning of the tournament, the 2417 was seed#2 and the 2228 was seed#3.

pairing numbers assigned to the players accordingly to the initial ranking list and subsequent modifications depending on possible late entries or [pre-tournament, e.g. rating refund] rating adjustments - https://handbook.fide.com/chapter/C0403

I'll try following some in-progress tournaments and see if I can download a file where incorrect seeding results in an incorrect pairing:

001    1                        schieberspieler                                  8.5         35 w 1    11 b 1    19 w 1     7 b 1     2 b 1     5 w 1     6 w 1     3 b =    10 b 1
001    2                                  dkguy                                  8.0         28 w 1    27 b 1     3 w 1     6 b 1     1 w 0    11 b 1     5 b 1     8 w 1     7 w 1
001    3                           sparklehorse                                  7.0         34 b 1    16 w 1     2 b 0    10 w =    15 b 1    13 w 1     4 b 1     1 w =     5 b 1
ddugovic commented 3 years ago

I downloaded the TRF for https://lichess.org/swiss/lLfBixY0 and was surprised that seeds didn't correlate with pre-tournament ratings. The highest-rated player - marked seed#6 in this TRF, which is wrong - is antoniomontero(2114) and he was paired with the lowest-rated opponent with 1.0 point - gregcn7(1079) - instead of being paired with the 5th seed - e.g. 1 vs 5, 2 vs 6, 3 vs 7, etc. among players who have 1.0 point): https://lichess.org/Q4IFnNnk

012 FVA Blitz Abierto Absoluto
022 https://lichess.org/swiss/lLfBixY0
032 Lichess
042 Sep 26, 2020
052 
062 27
092 Individual: Swiss-System
102 https://lichess.org/swiss
XXR 9
XXC white1
001    1                              ortizfran                                  1.0         11 w 1     7 b Z
001    2                             nelsonmeza                                  1.0         10 w 1     3 b Z
001    3                             rosemanrod                                  1.0         26 b 1     2 w Z
001    4                              orsini916                                  1.0         27 b 1     8 w Z
001    5                                gregcn7                                  1.0              U     6 b Z
001    6                         antoniomontero                                  1.0         23 b 1     5 w Z
001    7                                 dabv13                                  1.0         24 b 1     1 w Z
001    8                             edwinunefm                                  1.0         22 w 1     4 b Z
001    9                              hielodrag                                  1.0         25 w 1    12 b Z
[remaining players have 0.5 and 0.0 points]

When the next round started, I downloaded the TRF again, and observed that player seeds changed again:

001    1                         antoniomontero                                  2.0         16 b 1    17 w 1     3 b Z
001    2                             rosemanrod                                  2.0         26 b 1    12 w 1     4 b Z
001    3                             edwinunefm                                  2.0         24 w 1    13 b 1     1 w Z
001    4                              hielodrag                                  2.0         25 w 1    18 b 1     2 w Z
001    5                              ortizfran                                  1.5         15 w 1    10 b =     8 b Z
001    6                                djalmas                                  1.5              H    20 w 1     7 b Z
001    7                          jhoangonzalez                                  1.5              H    19 b 1     6 w Z
001    8                                paulmar                                  1.5              H    23 b 1     5 w Z
001    9                             wasdin1968                                  1.5         18 w =    21 b 1    13 w Z
001   10                                 dabv13                                  1.5         27 b 1     5 w =         -  0000   -

image

ornicar commented 3 years ago

I think what you call "seed" is what javafo, the reference implementation, calls "player-id" http://www.rrweb.org/javafo/aum/JaVaFo2_AUM.htm

There's no indication that they should be consistent from a round to another, and in practice it's impossible, because players can join late, and that would shift all player-ids of lower-rated players down.

So the lila implementation choice is that player-ids are re-attributed on each round based on the current swiss score, accounting for tie-breaks.

gbtami commented 3 years ago

Enabling late join seems reasonable in Arena tournaments, but not so in Swiss IMO.

ddugovic commented 3 years ago

OK, yes, I am referring to "player-id" (what USCF TDs call a "seed" and what FIDE documentation calls "Startingrank-Number"). Section A.2 B of https://handbook.fide.com/chapter/C0403 indicates that these ID values are stable: if there are players with player-ids and pre-tournament ratings (the ratings may or may not be in the file, but would appear on an IRL "standings" wall chart):

1 Lisa (1800)
2 Bob (1650)
3 Carl (1525)
4 Fred (1400)

then adding a player should preserve relative ordering of existing player-ids and pre-tournament ratings:

1 Lisa (1800)
2 Alex (1720)
3 Bob (1650)
4 Carl (1525)
5 Fred (1400)

What confuses me is the "positional-id" concept in the JavaFo manual (the ordering in which players are listed in the file) although if I read the document correctly, "positional-id" only matters if the program is instructed to pair by it & otherwise it is ignored:

Ranking id JaVaFo identifies players with two numbers, the player-id and the positional-id.

The first one is obvious and it is the one that is associated with the 001 record in the TRF(x). The second one is implicitly given by the position of the players in the TRF(x). Albeit this is not mandatory, players are normally inserted into the TRF(x) in accordance with their pairing-id, so that the two sets of data (pairing-id(s) and positional-id(s)) are basically coincident.

They may differ, though, and sometimes for good reasons. For instance, please give a look at the linked file, which is a modified version of the previous sample: the players with a local rating (0 for FIDE) are placed at the end of the list.