MadChess 3.1 Beta 533e382 (Move Legality Performance Improvement)

I improved the performance of code that determines the legality of pseudo-legal moves. Previously, move legality was tested prior to playing a move. This consisted of playing a move (to test whether it exposed its own king to check and whether it delivered check on the enemy king), undoing the move, updating the “check” move property, then re-playing the move. Now a move is played, move legality and check is tested, and the Board.PlayMove method returns a (bool isLegal, bool deliversCheck) tuple.

The calling method (such as Search.GetDynamicScore or Search.GetQuietScore) then either 1) undoes the move (if illegal or futile) and continues to the next pseudo-legal move or 2) searches the resulting position.

In addition to move legality, I experimented with other performance improvements. None of these experiments succeeded except PR 33: Trust Move Capture Victim, which eliminated redundant calls to Position.GetPiece(Square square) in move generation and when playing moves.

Eliminating redundant double-playing of a move (to test move legality) during search increased the search speed of MadChess 3.1 Beta and produced a 36 Elo gain in playing strength.

 

Feature Category Date Commit1 WAC2 Elo Rating3 Improvement
Move Legality
Performance Improvement
Search 2022 Mar 18 533e382 289 2687 +36
Pawn Structure Evaluation 2022 Jan 11 d691b32 288 2651 +15
Threats Evaluation 2021 Oct 24 26e5323 289 2636 +7
Color-Agnostic Code Evaluation 2021 Sep 13 2b475bc 286 2629 +12
Singular Move Search 2021 Jun 14 0c601ea 290 2617 +13
Endgame Eval Scaling Evaluation 2021 Apr 08 4d22dec 286 2604 +12
Bishop Pair Evaluation 2021 Mar 14 2960ec9 285 2592 +22
Position Cache Optimization Search 2021 Feb 23 42d7702 286 2570 +8
Move Generation Optimization Search 2021 Feb 17 22002dc 287 2562 +12
PVS and Null Move Search 2021 Feb 09 f231dac 285 2550 +20
Remove Aspiration Windows Search 2020 Dec 20 4b7963b 290 2530 +9
Time Management Search 2020 Dec 19 d143bb5 286 2521 +8
Crash Bug Search 2020 Aug 29 2d855ec 288 2513 +0
King Safety Evaluation 2020 Aug 16 6794c89 288 2513 +63
Eval Param Tuning Evaluation 2020 Jul 23 bef88d5 283 2450 +30
Late Move Pruning Search 2020 Feb 08 6f3d17a 288 2420 +29
Piece Mobility Evaluation 2020 Feb 01 5c5d4fc 282 2391 +62
Passed Pawns Evaluation 2018 Dec 27 103 279 2329 +119
Staged Move Generation Search 2018 Dec 15 93 275 2210 +39
History Heuristics Search 2018 Dec 03 84 275 2171 +28
Eval Param Tuning Evaluation 2018 Nov 24 75 272 2143 +47
Sophisticated Search
Material and Piece Location
Baseline 2018 Nov 08 58 269 2096 0
  1. GitHub commit (hash) or Subversion source code revision (integer)
  2. Win At Chess position test, 3 seconds per position
  3. Bullet chess, 2 min / game + 1 sec / move

Doing The Jellyfish Stomp

MadChess 3.0 participated in a tournament Graham Banks arranged, named Doing The Jellyfish Stomp.

                                    1    2    3    4    5    6    7    8    9    0    
1   Coiled 1.1 NoNNUE 64-bit        **** 1001 1½½1 11½1 1111 ½110 111½ 1½½1 ½½11 ½½11  27.5/36
2   Fridolin 3.10 64-bit            0110 **** 1½½½ 01½0 0½½1 00½½ 110½ 11½1 1010 0½½1  19.0/36  335.25
3   RookieMonster 1.9.6-dev 64-bit  0½½0 0½½½ **** ½001 1001 01½1 11½0 1111 00½1 1½01  19.0/36  322.75
4   Lozza 2.2 64-bit                00½0 10½1 ½110 **** 00½1 1½½½ 011½ 01½0 1½10 1½10  18.5/36  314.75
5   Betsabe II 2020                 0000 1½½0 0110 11½0 **** 0011 11½0 0011 0½11 1110  18.5/36  306.00
6   CM10th Paralyse                 ½001 11½½ 10½0 0½½½ 1100 **** ½0½0 1½1½ 0½1½ 1½½½  18.0/36
7   Jellyfish 1.1 64-bit            000½ 001½ 00½1 100½ 00½1 ½1½1 **** ½½½½ 1½00 11½0  15.5/36  267.50
8   Raven 1.20 64-bit               0½½0 00½0 0000 10½1 1100 0½0½ ½½½½ **** ½11½ 111½  15.5/36  261.50
9   MadChess 3.0 64-bit             ½½00 0101 11½0 0½01 1½00 1½0½ 0½11 ½00½ **** 0010  15.0/36
10  Keele 1.0 64-bit                ½½00 1½½0 0½10 0½01 0001 0½½½ 00½1 000½ 1101 ****  13.5/36

Games

The Rookies And The Assassin

MadChess 3.0 participated in a tournament Graham Banks arranged, named The Rookies And The Assassin.

                                    1    2    3    4    5    6    7    8    9    0    1    2    
1   CM9000 Assassin                 **** 0½10 ½½11 1½½1 101½ ½1½0 ½01½ 0101 ½011 1½11 01½1 1111  28.5/44
2   RookieMonster 1.9.6-dev 64-bit  1½01 **** 1110 0101 01½1 1011 ½½½½ 0½00 1101 100½ 0111 1101  26.0/44
3   Lozza 2.1 64-bit                ½½00 0001 **** 100½ 1½0½ 1101 ½½½½ 11½1 ½½½½ 111½ ½111 00½½  24.0/44
4   Betsabe II 2020                 0½½0 1010 011½ **** 1½½½ 10½1 1½1½ ½½½1 ½½00 0100 1½1½ 11½0  23.5/44  503.00
5   Blunder 7.6.0 64-bit            010½ 10½0 0½1½ 0½½½ **** 00½½ ½010 110½ 1101 1101 0½½1 1111  23.5/44  490.00
6   Raven 1.20 64-bit               ½0½1 0100 0010 01½0 11½½ **** ½1½½ ½½10 1½1½ 10½1 001½ 1011  23.0/44
7   RookieMonster 1.9.6 64-bit      ½10½ ½½½½ ½½½½ 0½0½ ½101 ½0½½ **** 1½1½ 1010 ½0½0 0½½0 11½1  21.5/44  469.75
8   MadChess 3.0 64-bit             1010 1½11 00½0 ½½½0 001½ ½½01 0½0½ **** 010½ ½10½ 1011 11½½  21.5/44  463.75
9   Zevra 2.5 64-bit                ½100 0010 ½½½½ ½½11 0010 0½0½ 0101 101½ **** 0111 111½ 1000  21.5/44  461.75
10  Jumbo 0.7.0 64-bit              0½00 011½ 000½ 1011 0010 01½0 ½1½1 ½01½ 1000 **** ½001 0111  19.5/44
11  Myrddin 0.88 64-bit             10½0 1000 ½000 0½0½ 1½½0 110½ 1½½1 0100 000½ ½110 **** ½00½  16.5/44
12  CT800 1.43 64-bit               0000 0010 11½½ 00½1 0000 0100 00½0 00½½ 0111 1000 ½11½ ****  15.0/44

Games

Banks 91st Amateur Series Division 7

MadChess 3.0 participated in Graham Banks’ 91st amateur tournament in division 7.

                              1    2    3    4    5    6    7    8    9    0    1    2    
1   Drosophila 1.6 64-bit     **** 111½ 10½0 ½0½½ 1111 1101 1011 ½1½1 1111 1½01 101½ ½½11  31.5/44
2   MadChess 3.0 64-bit       000½ **** ½1½½ 1½½1 011½ 1½1½ 101½ ½0½½ 101½ 0½11 1½11 1½11  27.5/44
3   Delocto 200419 64-bit     01½1 ½0½½ **** ½½01 ½1½0 110½ 1½11 0010 ½1½½ 1½1½ 11½½ ½111  27.0/44
4   Betsabe II 2020           ½1½½ 0½½0 ½½10 **** 0011 ½1½1 0½00 ½1½1 ½½11 1101 11½½ ½½11  26.0/44
5   Raven 1.20 64-bit         0000 100½ ½0½1 1100 **** ½1½0 ½½½1 ½11½ 1½½½ 1½10 1½01 1111  24.5/44
6   Lozza 2.0 64-bit          0010 0½0½ 001½ ½0½0 ½0½1 **** ½0½½ 11½½ 011½ 11½0 ½111 110½  22.0/44
7   CT800 1.43 64-bit         0100 010½ 0½00 1½11 ½½½0 ½1½½ **** 0½01 ½110 0½10 11½½ 001½  20.5/44
8   Myrddin 0.88 64-bit       ½0½0 ½1½½ 1101 ½0½0 ½00½ 00½½ 1½10 **** 0½½1 0½0½ ½½½0 111½  20.0/44
9   paulchen332 0.1.1 64-bit  0000 010½ ½0½½ ½½00 0½½½ 100½ ½001 1½½0 **** ½111 ½100 1110  18.5/44
10  Odonata 0.5.1 64-bit      0½10 1½00 0½0½ 0010 0½01 00½1 1½01 1½1½ ½000 **** 0½0½ 11½0  17.5/44
11  FoxSEE 7.32.1 64-bit      010½ 0½00 00½½ 00½½ 0½10 ½000 00½½ ½½½1 ½011 1½1½ **** 00½0  15.5/44
12  Qapla 0.1.1 64-bit        ½½00 0½00 ½000 ½½00 0000 001½ 110½ 000½ 0001 00½1 11½1 ****  13.5/44

Games

Toxic Environment

MadChess 3.0 participated in a tournament Graham Banks arranged, named Toxic Environment.

                                    1    2    3    4    5    6    7    8    9    0    
1   RookieMonster 1.9.6-dev 64-bit  **** 1½½1 1110 0100 111½ ½½1½ 0½01 ½110 1½11 01½1  23.0/36  401.75
2   Delocto 200419 64-bit           0½½0 **** ½½11 1½½0 100½ 1101 0½½1 1111 0½11 1111  23.0/36  377.50
3   CM11th Toxic                    0001 ½½00 **** 11½1 1101 ½011 101½ ½1½0 0½11 1½½1  21.0/36
4   Blunder 7.6.0 64-bit            1011 0½½1 00½0 **** 0½11 ½1½1 011½ 01½1 ½1½0 01½1  20.5/36
5   Betsabe II 2020                 000½ 011½ 0010 1½00 **** ½01½ ½1½½ ½110 1001 1111  18.5/36
6   Zevra 2.5 64-bit                ½½0½ 0010 ½100 ½0½0 ½10½ **** ½111 ½0½1 1100 ½111  18.0/36
7   Fridolin 3.10 64-bit            1½10 1½½0 010½ 100½ ½0½½ ½000 **** 1½01 0101 ½0½1  16.0/36  290.50
8   Rodin 8.0                       ½001 0000 ½0½1 10½0 ½001 ½1½0 0½10 **** ½10½ 1111  16.0/36  260.00
9   MadChess 3.0 64-bit             0½00 1½00 1½00 ½0½1 0110 0011 1010 ½01½ **** 1½½0  15.5/36
10  Odonata 0.5.1 64-bit            10½0 0000 0½½0 10½0 0000 ½000 ½1½0 0000 0½½1 ****   8.5/36

Games