Thursday, June 4, 2015

King's Gambit Theory with Stockfish

Following on from the earlier post on "fighting with Stockfish", I have some theory results in the King's Gambit.

Reminder of the project: a repertoire-for-black tree after 1.e4 e5 2.f4 exf4, up to three-deep for White based on Stockfish evaluations (top three, cutoff anything more than 0.5 worse than top result), one-deep for Black (my repertoire selection), moves 3 through 9.

That means 7 plies with up to 3 selections each, 3^7 = 2187 upper bound on number of potential lines (actually final positions) I need to look at. Big project, not done yet, but I do have some preliminary results.

The top line (main line, best for White) that I have evaluates at -0.25 and is 3.Nf3 d6 4.Bc4 h6 5.h4 Be7 6.d4 Nf6 7.Nc3 Nh5 8.Ne2 Nc6 9.Bxf4 Bg4.

The bottom line (worst for White) that I have, so far, is the very "rightmost" line in the tree as defined above, evaluating at -1.16, 3.Qf3 Nc6 4.Nc3 Nd4 5.Qd3 Qh4+ 6.Kd1 Ne6 7.Qf3 Bc5 8.Nge2 Nf6 9.d4 Nxd4 (10.Qxf4 Qxf4 11.Nxf4).

That's a lot of positions, in a narrower range of evaluations (under 1.0) than I would have expected. One metaphor I have for thinking about main lines (best play for both sides) is as walking the crest of a mountain ridge. Turns out that the top of the ridge is a lot flatter than I pictured -- there are a lot of lines theoretically drawn with best play.

Let's see how some theoretical lines stack up in this range. The seeming conventional-theory main line of the Fischer defense, 3.Nf3 d6 4.d4 g5 5.h4 g4 6.Ng1, comes in at -0.70, barely making the tree criteria (5.Qd3 and 5.h3 score better), with continuation 6...f5(!) 7.Bxf4 fxe4 8.Nc3 d5 9.Qd2 Ne7. (Fischer's own conclusion that 6...Bh6 gives White "no compensation" is maybe not so accurate in view of 6...Bh6 7.Nc3 Nc6 8.Qd3 with Nge2 coming, giving White control of f4 (and f5, f3, e4 and d5) and preparing O-O-O. Evaluation -0.27.)

How about the supposed recent recommendation (John Shaw's book; I don't have it) to play against the Fischer defense in "Quaade style"? This also doesn't make the tree criteria. Near as I can determine, the recommendation is 3.Nf3 d6 4.d4 g5 5.Nc3, to which Stockfish gives -0.70 with a nice counter 5...g4 6.Bxf4 gxf3 7.Qxf3 Nc6 8.O-O-O Qh4(!). In addition to Bg4, Black is also threatening Qxf4 and/or a Bh6 pin. And 8.Bb5 Qh4+ is only slightly better for White.

If Shaw meant 3.Nf3 d6 4.d4 g5 5.g3, that seems equally bad: 5...g4 6.Nh4 f3 7.Nc3 Bg7 8.Be3 Nc6 9.Qd2 Bd7, -0.70. Again, the "tree moves" after 3.Nf3 d6 4.d4 g5 are 5.Qd3, 5.h3, and 5.h4.

Caveat: none of these numerical evaluations is definitive. One discouraging result of this experiment so far is how fickle/unreliable the evaluations can be because of the horizon effect. My original main line preference after 3.Nf3 d6 4.Bc4 h6 was 5.d4 g5 6.h4 g4 7.Ng1 f3 8.gxf3 Be7 9.c3 Bxh4+ with only a -0.17 evaluation. It turns out that there is a Black error in this line that Stockfish didn't see. After 5.d4 g5 6.h4 Black should play 6...Bg7 instead. Stockfish thought that the liquidation 7.hxg5 hxg5 8.Rxh8 Bxh8 was good for White (-0.02) when it is actually better for Black, when examined at more depth: 9.Qd3 Nc6 (-1.07). The apparent king attack with 10.e5 is fully repelled via 10...Bg7 11.Qh7 Kf8 12.Qh5 Nh6, essentially tying up the queen with only two pieces.

So, in-depth theory still wins out over (shallow) computer evaluations. I still think this is a valuable experiment however.

On a practical note, I just had opportunity to use this experiment's data in an ICC tournament game when my opponent played the experiment's current main line, see above, only exiting the data at 8.Nd5 (data says 8.Ne2, 8.Qd3, 8.O-O). Unfortunately I did not find the winning plan after that -- Ng3 followed by c6 Nxe7 Qxe7. Still, very interesting.