lichess-org / lila-openingexplorer

Opening explorer for lichess.org that can handle all the variants and trillions of unique positions
http://lichess.org/analysis#explorer
GNU Affero General Public License v3.0
135 stars 34 forks source link

Opening explorer: "Top games" and "Recent games" list irrelevant games #271

Closed xjcl closed 2 months ago

xjcl commented 3 months ago

Exact URL of where the bug happened

https://lichess.org/analysis

Steps to reproduce the bug

  1. Paste "1. d4 Nf6 2. c4 g6 3. Nc3 d5 4. cxd5 Nxd5 5. Bd2 Bg7 6. e4 Nxc3 7. Bxc3 O-O 8. Qd2 c6 9. Nf3 Nd7 10. Bc4 Nb6 11. Bb3 Bg4" into the textbox labeled "PGN" and click the button "Import PGN"
  2. If not already showing, toggle the "Opening explorer & tablebase" to be on (the book icon under the right frame)
  3. Click on the settings (gear icon) and make sure that only the time control "blitz" and the rating groups "2000", "2200", and "2500" are selected, then press "All Set"

What did you expect to happen?

The list "Top games" should contain the 4 games by the strongest player, either sorted by the rating of the stronger player, or as some sort of average of the two players.

The list "Recent games" should contain the 4 most recent games, or, alternatively, the 4 most recent games not already featured in the list "Top games".

Both assuming at least 8 games in the database for the given position.

Specific expectation for this exact scenario:

Top games (result of sorting all games by mean rating): 2689 - 2529 2577 - 2523 2285 - 2250 2175 - 2162

Recent games (all games not already appearing in "top games" sorted by recency): 2065 - 1995 (2024-03) 2215 - 2112 (2024-03) 2113 - 1942 (2023-01) 2333 - 1917 (2020-09)

What happened instead?

lichess_bug_top_recent

The list "Top games" is missing a game between 2500s, which can be seen in the "recent games" list, and instead features games by lower-rated players.

The list "Recent games" contains games from 2020 and 2021, even though I can see more recent games in the "top games" list. In fact, these are instead the 4 OLDEST games.

Operating system

Windows 10

Browser and version (or alternate access method)

Mozilla Firefox 127.0.2

Additional information

I understand that the tool is programmed so that a game can only appear in one of these lists, not both. I also understand that I hit an unlikely edge cases with exactly 8 games to be distributed into two lists of 4. Even considering this, the result makes no sense, and doesn't help me find the strongest games easily.

kraktus commented 3 months ago

Cc @niklasf I haven’t checked yet if this is an issue (or expected behavior) from the opening explorer, or just with the frontend

xjcl commented 3 months ago

Just tested this in PowerShell. It is an issue with the opening explorer, not the frontend.

python -c "import requests, json; print(json.dumps(requests.get('https://explorer.lichess.ovh/lichess?fen=r2q1rk1/pp2ppbp/1np3p1/8/3PP1b1/1BB2N2/PP1Q1PPP/R3K2R w KQ - 6 12&modes=rated&speeds=blitz&ratings=2000,2200,2500').json(), indent=4))"

Should I close this issue and open an identical one in https://github.com/lichess-org/lila-openingexplorer?

xjcl commented 3 months ago

I still need an answer on my previous comment.

https://github.com/lichess-org/lila-openingexplorer/issues/202 Is this issue related or on something else? I can't open the Discord ref because I don't have an account.

niklasf commented 3 months ago

@xjcl Thanks for reporting! Moved to lila-openingexplorer.

niklasf commented 2 months ago

After https://github.com/lichess-org/lila/issues/13790, we no longer need to try to make https://github.com/lichess-org/lila-openingexplorer/issues/202 work. So now getting more reasonable results here.