Page 1 of 3

Repetition detection question

Posted: Mon Jan 28, 2008 10:55 pm
by bob
Here is something I have not seen asked or discussed previously. I found a serious repetition bug in Crafty that has been around for a couple of years. But in fixing it I looked carefully at how/when/where it was called, and came across the following issue.....

Do you still do repetition checks below a null-move? I have not yet concluded whether the answer should be yes or no. For me, I have been doing so, but it appears that it is wasted and might even break a null-move search here and there, because obviously there can be no repetition below a null-move that repeats a position prior to the null move. Actually there can be, but do we want it to terminate the null-move search? I am thinking "no" since the purpose of the null-move is to determine whether my current position is so good that even if I "pass" I am still winning, and a repetition might cause the answer to be "no" erroneously...

Has anyone given this any kind of thought??? If so, did you actually reach any kind of useful conclusion as a result? :)

Bob

Re: Repetition detection question

Posted: Mon Jan 28, 2008 11:00 pm
by Gerd Isenberg
bob wrote:Here is something I have not seen asked or discussed previously. I found a serious repetition bug in Crafty that has been around for a couple of years. But in fixing it I looked carefully at how/when/where it was called, and came across the following issue.....

Do you still do repetition checks below a null-move? I have not yet concluded whether the answer should be yes or no. For me, I have been doing so, but it appears that it is wasted and might even break a null-move search here and there, because obviously there can be no repetition below a null-move that repeats a position prior to the null move. Actually there can be, but do we want it to terminate the null-move search? I am thinking "no" since the purpose of the null-move is to determine whether my current position is so good that even if I "pass" I am still winning, and a repetition might cause the answer to be "no" erroneously...

Has anyone given this any kind of thought??? If so, did you actually reach any kind of useful conclusion as a result? :)

Bob
Why not treat null-move as irreversible?

Re: Repetition detection question

Posted: Mon Jan 28, 2008 11:36 pm
by rjgibert
I'm very far from an expert on nullmove, but here is my take on this issue.

If you repeat a position from before the null move, that is a demonstration that for at least that one line after the null move, the null move was of no benefit to the other side i.e. the position is still good for the null moving side, so the repetition should be counted, but not as a draw, but as a fail high position for the null moving side.

I may be way off base, but that is what seems to make sense to me.

Re: Repetition detection question

Posted: Tue Jan 29, 2008 12:17 am
by Zach Wegner
bob wrote:Here is something I have not seen asked or discussed previously. I found a serious repetition bug in Crafty that has been around for a couple of years. But in fixing it I looked carefully at how/when/where it was called, and came across the following issue.....

Do you still do repetition checks below a null-move? I have not yet concluded whether the answer should be yes or no. For me, I have been doing so, but it appears that it is wasted and might even break a null-move search here and there, because obviously there can be no repetition below a null-move that repeats a position prior to the null move. Actually there can be, but do we want it to terminate the null-move search? I am thinking "no" since the purpose of the null-move is to determine whether my current position is so good that even if I "pass" I am still winning, and a repetition might cause the answer to be "no" erroneously...

Has anyone given this any kind of thought??? If so, did you actually reach any kind of useful conclusion as a result? :)

Bob
I check(ed) for null moves in the history, because I use infinitely recursive null move and it could immediately return a draw. I didn't really think it through, I just needed to not return reps after null moves. Now I realize the Gerd's suggestion is a much better way of handling it.

Re: Repetition detection question

Posted: Tue Jan 29, 2008 12:18 am
by bob
Gerd Isenberg wrote:
bob wrote:Here is something I have not seen asked or discussed previously. I found a serious repetition bug in Crafty that has been around for a couple of years. But in fixing it I looked carefully at how/when/where it was called, and came across the following issue.....

Do you still do repetition checks below a null-move? I have not yet concluded whether the answer should be yes or no. For me, I have been doing so, but it appears that it is wasted and might even break a null-move search here and there, because obviously there can be no repetition below a null-move that repeats a position prior to the null move. Actually there can be, but do we want it to terminate the null-move search? I am thinking "no" since the purpose of the null-move is to determine whether my current position is so good that even if I "pass" I am still winning, and a repetition might cause the answer to be "no" erroneously...

Has anyone given this any kind of thought??? If so, did you actually reach any kind of useful conclusion as a result? :)

Bob
Why not treat null-move as irreversible?
That is what I have been doing, but I thought I would ask to see if there were any different opinions...

Re: Repetition detection question

Posted: Tue Jan 29, 2008 12:19 am
by bob
rjgibert wrote:I'm very far from an expert on nullmove, but here is my take on this issue.

If you repeat a position from before the null move, that is a demonstration that for at least that one line after the null move, the null move was of no benefit to the other side i.e. the position is still good for the null moving side, so the repetition should be counted, but not as a draw, but as a fail high position for the null moving side.

I may be way off base, but that is what seems to make sense to me.
My question would be, why is that good? Suppose I am winning handily before trying a null-move. How does repeating a position after the null that was played before the null prove that this position is good for me???

Re: Repetition detection question

Posted: Tue Jan 29, 2008 12:27 am
by rjgibert
bob wrote:
rjgibert wrote:I'm very far from an expert on nullmove, but here is my take on this issue.

If you repeat a position from before the null move, that is a demonstration that for at least that one line after the null move, the null move was of no benefit to the other side i.e. the position is still good for the null moving side, so the repetition should be counted, but not as a draw, but as a fail high position for the null moving side.

I may be way off base, but that is what seems to make sense to me.
My question would be, why is that good? Suppose I am winning handily before trying a null-move. How does repeating a position after the null that was played before the null prove that this position is good for me???
It's just as good as the position before the the null move that got repeated. You gave up a tempo with the nullmove and wrested the tempo back. What could be more convincing (besides mate)?

Re: Repetition detection question

Posted: Tue Jan 29, 2008 1:15 am
by rjgibert
bob wrote:
rjgibert wrote:I'm very far from an expert on nullmove, but here is my take on this issue.

If you repeat a position from before the null move, that is a demonstration that for at least that one line after the null move, the null move was of no benefit to the other side i.e. the position is still good for the null moving side, so the repetition should be counted, but not as a draw, but as a fail high position for the null moving side.

I may be way off base, but that is what seems to make sense to me.
My question would be, why is that good? Suppose I am winning handily before trying a null-move. How does repeating a position after the null that was played before the null prove that this position is good for me???
Here is another way of looking at it if you prefer.

If you answer "no" as you suggested to the original question you posed, then what will happen is that your program will then look up the position in the hash table and get a hit if the entry has not been overwritten.

Naturally, the entry will have more than enough depth to it and your program will use the entry for a cutoff producing essentially the same result.

Re: Repetition detection question

Posted: Tue Jan 29, 2008 1:36 am
by Karlo Bala
bob wrote:
Gerd Isenberg wrote:
bob wrote:Here is something I have not seen asked or discussed previously. I found a serious repetition bug in Crafty that has been around for a couple of years. But in fixing it I looked carefully at how/when/where it was called, and came across the following issue.....

Do you still do repetition checks below a null-move? I have not yet concluded whether the answer should be yes or no. For me, I have been doing so, but it appears that it is wasted and might even break a null-move search here and there, because obviously there can be no repetition below a null-move that repeats a position prior to the null move. Actually there can be, but do we want it to terminate the null-move search? I am thinking "no" since the purpose of the null-move is to determine whether my current position is so good that even if I "pass" I am still winning, and a repetition might cause the answer to be "no" erroneously...

Has anyone given this any kind of thought??? If so, did you actually reach any kind of useful conclusion as a result? :)

Bob
Why not treat null-move as irreversible?
That is what I have been doing, but I thought I would ask to see if there were any different opinions...
I treat NULL move just like pawn push somewhere out of board.
(every NULL is different pawn push). With that approach even double NULL work fine in pawn endgames 8-)

Re: Repetition detection question

Posted: Tue Jan 29, 2008 1:39 am
by BubbaTough
This is an interesting question. Has anyone actually collected any data as to which way works best in games?

-Sam