Stockfish 3 PA_GTB

Discussion about chess-playing software (engines, hosts, opening books, platforms, etc...)
BorgKing
Posts: 19
Joined: Mon May 20, 2013 9:47 am

Re: Stockfish 3 PA_GTB

Post by BorgKing » Mon Aug 05, 2013 9:10 pm

Is there anyone else here experiencing sudden but only occasional "unexpected shutdowns" when playing engine matches in Arena?

It has happened to me three times by now, and Stockfish 3 GTB 006 (or the testversion 006-16) has been one of the contestant on all three occasions.

And also, which may be related, on at least a couple of times Windows 7 has had to correct errors on the C drive when starting up, after having had this SF version playing very long games (3-4 hours for every 30 moves approximately) for 1-2 days in a row. Is this happening to anyone else?

Ace1
Posts: 12
Joined: Thu Dec 20, 2012 4:40 am
Real Name: AceAce

Re: Stockfish 3 PA_GTB

Post by Ace1 » Thu Aug 08, 2013 7:46 am

Jeremy Bernstein wrote:
endings wrote:Hello Jeremy,

Do you think you can bring us to the tip of the master?
Thanks
Next week, sure. Jb
:?:

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Stockfish 3 PA_GTB

Post by Jeremy Bernstein » Thu Aug 08, 2013 12:23 pm

Sorry, it's been a very busy couple of weeks. I'll try to deal with this by the end of the weekend. Thanks for your patience.

jb

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Stockfish 3 PA_GTB

Post by Jeremy Bernstein » Mon Aug 12, 2013 9:01 pm

Once again, I apologize for the delay -- it has been a really PITA few weeks. But hey, v007 is out!

- updated to the tip of the upstream master
- new for v007, largely untested! :-)

Enjoy!
Jeremy

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: Stockfish 3 PA_GTB

Post by User923005 » Tue Aug 13, 2013 12:01 am

Thank you for doing this.
It is very useful for me.

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: Stockfish 3 PA_GTB

Post by User923005 » Tue Aug 13, 2013 2:00 am

This version never stores the hash value for me.

In the debugger, I always hit only the empty version of to_phash that looks like this:
void to_phash() {}
from this template:

Code: Select all

template<class T>
class TranspositionTable {

  static const unsigned ClusterSize = 4; // A cluster is 64 Bytes

public:
 ~TranspositionTable() { free(mem); }
  void new_search() { generation++; }

  const T* probe(const Key key) const;
  T* first_entry(const Key key) const;
  void refresh(const T* tte) const;
  void set_size(size_t mbSize);
  void clear();
  void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV, Value kingD);
  void store(const Key key, Value v, Bound type, Depth d, Move m, Value statV, Value kingD, bool interested);
  void from_phash() {}
  void to_phash() {}

private:
  uint32_t hashMask;
  T* table;
  void* mem;
  uint8_t generation; // Size must be not bigger than TTEntry::generation8
};
IOW, I never go into the code:

Code: Select all

template<>
void TranspositionTable<PHEntry>::to_phash() {

#ifdef PHASH_DEBUG
  struct timeval tv1, tv2;
  unsigned entries = 0;
  unsigned count = 0;
  unsigned rootcount = 0;

  gettimeofday(&tv1, NULL);
#endif
  int minDepth = Options["Persistent Hash Depth"] * ONE_PLY;

  PHInst.starttransaction_phash(PHASH_MODE_WRITE);
  for (unsigned i = 0; i < (hashMask + ClusterSize); i++) {
    PHEntry *phe = table + i;
    Key key;
    if ((key = phe->fullkey())) {
      const TTEntry *tte = TT.probe(key);
      if ( tte &&
          (tte->bound() == BOUND_EXACT) &&
          (DEPTH_IS_VALID(tte->depth(), minDepth)))
      {
        if (PHInst.store_phash(key, tte->value(), phe->fulltype(), tte->depth(), tte->move(), tte->eval_value(), tte->eval_margin())) {
#ifdef PHASH_DEBUG
          if (phe->fulltype() & BOUND_ROOT) rootcount++;
          count++;
#endif
        }
      }
    }
#ifdef PHASH_DEBUG
    entries++;
#endif
  }
  PHInst.endtransaction_phash();
  clear(); // clear the hash each time
#ifdef PHASH_DEBUG
  if (count) {
    gettimeofday(&tv2, NULL);
    sync_cout << "\nTranspositionTable<PHEntry>::to_phash stored "
              << count << " entries (" << rootcount << " root, " << entries << " total) in "
              << ((tv2.tv_sec * 1000.) + (tv2.tv_usec / 1000.) - (tv1.tv_sec * 1000.) + (tv1.tv_usec / 1000.))
              << " milliseconds.\n" << sync_endl;
  }
#endif
}
so the data never gets saved to the hash.

User923005
Posts: 616
Joined: Thu May 19, 2011 1:35 am

Re: Stockfish 3 PA_GTB

Post by User923005 » Tue Aug 13, 2013 2:10 am

I noticed this at the end of the {older} include file, and put it back :

// These declarations are mandatory, or the compiler will optimize the specialization out!
template<>
void TranspositionTable<PHEntry>::from_phash();
template<>
void TranspositionTable<PHEntry>::to_phash();

Now the code is working again.

endings
Posts: 9
Joined: Wed May 22, 2013 12:07 am
Real Name: Robert

Re: Stockfish 3 PA_GTB

Post by endings » Tue Aug 13, 2013 3:35 am

thanks for bringing SF to the tip. I know you were busy and I appreciate what you are doing. Thanks again Bob

Ace1
Posts: 12
Joined: Thu Dec 20, 2012 4:40 am
Real Name: AceAce

Re: Stockfish 3 PA_GTB

Post by Ace1 » Tue Aug 13, 2013 3:52 am

endings wrote:thanks for bringing SF to the tip. I know you were busy and I appreciate what you are doing.
+1 :D

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Stockfish 3 PA_GTB

Post by Jeremy Bernstein » Tue Aug 13, 2013 7:23 am

As Dann noticed, I accidentally neutered the Persistent Hash during the merge. v008 will be forthcoming.

jb

Post Reply