4

In this talkchess thread, they discuss trapped rooks and castling rights. In post #5, user @Lyudmil Tsvetkov posted:

I would give at least some 10-15cps for temporary prevention of castling.

Here is how StockFish implements it:

score -= TrappedRook * (1 + !pos.castling_rights(Us));

Here an example position.

r3kb1r/pp3ppp/4bn2/3p4/P7/4N1P1/1P2PPBP/R1B1K2R w Kq - 0 1

When searching, the move Bg2-f1 leads to the position.

r3kb1r/pp3ppp/4bn2/3p4/P7/4N1P1/1P2PP1P/R1B1KB1R b Kq - 1 1

As you can see, the White bishop has blocked castling, but pos.castling_rights(Us) for White still returns true, which means Stockfish is not penalizing for the temporary prevention of castling.

Is it intentional or is it a Stockfish bug?

1

White hasn't lost his castling rights. It's just not a legal move right now. There is a distinction.

White would still be able to castle king-side, if the bishop were to move.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.