MadChess 3.0 Beta f231dac (PVS and Null Move Improvements)

I improved MadChess 3.0 Beta’s Principal Variation Search (PVS) by consolidating two separate re-searches into one. In addition, I changed the null move implementation so it reduces the search horizon more aggressively if the current position’s static score far exceeds beta. Previously, if a PVS search failed high, the engine would confirm the fail high first by restoring beta from bestScore + 1 to its original value and re-searching. If that also failed high, it restored the search horizon from a reduced value to its original value and re-searched. If that failed high the engine took a beta cutoff. I… Continue Reading

MadChess 3.0 Beta 4b7963b (Remove Aspiration Windows)

When analyzing a Carlsen versus Vachier-Lagrave game, I noticed MadChess 3.0 Beta struggling to find Magnus Carlsen’s crushing 23rd move, d6, in the following position. In the engine output displayed by the Hiarcs Chess GUI, I noticed MadChess kept restarting its search of ply 18. It indicated it was searching the first move (of 47 legal moves), second move, third move, etc… then would restart searching the first move again, still on ply 18. It restarted searching the first move of ply 18 numerous times. I suspected this was due to search instability caused by aspiration windows: searching a window… Continue Reading

MadChess 3.0 Beta d143bb5 (Time Management)

I improved MadChess 3.0 Beta’s time management. I added code that increases MoveTimeSoftLimit, a TimeSpan variable that controls how long the engine examines a position (in a timed game) before responding with its move. The code increases MoveTimeSoftLimit 25% each ply (depth >= 9) if the score decreases at least one third of a pawn from the prior ply. In some engines this is known as “panic time.” The engine notices the score dropping and- to anthropomorphize it- panics like a human chess player would, spending more time than usual searching for a move that prevents its position from crumbling.… Continue Reading

MadChess 3.0 Beta 2d855ec (Crash Bug)

I found and exterminated a bug that caused MadChess to crash in about one quarter of one percent of games. I noticed the engine crashes on line 6 of this code in the Board.IsMoveLegal(ref ulong Move) method. First Hypothesis : Illegal Move Causing King Capture? I suspected the crash was caused by kingSquare == Square.Illegal (meaning king not on any square) due to a missing king. Perhaps a move two ply earlier exposed its own king to check, MadChess erroneously considered the move legal, then captured the king the previous ply? If that were true, in the current ply, when… Continue Reading

MadChess 3.0 Beta 6794c89 (King Safety)

I added evaluation of king safety to MadChess 3.0 Beta. Because determining the safety of a king’s position involves examining moves that attack squares near the king, I combined it with piece mobility evaluation, which also examines moves. When examining piece mobility, keep a weighted count of attacks on squares ringing the king (16 squares in outer ring and 8 squares in inner ring) with separate weights for attacks by minor pieces, rooks, and queens. In the following code, white moves to squares ringing the black king contribute negatively to black’s king safety. Black moves to squares ringing the white… Continue Reading