chesslablab / php-chess

A chess library for PHP.
https://chesslablab.github.io/php-chess/
MIT License
91 stars 45 forks source link

Fix the relative pin evaluation #542

Closed programarivm closed 3 months ago

programarivm commented 3 months ago

chessboard Figure 1. 4r1k1/4r3/4p3/8/8/8/8/4R1K1 w - -

screencapture-chesslablab-org-en-learn-fen-string-2024-05-25-12_26_35 Figure 2. Click on Study > Explain Position

Black has a decisive material advantage. Black has a moderate control of the center. The black pieces are totally better connected. Black has a slight space advantage. The white player is pressuring a little bit more squares than its opponent. Black has a slight passed pawn advantage. White has a slight isolated pawn advantage. White has a slight relative pin advantage. Black has a moderate outpost advantage. e6 is a passed pawn. e6 is an isolated pawn. The pawn on e6 is pinned shielding a piece that is more valuable than the attacking piece. d5 and f5 are outpost squares. Overall, 3 heuristic evaluation features are favoring White while 6 are favoring Black.

programarivm commented 3 months ago

In this position, the e6-pawn is not pinned because the rook on e7 is being defended by the rook on e8. The piece on e1 has the exact same value as the piece on e7. As a result, if the pawn moved White wouldn't gain any material advantage by capturing the piece on e7.