---
title: The Beginnings of a Chess 960 Opening Theory
description: Combining Stockfish with the Python Chess module to find the "Best First Move" for white in every Chess 960 starting position
image: https://image.lichess1.org/display?fmt=webp&h=550&op=thumbnail&path=ZfJuQrkCMh17.webp&w=880&sig=aa5842a3130b1d44920676c602d11600e197e9a2
---

## Introduction

It is well known that Chess 960 was created in response to the growing reliance on computer assisted opening theory in standard chess. Computers have led to an obnoxious tendency for players to memorize the best ten to fifteen moves of an opening which has, in the opinion of many strong players, rendered high level chess stale and uninteresting. In Chess 960 the situation is different. With 960 different starting positions it is essentially impossible for one player to gain an advantage by memorizing the best computer line from a given opening. Despite this fact, it is not hard to see that the vast jungle of chess 960 openings contain many fascinating possibilities and novel strategies which simply do not exist in the standard starting position. I therefore decided that it would be interesting to use stockfish to find the "best first move" for white in each starting position and in the process uncover more of the richness and complexity of this variant. 

## Important caveats 

Stockfish combines a deep search of the game tree with positional evaluations from a neural network trained primarily on a large number of standard chess games. The fact that there are few if any chess 960 games in the training data means that stockfish opening evolutions of chess 960 positions may be slightly less accurate than those generated by a network which had been trained exclusively on games from this variant. Yet at a sufficient search depth we can still be reasonably confident in engine evaluation of these strange starting positions. Although, we must also remember that the evaluation of a position may change as the search depth increases, causing the engine to switch between various recommendations as it explores the consequences of a position more deeply. The evaluation at a depth of 20 could differ from an evaluation of the same position evaluated at a depth of 30 as the engine untangles the consequences of certain moves further down the game tree. Luckily for the purposes of human understanding, such consequences are mostly irrelevant for us since there are few if any human players who can calculate that far into the future. Therefore we will fix the depth for our analysis at 24 and assume that any changes in the evaluation which occur at higher depths are irrelevant for human play or research purposes. Lastly, we must acknowledge that Stockfish is better than any human could ever hope to be at chess 960 therefore it will be more than adequate for our purposes, yet we could easily imagine that an engine trained explicitly for chess 960 could beat stockfish in this variant. Perhaps this could be a project for an ambitious reader. 

## Methodology

To conduct this experiment I used the three python libraires inside of a Jupyter notebook: Python Chess to handle the game logic, the stockfish python wrapper for generating the best move, and matplotlib for visualization. For the stockfish parameters I used a depth of 24, 6 threads and a hash value of 2048. Then I looped through all 960 starting positions and stored the best first move in a dictionary. The script took approximately 2.5 hours to run. 

## Results

The following bar graph summarizes the results of this experiment:

![output.png](https://image.lichess1.org/display?fmt=png&h=0&op=resize&path=cBBf7cNIjnP2.png&w=800&sig=642542a537a6673290cf09c81f395f817c5bd6b6)

For each possible first move, here are the starting positions for which the given move is the top choice of stockfish:

*f1g3:* 788

*g1h3:* 513

*d1c3:* 270

*h2h3:* 220

*c1d3:* 561, 765

*f1e3:* 392, 911

*b1c3:* 91, 457, 477

*d1c1:* 90, 376, 380

*d2d3:* 149, 169, 218, 247, 299, 343, 356, 523, 603, 623

*f1g1:* 292, 293, 296, 308, 320, 321, 329, 580, 600, 612, 613

*a1b3:* 78, 87, 166, 171, 238, 253, 262, 264, 269, 278, 367, 382, 383

*e2e3:* 66, 129, 202, 241, 322, 610, 625, 635, 641, 657, 661, 802, 865

*h1g3:* 288, 582, 588, 589, 605, 790, 864, 866, 868, 882, 888, 892, 908, 916

*g1f3:* 197, 201, 295, 311, 327, 489, 521, 538, 599, 677, 680, 697, 791, 885, 952

*f2f3:* 12, 29, 64, 72, 142, 160, 162, 164, 170, 206, 256, 300, 334, 358, 428, 450, 492, 876

*b2b3:* 7, 81, 210, 355, 370, 371, 419, 435, 466, 547, 660, 685, 688, 704, 737, 753, 774, 780, 880, 896, 930

*c2c3:* 188, 260, 310, 319, 411, 413, 452, 503, 509, 568, 598, 607, 628, 632, 644, 695, 698, 699, 701, 795, 797, 820, 886

*h2h4:* 1, 2, 17, 25, 33, 48, 49, 104, 106, 124, 145, 181, 204, 257, 386, 390, 410, 416, 434, 440, 464, 469, 569, 659

*g2g3:* 19, 23, 63, 67, 79, 80, 82, 95, 182, 184, 215, 272, 274, 280, 284, 291, 323, 351, 372, 395, 447, 463, 472, 491, 499, 592, 611, 647, 675, 707, 867, 875, 891, 944, 947

*a2a4:* 393, 552, 572, 679, 717, 727, 733, 743, 745, 747, 759, 761, 763, 811, 812, 823, 825, 826, 827, 831, 839, 841, 842, 843, 844, 846, 847, 853, 855, 857, 861, 862, 894, 907, 921, 923, 927, 937, 939, 942, 943, 954, 955

*g2g4:* 75, 83, 147, 163, 175, 176, 177, 178, 179, 186, 187, 243, 258, 259, 267, 273, 275, 282, 283, 339, 345, 361, 368, 369, 439, 451, 455, 459, 465, 471, 473, 474, 475, 494, 507, 531, 555, 562, 563, 565, 566, 567, 570, 571, 627, 633, 643, 649, 651, 655, 656, 658, 663, 664, 666, 671, 715, 719, 752, 754, 758, 762, 848, 889, 931, 951, 959

*b2b4:* 3, 73, 96, 97, 111, 139, 192, 205, 207, 208, 209, 211, 217, 225, 227, 233, 297, 303, 305, 385, 387, 389, 391, 399, 401, 403, 481, 482, 483, 485, 486, 487, 495, 497, 498, 515, 529, 545, 560, 577, 579, 581, 583, 585, 586, 587, 591, 593, 595, 673, 674, 681, 682, 683, 689, 690, 691, 705, 706, 739, 771, 773, 775, 777, 778, 779, 783, 785, 787, 803, 818, 869, 871, 874, 879, 881, 883, 897, 914, 915, 946

*f2f4:* 15, 47, 61, 68, 69, 76, 77, 92, 93, 94, 127, 141, 161, 165, 167, 173, 183, 237, 239, 255, 261, 263, 271, 279, 285, 286, 287, 301, 316, 317, 324, 325, 332, 333, 335, 337, 341, 348, 349, 353, 354, 357, 359, 360, 363, 364, 365, 373, 375, 377, 379, 381, 462, 467, 511, 527, 535, 541, 574, 575, 604, 608, 620, 621, 636, 648, 652, 665, 667, 687, 703, 709, 726, 755, 757, 801, 817, 824, 829, 833, 834, 836, 840, 850, 854, 859, 863, 878, 904, 909, 925, 929, 933, 945, 949

*c2c4:* 4, 10, 11, 26, 27, 35, 40, 41, 42, 43, 44, 51, 56, 98, 99, 102, 103, 108, 109, 112, 115, 119, 123, 125, 126, 135, 136, 143, 152, 155, 168, 193, 194, 200, 216, 221, 223, 226, 236, 240, 248, 252, 268, 277, 289, 290, 298, 304, 306, 307, 312, 313, 314, 315, 318, 328, 331, 336, 344, 352, 384, 388, 394, 402, 406, 418, 422, 432, 442, 443, 449, 480, 484, 496, 501, 505, 512, 514, 520, 528, 544, 576, 578, 584, 594, 601, 602, 616, 619, 624, 640, 672, 676, 692, 694, 712, 720, 769, 770, 784, 786, 794, 796, 808, 816, 832, 872, 884, 890, 900, 912, 922

*d2d4:* 0, 5, 6, 8, 9, 14, 16, 18, 20, 22, 24, 28, 32, 34, 38, 39, 53, 55, 57, 58, 59, 60, 70, 71, 74, 84, 86, 88, 89, 100, 101, 105, 107, 113, 114, 116, 120, 121, 122, 128, 130, 131, 137, 138, 140, 146, 156, 174, 180, 195, 196, 198, 199, 203, 212, 219, 222, 224, 231, 232, 235, 266, 302, 326, 338, 340, 342, 346, 374, 396, 400, 405, 407, 408, 412, 414, 420, 421, 423, 425, 426, 427, 430, 431, 438, 441, 444, 448, 454, 456, 458, 468, 470, 488, 504, 506, 508, 516, 519, 522, 525, 526, 534, 539, 548, 550, 551, 554, 564, 590, 596, 597, 614, 617, 618, 622, 629, 630, 631, 638, 646, 650, 654, 662, 684, 696, 700, 708, 718, 728, 731, 732, 734, 736, 742, 744, 750, 756, 760, 768, 772, 776, 789, 792, 793, 800, 804, 805, 809, 810, 814, 822, 838, 899, 903, 910, 918, 924, 926, 928, 936

*e2e4:* 13, 21, 30, 31, 36, 37, 45, 46, 50, 52, 54, 62, 65, 85, 110, 117, 118, 132, 133, 134, 144, 148, 150, 151, 153, 154, 157, 158, 159, 172, 185, 189, 190, 191, 213, 214, 228, 229, 230, 234, 242, 244, 245, 246, 249, 250, 251, 254, 265, 276, 281, 294, 309, 330, 347, 350, 362, 366, 378, 397, 398, 404, 409, 415, 417, 424, 429, 433, 436, 437, 445, 446, 453, 460, 461, 476, 478, 479, 490, 493, 500, 502, 510, 517, 518, 524, 530, 532, 533, 536, 537, 540, 542, 543, 546, 549, 553, 556, 557, 558, 559, 573, 606, 609, 615, 626, 634, 637, 639, 642, 645, 653, 668, 669, 670, 678, 686, 693, 702, 710, 711, 713, 714, 716, 721, 722, 723, 724, 725, 729, 730, 735, 738, 740, 741, 746, 748, 749, 751, 764, 766, 767, 781, 782, 798, 799, 806, 807, 813, 815, 819, 821, 828, 830, 835, 837, 845, 849, 851, 852, 856, 858, 860, 870, 873, 877, 887, 893, 895, 898, 901, 902, 905, 906, 913, 917, 919, 920, 932, 934, 935, 938, 940, 941, 948, 950, 953, 956, 957, 958

## Conclusions

As with standard chess, we can see that in 960 certain fundamental opening principles do still apply. Controlling the center on move one with a central pawn thrust is almost always the best option. In 48% of positions the best move first move belongs to the set {e2e4, d2d4, c2c4} therefore in most 960 games one can reasonably assume that one of these three moves is a safe choice. However, in my opinion, the interesting results of this experiment are first moves that have a low frequency such as castling on move one or a knight move. What strategic considerations are at play here? Are these just flukes from the engine which disappear on a higher depth? Remember the caveat: we assume that a depth of 24 offers a reasonable approximation of the best first move yet the consequences of certain openings may not become manifest until move 30 or even 40 and these may sway the evaluation. Of course such consequences matter for an engine but are immaterial for a human player. I encourage the reader to analyze the positions from these low frequency first moves and try to observe any patterns. What lines do the engine suggest? Do such positions share structural similarities? For example, in every position where e2e3 is the best move, there is a bishop on d1 or f1 which is immediately opened up by this pawn move. 


Thank you for reading. If you enjoy watching chess content I encourage you to check out my YouTube channel @TheIsolatedPawn which is linked in my bio. 
Let me know what you think of this experiment in the forum, I am happy to hear any comments/criticism you may have.
