In the Weiss chess engine, the Static Exchange Evaluation (SEE) and noisy checks are performed during the move generation and search phases.
Static Exchange Evaluation (SEE):
SEE is a heuristic used to evaluate the material gain or loss of a move. It's a static evaluation, meaning it doesn't consider the dynamic aspects of the position, such as potential attacks or defenses.
In the Weiss engine, SEE is performed in the following situations:
- Move ordering: During move generation, SEE is used to evaluate the material gain or loss of each move. This helps to order the moves in a way that prioritizes captures and other moves that are likely to be good.
- Move pruning: In the search phase, SEE is used to prune moves that are unlikely to be good. If the SEE evaluation indicates that a move would result in a material loss, it's likely to be pruned from the search tree.
The SEE evaluation works as follows:
- It starts by evaluating the material value of the pieces on the board.
- For each move, it calculates the material gain or loss by considering the pieces that are captured and the pieces that are moved.
- It uses a set of precomputed tables to look up the material values of the pieces and calculate the material gain or loss.
Noisy checks:
Noisy checks refer to the evaluation of moves that are likely to be good, but may not be the best move. In the Weiss engine, noisy checks are performed during the move generation and search phases.
In the move generation phase, noisy checks are used to evaluate moves that are likely to be good, such as:
- Captures: Moves that capture an opponent's piece.
- Promotions: Moves that promote a pawn to a more powerful piece.
- Castling: Moves that castle the king to a safer position.
In the search phase, noisy checks are used to evaluate moves that are likely to be good, but may not be the best move. This includes moves that:
- Attack an opponent's piece.
- Defend a piece that's under attack.
- Move a piece to a safer position.
The noisy checks work by evaluating the material gain or loss of each move, as well as other factors such as:
- Piece development: Moving pieces to more active squares.
- Control of the center: Controlling the central squares on the board.
- Pawn structure: Managing the pawns to create weaknesses or strengths.
The noisy checks use a combination of precomputed tables and heuristics to evaluate the moves and determine which ones are likely to be good.
Here's some sample code that illustrates how SEE and noisy checks might be implemented: