News for hackers. Stuff that matters.
Re:Positions chess engines don't understand by dmurray on Monday May 17, 2021 @07:23PM (#27189570)
> So if you plan to write chess engine it would be pretty stupid of you to not prepare it to face multiple black bishops. If I knew that it would give me a lot of advantage.

It would not.

Rybka (formerly the #1 chess engine) doesn't support promoting to bishops. The author chose an efficient move representation that couldn't handle more than four promotion types. Not quite the same situation, but I can be sure the difference is small even against an opponent trying to exploit it.

Re:Positions chess engines don't understand by toast0 on Monday May 17, 2021 @08:54PM (#27190172)
Isn't that a big advantage... if you can promote to bishop and the other player crashes, wouldn't you win by default or something?
Re:Positions chess engines don't understand by bluGill on Monday May 17, 2021 @08:59PM (#27190208)
So long as you don't crash the engine just evaluates when it happens .bishop promotions are rare.
Re:Positions chess engines don't understand by agalunar on Monday May 17, 2021 @09:07PM (#27190245)
Wait, there are only four promotions! Queen, rook, bishop, and knight – you're not allowed to keep a pawn on the back rank.
Re:Positions chess engines don't understand by dmurray on Wednesday May 19, 2021 @04:39AM (#27206021)
Good point. If I remember right, the engine used one state to represent "no promotion happening this turn". Of course it's redundant, because you can determine that from the rest of the representation, but apparently it was worth being able to determine that with a single bitwise operation.

Edit:

> each move is easily encoded as a 16 bit value: 6 bits for origin square, 6 for destination square, 1 for en passant, 1 for castling, and 2 for promotion. The 2 promotion bits can only represent 4 options... and since the move encoding is for ANY move, not just promotions, one of the options is "no promotion"[0]

And another tidbit from that page: the same encoding is used for making moves and retracting them (going back up the search tree), so efficient encoding of "no promotion" is important there. E.g. If there's a white rook on e8 and the last move was e7-e8, when retracting it you need to know whether to put a pawn or a rook on e7.

[0] http://rybkaforum.net/cgi-bin/rybkaforum/topic_show.pl?tid=1...

Re:Positions chess engines don't understand by WJW on Tuesday May 18, 2021 @06:56AM (#27193119)
Actually now that I think about it, promoting to a second king would be pretty sick. Then you have a spare so losing the original doesn't lose you the game immediately. I could see an incredible game where someone uses this to salvage an otherwise unescapable checkmate.
Re:Positions chess engines don't understand by dragonwriter on Monday May 17, 2021 @09:11PM (#27190268)
Yes. It’s possible some engines represent bishop-on-black as a different thing than bishop-on-white, which would make 5 with bishops and 3 without.