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.08k stars 2.23k forks source link

Variation Counter in Analysis Book #10643

Closed Sonnexo closed 2 years ago

Sonnexo commented 2 years ago

In a study, when using the Opening Book and Tablebase (Masters and Games alike), the variation counts give the number of times that in this position, the respective move was played, not the resulting position has been reached.

For example, see the study https://lichess.org/study/ceXzLwG3/PZG233r6, or try for yourself with the moves

  1. e4 c5 2. Nf3 d6 3. g3 Nc6 4. Bg2 Nf6 5. d3 e6 *

Before the latest move of 5. ... e6, the Masters' Book indicates that the move was played 21 times, however, once this move is made, it shows that 454 times 6. O-O is played. This is most probably by other move orders.

In general, both are interesting. We want to know how often a certain move is played in the position, as well as how often a resulting position occurred.

benediktwerner commented 2 years ago

How often a resulting position has been reached is shown at the bottom, in the blue row marked with the sum symbol.

Sonnexo commented 2 years ago

Unfortunately, you have misunderstood my point. The number shown there is the number of times the current position on the board has been reached. However, I am talking about the number the resulting position has been reached, when making the suggested move from the book. If you look at the example, you can easily verify my issue.

I'm sorry for making this not easier to understand. Let me know if you still have trouble.

benediktwerner commented 2 years ago

So you mean, how often this specific line from the start was played? I don't think that's something we'll ever show. It doesn't really add much value and would require way more storage space.

Sonnexo commented 2 years ago

If I understand you correctly, than that's more or less the inverse of what I suggested.

Let me try to make a related example. If we play a game where we repeatedly say any (natural) number, and the game state itself is just the last number, the following are valid plays: 0 -- 3 -- 1 -- 5 0 -- 2 -- 1 -- 3 0 -- 2 -- 4 -- 1

Now, assume our game is in the state 0 -- 2

The "opening explorer" now shows: Next move 1: played one time Next move 4: played one time Total number: 2 (the number in the blue column)

However, If you were to play 1 in that state, i.e., the current game has now history 0 -- 2 -- 1, that position has been reached 3 times before via 0 -- 3 -- 1, 0 -- 2 -- 1, and 0 -- 2 -- 4 -- 1.

My point is: In the position 0 -- 2, it is interesting how often the state after the play 1 is reached, not only via 0 -- 2 -- 1, but with any history. As I understand your point, you think i want that in the position 1, it should be shown how often it is reached via 0 -- 2 -- 1, 0 -- 3 -- 1, etc.. This is not what I suggest.

benediktwerner commented 2 years ago

Still not sure I really understand what you mean, provided you want something that's not actually shown already.

What you explained now just sounds like what you see in the blue row after clicking on the move that leads to 1? Do you mean it should also be shown when looking at position 2? For all of the moves? Not sure there's really space for that in the UI.

Sonnexo commented 2 years ago

Yes, that's what I'm asking for.

I don't think the first question to ask should be: Is there enough space in the user interface to display that?

In my opinion, the first question should be: Is this a feature that users might find relevant?

To the latter, my answer is (obviously, as I brought that up): Yes

The use case for that is easy to see: As a user, when analysing my game, I want to know if I followed the main lines. Currently, if I want to be sure, I need to click through every suggested move to see if there is a hidden transposition. In the future, I'd like to skip this effort and see such information without the need to click the moves.

When it comes to space in the user interface, I see several possibilities:

  1. The "White / Draw / Black" bares are very large, they can be shrunken to fit another number to the left of them. For example, one column could read Nf3 \t 200k (250k) \t 30%, 50%, 20%
  2. In the header column where it currently says Move \t Games \t White / Draw / Black, there is enough space on the right for a switch between Moves played in this position and Times resulting position has been reached.
  3. In the settings tab, there is plenty of white space