ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

repetition draw bug
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Lucas Braesch



Joined: 31 May 2010
Posts: 2900

PostPost subject: repetition draw bug    Posted: Wed Aug 17, 2011 6:12 pm Reply to topic Reply with quote

My engine seems to accept a lot of repetition draws, when it clearly shouldn't. Obviously the problem comes from the transposition table. But I've looked at it again and again, and I can't figure out what I'm doing wrong.. Here's what I do

in the search
Code:

   // TTable lookup
   U64 key = get_key(B);
   const TTEntry *tte = tt_find(key);
   move_t tt_move;
   if (tte) {
      si->best = tt_move = tte->depth > 0 ? tte->move : NoMove;
      current_eval = tte->eval;
      if (ply > 0 && can_return_tt(is_pv, tte, depth, beta, ply))
         return adjust_tt_score(tte->score, ply);
   }


in the qsearch
Code:

   // TTable lookup
   U64 key = get_key(B);
   const TTEntry *tte = tt_find(key);
   move_t tt_move;
   int current_eval;
   if (tte) {
      si->best = tt_move = tte->move;
      current_eval = tte->eval;
      if (can_return_tt(is_pv, tte, depth, beta, ply))
         return adjust_tt_score(tte->score, ply);
   }


and the function can_return_tt
Code:

static inline bool can_return_tt(bool is_pv, const TTEntry *tte, int depth, int beta, int ply)
{
   if (is_pv)
      return tte->depth >= depth && tte->type == ScoreExact;
   else {
      const int tt_score = adjust_tt_score(tte->score, ply);
      return (tte->depth >= depth
              ||   tt_score >= max(mate_in(MAX_PLY), beta)
              ||   tt_score < min(mated_in(MAX_PLY), beta))
             &&   ((tte->type == ScoreLbound && tt_score >= beta)
                  ||(tte->type == ScoreUbound && tt_score < beta));
   }
}

so I use the TT for pruning even at PV nodes, but not at the root (which should avoid most of the problems?)

Any suggestions are welcome!

PS: Of course I check for repetition draws (search and qsearch) *before* the TTable blocks shown above
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Subject Author Date/Time
repetition draw bug Lucas Braesch Wed Aug 17, 2011 6:12 pm
      Re: repetition draw bug Michael Hoffmann Wed Aug 17, 2011 9:36 pm
            Re: repetition draw bug Lucas Braesch Wed Aug 17, 2011 10:22 pm
                  Re: repetition draw bug Michael Hoffmann Wed Aug 17, 2011 10:34 pm
                        Re: repetition draw bug Michael Hoffmann Wed Aug 17, 2011 10:48 pm
                              Re: repetition draw bug Lucas Braesch Thu Aug 18, 2011 5:14 pm
                              Re: repetition draw bug Lucas Braesch Thu Aug 18, 2011 5:26 pm
      Re: repetition draw bug Martin Sedlak Wed Aug 17, 2011 10:39 pm
            Re: repetition draw bug Lucas Braesch Thu Aug 18, 2011 5:12 pm
            Re: repetition draw bug Lucas Braesch Thu Aug 18, 2011 8:43 pm
                  Re: repetition draw bug Martin Sedlak Thu Aug 18, 2011 9:24 pm
      Re: repetition draw bug Robert Hyatt Thu Aug 18, 2011 2:42 am
      An easy test for repetition draw detection Steven Edwards Thu Aug 18, 2011 3:17 am
            Re: An easy test for repetition draw detection Robert Purves Sat Aug 20, 2011 6:38 am
                  Re: An easy test for repetition draw detection Michael Hoffmann Sat Aug 20, 2011 6:43 am
                  Re: An easy test for repetition draw detection Lucas Braesch Sat Aug 20, 2011 11:12 am
            Re: An easy test for repetition draw detection Steve Mulligan Tue Aug 23, 2011 12:52 pm
                  Re: An easy test for repetition draw detection Steven Edwards Tue Aug 23, 2011 10:09 pm
                        Re: An easy test for repetition draw detection Steve Mulligan Tue Aug 23, 2011 11:36 pm
                              Re: An easy test for repetition draw detection Sven Schüle Wed Aug 24, 2011 8:27 am
                                    Re: An easy test for repetition draw detection H.G.Muller Wed Aug 24, 2011 9:24 am
                  Re: An easy test for repetition draw detection Robert Purves Tue Aug 23, 2011 10:51 pm
            Re: An easy test for repetition draw detection Steven Edwards Wed Aug 24, 2011 12:50 pm
                  Re: An easy test for repetition draw detection Steve Mulligan Fri Sep 16, 2011 10:45 am
                        The rg and rgstat commands Steven Edwards Fri Sep 16, 2011 11:40 am
                              Re: The rg and rgstat commands Steve Mulligan Fri Sep 16, 2011 1:30 pm
                                    Re: The rg and rgstat commands Steven Edwards Fri Sep 16, 2011 1:40 pm
                                          Re: The rg and rgstat commands Steve Mulligan Fri Sep 16, 2011 3:31 pm
            Some minor ambiguities concerning game termination Steven Edwards Fri Sep 16, 2011 11:56 am
                  Re: Some minor ambiguities concerning game termination Volker Annuss Fri Sep 16, 2011 3:37 pm
                        Re: Some minor ambiguities concerning game termination H.G.Muller Fri Sep 16, 2011 4:51 pm
                  Re: Some minor ambiguities concerning game termination Steve Mulligan Fri Sep 23, 2011 12:25 pm
                        Re: Some minor ambiguities concerning game termination Steven Edwards Fri Sep 23, 2011 12:59 pm
                              Re: Some minor ambiguities concerning game termination Steve Mulligan Sat Sep 24, 2011 12:19 am
                              Re: Some minor ambiguities concerning game termination Steve Mulligan Sat Sep 24, 2011 1:34 pm
                                    Re: Some minor ambiguities concerning game termination Steven Edwards Sat Sep 24, 2011 6:17 pm
                                          Re: Some minor ambiguities concerning game termination Steve Mulligan Wed Oct 05, 2011 8:18 pm
                                                Re: Some minor ambiguities concerning game termination Steven Edwards Thu Oct 06, 2011 1:52 am
                                                      Re: Some minor ambiguities concerning game termination Steven Edwards Thu Oct 06, 2011 1:54 am
                                                      Re: Some minor ambiguities concerning game termination Steve Mulligan Thu Oct 06, 2011 2:33 pm
                                                            Re: Some minor ambiguities concerning game termination Steven Edwards Thu Oct 06, 2011 3:50 pm
                                                                  Re: Some minor ambiguities concerning game termination Steve Mulligan Thu Oct 06, 2011 4:19 pm
                                                                        Re: Some minor ambiguities concerning game termination Steven Edwards Thu Oct 06, 2011 4:37 pm
                                                                        Some files with random PGN games Steven Edwards Thu Oct 06, 2011 6:23 pm
                                                                              Re: Some files with random PGN games Steve Mulligan Fri Oct 07, 2011 4:57 am
                                                                              Re: Some files with random PGN games Steve Mulligan Sat Oct 08, 2011 11:16 am
                                                                                    Re: Some files with random PGN games Steven Edwards Sat Oct 08, 2011 12:59 pm
                                                                                          Re: Some files with random PGN games Steven Edwards Sat Oct 08, 2011 1:17 pm
                                                                                          Re: Some files with random PGN games Steve Mulligan Sat Oct 08, 2011 5:32 pm
                                                                                          Re: Some files with random PGN games Steven Edwards Sun Oct 09, 2011 10:30 am
                                                                                          Re: Some files with random PGN games Steve Mulligan Mon Oct 10, 2011 11:25 pm
                                                                                          Re: Some files with random PGN games Steven Edwards Fri Oct 28, 2011 5:34 pm
                                                                                    Re: Some files with random PGN games Steven Edwards Sat Oct 08, 2011 1:06 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads