MadChess 3.1 Released

I have released version 3.1 of my chess engine. I worked on the engine over the last year occasionally, when I had time in the evenings. Slowly, I’ve added about 100 Elo points of playing strength compared to the prior release. This release includes strength improvements achieved by Singular Move, Threat Evaluation, Pawn Structure Evaluation, Move Legality Performance Improvement, Logarithmic LMR Based on QuietMoveNumber and ToHorizon, and evaluation of piece mobility, king safety (including x-ray moves), and threats using Safe Squares. It also includes code quality improvements such as Color Agnostic Code, Removed Endgame King Safety Evaluation, Code Style Refactor… Continue Reading

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)… Continue Reading

MadChess 3.1 Beta d691b32 (Pawn Structure)

I added evaluation of two pawn structure features to MadChess 3.1 Beta. Isolated Pawns Doubled Pawns In addition to pawn structure evaluation, I made other code quality improvements in a series of Pull Requests. PR 24: Upgrade to .NET 6 PR 25: Tune Quiet Positions: Added UCI command that exports quiet positions (static score and quiet score differ <= given centipawns) from a PGN file. Tuner calls Eval.GetStaticScore against QuietPositions.txt instead of Search.GetQuietScore against Games.pgn. PR 26: Lone King Evaluation: Consider any endgame with lone king a simple endgame (instead of only K vrs KQ or KR). PR 27: Remove… Continue Reading

MadChess 3.1 Beta 26e5323 (Threats)

I added evaluation of threats in the middlegame to MadChess 3.1 Beta. A bonus is given if a pawn or minor piece threatens to capture a more valuable piece on its next move. The evaluation code does not determine if the threatening piece is defended. That is left to the Search.GetQuietScore method to resolve. In other words, Search.GetQuietScore may determine the opponent can capture the threatening piece, eliminating the threat and rendering the evaluation bonus moot (because loss of a piece greatly outweighs the threat bonus). Evaluating threats increased the playing strength of MadChess 3.1 Beta by 7 Elo.  … Continue Reading

MadChess 3.1 Beta 2b475bc (Color-Agnostic Code)

I removed 350 lines of code from MadChess and increased its playing strength by 12 Elo. I’m happy with the ratio. The bulk of changes since my last blog post involve replacing redundant, color-specific code with color-agnostic code, mostly in the Eval class. I replaced code such as this… … with code that’s generalized for multiple pieces and colors. The above is just one example of refactored code. There are many others in PR 22 that adds 2,641 lines of code and removes 3,336 lines of code (net -695 lines of code). This refactoring took a lot of time. I… Continue Reading