Page 1 of 3

repetition detection

Posted: Sat Oct 29, 2011 8:46 pm
by Edmund
I suspected some problems with repetition detection in Glass, so today I collected some figures for how often a repetition is triggered.

Glass tests for a repetition at the beginning of every node. If the position is found in the line between the current node and the root node, draw score is returned immediately.

For a 15 ply search from the start position I am getting 4404 repetitions out of 34115733 tests. So on average there is a repetition on every 7747 nodes.

I would be very much interested, what your engines return for this index.

Regards
Edmund

Re: repetition detection

Posted: Sun Oct 30, 2011 3:24 am
by micron
Edmund wrote:Glass tests for a repetition at the beginning of every node. If the position is found in the line between the current node and the root node, draw score is returned immediately.
For a 15 ply search from the start position I am getting 4404 repetitions out of 34115733 tests. So on average there is a repetition on every 7747 nodes.
I would be very much interested, what your engines return for this index.
Spandrel's repetition code corresponds to your description, but my results are hard to reconcile with your index 7747.

Code: Select all

ply   repets     tests    tests/repet
 9        1       80945    80945
10        4      226157    56539
11       10      624105    62410
12       25     1026408    41056
13       96     2985570    31099
14      163     5194982    31871
15      276     8257388    29918
16      559    14557943    26042
17     1384    32776902    23682
18     2647    61886605    23379
19     6885   127764844    18556
20    36756   476123023    12953
21    53554   713229233    13317
Robert P.

Re: repetition detection

Posted: Sun Oct 30, 2011 3:47 am
by sje
A better test that isn't specific to any search is to read PGN data for many different games and check if the program says "Repetition" for, and only for, those games marked "Repetition".

See: http://www.talkchess.com/forum/viewtopic.php?t=40916

Re: repetition detection

Posted: Sun Oct 30, 2011 6:47 am
by Matthias Gemuh
sje wrote:A better test that isn't specific to any search is to read PGN data for many different games and check if the program says "Repetition" for, and only for, those games marked "Repetition".

See: http://www.talkchess.com/forum/viewtopic.php?t=40916
Engines are not compelled to claim 3-fold-rep draws, so there may be unmarked games that contain 3-fold-rep.

Re: repetition detection

Posted: Sun Oct 30, 2011 8:15 am
by Mincho Georgiev
Pawny - 15 ply search without qnodes = 174 repetitions from start position.
With qnodes = 205. The numbers you gave seems little bit high, but your search tree it's probably much wider, so I can't really say if they are.

Re: repetition detection

Posted: Sun Oct 30, 2011 9:06 am
by Edmund
Mincho Georgiev wrote:Pawny - 15 ply search without qnodes = 174 repetitions from start position.
With qnodes = 205. The numbers you gave seems little bit high, but your search tree it's probably much wider, so I can't really say if they are.
Thanks for this comparison data. For a 15 ply search your engine reports 17773520 visted nodes. So your total / hit ratio would be 86700.

Re: repetition detection

Posted: Sun Oct 30, 2011 9:11 am
by Edmund
Thanks to mincho and Robert for their comparison.
For "visited nodes" / "reported repetitions" for ply 15
- Pawny reports 86700
- Spandrel reports 29918
- Glass Reports 7747

Low could either mean very bad move ordering or some bug in repetition detection. Anyway I will have a closer look into this issue.

Re: repetition detection

Posted: Sun Oct 30, 2011 11:59 pm
by Desperado
Hello Edmund,

There can be another issue measuring from "start position".

Depending on how the the ep-flag is set by the engine.

eg: * only double pawn push condition

eg: * or double pawn push condition + check if a real ep-capture can
be done at next move.
(So is there a pawn which can do the ep-capture).


Both variants can be implemented of course, but because
the board states may be different after a double pawn push it can
lead to earlier/delayed (matter of viewpoint) repetition detection
in the lines. Needless to say that this can have significant impact,
because from the "start-position" the highest number of double
pawn pushes can be made.

Michael

Re: repetition detection

Posted: Mon Oct 31, 2011 12:05 am
by Edmund
Desperado wrote:Hello Edmund,

There can be another issue measuring from "start position".

Depending on how the the ep-flag is set by the engine.

eg: * only double pawn push condition

eg: * or double pawn push condition + check if a real ep-capture can
be done at next move.
(So is there a pawn which can do the ep-capture).


Both variants can be implemented of course, but because
the board states may be different after a double pawn push it can
lead to earlier/delayed (matter of viewpoint) repetition detection
in the lines. Needless to say that this can have significant impact,
because from the "start-position" the highest number of double
pawn pushes can be made.

Michael
Thanks for this hint. Glass only considers ep-squares if there is truly a capture possible for the hash-signature. Would be interesting to hear about how this is done in Pawny or Spandrel.

Re: repetition detection

Posted: Mon Oct 31, 2011 2:29 am
by Ferdy
Edmund wrote:I suspected some problems with repetition detection in Glass, so today I collected some figures for how often a repetition is triggered.

Glass tests for a repetition at the beginning of every node. If the position is found in the line between the current node and the root node, draw score is returned immediately.

For a 15 ply search from the start position I am getting 4404 repetitions out of 34115733 tests. So on average there is a repetition on every 7747 nodes.

I would be very much interested, what your engines return for this index.

Regards
Edmund
Deuterium:

Code: Select all

 15    19     98     717133 b1c3 b8c6 g1f3 g8f6 e2e3 e7e6 f1e2 f8e7 e1g1 e8g8
                            d2d4 d7d5 c1d2 e7d6 e2d3 (1.9) 
 repCnt=25, repTries=717133, Tries/Cnt=28685