Moderator: Andres Valverde
Hi, Ochazuke,Ochazuke wrote:Yikes, I didnt think of some of that stuff .
So it would seem that a position with an enpassant target square is different from its counterpart position without an enpassant target square only if:
1. the ep target square is attacked by a pawn of the side to move.
2. the pawn attacking the ep target square isn't pinned.
3. nobody is in check.
Sound right?
Hi Reinhard,Reinhard Scharnagl wrote:...both engines do not conform to the FIDE rules...
I do not understand this. FIDE has no competence to demand how chess engines should handle the e.p. flag internally. They do make clear, what a legal e.p. capture is. And according to that Smirf is producing all legal and only legal moves.
Hi Uri,Uri Blass wrote:I think that you are right and the only error can be not detecting repetition when there is a repetition.
In the following case movei does not detect draw by repetition because inspite of the case that the position repeated 3 times the hash key did not repeat 3 times.
[Event "Edited game"]
[Site "URI-AMD"]
[Date "2005.01.09"]
[Round "-"]
[White "-"]
[Black "-"]
[Result "*"]
1. e4 e5 2. Nf3 Qe7 3. Nxe5 Qd8 4. Nf3 Qe7 5. e5 d5 6. Ng1 Nc6 7. Nf3 Nb8
8. Nc3 Nc6 9. Nb1 Nb8
*
Hi again for my x-th posting tonight ...Sven Sch?le wrote:I'm already thinking about a cheap solution.
if (is_last_move_identified_as_illegal()) {
handle_illegal_move_as_usual_including_taking_it_back();
if (ep_target_square_of_current_position_is_valid_square() AND
last_move_was_an_ep_capture_to_that_square()) {
reset_ep_target_square_of_current_position_to_zero();
update_hash_key_of_current_position_accordingly();
}
}
Reinhard Scharnagl wrote:... 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).
if (is_last_move_identified_as_illegal()) {
handle_illegal_move_as_usual_including_taking_it_back();
if (ep_target_square_of_current_position_is_valid_square() AND
last_move_was_an_ep_capture_to_that_square()) {
reset_ep_target_square_of_current_position_to_zero();
update_hash_key_of_current_position_accordingly();
}
}
Sven Sch?le wrote:Hi Uri,Uri Blass wrote:I think that you are right and the only error can be not detecting repetition when there is a repetition.
In the following case movei does not detect draw by repetition because inspite of the case that the position repeated 3 times the hash key did not repeat 3 times.
[Event "Edited game"]
[Site "URI-AMD"]
[Date "2005.01.09"]
[Round "-"]
[White "-"]
[Black "-"]
[Result "*"]
1. e4 e5 2. Nf3 Qe7 3. Nxe5 Qd8 4. Nf3 Qe7 5. e5 d5 6. Ng1 Nc6 7. Nf3 Nb8
8. Nc3 Nc6 9. Nb1 Nb8
*
your example matches exactly what I tried to explain in my earlier posts, but I must apologise for not having been able to explain it better so that everybody could understand it immediately.
I believe that there are more realistic examples that show the situation. 3...Qd8 and most of the following moves are of course stupid. But when talking about exactly implementing the rules I think that one should always leave out the "stupidity factor", so your example is good enough to understand the principle.
We should not forget that this situation (ep illegal due to pinned pawn) can also occur anywhere deep in the tree, probably at a depth where engines do not necessarily enter "realistic" positions only. So I think this should be solved somehow.
Cheers,
Sven
if (is_last_move_identified_as_illegal()) {
handle_illegal_move_as_usual_including_taking_it_back();
if (ep_target_square_of_current_position_is_valid_square() AND
last_move_was_an_ep_capture_to_that_square()) {
reset_ep_target_square_of_current_position_to_zero();
update_hash_key_of_current_position_accordingly();
}
}
Uri Blass wrote:1)My opinion is that missing repetition in these rare cases when enpaasent capture was illegal because of pin probably changes the result in less than 1 of million games.
Uri Blass wrote:Can you show me a single practical example when an engine missed a draw because of that problem?
Uri Blass wrote:2)You can claim that you do it not to detect repetition in games but to avoid searching irrelevant lines in games when you could detect repetition earlier [...]
Ochazuke wrote:Maybe I should elaborate on my above post a bit. I don't think your code
- Code: Select all
if (is_last_move_identified_as_illegal()) {
handle_illegal_move_as_usual_including_taking_it_back();
if (ep_target_square_of_current_position_is_valid_square() AND
last_move_was_an_ep_capture_to_that_square()) {
reset_ep_target_square_of_current_position_to_zero();
update_hash_key_of_current_position_accordingly();
}
}
works as is.
First, you cannot read from the hash table correctly because the hash key may be incorrect upon entering a position. Second, it doesn't work with the position I posted above(8/8/6k1/8/4pPp1/8/3K4/6R1 b - f3 0 1) because when it sees that there is an illegal ep capture, it immediately changes the hash key. however, an ep capture is still available, so the hash key will be incorrect.
Sven Sch?le wrote:[snip]
Nevertheless I think that the PGN/FEN standard should be changed at least to show an ep target square only if there is an enemy pawn present to the left or right of the pawn having advanced two squares (as I already pointed out earlier within this thread).
Sven Sch?le wrote:Does anyone know who should be contacted for an update of the PGN standard?
Sven Sch?le wrote:Hi Uri,
It is also a matter of style. My style is to try to write my chess program as if I would write software for a customer. Such a customer would not be happy if I told him that I knew of a possible problem in the software which is probably very rare and which has never been reported by any other customer. And of course I would fix it immediately as soon as someone really reported that problem. And I already knew how to fix it today but I would not want to do it because it would slow down the program by 1%.
Cheers,
Sven
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 22 guests