Sunday, December 24, 2023

The Main Line of Chess

A "main line" in chess is a sequence of moves where each side plays the "best" move (for themselves) at each position. It's most often used in the context of an opening, as in "the main line of the queen's gambit", where the queen's gambit is defined as 1. d4 d5 2. c4. Of course it is debatable what the "best" move for Black now is -- accepted 2...dxc4 or declined 2...e6 -- which is why "best" above is in quotes. It's largely a matter of opinion in many or most positions as to which is the best move.

However, we have strong chess engines now, even in the opening, which can narrow the definition of "best" down considerably, often to a single move. Caveat: chess engines can only look ahead a finite "depth" and are also fickle as their depth of search increases as they "think"; and engines can disagree with one another.

But it should be possible to create better main lines using engines, and even a single candidate main line for chess itself if we start from the starting position. (I'm surprised no one has done this explicitly as a theoretical start to "solving" chess.) When I do this with Stockfish 13, I get the Berlin Defense of the Ruy Lopez:
1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. Re1 Nd6 6. Nxe5 Be7 7. Bf1 Nxe5
8. Rxe5 O-O 9. Nc3 Bf6 10. Re1 Re8 11. Nd5 Rxe1 12. Nxf6+ Qxf6 13. Qxe1 b6 14.
d3 Bb7

With a consistent engine evaluation throughout of about +0.20, which is another definition of an engine "main line" with a stable engine -- the evaluation stays the same throughout the line.

"What about theory?!" I hear you say. Well, from older/cruder to newer/more-refined, I have three main sources of "theory", so let's look.

1) Nunn's Chess Openings (1999). This source gets "alternate lines" out of the way at the top and so puts what would be its "main lines" at the bottom. For an idea of how it categorizes openings overall then, a look at the index on p. 541 shows that it considers the Sicilian (+0.30) the main line, but Ruy Lopez looks to be a close second. But not the Berlin; it likes 3...a6 (+0.40) as the main line. It covers Berlin on p. 326 but likes 5. d4 Nd6 (+0.14) as Berlin's main line. It does cover 5. Re1 Nd6 as the only alternate on the main page, but considers 7. Bd3 (-0.14) the main line after that. It covers the line above in note 20 but then only gives 9. d4 (+0.13).

2) Fritz 10 (2009) opening book. This source and the next seem to rely heavily on the popularity of moves in a curated high-rating database. Fritz also likes Sicilian, and 3...a6, and 5. d4, and 7. Bd3, and 9. d4, but it does have 9. Nc3 Bf6 10. Re1 as well, but then has an inferior line 10...Bd4 (+0.80) that a 2500 supposedly played against a 2250?

3) 365chess.com opening explorer (continuously updated, 2023). It does have 1...c5 (760586 games) over 1...e5 (442811 games), 3...a6 (117085 games) over 3..Nf6 (23854 games), 5. d4 (7034 games) over 5. Re1 (2950 games), 9. d4 (1139 games) over 9. Nc3 (397 games), 9...Ne8 (280 games) over 9...Bf6 (111 games). Other than that, it is in agreement. And apparently there are 25 games that reached the end position of the line above. Good!