MadChess 3.0 Beta 6f3d17a (Late Move Pruning)

I added late move pruning to MadChess 3.0 Beta. Quiet moves (not captures, pawn promotions, castling, or check) near the search horizon that are sorted near the bottom of the move list- in order words, “late” moves- are skipped. These moves are “late” because history heuristics have recorded few instances of them causing a beta cutoff. Most likely they are futile (they will not raise the score to alpha), so the engine doesn’t waste time searching them. The search only examines two quiet moves immediately next to the search horizon, five quiet moves two ply from the horizon, up to… Continue Reading

MadChess 3.0 Beta 5c5d4fc (Piece Mobility)

I have not worked on my chess engine in over a year. I had other, more important, priorities. In the last year, my wife and I bought a new home closer to the city, sold our old home, moved (*), started new jobs in the summer, and ran the Chicago Marathon in the autumn. The little free time I had for hobby programming I spent on general interest projects, not on MadChess. I’m especially proud of Leaderless Replication, an essay I published on my general programming blog, ErikTheCoder. Lately I’ve had time to do some chess programming. I added piece… Continue Reading

MadChess 3.0 Beta Build 103 (Passed Pawns)

I added passed pawn evaluation to MadChess 3.0 Beta. The passed pawn evaluation code scores the following features: Passed Pawns Free Passed Pawns (no pieces blocking promotion path) King Escorted Passed Pawns Unstoppable Passed Pawns (Rule of the Square) Middlegame Passed Pawns: 000 000 003 008 015 024 034 000 Endgame Passed Pawns: 000 004 018 042 075 118 170 000 Endgame Free Passed Pawns: 000 008 034 077 138 216 311 000 Endgame King Escorted Passed Pawn: 11 Unstoppable Passed Pawn: 775   This code improved the engine’s understanding of threats created by pushing passed pawns. It increased the… Continue Reading

MadChess 3.0 Beta Build 093 (Staged Move Generation)

I increased the speed at which MadChess 3.0 Beta examines nodes by implementing staged move generation. Previously, in the main search, the chess engine would generate all pseudo-legal moves, sort them by move priority, then iterate through them: testing move legality (does move expose own king to check) and playing the legal moves. This is wasteful if a beta cutoff occurs early in the move list. Usually a capture is responsible for a beta cutoff, so time is wasted generating non-captures. Now the chess engine generates moves in stages. I could have implemented more stages (QueenCaptures, RookCaptures, BishopKnightCaptures, etc) but… Continue Reading

MadChess 3.0 Beta Build 084 (History Heuristics)

I increased the playing strength of MadChess 3.0 by improving the history heuristics used by Late Move Reductions (LMR). First, I added a flag that indicates if a move was played during search (indicated below with “!”). This implies the move is legal (doesn’t expose own king to check) and search examined it (as opposed to moves appearing in the move list after a move that causes a beta cutoff). Moves are encoded as ulong primitives like so: Next, I altered the search function to flag played moves. Then I modified the search function so it not only increments move… Continue Reading