I think you're right. For a start rep should start at 1, not zero... As for i += 2 i/o 4, I'm not sure. 2 is safer anyway. I'm running a test match now. We'll seeDesperado wrote:But before i leave, what happens if you simply disable your trans-code ?
repetition draw bug
Moderators: hgm, Rebel, chrisw
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: repetition draw bug
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: repetition draw bug
Thanks! I managed tio fix the problem thanks to your suggestions. My new version, if you're curious to see it, is available on WBEC.mar wrote: Perhaps you should look at board_is_draw instead of TT. I would drop ++rep == 3 and change i += 4 to i += 2
-
- Posts: 2559
- Joined: Fri Nov 26, 2010 2:00 pm
- Location: Czech Republic
- Full name: Martin Sedlak
Re: repetition draw bug
I'm glad I could help. Will take a look, thanks.lucasart wrote:Thanks! I managed tio fix the problem thanks to your suggestions. My new version, if you're curious to see it, is available on WBEC.mar wrote: Perhaps you should look at board_is_draw instead of TT. I would drop ++rep == 3 and change i += 4 to i += 2
-
- Posts: 155
- Joined: Mon Feb 15, 2010 9:33 am
- Location: New Zealand
Re: An easy test for repetition draw detection
Good test. I tried it and found a bug in my function IsTripleRepetition(), such that only 1.2% of games ended as repetition draws. A simple off-by-one bug. Hypnotised by the word "triple", I was looking for 3 matches of the current position to historical ones, instead of 2.sje wrote:An easy test for repetition draw detection:
1) In your chess program, add a routine that will play a game with each move selected at random. This routine also reports back the reason (one of five possible) that the game ended.
2) Call the above routine a million times and summarize the results.
3) If the number of games that ended by repetition is about 2.6% of the total, then the repetition detection code is probably working.
Before passing round the cigars and celebrating a huge ELO increase from the bug- fix, I remembered that IsTripleRepetition() isn't actually used in the search. A faster function IsRepetition() suffices, and there was no bug in that. IsTripleRepetition() gets called only in console play. Still, it's good to have found and fixed a bug. Thanks.
Robert P.
-
- Posts: 879
- Joined: Mon Dec 15, 2008 11:45 am
Re: An easy test for repetition draw detection
micron wrote:
...Before passing round the cigars and celebrating a huge ELO increase...
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: An easy test for repetition draw detection
I've tested, and I can assure you that it's time for the cigarsmicron wrote:Good test. I tried it and found a bug in my function IsTripleRepetition(), such that only 1.2% of games ended as repetition draws. A simple off-by-one bug. Hypnotised by the word "triple", I was looking for 3 matches of the current position to historical ones, instead of 2.sje wrote:An easy test for repetition draw detection:
1) In your chess program, add a routine that will play a game with each move selected at random. This routine also reports back the reason (one of five possible) that the game ended.
2) Call the above routine a million times and summarize the results.
3) If the number of games that ended by repetition is about 2.6% of the total, then the repetition detection code is probably working.
Before passing round the cigars and celebrating a huge ELO increase from the bug- fix, I remembered that IsTripleRepetition() isn't actually used in the search. A faster function IsRepetition() suffices, and there was no bug in that. IsTripleRepetition() gets called only in console play. Still, it's good to have found and fixed a bug. Thanks.
Robert P.
as you exaplain quite rightly, the point is that the function called in the search should not search triple repetition but simply repetition...
-
- Posts: 117
- Joined: Wed Jul 20, 2011 2:54 pm
- Location: Ottawa, Canada
Re: An easy test for repetition draw detection
Does it have to be a million games to get good results? Could I get away with 100k games?sje wrote: Count: 1,000,000 Elapsed: 204.051 (4900.75 Hz / 0.000204051 s)
My engine is so slow it would take me 1.48 million seconds or about 17 days to run, compared to your 204 seconds?? (I'm in c#, and a 1.8Ghz single core, but it really shouldn't be creating that much of a difference)
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: An easy test for repetition draw detection
These games are random games and do not use any search. My posted result was from a single thread on a 2.67 GHz Xeon 5150.stevemulligan wrote:Does it have to be a million games to get good results? Could I get away with 100k games?sje wrote: Count: 1,000,000 Elapsed: 204.051 (4900.75 Hz / 0.000204051 s)
My engine is so slow it would take me 1.48 million seconds or about 17 days to run, compared to your 204 seconds?? (I'm in c#, and a 1.8Ghz single core, but it really shouldn't be creating that much of a difference)
-
- Posts: 155
- Joined: Mon Feb 15, 2010 9:33 am
- Location: New Zealand
Re: An easy test for repetition draw detection
You don't need a million. I just tried it, and 100k would be easily enough to show major discrepancy from the expected 2.5% repetition draws.stevemulligan wrote: Does it have to be a million games to get good results? Could I get away with 100k games?
-
- Posts: 117
- Joined: Wed Jul 20, 2011 2:54 pm
- Location: Ottawa, Canada
Re: An easy test for repetition draw detection
Sadly, mine were too. I'll try with 100k, that should only take me a day complete :{sje wrote: These games are random games and do not use any search.
My move generation is terrible. I get slow perft results too. I guess I should try and speed it up. I spend all most of my time checking for check.