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

Play Rather Than Code

Watching The Queen’s Gambit on Netflix nudged me to play chess online. I’ve spent time on chess over the last few years… programming an engine, not actually playing. I’m very rusty. Though my puzzle rating is decent. It’s much higher than my game rating, suggesting I need to work on time management. Thinking fast is not my strength, but everyone online plays blitz or bullet so here goes nothing… Last night I joined a bullet tournament with a 2+1 clock. Each player has 2 minutes to make all their moves in the game, plus 1 second added to their clock… Continue Reading