MadChess 2.0 Beta Build 029 (Piece Mobility)

I added piece mobility evaluation to MadChess 2.0 Beta. The candidate moves of each piece are counted (move legality is not tested) and a non-linear bonus is assigned. Pieces with few moves are penalized. Pieces with many moves are awarded. Assigning a non-linear bonus encourages MadChess to develop all of its pieces, as opposed to maximizing the candidate moves of a few pieces. For example, more centipawns are awarded for increasing the candidate moves of a knight from three to six moves than for increasing the candidate moves of a queen from 14 to 20.

This added 64 Elo to the playing strength of MadChess 2.0 Beta.

MadChess 2.0                   1877 :    800 (+208,=134,-458),  34.4 %

vs.                                 :  games (   +,   =,   -),   (%) :   Diff,  SD, CFS (%)
BikJump v2.01                       :    100 (  13,  17,  70),  21.5 :   -204,  12,    0.0
Matheus-2.3                         :    100 (  12,  22,  66),  23.0 :   -186,  13,    0.0
Monarch 1.7                         :    100 (  31,  10,  59),  36.0 :   -151,  13,    0.0
BigLion 2.23w                       :    100 (  30,  15,  55),  37.5 :   -127,  12,    0.0
Faile 1.4                           :    100 (  17,  29,  54),  31.5 :   -123,  11,    0.0
Sharper 0.17                        :    100 (  43,   9,  48),  47.5 :   -104,  12,    0.0
Jabba13032012                       :    100 (  35,  11,  54),  40.5 :    -55,  11,    0.0
Roce 0.0390                         :    100 (  27,  21,  52),  37.5 :    +16,  10,   94.1
Feature Category Date Rev1 WAC2 Elo Rating3 Improvement
Piece Mobility Evaluation 2014 Dec 16 29 225 1877 +64
Draw By Repetition Bug Evaluation 2014 Dec 10 27 225 1813 +47
Passed Pawns Evaluation 2014 Dec 09 26 225 1766 +72
Time Management Search 2014 Dec 08 25 231 1694 +24
Delay Move Generation
Aspiration Window Bug
Search 2014 Dec 02 23 231 1670 +44
MVV / LVA Move Order
Draw By Insufficient Material
Move List Overflow Bug
Search 2014 Dec 01 22 235 1626 +30
Tapered Evaluation
MG and EG Piece Location
Evaluation 2014 Nov 29 21 234 1596 +107
Alpha / Beta Negamax
Aspiration Windows
Quiescence, Hash
Material, Piece Squares
Baseline 2014 Nov 25 20 236 1489
  1. Subversion source code revision
  2. Win At Chess position test, 3 seconds per position
  3. Bullet chess, 2 min / game + 1 sec / move

MadChess 2.0 Beta Build 027 (Draw By Repetition Bug)

Yes! I found and exterminated the bug I mentioned in my previous post.

I corrected a bug that caused MadChess to play a losing move in a drawn by repetition position. MadChess evaluates the first repetition of a position as drawn, even though the rules of chess state the second repetition is drawn. This search optimization avoids wasting a ply to determine the position is drawn by repetition.

MadChess’ recursive search method checks if a position is repeated before searching any moves. If the position is a repeat of an earlier position, the search returns a zero score.

I forgot to prevent MadChess from considering the root position as drawn. If the root position was drawn, the game would be over and MadChess would have nothing to search. It’s not legally drawn. MadChess considers it drawn due to a search optimization. Because MadChess considers the root position drawn, it does not search any root moves. The score of each root move remains -Score.Max, which represents the nonsensical mate in zero I mentioned in my previous post. Because each move is considered equal, essentially a random move is played. Since many drawn by repetition positions are dependent on a single move that holds the draw, this bug often caused MadChess to play a losing move.

The bug fix was trivial.

This added 47 Elo to the playing strength of MadChess 2.0 Beta.

MadChess 2.0                   1813 :    800 (+161,=104,-535),  26.6 %

vs.                                 :  games (   +,   =,   -),   (%) :   Diff,  SD, CFS (%)
BikJump v2.01                       :    100 (  10,  11,  79),  15.5 :   -270,  13,    0.0
Matheus-2.3                         :    100 (  10,   7,  83),  13.5 :   -256,  13,    0.0
Monarch 1.7                         :    100 (  13,  13,  74),  19.5 :   -226,  14,    0.0
BigLion 2.23w                       :    100 (  27,   7,  66),  30.5 :   -193,  13,    0.0
Faile 1.4                           :    100 (  17,  20,  63),  27.0 :   -187,  12,    0.0
Sharper 0.17                        :    100 (  26,  18,  56),  35.0 :   -173,  13,    0.0
Jabba13032012                       :    100 (  33,  13,  54),  39.5 :   -116,  12,    0.0
Roce 0.0390                         :    100 (  25,  15,  60),  32.5 :    -47,  12,    0.0
Feature Category Date Rev1 WAC2 Elo Rating3 Improvement
Draw By Repetition Bug Evaluation 2014 Dec 10 27 225 1813 +47
Passed Pawns Evaluation 2014 Dec 09 26 225 1766 +72
Time Management Search 2014 Dec 08 25 231 1694 +24
Delay Move Generation
Aspiration Window Bug
Search 2014 Dec 02 23 231 1670 +44
MVV / LVA Move Order
Draw By Insufficient Material
Move List Overflow Bug
Search 2014 Dec 01 22 235 1626 +30
Tapered Evaluation
MG and EG Piece Location
Evaluation 2014 Nov 29 21 234 1596 +107
Alpha / Beta Negamax
Aspiration Windows
Quiescence, Hash
Material, Piece Squares
Baseline 2014 Nov 25 20 236 1489
  1. Subversion source code revision
  2. Win At Chess position test, 3 seconds per position
  3. Bullet chess, 2 min / game + 1 sec / move

MadChess 2.0 Beta Build 026 (Passed Pawns)

I added passed pawn evaluation to MadChess 2.0 Beta. No sophisticated evaluation of free (unimpeded) or unstoppable passed pawns. Just a simple tapered evaluation of passed pawns, with a score based on the pawn’s rank.

This added 72 Elo to the playing strength of MadChess 2.0 Beta.

Bug

While watching one of the games, I observed MadChess play a losing move in a drawn by repetition position. It gave a score of mate in zero (which is nonsense), searched to the max depth of 100 plies. I need to hunt down this bug, which likely is robbing MadChess of significant Elo.

MadChess 2.0                   1766 :    800 (+151,=49,-600),  21.9 %

vs.                                 :  games (   +,  =,   -),   (%) :   Diff,  SD, CFS (%)
BikJump v2.01                       :    100 (   6,  5,  89),   8.5 :   -320,  14,    0.0
Matheus-2.3                         :    100 (   8,  2,  90),   9.0 :   -304,  14,    0.0
Monarch 1.7                         :    100 (  10, 11,  79),  15.5 :   -273,  15,    0.0
BigLion 2.23w                       :    100 (  16,  9,  75),  20.5 :   -243,  13,    0.0
Faile 1.4                           :    100 (  17,  3,  80),  18.5 :   -234,  12,    0.0
Sharper 0.17                        :    100 (  27,  8,  65),  31.0 :   -219,  14,    0.0
Jabba13032012                       :    100 (  31,  5,  64),  33.5 :   -162,  13,    0.0
Roce 0.0390                         :    100 (  36,  6,  58),  39.0 :    -88,  12,    0.0
Feature Category Date Rev1 WAC2 Elo Rating3 Improvement
Passed Pawns Evaluation 2014 Dec 09 26 225 1766 +72
Time Management Search 2014 Dec 08 25 231 1694 +24
Delay Move Generation
Aspiration Window Bug
Search 2014 Dec 02 23 231 1670 +44
MVV / LVA Move Order
Draw By Insufficient Material
Move List Overflow Bug
Search 2014 Dec 01 22 235 1626 +30
Tapered Evaluation
MG and EG Piece Location
Evaluation 2014 Nov 29 21 234 1596 +107
Alpha / Beta Negamax
Aspiration Windows
Quiescence, Hash
Material, Piece Squares
Baseline 2014 Nov 25 20 236 1489
  1. Subversion source code revision
  2. Win At Chess position test, 3 seconds per position
  3. Bullet chess, 2 min / game + 1 sec / move

MadChess 2.0 Beta Build 025 (Time Management)

I added code to measure the time taken to search each ply and calculate if enough time remains to search the next ply. This lessens the number of searches that must be abandoned in the middle of a ply, and the best move from the prior ply played. These abandoned searches waste time.

This added 24 Elo to the playing strength of MadChess 2.0 Beta. I believe improved time management will pay greater dividends once I add search reductions and pruning of moves.

MadChess 2.0                   1694 :    800 (+101,=54,-645),  16.0 %

vs.                                 :  games (   +,  =,   -),   (%) :   Diff,  SD, CFS (%)
BikJump v2.01                       :    100 (   7,  5,  88),   9.5 :   -385,  16,    0.0
Matheus-2.3                         :    100 (   3,  4,  93),   5.0 :   -373,  15,    0.0
Monarch 1.7                         :    100 (   9, 12,  79),  15.0 :   -338,  16,    0.0
BigLion 2.23w                       :    100 (  13,  6,  81),  16.0 :   -312,  14,    0.0
Faile 1.4                           :    100 (  10,  2,  88),  11.0 :   -306,  13,    0.0
Sharper 0.17                        :    100 (  17,  6,  77),  20.0 :   -292,  15,    0.0
Jabba13032012                       :    100 (  19, 11,  70),  24.5 :   -234,  14,    0.0
Roce 0.0390                         :    100 (  23,  8,  69),  27.0 :   -160,  14,    0.0
Feature Category Date Rev1 WAC2 Elo Rating3 Improvement
Time Management Search 2014 Dec 08 25 231 1694 +24
Delay Move Generation
Aspiration Window Bug
Search 2014 Dec 02 23 231 1670 +44
MVV / LVA Move Order
Draw By Insufficient Material
Move List Overflow Bug
Search 2014 Dec 01 22 235 1626 +30
Tapered Evaluation
MG and EG Piece Location
Evaluation 2014 Nov 29 21 234 1596 +107
Alpha / Beta Negamax
Aspiration Windows
Quiescence, Hash
Material, Piece Squares
Baseline 2014 Nov 25 20 236 1489
  1. Subversion source code revision
  2. Win At Chess position test, 3 seconds per position
  3. Bullet chess, 2 min / game + 1 sec / move

MadChess 2.0 Beta Build 023 (Delay Move Generation)

I added code to delay move generation if a cached position specifies a best move. The best move is played first. If it causes a beta cutoff, the expense of generating moves is avoided. If not, moves are generated and searched, skipping the best move, which has already been searched.

Also, I corrected a bug that caused all searches to use an infinite aspiration window.  The corrected code will search the first ply using an infinite aspiration window, then search subsequent plies with a narrow window around the first ply’s score.  If the score of subsequent searches lies on an aspiration boundary, the window gradually is widened from 50 to 200 to 500 to infinite centipawns.

This added 44 Elo to the playing strength of MadChess 2.0 Beta

MadChess 2.0                   1670 :    800 (+64,=100,-636),  14.3 %

vs.                                 :  games (  +,   =,   -),   (%) :   Diff,  SD, CFS (%)
BikJump v2.01                       :    100 (  1,   7,  92),   4.5 :   -413,  17,    0.0
Matheus-2.3                         :    100 (  6,  13,  81),  12.5 :   -389,  16,    0.0
Monarch 1.7                         :    100 (  3,  10,  87),   8.0 :   -368,  17,    0.0
BigLion 2.23w                       :    100 ( 11,  11,  78),  16.5 :   -335,  14,    0.0
Faile 1.4                           :    100 (  3,  15,  82),  10.5 :   -330,  14,    0.0
Sharper 0.17                        :    100 ( 12,   9,  79),  16.5 :   -318,  16,    0.0
Jabba13032012                       :    100 ( 15,  12,  73),  21.0 :   -259,  15,    0.0
Roce 0.0390                         :    100 ( 13,  23,  64),  24.5 :   -184,  14,    0.0
Feature Category Date Rev1 WAC2 Elo Rating3 Improvement
Delay Move Generation
Aspiration Window Bug
Search 2014 Dec 02 23 231 1670 +44
MVV / LVA Move Order
Draw By Insufficient Material
Move List Overflow Bug
Search 2014 Dec 01 22 235 1626 +30
Tapered Evaluation
MG and EG Piece Location
Evaluation 2014 Nov 29 21 234 1596 +107
Alpha / Beta Negamax
Aspiration Windows
Quiescence, Hash
Material, Piece Squares
Baseline 2014 Nov 25 20 236 1489
  1. Subversion source code revision
  2. Win At Chess position test, 3 seconds per position
  3. Bullet chess, 2 min / game + 1 sec / move