lichess.org
Donate

A Framework for the Lichess Opening Explorer Opening Names

I have created a public set of studies that are a framework for the Lichess Opening Explorer opening names.
Here is some documentation.
- Need terminology and intent for framework.

- Lichess Opening Explorer (LOE)

A tool in Lichess for exploring the opening. This tool is available
from the TOOLS menu, and inside a study. When the LOE is fired up from
the TOOLS menu, one can use it in a variety of ways. One can give it
an FEN or PGN, or one can simple make moves. The default position is
the initial position of standard chess, and the rules are standard
chess rules. Once can choose between several databases from which
to display moves and statistics from the position displayed.
Currently, one can pick the Masters DB, Lichess DB, or Player DB.

Once a DB has been chosen, the display has a number of statistics.
An example displayed line from the initial position with the Master
DB chosen for the full set of years shows:

e4 1,138,568 33% 43% 25%

This means that in all the DB, in the current position, 1.e4 was
played 1,138,568 times, and White won 33% of the games, a draw was
obtained in 43% of the games and Black won 25% of the games in which
White played 1.e4.

The last line starts with the Greek letter capital sigma, and then has
the total number of games in which the position occurs (for this case,
the total number of games in the DB starting with the initial position
of chess), and then the win/loss/draw statistics.

- Lichess Master Database (LMDB)

By this I mean that one has chosen in the LOE the Masters DB and has
chosen the entire range of available dates. Currently that is 1952-2022.

- Lichess Opening Names (LON)

In the LOE, at various times, there is a line displayed above the move
statistics that is an opening name. That name includes an ECO code.
For example, if one makes the moves 1.e4 c5, then it will display
B20 Sicilian Defense

The LON displayed depends on the exact sequence of moves to arrive at
the position! That is, one can make two different sequences of moves
that arrive at the same FEN, but the display will have two different
names displayed! This is very unfortunate, and I have no idea how
often this occurs.

[Example:
1.d4 d5 2.Nf3 Nf6 3.e3 e6 4.c3
LOE displays D05 Queen's Pawn Game: Colle System
FEN = rnbqkb1r/ppp2ppp/4pn2/3p4/3P4/2P1PN2/PP3PPP/RNBQKB1R b KQkq - 0 4

1.c3 Nf6 2.Nf3 d5 3.d4 e6 4.e3
LOE displays A00 Saragossa Opening
FEN = rnbqkb1r/ppp2ppp/4pn2/3p4/3P4/2P1PN2/PP3PPP/RNBQKB1R b KQkq - 0 4

Same FEN, different LON.]

Now there is a file in Github that seems to have been the starting
point for Lichess in defining what the LON would be.

github.com/lichess-org/chess-openings
Lichess openings in a tsv file. With SAN and FEN, and ECO and opening name.
Hence, at some point in the past, there was a specific sequence
of moves that was definitely going to be given a specific LON.
That tsv file is alphabetically ordered.
There are 142 exact duplicate names in the file.
There are 3,209 opening names not counting duplicates.

However, the live LOE has been changed from this tsv file!
I have not counted how many changes there have been.

Example: 1. e4 e5 2. f4 exf4 3. Bb5
In the tsv file this is called
C33 King's Gambit Accepted: Schurig Gambit
In the LOE it is called
C33 King's Gambit Accepted: Schurig Gambit, with Bb5

- LON Mainline Sequence of Moves (LON-MSM)

By this I mean the sequence of moves from the tsv file, and the
associated LON is the name from the current LOE; not from the tsv
file!

The above is an example.
1. e4 e5 2. f4 exf4 3. Bb5, is an LON-MSM with
LON being C33 King's Gambit Accepted: Schurig Gambit, with Bb5

- My Public Lichess Opening Framework Studies (PLOFS)

I took all the LON-MSM from the tsv file and created studies in which
the chapters contained those MSM and the chapter names where the LON
displayed live. I created a top level study for this study collection
that contains five chapters that are table of contents for the
collection. That is, these table of contents chapters, contain links
to all the studies in the collection. They are organized by ECO letter
codes A-E, and by the "part numbers" that I created to separate the
large number of LON-MSM. That was required because a Lichess study can
only hold 64 chapters.

Top Level Framework 1 study lichess.org/study/PXUWCtku
A has Parts 1-14A,14B 15 studies
B has Parts 15-29 15 studies
C has Parts 30a,30b-52 24 studies
D has Parts 53-62 10 studies
E has Parts 63-68 6 studies

71 studies in all.

These studies are a framework for other people to clone and use as
they will. See the Introduction chapter in the top level study for
more information. In particular these studies have no annotations, no
comments, no glyphs, and no other links other than the table of
contents in the top level.

The reason links are kept to a minimum is because I envision a common
use of the framework will be to clone part of it, or all of it. Then
the links would be to the original; not the clone! Hence, this would
require work by the user to change the links to point to their clone.

- Main Use Case for the Framework

I envision the main use case of the PLOFS will be by a user who is
comment many games and wishes to avoid repeating comments about the
openings that occur. They can put their comments on the openings in
their clone of the framework and then place one or more links in their
games' annotations.

- My CLONE of the Public Lichess Opening Framework Studies (CPLOFS)

My own clone of the PLOFS is intended for my use in the main use case.
Since it is my clone, I will put links as I please. If someone clones
my clone, then they will have to deal with changing the links.

CLONE: Lichess Opening Framework Studies
lichess.org/study/dePpIInC

- Know Issues with the Framework Project
a) 'Position' is ill defined.
Does it mean 'picture'; i.e. just piece placement?
Does it mean that, but with knowledge of who is on the move? As in a zillion
positions given in chess books.
Does it mean exactly what is in the FEN? Which leaves out knowledge of
whether a repetition of moves is possible.
Does it mean the *exact* sequence of moves leading to some position in a game?

In chess playing programs the repetition problem is solved because the entire
sequence of moves is known.

b) LON is not unique.
What I mean is that two different sequences can arrive at the same FEN
and the LOE will display different LONs!

[Example:
1.d4 d5 2.Nf3 Nf6 3.e3 e6 4.c3
LOE displays D05 Queen's Pawn Game: Colle System
FEN = rnbqkb1r/ppp2ppp/4pn2/3p4/3P4/2P1PN2/PP3PPP/RNBQKB1R b KQkq - 0 4

1.c3 Nf6 2.Nf3 d5 3.d4 e6 4.e3
LOE displays A00 Saragossa Opening
FEN = rnbqkb1r/ppp2ppp/4pn2/3p4/3P4/2P1PN2/PP3PPP/RNBQKB1R b KQkq - 0 4

Same FEN, different LON.]

c) An initial segment of an LON-MSM can either be the same LON or a different
LON.
That is, as one backs up by half-moves from the end of a LON-MSM, the LOE
either displays the same LON or a different LON.

An 'initial segment' of a sequence of moves is the moves from move 1 for
some number of half-moves, but not the entire sequence of moves.
Given LON-MSM 1.e4 e5, 1.e4 is an initial segment.

d) Extensions of an LON-MSM can be the same LON or a different one.
If the extension is the same LON, it can also be an
initial segment of some other LON-MSM. That is A < B < C, where
< is the natural relation formed from the initial segement idea, and A, B, and C
are each move sequences where A and C are LON-MSM, but B is not, and A and
B have the same LON!
What this means in practice is that backing up in a LON-MSM can land in
a position corresponding to a LON-MSM that is missing moves!

Example:
E36 Nimzo-Indian Defense: Classical Variation, Noa Variation, Main Line
has LON-MSM
C = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3 Bxc3+ 6.Qxc3 Ne4
It is here


Backing up one half-move the initial segment is
B = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3 Bxc3+ 6.Qxc3
B < C.
The LON is
E36 Nimzo-Indian Defense: Classical Variation, Noa Variation
That LON is here


But the LON-MSM for that chapter is
A = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3
which is an initial segment of B.

So
A = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3
B = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3 Bxc3+ 6.Qxc3
C = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3 Bxc3+ 6.Qxc3 Ne4
We have A < B < C.

LON(A) = LON(B) = E36 Nimzo-Indian Defense: Classical Variation, Noa Variation
LON(C) = E36 Nimzo-Indian Defense: Classical Variation, Noa Variation, Main Line

This means that the moves 5...Bxc3+ 6.Qxc3 where missing from the public framwwork.
That is because the original tsv file *and* the LOE considers
A = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3
the shortest sequence defining the LON
E36 Nimzo-Indian Defense: Classical Variation, Noa Variation
and B = 1.d4 Nf6 2.c4 e6 3.Nc3 Bb 44.Qc2 d5 5.a3 Bxc3+ 6.Qxc3
is an extension of A with the same LON.

I solved this problem by putting those missing moves into my clone.
I marked the end of the original LON_MSM with "- End.".
In that way I can annotate those moves.
An example of cloning new framework to annotate opening positions.

The start of this example came from Game 1 of Road to Chess Mastery. The
opening of that game is per Informant naming
E37 Nimzo-Indian: Classical: Noa Variation: Main line: 7.Qc2
In Lichess this is named
E37 Nimzo-Indian Defense: Classical Variation, Noa Variation

The idea is to find this chapter in the framework, clone that study,
make annotations, and back up in the moves. At each backup point,
either the named opening stays the same, per Lichess, in which case
the annotations of that position will be put in the same chapter, or
else a new name occurs, and then the process is repeated
recursively. This continues until the first move by White!

Here are the studies that got cloned for this example:

E37 Nimzo-Indian Defense: Classical Variation, Noa Variation
is chapter 35 in my clone
CLONE: E21-E46 Part 65


Backing up a half-move (6...Ne4) is
E36 Nimzo-Indian Defense: Classical Variation, Noa Variation, Main Line
which is in that same study; chapter 34.


Backing up a half-move (6.Qxc3) is
E36 Nimzo-Indian Defense: Classical Variation, Noa Variation
which is chapter 32.


Backing up another half-move (5...Bxc3+) is still in the same name.
Backing up another half-move (5.a3) is still in the same name.

Backing up a half-move (4...d5) is
E34 Nimzo-Indian Defense: Classical Variation, Noa Variation
which is chapter 30 in the same study.


Backing up a half-move (4.Qc2) is
E32 Nimzo-Indian Defense: Classical Variation
which is chapter 24 in the same study.


Backing up a half-move (3...Bb4) is
E20 Nimzo-Indian Defense
This required making a clone.
CONE: E12-E21 Part 64

Chapter 45.

Backing up a half-move (3.Nc3) is
A50 Indian Defense: Normal Variation
This required making a clone.
CLONE: A48-A56 Part 12

Chapter 11. Note how some extra moves had to be played here!

Backing up a half-move (2...e6) is still in the same name.
Backing up a half-move (2.c4) is still in the same name.

Backing up a half-move (1...Nf6) is
A45 Indian Defense
This required making a clone.
CLONE: A45-A47 Part 11

Chapter 5.

Backing up a half-move (1.d4) is
A40 Queen's Pawn Game
This required making a clone.
CLONE: A40-A44 Part 10


Now the process stopped.
Of course at each step in the above process, whenever I needed to find a Lichess opening name, I used the table of contents chapters in the clone of the top level to the framework. As soon as the clone study was made, I added my clone name to my clone of the top level, thereby keeping track of which of the 70 studies in the framework I had already cloned.
Note the links that are in the annotations that take one right to the study/chapter as one backs up by half-moves.

If one prefers to go forward in the move sequence from the start of the game, then one should click on each of the links while backing up. This will open tabs in the browser. Then one can go to the tab that is the initial White move and move forward. When the moves run out in that chapter, then the tab can be closed and the next tab will have the moves to the continuation of the game. This process then continues until one arrives at the move that was linked from the annotated game.

Having forward links would be ridiculous! It would be huge, and messy. It also seems quite unnecessary, because one can open the Lichess Opening Explorer, and see a bunch of Black possible replies, with statistics. Does that cover the entire space of Lichess opening names? I don't know, but I bet it does.

This is where one could argue that one should be able to specify the DB of one's choosing. However, the statistics would have to be generated as well as deciding where the DB would reside.
Also note that the main use case assumes it makes sense to comment such opening positions *independent of the game they occur in*. While this is often true, it is also true that an annotator might desire to make comments that are specific to the situation. For example, annotating historic games might warrant some note of the way the opening was played at that point in history. Another example would be an annotation that mentions how the particular player handles that opening.

Also note that the annotator has to deal with possible transpositions that in the game might lead to a position in the framework by a different order of moves!
The duplication of LONs and the missing moves talked about in #2 would make it very difficult to write a program that could automatically figure out the correct back links.
Even worse than transpositions is reversed openings. These may exist as named openings in Lichess, or not. If they do not, then if the annotator points into the framework, the colors will be reversed and almost for sure the side playing the reversed opening will have made an extra move.
The scope of my clone of the PLOFS is to include what Euwe said was
the "essential" information on the openings.

I assume that any reader, including myself, that is interested in the
many variations that might occur from a position, can work them out
with the help of the Lichess opening explorer and/or Stockfish.

What I want to provide is a "chess ideas" explanation using chess
theory from references like PCC, PSC, Silman, etc. Since, at best, the
Lichess opening explorer only provides an opening name (including ECO
code), that string provides the index into the PLOFS which lands at
some chapter of some study. It does not take long to find that
study/chapter from that string because I have the ECO codes in the
table of contents chapters of the PLOFS, and once in the correct
study, one can use the browser's search (Ctrl-F) functionality or just
scan the alphabetic list of 50ish chapter names.

It is beyond the scope of what I intend for my clone of the PLOFS to
talk about the full ramifications of transpositions in the opening and
the pros/cons of different move orderings. I think the proper place
for that sort of discussion is a treatise on an opening repertoire
that features some openings. That is because, it is in such a context
that most people get concerned about transpositions and move
orderings.

This topic has been archived and can no longer be replied to.