Moderator: Andres Valverde
Ochazuke wrote:I have discovered a problem with detecting repetitions using hash keys.
use the following game for reference:
8/3k4/8/8/6p1/3K4/5P2/8 w - - 0 1
1. f4 Kc7 2. Kc3 Kd7 3. Kd3 Kc7 4. Kc3 Kd7 5. Kd3 1/2-1/2
The problem is that after 1. f4, an enpassant capture is available and the hash key must be changed to reflect that, otherwise if you encounter the same position later but there is no enpassant capture available you may return an incorrect value.
So assuming the engine changes the hash key to reflect available enpassant captures, after 3. Kd3 the engine will think it is the first time it has encountered this position. However, according to the rules of chess, this position has been encountered twice.
Any thoughts?
Positions as in (a) and (b) are considered the same, if the same player has the move, pieces of the same kind and colour occupy the same squares, and the possible moves of all the pieces of both players are the same.
Positions are not the same if a pawn that could have been captured en passant can no longer be captured or if the right to castle has been changed temporarily or permanently.
Yes, the gui is wrong. I do not know the chessbase gui but, from what I can read in different forums, it has an extremely bad reputation. Engines are great, but the interface is poor, apparently. One more bug is not suprising.Ochazuke wrote:That short game in my first post was obtained by playing those moves in the chessbase gui. Does this mean the gui is wrong? And thx for the reply!
... or if the right to castle has been changed temporarily ...
Reinhard Scharnagl wrote:Hi R?mi,... or if the right to castle has been changed temporarily ...
I hardly can imagine what a temporarily change of castling rights could be (when nothing else at the board would change). Could you please supply me with an example, with two identic positions and temporarily changed castling rights.
Reinhard.
Reinhard Scharnagl wrote:Hello R?mi,
so you agree with me in that this FIDE law contains a little bit nonsense in that point. The word "temporarily" is silly here.
Reinhard.
16.1.3.4: En passant target square
The fourth field is the en passant target square. If there is no en passant target square then the single character symbol "-" appears. If there is an en passant target square then is represented by a lowercase file character immediately followed by a rank digit. Obviously, the rank digit will be "3" following a white pawn double advance (Black is the active color) or else be the digit "6" after a black pawn double advance (White being the active color).
An en passant target square is given if and only if the last move was a pawn advance of two squares. Therefore, an en passant target square field may have a square name even if there is no pawn of the opposing side that may immediately execute the en passant capture.
Sven Sch?le wrote:How do the other engine authors address this?
Reinhard Scharnagl wrote:Hi R?mi,
Smirf handles it that way, that an e.p. flag internally is set then and only then, when a double moved pawn would be placed beside an opponent's pawn. But it is irrelevant whether then an e.p. capture is possible in the following or not. That seems to be a good compromise.
Reinhard.
Sven Sch?le wrote:Any other remarks from someone else? Anyone detecting the pin case?
Ochazuke wrote:here black can do the enpassant capture to get out of check
...both engines do not conform to the FIDE rules...
Reinhard Scharnagl wrote:Hi R?mi,
Smirf handles it that way, that an e.p. flag internally is set then and only then, when a double moved pawn would be placed beside an opponent's pawn. But it is irrelevant whether then an e.p. capture is possible in the following or not. That seems to be a good compromise.
Reinhard.
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 12 guests