MadChess 3.0 Beta 4d22dec (Endgame Eval Scaling)

I improved MadChess 3.0 Beta’s detection of drawn endgames. The IsPawnlessDraw method scores the following positions as drawn. Though it continues to search moves for a swindle (opponent mistake that makes a drawn game winnable). 2N vrs <= 1 Minor Q vrs 2B Q vrs 2N Q vrs Q Q vrs R + Minor R vrs R + <= 1 Minor Q vrs 2R 2R vrs R + Minor 2R vrs 2R Testing revealed considering R vrs <= 2 Minors a draw increased evaluation error and caused the engine to play weaker. I left that endgame in the IsPawnlessDraw function… Continue Reading

MadChess 3.0 Beta 2960ec9 (Bishop Pair)

I improved MadChess 3.0 Beta’s evaluation function by adding middlegame and endgame evaluation parameters for bishop pair. Tuning code indicated the bishop pair parameters immediately reduced evaluation error when examining a database consisting of approximately 54,000 Grandmaster games (both players 2600 ELO or stronger). I ran the Particle Swarm Optimization tuner on all evaluation parameters and it further reduced evaluation error. This improved evaluation function increased the playing strength of MadChess 3.0 Beta by 22 ELO.   Feature Category Date Commit1 WAC2 ELO Rating3 Improvement Bishop Pair Evaluation 2021 Mar 14 2960ec9 285 2592 +22 Position Cache Optimization Search 2021… Continue Reading

MadChess 3.0 Beta 42d7702 (Position Cache Optimization)

Quoting from my Pull Request #12: Converted Cache class’ _positions field from a jagged array to a flat array. The flat array is more memory efficient than a jagged array. Jagged arrays have a .NET object header for each sub-array (for garbage collection tracking of reachable-from-root). This enables more positions to be stored per megabyte of memory. The code in this PR stores 65,536 positions per MB = 8,388,608 positions for a typically sized 128 MB cache. Added stats to track cache hit %, best move found in cached position %, and count of invalid best moves. Stats are displayed… Continue Reading

MadChess 3.0 Beta 22002dc (Move Generation Optimization)

Rather than repeat myself, I’ll explain my recent code update by copying the text of my Pull Request #10 here: Improved detection of pieces pinned to own king by sliding attackers. Previous implementation only found potentially pinned pieces (because the pieces were on the same file, rank, or diagonal as the sliding attacker). The new implementation finds all actually pinned pieces. This speeds up resolution of pseudo-legal moves to legal moves by eliminating unnecessary calls to Board.IsSquareAttacked(kingSquare) in Board.IsMoveLegal method. Its benefit is limited though because many pseudo-legal moves never are examined for legality because a beta cutoff occurs before… Continue Reading

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