Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Repetition Detection

Author: James Swafford

Date: 14:34:48 12/01/04

Go up one level in this thread


On December 01, 2004 at 17:01:34, Michel Langeveld wrote:

I think you're hitting on the right idea: there will be a few more
nodes in some positions, a bit less in others.  It really depends
on your move ordering and the position.

--
James


>Is it a lot more nodes ... or just a few more nodes?
>
>Here is a 11 ply search with TSCPGothic (compiled for normal chess):
>
>I think they should be close. I saw examples where with repition on, it
>generates a bit more nodes. I tried 2 positions, and it were all a bit less.
>
>[D]r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq -
>repetition off:
>11*   1212  13030193     16  e2e4 d7d5 e4d5 d8d5 g1f3 c8f5 b1c3 d5d6 f1c4 d6c5 d
>2d3
>repetition on:
>11*   1229  12998060     16  e2e4 d7d5 e4d5 d8d5 g1f3 c8f5 b1c3 d5d6 f1c4 d6c5 d
>2d3
>
>conclusion: a few less nodes
>
>[D]r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq -
>repetition off:
>12*   6039  64176797     -9  g8f6 e1g1 f8c5 d1e2 e8g8 b1c3 f6g4 c3d1 a7a6 b5c4 d
>8f6 g1h1
>repetition on:
>12*   6101  63430117     -9  g8f6 e1g1 f8c5 d1e2 e8g8 b1c3 f6g4 c3d1 a7a6 b5c4 d
>8f6 g1h1
>
>conclusion: a few less nodes
>
>[D]r5k1/1n3p1p/1PN1p1p1/8/p7/4P2P/6PK/3R4 w - -
>repetition off:
>12*   2060  26034077    -60  d1d7 a4a3 d7b7 a3a2 b7c7 a2a1q b6b7 g8g7 c7c8 a8c8
>b7c8q a1e1 c8d7 e1e3
>
>repetition on:
>12*   2356  29480990    -60  d1d7 a4a3 d7b7 a3a2 b7c7 g8g7 b6b7 a2a1q c7c8 a8c8
>b7c8q a1e1 c8d7 e1e3
>
>conclusion: a few _more_ nodes
>
>I don't mind to try more positions if you want.
>
>This is what I use in TSCPGothic for repetition check:
>
>/* reps() returns the number of times the current position
>   has been repeated. It compares the current value of hash
>   to previous values. */
>
>int reps(void)
>{
>   int i;
>   int r = 0;
>
>   for (i = hply - fifty; i < hply; ++i)
>      if (hist_dat[i].hash == dynhash)
>         ++r;
>   return r;
>}
>
>Let me know if you can optimize this even more further.
>
>In search I do:
>
>check first reps,
>then lookup hash,
>the quiescense search,
>then nullmove,
>then generation of moves,
>then score them,
>then play them with selectsort,
>then I check for mate/stalemate
>then I check for fifty moves in a row,
>then I store end
>return function



This page took 0.04 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.