Stockfish 1.5 64-bit and 32-bit do not behave the same.

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

Moderators: hgm, Rebel, chrisw

ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by ernest »

I wanted to compare the speed of Jim Ablett's compiles of Stockfish 1.5, stockfish_15_x64_ja.exe (64-bit) and stockfish_15_ja.exe (32-bit).

So I tested them by running infinite analysis on a few positions (of course same hash and only 1 thread for reproducibility).

But I was surprised that, contrary to most programs which have a 32-bit and a 64-bit version (e.g. Rybka: at any depth, you get the same eval, nodes, PV; only time is different), the 2 Stockfish versions behave in a different way.

Any explanation, Tord, Marc, Jim ?

Here are some examples:

Code: Select all

start_position
1 thread   512 MB hash
XP Pro x64    64-bit
New game - Stockfish 1.5 JA 64bit, Blitz:2'+1" home
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Analysis by Stockfish 1.5 JA 64bit:
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 
  =  (0.12)   Depth: 6   00:00:00  3kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 
  +/=  (0.32)   Depth: 7   00:00:00  7kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 Bf5 
  =  (0.12)   Depth: 8   00:00:00  10kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 d5 4.Bd3 d4 5.Nb5 
  +/=  (0.44)   Depth: 9   00:00:00  28kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e6 4.Bd3 Bd6 5.0-0 0-0 
  =  (0.12)   Depth: 10   00:00:00  51kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e6 4.Bb5 Bd6 5.0-0 0-0 6.d4 
  +/=  (0.40)   Depth: 11   00:00:00  128kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e6 4.Bb5 Bb4 5.0-0 0-0 6.d4 d5 
  =  (0.12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be3 Kb8 10.h3 Be6 
  +/=  (0.28)   Depth: 20   00:02:09  175mN

XP Home 32-bit
New game - Stockfish 1.5 JA, Blitz:4'+2" home
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Analysis by Stockfish 1.5 JA:
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 
  =  (0.12)   Depth: 6   00:00:00  3kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 
  +/=  (0.32)   Depth: 7   00:00:00  7kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 Bf5 
  =  (0.12)   Depth: 8   00:00:00  10kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 d5 4.Bd3 d4 5.Nb5 
  +/=  (0.44)   Depth: 9   00:00:00  29kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e5 4.Bd3 Bd6 5.0-0 0-0 
  =  (0.24)   Depth: 10   00:00:00  51kN
1.Nf3 Nf6 2.d4 Nc6 3.e3 e6 4.Bd3 Bb4+ 5.c3 Bd6 6.0-0 0-0 
  +/=  (0.36)   Depth: 11   00:00:00  135kN
1.Nf3 Nf6 2.d4 Nc6 3.e3 e6 4.Bd3 d5 5.Nc3 Bd6 6.0-0 0-0 
  =  (0.12)   Depth: 12   00:00:01  278kN
1.Nf3 Nf6 2.d4 d5 3.e3 e6 4.Bd3 Nc6 5.Nc3 Bd6 6.0-0 0-0 7.Bd2 
  =  (0.16)   Depth: 13   00:00:01  739kN
1.Nf3 Nf6 2.d4 d5 3.e3 e6 4.Bb5+ c6 5.Bd3 Bd6 6.Nc3 0-0 7.0-0 Nbd7 8.Bd2 
  =  (0.20)   Depth: 14   00:00:02  1525kN
1.e4 Nf6 2.e5 Nd5 3.Nf3 d6 4.d4 Bf5 5.Bc4 Nb4 6.Na3 N8c6 7.c3 d5 
  +/=  (0.36)   Depth: 14   00:00:03  3536kN
1.e4 e5 2.Nf3 Nc6 3.Bb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00:00:04  5185kN
1.Qh4 Rde8 2.Qh3 Qe7 3.Qg2 Ng5 4.b4 Nxf3 5.Qxf3 Ne5 6.Qe2 b6 7.Kg1 a6 8.bxc5 Qxc5 
  =  (-0.08)   Depth: 15   00:00:08  8884kN
1.Qh4 Rde8 2.Qh3 Qe7 3.Qg2 Ng5 4.Nh4 Ne5 5.Ne2 Ne6 6.b4 b6 7.Nf3 Nxf3 8.Rxf3 Ng5 9.Bxg5 fxg5 10.bxc5 Qxc5 
  =  (-0.12)   Depth: 16   00:00:20  21814kN
1.Qh4 Rde8 2.Qh3 Qe7 3.Qg2 Ng5 4.Nh4 Ne5 5.Ne2 Ne6 6.b4 b6 7.Nf3 Rd8 8.Nf4 Nxf4 9.Bxf4 c4 
  =  (-0.12)   Depth: 17   00:00:51  54824kN
1.Nf5 gxf5 2.gxf5 Qf7 3.fxe6 
  =  (0.08 !)   Depth: 17   00:01:09  74627kN
1.Nf5 gxf5 2.gxf5 Nc7 3.Rg1 Rf7 4.Rg2 Rh8 5.Rbg1 Kg8 6.Bf4 Kf8 7.Qh5 Kg8 8.Bxh6 Ne8 9.Rg6 Nd6 10.b4 b6 
  +/=  (0.56)   Depth: 18   00:01:21  87290kN
1.Nf5 gxf5 2.gxf5 Nc7 3.Rg1 Rf7 4.Rg2 Rh8 5.Rbg1 Kg8 6.Qh5 Kf8 7.Nh4 Rh7 8.b4 Ke7 9.Qg6 Bf8 10.bxc5 
  +/=  (0.60)   Depth: 19   00:01:43  112mN
in the following exemple, the divergence is very small (only at depth 20and after).

Code: Select all

2rr2k1/pp2b1pp/1nb1p3/5p2/1P1B4/P2BPP2/3NK1PP/R6R b - - bm e5; id "WM_Test_Express_03"; New game
x64  64-bit
New game
2rr2k1/pp2b1pp/1nb1p3/5p2/1P1B4/P2BPP2/3NK1PP/R6R b - - 0 1
Analysis by Stockfish 1.5 JA 64bit:
1...Nd5 2.g3 Bf6 3.Bxf6 Nxf6 4.Rhc1 Kf7 
  =/+  (-0.44)   Depth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rd6 11.Bxh7+ Kf8 
  =  (-0.16)   Depth: 19   00:02:50  200mN
1...e5 2.Kf2 exd4 
  =/+  (-0.48 !)   Depth: 19   00:03:08  223mN
1...e5 2.Bc5 Na4 3.Rhc1 Rxd3 4.Bxe7 Rd7 5.Bh4 Nb2 6.a4 b5 7.a5 Nd3 8.Rcb1 Bd5 9.g4 fxg4 10.fxg4 e4 11.Bg3 
  -/+  (-0.96)   Depth: 20   00:06:23  473mN
1...e5 2.Bc5 Na4 3.Rhc1 Rxd3 4.Bxe7 Rd7 5.Bh4 Nb2 6.a4 b5 7.a5 Nd3 8.Rcb1 Bd5 9.g4 fxg4 10.fxg4 e4 11.Bg3 a6 
  -/+  (-1.01)   Depth: 21   00:08:43  649mN
Last edited by ernest on Tue Oct 06, 2009 8:16 pm, edited 2 times in total.
Dann Corbit
Posts: 12534
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by Dann Corbit »

There are some progams that play identical in 32 and 64 bit mode (e.g. Smarthink).

It is possible for there to be sensible reasons for small differences.
For instance, because pointers are different sizes, the memory allocations of identical code can be different.

It is also possible that it is a compiler bug. I have seen posts that seem to imply Stockfish plays strangely with some positions.

I guess it will be resolved one way or the other pretty soon
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by mcostalba »

ernest wrote:I wanted to compare the speed of Jim Ablett's compiles of Stockfish 1.5, stockfish_15_x64_ja.exe (64-bit) and stockfish_15_ja.exe (32-bit).

So I tested them by running infinite analysis on a few positions (of course same hash and only 1 thread for reproducibility).

But I was surprised that, contrary to most programs which have a 32-bit and a 64-bit version (e.g. Rybka: at any depth, you get the same eval, nodes, PV; only time is different), the 2 Stockfish versions behave in a different way.

Any explanation, Tord, Marc, Jim ?
How many threads you used ?

IOW is your PC a dual core (or quad) and you tested without before setting threads to 1 ?

Results using more then one thread are not reproducible even with the same engine because different timings (CPU / OS dependent) make every search a bit different from the others.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by bob »

ernest wrote:I wanted to compare the speed of Jim Ablett's compiles of Stockfish 1.5, stockfish_15_x64_ja.exe (64-bit) and stockfish_15_ja.exe (32-bit).

So I tested them by running infinite analysis on a few positions (of course same hash and only 1 thread for reproducibility).

But I was surprised that, contrary to most programs which have a 32-bit and a 64-bit version (e.g. Rybka: at any depth, you get the same eval, nodes, PV; only time is different), the 2 Stockfish versions behave in a different way.

Any explanation, Tord, Marc, Jim ?

Here are some examples:

Code: Select all

start_position
1 thread   512 MB hash
XP Pro x64    64-bit
New game - Stockfish 1.5 JA 64bit, Blitz:2'+1" home
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Analysis by Stockfish 1.5 JA 64bit:
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 
  =  (0.12)   Depth: 6   00:00:00  3kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 
  +/=  (0.32)   Depth: 7   00:00:00  7kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 Bf5 
  =  (0.12)   Depth: 8   00:00:00  10kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 d5 4.Bd3 d4 5.Nb5 
  +/=  (0.44)   Depth: 9   00:00:00  28kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e6 4.Bd3 Bd6 5.0-0 0-0 
  =  (0.12)   Depth: 10   00:00:00  51kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e6 4.Bb5 Bd6 5.0-0 0-0 6.d4 
  +/=  (0.40)   Depth: 11   00:00:00  128kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e6 4.Bb5 Bb4 5.0-0 0-0 6.d4 d5 
  =  (0.12)   Depth: 12   00:00:00  246kN
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+/=  (0.28)   Depth: 20   00:02:09  175mN

XP Home 32-bit
New game - Stockfish 1.5 JA, Blitz:4'+2" home
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Analysis by Stockfish 1.5 JA:
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 
  =  (0.12)   Depth: 6   00:00:00  3kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 
  +/=  (0.32)   Depth: 7   00:00:00  7kN
1.Nf3 Nf6 2.Nc3 Nc6 3.d4 d5 4.Bf4 Bf5 
  =  (0.12)   Depth: 8   00:00:00  10kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 d5 4.Bd3 d4 5.Nb5 
  +/=  (0.44)   Depth: 9   00:00:00  29kN
1.Nf3 Nf6 2.Nc3 Nc6 3.e3 e5 4.Bd3 Bd6 5.0-0 0-0 
  =  (0.24)   Depth: 10   00:00:00  51kN
1.Nf3 Nf6 2.d4 Nc6 3.e3 e6 4.Bd3 Bb4+ 5.c3 Bd6 6.0-0 0-0 
  +/=  (0.36)   Depth: 11   00:00:00  135kN
1.Nf3 Nf6 2.d4 Nc6 3.e3 e6 4.Bd3 d5 5.Nc3 Bd6 6.0-0 0-0 
  =  (0.12)   Depth: 12   00:00:01  278kN
1.Nf3 Nf6 2.d4 d5 3.e3 e6 4.Bd3 Nc6 5.Nc3 Bd6 6.0-0 0-0 7.Bd2 
  =  (0.16)   Depth: 13   00:00:01  739kN
1.Nf3 Nf6 2.d4 d5 3.e3 e6 4.Bb5+ c6 5.Bd3 Bd6 6.Nc3 0-0 7.0-0 Nbd7 8.Bd2 
  =  (0.20)   Depth: 14   00:00:02  1525kN
1.e4 Nf6 2.e5 Nd5 3.Nf3 d6 4.d4 Bf5 5.Bc4 Nb4 6.Na3 N8c6 7.c3 d5 
  +/=  (0.36)   Depth: 14   00:00:03  3536kN
1.e4 e5 2.Nf3 Nc6 3.Bb5 Nf6 4.0-0 Bc5 5.d3 Qe7 6.c3 0-0 7.b4 Bb6 8.Na3 
  +/=  (0.40)   Depth: 15   00:00:07  7967kN
1.e4 e5 2.Nf3 Nf6 3.Nxe5 d6 4.Nf3 Nxe4 5.Bd3 Nc5 6.Be2 Nc6 7.d4 Ne4 8.0-0 Be6 
  +/=  (0.56)   Depth: 16   00:00:13  13827kN
1.e4 e6 2.Nf3 d5 3.e5 c5 4.Nc3 Bd7 5.Be2 Nc6 6.0-0 Qb8 7.d4 cxd4 8.Nxd4 Qxe5 9.Be3 
  +/=  (0.44)   Depth: 17   00:00:29  32142kN
1.e4 e6 2.Nf3 d5 3.e5 c5 4.Nc3 Bd7 5.Bb5 a6 6.Bxd7+ Kxd7 7.0-0 Nc6 8.d3 Be7 9.Qe2 Nh6 10.Bxh6 gxh6 
  +/=  (0.40)   Depth: 18   00:00:48  52836kN
1.e4 e6 2.Nf3 d5 3.e5 Nh6 4.d4 c5 5.Bd3 cxd4 6.0-0 Nc6 7.Bb5 Nf5 8.g4 Nh6 9.Nxd4 Bd7 10.Nxc6 Bxc6 11.Bxc6+ bxc6 
  +/=  (0.36)   Depth: 19   00:01:34  104mN
1.e4 e6 2.Nf3 d5 3.e5 Nh6 4.d4 c5 5.Bd3 cxd4 6.0-0 Nc6 7.Bb5 Nf5 8.g4 Nh4 9.Nxd4 Bd7 10.Nxc6 bxc6 11.Bd3 
  +/=  (0.32)   Depth: 20   00:03:05  202mN
1.e4 e6 2.Nf3 d5 3.exd5 exd5 4.d4 Nf6 5.Bd3 Bd6 6.0-0 0-0 7.Nc3 Nc6 8.Bg5 Nb4 9.Ne5 c5 10.Nb5 cxd4 11.Nxd6 Qxd6 
  +/=  (0.32)   Depth: 21   00:07:25  479mN

Code: Select all

3r1r2/pp1q2bk/2n1nppp/2p5/3pP1P1/P2P1NNQ/1PPB3P/1R3R1K w - - bm Nf5; id "WM_Test_Express_02"; 
x64  64-bit
New game, Blitz:2'+1" home
3r1r2/pp1q2bk/2n1nppp/2p5/3pP1P1/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rde8 2.Qh3 Qe7 3.Qg2 Ng5 4.b4 Nxf3 5.Qxf3 Ne5 6.Qe2 b6 7.Kg1 a6 8.bxc5 Qxc5 
  =  (-0.08)   Depth: 15   00:00:08  8884kN
1.Qh4 Rde8 2.Qh3 Qe7 3.Qg2 Ng5 4.Nh4 Ne5 5.Ne2 Ne6 6.b4 b6 7.Nf3 Nxf3 8.Rxf3 Ng5 9.Bxg5 fxg5 10.bxc5 Qxc5 
  =  (-0.12)   Depth: 16   00:00:20  21814kN
1.Qh4 Rde8 2.Qh3 Qe7 3.Qg2 Ng5 4.Nh4 Ne5 5.Ne2 Ne6 6.b4 b6 7.Nf3 Rd8 8.Nf4 Nxf4 9.Bxf4 c4 
  =  (-0.12)   Depth: 17   00:00:51  54824kN
1.Nf5 gxf5 2.gxf5 Qf7 3.fxe6 
  =  (0.08 !)   Depth: 17   00:01:09  74627kN
1.Nf5 gxf5 2.gxf5 Nc7 3.Rg1 Rf7 4.Rg2 Rh8 5.Rbg1 Kg8 6.Bf4 Kf8 7.Qh5 Kg8 8.Bxh6 Ne8 9.Rg6 Nd6 10.b4 b6 
  +/=  (0.56)   Depth: 18   00:01:21  87290kN
1.Nf5 gxf5 2.gxf5 Nc7 3.Rg1 Rf7 4.Rg2 Rh8 5.Rbg1 Kg8 6.Qh5 Kf8 7.Nh4 Rh7 8.b4 Ke7 9.Qg6 Bf8 10.bxc5 
  +/=  (0.60)   Depth: 19   00:01:43  112mN
in the following exemple, the divergence is very small (only at depth 20and after).

Code: Select all

2rr2k1/pp2b1pp/1nb1p3/5p2/1P1B4/P2BPP2/3NK1PP/R6R b - - bm e5; id "WM_Test_Express_03"; New game
x64  64-bit
New game
2rr2k1/pp2b1pp/1nb1p3/5p2/1P1B4/P2BPP2/3NK1PP/R6R b - - 0 1
Analysis by Stockfish 1.5 JA 64bit:
1...Nd5 2.g3 Bf6 3.Bxf6 Nxf6 4.Rhc1 Kf7 
  =/+  (-0.44)   Depth: 6   00:00:00  19kN
1...Nd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  =  (-0.16)   Depth: 19   00:02:50  200mN
1...e5 2.Kf2 exd4 
  =/+  (-0.48 !)   Depth: 19   00:03:08  223mN
1...e5 2.Bc5 Na4 3.Rhc1 Rxd3 4.Bxe7 Rd7 5.Bh4 Nb2 6.a4 b5 7.a5 Nd3 8.Rcb1 Bd5 9.g4 fxg4 10.fxg4 e4 11.Bg3 
  -/+  (-0.96)   Depth: 20   00:06:23  473mN
1...e5 2.Bc5 Na4 3.Rhc1 Rxd3 4.Bxe7 Rd7 5.Bh4 Nb2 6.a4 b5 7.a5 Nd3 8.Rcb1 Bd5 9.g4 fxg4 10.fxg4 e4 11.Bg3 a6 
  -/+  (-1.01)   Depth: 21   00:08:43  649mN
That will probably help them. It really is a bug, plain and simple.
tano-urayoan
Posts: 638
Joined: Thu Aug 30, 2007 8:23 pm
Location: San Juan, Puerto Rico

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by tano-urayoan »

mcostalba wrote:
ernest wrote:I wanted to compare the speed of Jim Ablett's compiles of Stockfish 1.5, stockfish_15_x64_ja.exe (64-bit) and stockfish_15_ja.exe (32-bit).

So I tested them by running infinite analysis on a few positions (of course same hash and only 1 thread for reproducibility).

But I was surprised that, contrary to most programs which have a 32-bit and a 64-bit version (e.g. Rybka: at any depth, you get the same eval, nodes, PV; only time is different), the 2 Stockfish versions behave in a different way.

Any explanation, Tord, Marc, Jim ?
How many threads you used ?

IOW is your PC a dual core (or quad) and you tested without before setting threads to 1 ?

Results using more then one thread are not reproducible even with the same engine because different timings (CPU / OS dependent) make every search a bit different from the others.
Ernest used 1 thread in a core 2 duo with same hash. You should read more carefully.
Damir
Posts: 2800
Joined: Mon Feb 11, 2008 3:53 pm
Location: Denmark
Full name: Damir Desevac

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by Damir »

and u should show some more respect to the Stockfish author, instead of behaving like an ass.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by Tord Romstad »

bob wrote:That will probably help them. It really is a bug, plain and simple.
Quite possibly. If it is, it is probably a very minor and insignificant bug, but even very minor bugs need to be fixed. It's certainly worth looking at -- thanks for bringing it to our attention, Ernest!

It's not immediately clear whether it is a bug, though. Stockfish relies on C++ library functions for things like move sorting, and these functions could conceivably differ between 32 bit and 64 bit versions of the libraries. For this reason, it might be better to avoid using library functions for sorting. Actually I seem to recall that we originally used our own sorting functions; I don't remember when or why we switched to the library versions.
Dann Corbit
Posts: 12534
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by Dann Corbit »

Tord Romstad wrote:
bob wrote:That will probably help them. It really is a bug, plain and simple.
Quite possibly. If it is, it is probably a very minor and insignificant bug, but even very minor bugs need to be fixed. It's certainly worth looking at -- thanks for bringing it to our attention, Ernest!

It's not immediately clear whether it is a bug, though. Stockfish relies on C++ library functions for things like move sorting, and these functions could conceivably differ between 32 bit and 64 bit versions of the libraries. For this reason, it might be better to avoid using library functions for sorting. Actually I seem to recall that we originally used our own sorting functions; I don't remember when or why we switched to the library versions.
It is not unusual for qsort() to be randomized in selection of the median. For this reason, if you use the library qsort, it is possible to get different answers even for the 32 bit version (for some implementations).

However, if all sorted items have values that differ, then the results should be identical.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by mcostalba »

Tord Romstad wrote:
bob wrote:That will probably help them. It really is a bug, plain and simple.
Quite possibly. If it is, it is probably a very minor and insignificant bug, but even very minor bugs need to be fixed. It's certainly worth looking at -- thanks for bringing it to our attention, Ernest!

It's not immediately clear whether it is a bug, though. Stockfish relies on C++ library functions for things like move sorting, and these functions could conceivably differ between 32 bit and 64 bit versions of the libraries. For this reason, it might be better to avoid using library functions for sorting. Actually I seem to recall that we originally used our own sorting functions; I don't remember when or why we switched to the library versions.
Well in Glaurung, if I remember correctly, the move list is scanned and the highest score is picked each time we need a move until, if I remember correctly, up to the 12-th.

I changed to std::sort() of all the moves before picking because it proved stronger and code is cleaner.

It is correct that std::sort() is not stable (to have maximum speed), but if we need a stable sort there is std::stable_sort() :-)

We could replace sort() with stable_sort() everywhere and see if that's the problem. If it is we can happily come back to the faster std::sort() because it means the bug is actually not a bug. Unfortunatly I don't have a 64 bit system to test.

Function std::stable_sort() gives the same results for _any_ library because specification does not leave anything undocumented.

Intead std::sort() can be application specific. In our case I don't think the problem is 32 / 64 bit but perhaps that Jim uses MSVC on 32 bit and Intel compiler on 64 bit (if I remember correctly, but I can be wrong).

Tomorrow I can test with std::stable_sort() on Windows with MSVC and on Linux with gcc and see if node count is the same with std::stable_sort() while differs with std::sort()
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Stockfish 1.5 64-bit and 32-bit do not behave the same.

Post by michiguel »

mcostalba wrote:
Tord Romstad wrote:
bob wrote:That will probably help them. It really is a bug, plain and simple.
Quite possibly. If it is, it is probably a very minor and insignificant bug, but even very minor bugs need to be fixed. It's certainly worth looking at -- thanks for bringing it to our attention, Ernest!

It's not immediately clear whether it is a bug, though. Stockfish relies on C++ library functions for things like move sorting, and these functions could conceivably differ between 32 bit and 64 bit versions of the libraries. For this reason, it might be better to avoid using library functions for sorting. Actually I seem to recall that we originally used our own sorting functions; I don't remember when or why we switched to the library versions.
Well in Glaurung, if I remember correctly, the move list is scanned and the highest score is picked each time we need a move until, if I remember correctly, up to the 12-th.

I changed to std::sort() of all the moves before picking because it proved stronger and code is cleaner.

It is correct that std::sort() is not stable (to have maximum speed), but if we need a stable sort there is std::stable_sort() :-)

We could replace sort() with stable_sort() everywhere and see if that's the problem. If it is we can happily come back to the faster std::sort() because it means the bug is actually not a bug. Unfortunatly I don't have a 64 bit system to test.
IMHO, that is not a good idea at all (allowing different systems to have diiferent node counts). Differences in node counts are very good symptoms of bugs. If you are happy with different counts because you conclude it is caused by different ordering of equal moves, you may be hiding future bugs. Whenver you have different node counts, you will never know whether it is ok or not.

Using different compilers and running in different systems may sometimes catch bugs. If you ignore this difference, you have one less tool to detect them.

Function std::stable_sort() gives the same results for _any_ library because specification does not leave anything undocumented.

Intead std::sort() can be application specific. In our case I don't think the problem is 32 / 64 bit but perhaps that Jim uses MSVC on 32 bit and Intel compiler on 64 bit (if I remember correctly, but I can be wrong).

Tomorrow I can test with std::stable_sort() on Windows with MSVC and on Linux with gcc and see if node count is the same with std::stable_sort() while differs with std::sort()
Why not the simplest selection sort all the way? Is there any real speed difference?.

This may be a compiler bug. I posted a similar situation some time ago using two different compilers (two different optimization switches, actually). The only safe way to figure this out is to dump the trees and compare them. Compiling and testing it with different optimization switches should be done too (or no optimization at all). That will give you a good hint.

IMO, a program should have the same output when it faces the same input, in conditions in which it is supposed to be deterministic. I am a bit paranoid with this. To ensure stability of the move ordering, I made sure that no move can have any chance to be equal to anyone else.

Miguel