Stockfish 1.0

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Stockfish 1.0

Post by mcostalba »

royb wrote:We are getting farther each time. Now I see this (after adding #include <stdlib.h> to the beginning of file square.h:

roy@roy-laptop:~/chess/sf_1.0/src$ make
g++ -DNDEBUG -Wall -g -O3 -fno-exceptions -fomit-frame-pointer -fno-rtti -fno-strict-aliasing -c -o pawns.o pawns.cpp
pawns.cpp: In member function ‘void PawnInfoTable::clear()’:
pawns.cpp:165: error: ‘memset’ was not declared in this scope

--cut ---
Here we go: http://clc-wiki.net/wiki/C_standard_lib ... g.h:memset

this time the missing header is

#include <string.h>

Please add it at the beginning of pawns.cpp file.

It is strange because I compile *usually* under Linux without problems, I have Mandriva 2008, anyhow to explicit state the included used (also if the standard ones) it is always a good thing to do.

Please, gimmie the next one :D


Thanks
Marco
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Stockfish 1.0

Post by mcostalba »

Tord Romstad wrote:
Actually, I think the most correct form in C++ is:

Code: Select all

#include <cstdlib>
Tord
Hi Tord,

yes you are right. Thanks for pointing out this.


What do you think about this strange fish ? Had any chance to look at it ?


Marco
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Stockfish 1.0

Post by Tord Romstad »

mcostalba wrote:Hi Tord,

yes you are right. Thanks for pointing out this.


What do you think about this strange fish ? Had any chance to look at it ?
Yes, a little -- please read the whole thread. I posted a few comments earlier in the thread, and pointed out one very serious bug.

Tord
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Stockfish 1.0

Post by mcostalba »

Tord Romstad wrote:Hello Marco,

I am very happy to see this project, and I wish you good luck with it! This is how free software is meant to be used.

I tried to compile and run your program on my Mac, and it crashed after a few seconds. I was quickly able to identify the bug. Even if it does not crash the program on your computer, it will certainly have a negative impact on the performance, so it should definitely be fixed. The bug is in the TranspositionTable::retrieve function:

Code: Select all

/// TranspositionTable&#58;&#58;retrieve looks up the current position in the
/// transposition table. Returns a pointer to the TTEntry or NULL
/// if position is not found.

const TTEntry* TranspositionTable&#58;&#58;retrieve&#40;const Position &pos&#41; const &#123;

  TTEntry *tte = first_entry&#40;pos&#41;;

  for &#40;int i = 0; i < 4; i++)
  &#123;
      tte += i;
      if &#40;tte->key&#40;) == pos.get_key&#40;))
          return tte;
  &#125;
  return NULL;
&#125;
You clearly mean to iterate over the four first transposition table entries beginning with first_entry(pos), but that's not what the above code does: Notice that you add 'i' to 'tte' once in every iteration, which is wrong, and means that you will try to access memory beyond the end of the transposition table in the case that first_entry(pos) happens to point to the last cluster in the table. What you meant to write is probably something like this (untested, but should work):

Code: Select all

const TTEntry* TranspositionTable&#58;&#58;retrieve&#40;const Position &pos&#41; const &#123;

  TTEntry *first = first_entry&#40;pos&#41;, *tte;

  for &#40;int i = 0; i < 4; i++)
  &#123;
      tte = first + i;
      if &#40;tte->key&#40;) == pos.get_key&#40;))
          return tte;
  &#125;
  return NULL;
&#125;
The name "Stockfish" is great!

During my summer holiday this year, I spent a three very interesting days in the stormy and isolated archipelago of Røst in Northern Norway, outside the Lofoten islands. Røst is a very tiny island community, with just about 600 inhabitants (separated from continental Norway by a 4 hour ferry trip, with only one ferry per day), most of whom make their living from stockfish. During the trip, I learnt a lot about the history of the stockfish trade between Norway and Italy. In particular, the story of Pietro Querini, the Venetian merchant and nobleman who stranded on Røst after a storm in the winter of 1432 (while on his way from Crete to Flandern -- it must have been a terrible storm!) is told by everyone in Røst, and even the local pub is named after him. :)

According to the local traditions, the export of stockfish to Italy dates back to the 15th century, and started as a direct result of the contacts established by Querini.

Tord

Wow, that's a SUPER BUG!!! how can be I never saw or impacted that, anyhow perhaps a possible correct code could be.

Code: Select all


const TTEntry* TranspositionTable&#58;&#58;retrieve&#40;const Position &pos&#41; const &#123;

  TTEntry *tte = first_entry&#40;pos&#41;;

  for &#40;int i = 0; i < 4; i++,  tte++)
  &#123;
      if &#40;tte->key&#40;) == pos.get_key&#40;))
          return tte;
  &#125;
  return NULL;
&#125;

Under MAC it _should_ crash also for an optimization in pop_first_bit() when compiled for 32 bit cases and 32BIT_ATTACKS is defined.



Yes, I knew the history of the venetian Querini in Lofoten islands, because I live near Venice, more exactly in a region called Vicenza province, the home town of Querini (the main park of the town is named after him), where there is a town called Sandrigo that is twinned with the Lofoten and is the main importer of stockfish. The local cousine is very famous and the stockfish is the king, is cooked in a special way and only there, you cannot find that recipe in any other place of the world!

There is people that makes long trips, also from abroad, just to go there in one of the very few offically approved restaurant of that town to eat this speciality!


Marco
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: Stockfish 1.0

Post by Ovyron »

Is this a new version that obsoletes glaurung_clone_210908_ja?
User avatar
Le Fou numerique
Posts: 859
Joined: Wed Apr 05, 2006 9:58 pm
Location: Elsass

Stockfish 1.0 : 2573

Post by Le Fou numerique »

Hi,

ImageStockFish 1.0 first rating in a "tournoi d'entrée" for the UEL: 2573. He is not in the Ligue, we allowed only one engine for each original author.

Glaurung 2.1 has a rating of 2668 in the UEL.

PGN on this page.
Complet rating in this thread.

Regards,
Patrick
User avatar
AdminX
Posts: 6340
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: Stockfish 1.0

Post by AdminX »

mcostalba wrote:
AdminX wrote:Hello Marco,

Thanks for your work on Stockfish. I am currently running a test match (30 Games at a 25 minute time control) with it against Bright. Both engines are using Rybka 3 book. The computer is a Q6700. Both engines have a hash of 1024, and are only using two cores with ponder on. Here are the results so far:

+2 =13 +2

So far I would say the results look very good. :wink: By the way I am only using the default settings of the 64-bit version.
Hi Ted,

your test is very valuable.

As a developer the normal time I use is much shorter. It happens that for every patch that goes in there are at least 5-10 that do not show a clear improvment and are discarded. So to have a statistically reasonable number of matches for each patch I, as I think others, end up using a blitz time tournment that runs overnight.

It is rare to have the possibility to test with longer times.


Another novelity for me is the 64bit machine: I have a 32bit and some of the most important improvments are targetted to 32bits, so testing on 64bits is very sensible, at least to define a "bottom level" for Stockfish.

Thanks
Marco
Results:

Stockfish 1.0 JA +7/-6/=17 15.5/30
---------------------------------------
Bright 3.0a +6/-7/=17 14.5/30

You can download the games here.
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers