The starting point is i=4 and the for-loop is ascending. If plies-from-null==4 and 50-move-counter>4 then they test the actual position against the position after the last null move. No null moves in between.bob wrote:Also, IIRC, the stockfish starting point is ply - 4 so it is already excluding the first 4 plies, whether by design or by accident is unknown. Normally you would start looking 4 plies back since you can't repeat any sooner, but null-move changes that and you can repeat sooner than that...Ralph Stoesser wrote:I have changed SF to look back beyond null-move. I've also tried the additional 4 plies from null limit (don't test for rep draw if plies-from-null < 4).bob wrote:
The short answer is that SF does not look back beyond the null-move when doing repetition detection.
Both variants have played slightly weaker than default SF, but the results were well within the error margin (-4 Elo and -2 Elo). I've played only 2000 games each version.
Probably not much Elo to gain here. But interesting anyway.I just finished a calibration run for 23.4, and am now re-adding in the 50-move counter limit for 23.5. I am going to run this test and then report the results. This simply uses the 50-move counter as a limit on how far back one can hunt for a repetition, and since Crafty resets the 50 move counter (SF does not, but has a separate counter for moves since a null was played) after a null, the two programs will be doing exactly the same thing. I have tested this more than once and found an Elo drop-off. This time I will report the results here once the test finishes this afternoon some time...
As would seem natural they use the 50-move counter for 50 move rule tests.I am not sure why they maintain two counters, a 50-move counter and a moves-since-null counter. If repetitions previous to a null are ignored, I am not sure one would want to deal with 50 move draws since nulls are not going to make much sense there either...
And they use the plies-from-null counter for counting the plies from last null move.
I'd say it's easy to understand.
Perhaps we both found the "optimal value" quite by accident... Still testing however...
bizarre repetition detection issue
Moderator: Ras
-
Ralph Stoesser
- Posts: 408
- Joined: Sat Mar 06, 2010 9:28 am
Re: bizarre repetition detection issue
-
bob
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: bizarre repetition detection issue
The for-loop is ascending, but the array accesses are not:Ralph Stoesser wrote:The starting point is i=4 and the for-loop is ascending. If plies-from-null==4 and 50-move-counter>4 then they test the actual position against the position after the last null move. No null moves in between.bob wrote:Also, IIRC, the stockfish starting point is ply - 4 so it is already excluding the first 4 plies, whether by design or by accident is unknown. Normally you would start looking 4 plies back since you can't repeat any sooner, but null-move changes that and you can repeat sooner than that...Ralph Stoesser wrote:I have changed SF to look back beyond null-move. I've also tried the additional 4 plies from null limit (don't test for rep draw if plies-from-null < 4).bob wrote:
The short answer is that SF does not look back beyond the null-move when doing repetition detection.
Both variants have played slightly weaker than default SF, but the results were well within the error margin (-4 Elo and -2 Elo). I've played only 2000 games each version.
Probably not much Elo to gain here. But interesting anyway.I just finished a calibration run for 23.4, and am now re-adding in the 50-move counter limit for 23.5. I am going to run this test and then report the results. This simply uses the 50-move counter as a limit on how far back one can hunt for a repetition, and since Crafty resets the 50 move counter (SF does not, but has a separate counter for moves since a null was played) after a null, the two programs will be doing exactly the same thing. I have tested this more than once and found an Elo drop-off. This time I will report the results here once the test finishes this afternoon some time...
As would seem natural they use the 50-move counter for 50 move rule tests.I am not sure why they maintain two counters, a 50-move counter and a moves-since-null counter. If repetitions previous to a null are ignored, I am not sure one would want to deal with 50 move draws since nulls are not going to make much sense there either...
And they use the plies-from-null counter for counting the plies from last null move.
I'd say it's easy to understand.
Perhaps we both found the "optimal value" quite by accident... Still testing however...
Code: Select all
for (int i = 4, e = Min(Min(st->gamePly, st->rule50), st->pliesFromNull); i <= e; i += 2)
if (history[st->gamePly - i] == st->key)
^^^^^^^^^^^^^^^
return true;
One would not want to talk the replist forward, because repetitions tend to occur with positions near the end, not near the front.[/b]