n/s speed of search through Wb2Uci - need some clarification

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Martin Thoresen
Posts: 1833
Joined: Thu Jun 22, 2006 12:07 am

n/s speed of search through Wb2Uci - need some clarification

Post by Martin Thoresen »

Hello,

I was analyzing a position earlier with a couple of UCI engines. Then I though I'd install a couple of Winboard engines that I like, namely Crafty 23.1 and Scorpio 2.4 (both run through Wb2Uci).

However, after some minutes into the search, the n/s started to drop significantly.

First Crafty, as you can see it starts at about 18kn/s at depth 15.
Then at the last line it gives on depth 20 it's at 19kn/s+ until it drops significantly at depth 21, with 11kn/s. Then it's down to just above 7kn/s at depth 23 at around 5 minutes.

Same phenomena with Scorpio. At about depth 22 it drops significantly and at 5 minutes it's reduced the speed by over 50%.

Does the hash table fill up and doesn't get written to any more or what is happening? Both hash-sizes are verified in the task manager as correct together with 100% cpu utilization.

Any explanation/solution for this?

Code: Select all

8/p1p5/Pp1p2nk/1P1Bq1r1/2P1Pprp/1Q6/5RPP/3R3K b - - 

Engine: Crafty 23.1 JA 64-bit 4CPU (1024 MB) 
by Robert Hyatt


15.00  0:01   +0.15    1...Qe8 2.c5 bxc5 3.Be6 c4 4.Qxc4 Rc5 
                       5.Qa2 Rgg5 6.Bf5 Rxb5 7.Bxg6 Rxg6 
                       8.Rxf4 Qe7 (33.851.273) 18199 

15.00  0:02   +0.15    1...Qe8 2.c5 bxc5 3.Be6 c4 4.Qxc4 Rc5 
                       5.Qa2 Rgg5 6.Bf5 Rxb5 7.Bxg6 Rxg6 
                       8.Rxf4 Qe7 (41.404.224) 18401 

16.00  0:02   +0.46    1...Qe8 2.c5 bxc5 3.Be6 c4 4.Qxc4 Rc5 
                       5.Qa2 Rgg5 6.Bf5 Rxb5 7.Bxg6 Qxg6 
                       8.Rxf4 h3 9.gxh3 (46.463.322) 18511 

16.00  0:10   +0.46    1...Qe8 2.c5 bxc5 3.Be6 c4 4.Qxc4 Rc5 
                       5.Qa2 Rgg5 6.Bf5 Rxb5 7.Bxg6 Qxg6 
                       8.Rxf4 h3 9.gxh3 (199.262.243) 19233 

17.00  0:11   +0.42    1...Qe8 2.c5 bxc5 3.Be6 c4 4.Bxc4 Rc5 
                       5.Rd4 Rgg5 6.Rf1 Qe5 7.Rfd1 Qf6 
                       8.Qh3 Qe5 9.Qc8 Ne7 (218.727.739) 19237 

17.00  0:20   +0.40    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Qd4 Re5 7.Rf3 Qg5 8.Qd2 (401.279.196) 19282 

17.00  0:22   +0.40    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Qd4 Re5 7.Rf3 Qg5 8.Qd2 (434.973.754) 19212 

18.00  0:24   +0.40    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Qd4 Re5 7.Rf3 Qg5 8.Qd2 (470.421.163) 19271 

18.00  0:26   +0.40    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Qd4 Re5 7.Rf3 Qg5 8.Qd2 (508.084.956) 19304 

19.00  0:29   +0.40    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Qd4 Re5 7.Rf3 Qg5 8.Qd2 (571.674.582) 19378 

19.00  0:34   +0.40    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Qd4 Re5 7.Rf3 Qg5 8.Qd2 (662.265.871) 19404 

20.00  0:49   +0.46    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.h3 Rg3 7.Rxf4 Nxf4 
                       8.Qh8+ Qh7 9.Qf8+ Qg7 10.Qxf4 Rxg2 
                       11.Qxh4+ Rh5 12.Rf6+ Rg6 13.Qf4+ Rhg5 
                       14.Qh4+ Rh5 (954.224.266) 19328 

20.00  1:44   +0.46    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.h3 Rg3 7.Rxf4 Nxf4 
                       8.Qh8+ Qh7 9.Qf8+ Qg7 10.Qxf4 Rxg2 
                       11.Qxh4+ Rh5 12.Rf6+ Rg6 13.Qf4+ Rhg5 
                       14.Qh4+ Rh5 (2.004.954.557) 19127 

21.00  3:06   +0.42    1...Kg7 2.Bb7 Qe6 3.Rdf1 Kh6 4.Bd5 Qe5 
                       5.Qb2 Qe7 6.Bb7 Qe6 7.Bc6 Re5 8.Bd5 Qd7 
                       9.Rf3 Qd8 10.h3 Rg3 11.Rxg3 hxg3 (2.147.483.647) 11542 

21.00  3:49   +0.24    1...Rg3 2.hxg3 hxg3 3.Ra2 Rh5+ 4.Kg1 Qg5 
                       5.Kf1 f3 6.Qxf3 Nf4 7.Ke1 Rh1+ 8.Kd2 Nxd5+ 
                       9.Ke2 Nf4+ 10.Qxf4 Qxf4 11.Rxh1+ Kg5 
                       12.Kd3 Kg6 13.Rd2 Kg7 14.Ra2 (236.987.355) 1032 

21.00  3:49   +0.24    1...Rg3 2.hxg3 hxg3 3.Ra2 Rh5+ 4.Kg1 Qg5 
                       5.Kf1 f3 6.Qxf3 Nf4 7.Ke1 Rh1+ 8.Kd2 Nxd5+ 
                       9.Ke2 Nf4+ 10.Qxf4 Qxf4 11.Rxh1+ Kg5 
                       12.Kd3 Kg6 13.Rd2 Kg7 14.Ra2 (2.147.483.647) 9357 

22.00  4:15   -0.01    1...Rg3 2.hxg3 hxg3 3.Ra2 Rh5+ 4.Kg1 Rh2 
                       5.Qf3 Qg5 6.Be6 Nh4 7.Qc3 Qc5+ 8.Rd4 Nf3+ 
                       9.gxf3 Qh5 10.Bh3 Qxh3 11.Rxd6+ cxd6 
                       12.Qf6+ Kh5 13.Qf7+ Kg5 14.Qg7+ Kh5 (2.147.483.647) 8401 

22.00  4:41   -0.01    1...Rg3 2.hxg3 hxg3 3.Ra2 Rh5+ 4.Kg1 Rh2 
                       5.Qf3 Qg5 6.Be6 Nh4 7.Qc3 Qc5+ 8.Rd4 Nf3+ 
                       9.gxf3 Qh5 10.Bh3 Qxh3 11.Rxd6+ cxd6 
                       12.Qf6+ Kh5 13.Qf7+ Kg5 14.Qg7+ Kh5 (2.147.483.647) 7625 

23.00  5:00   -0.01    1...Rg3 2.hxg3 hxg3 3.Ra2 Rh5+ 4.Kg1 Rh2 
                       5.Qf3 Qg5 6.Be6 Nh4 7.Qc3 Qc5+ 8.Rd4 Nf3+ 
                       9.gxf3 Qh5 10.Bh3 Qxh3 11.Rxd6+ cxd6 
                       12.Qf6+ Kh5 13.Qf7+ Kg5 14.Qg7+ Kh5 (2.147.483.647) 7139 

n/s: 7.139.952  nodes: 2.147.483.647

Code: Select all

8/p1p5/Pp1p2nk/1P1Bq1r1/2P1Pprp/1Q6/5RPP/3R3K b - -

Engine: Scorpio 2.4 JA 64-bit 4CPU (1024 MB)
by Daniel Shawul

14.00  0:01   +0.33    1...Rh5 2.Qf3 Rg3 3.Qe2 Re3 4.Qd2 Qc3 
                       5.Qxc3 Rxc3 6.h3 Rg5 7.Kh2 Re3 8.Kg1 (12.123.732) 9471 

14.00  0:01   +0.33    1...Rh5 2.Qf3 Rg3 3.Qe2 Re3 4.Qd2 Qc3 
                       5.Qxc3 Rxc3 6.h3 Rg5 7.Kh2 Re3 8.Kg1 (12.763.896) 9454 

15.00  0:01   +0.18    1...Rh5 2.Qf3 Rg3 3.Qe2 Re3 4.Qd2 Qc3 
                       5.Qxc3 Rxc3 6.h3 Rg5 7.Rdf1 Re3 
                       8.Rd2 Kg7 (17.174.881) 9758 

15.00  0:01   +0.18    1...Rh5 2.Qf3 Rg3 3.Qe2 Re3 4.Qd2 Qc3 
                       5.Qxc3 Rxc3 6.h3 Rg5 7.Rdf1 Re3 
                       8.Rd2 Kg7 (19.080.498) 9784 

16.00  0:02   +0.19    1...Rh5 2.Qf3 Rg3 3.Qe2 Re3 4.Qd2 Qc3 
                       5.Qxc3 Rxc3 6.h3 Rg5 7.Rdf1 Kg7 
                       8.Kh2 Rd3 9.Rf3 (26.403.119) 9963 

16.00  0:03   +0.19    1...Rh5 2.Qf3 Rg3 3.Qe2 Re3 4.Qd2 Qc3 
                       5.Qxc3 Rxc3 6.h3 Rg5 7.Rdf1 Kg7 
                       8.Kh2 Rd3 9.Rf3 (30.815.415) 10070 

17.00  0:05   0.00     1...Rh5 2.Qf3 Rg3 3.Qe2 Rhg5 4.Qd2 Ra3 
                       5.Qc1 Rc3 6.Qd2 Ra3 (57.160.322) 10565 

17.00  0:06   0.00     1...Rh5 2.Qf3 Rg3 3.Qe2 Rhg5 4.Qd2 Ra3 
                       5.Qc1 Rc3 6.Qd2 Ra3 (63.792.015) 10614 

18.00  0:12   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (138.700.813) 10999 

18.00  0:17   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (189.305.081) 11089 

19.00  0:27   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (305.785.317) 11237 

19.00  0:38   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (430.757.603) 11311 

20.00  1:02   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (712.831.430) 11334 

20.00  1:28   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (1.007.532.885) 11328 

21.00  2:19   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (1.580.041.574) 11308 

21.00  3:04   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (2.081.963.152) 11286 

22.00  5:11   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (2.147.483.647) 6901 

22.00  6:50   0.00     1...Rh5 2.Rf3 Rhg5 3.Rf2 (2.147.483.647) 5236 

best move: Rg5-h5 time: 10:27.046 min  n/s: 5.236.360  nodes: 2.147.483.647 
alpha123
Posts: 660
Joined: Sat Dec 05, 2009 5:13 am
Location: Colorado, USA

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by alpha123 »

Either hash is filled, or you're getting a lot of TB hits (assuming it's an endgame position), though that shouldn't slow Scopio very much.

Peter
Martin Thoresen
Posts: 1833
Joined: Thu Jun 22, 2006 12:07 am

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by Martin Thoresen »

alpha123 wrote:Either hash is filled, or you're getting a lot of TB hits (assuming it's an endgame position), though that shouldn't slow Scopio very much.

Peter
Thanks for your answer, Peter.

It's not an endgame position though. But why don't I see this phenomena with pure UCI engines?

For instance, Stockfish can run many hours without showing any sign of n/s degradation.
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by jwes »

Martin T wrote:
alpha123 wrote:Either hash is filled, or you're getting a lot of TB hits (assuming it's an endgame position), though that shouldn't slow Scopio very much.

Peter
Thanks for your answer, Peter.

It's not an endgame position though. But why don't I see this phenomena with pure UCI engines?

For instance, Stockfish can run many hours without showing any sign of n/s degradation.
It looks like you are overflowing some 32 bit node counter. 2147483647 is 2^31 -1 or the largest 32 bit signed integer.
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by hgm »

It would be better to first check what the NPS really is. 19knps sounds suspiciously low for Crafty, not? It should be mor like 2 million/sec...

WinBoard implements node count as a 64-bit unsigned, so there should not be any overflow problems there.
Martin Thoresen
Posts: 1833
Joined: Thu Jun 22, 2006 12:07 am

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by Martin Thoresen »

hgm wrote:It would be better to first check what the NPS really is. 19knps sounds suspiciously low for Crafty, not? It should be mor like 2 million/sec...

WinBoard implements node count as a 64-bit unsigned, so there should not be any overflow problems there.
Yes, you are right, I was mistyping in my original post.

When I wrote 19kn/s I meant 19mn/s. :)
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by Sven »

The Crafty 23.1 code has been fixed after its initial release, and then uploaded again with the same version number. So maybe you are using a "23.1" version prior to that fix. You can check by downloading again the current 23.1 source, and comparing whether you have the same or not. The fixes covered also some accidentally wrong usage of integer types, so it may be possible that this "31 bit overflow" issue is solved there, too.

Sven
Martin Thoresen
Posts: 1833
Joined: Thu Jun 22, 2006 12:07 am

Re: n/s speed of search through Wb2Uci - need some clarifica

Post by Martin Thoresen »

Sven Schüle wrote:The Crafty 23.1 code has been fixed after its initial release, and then uploaded again with the same version number. So maybe you are using a "23.1" version prior to that fix. You can check by downloading again the current 23.1 source, and comparing whether you have the same or not. The fixes covered also some accidentally wrong usage of integer types, so it may be possible that this "31 bit overflow" issue is solved there, too.

Sven
Hello Sven,

I downloaded the crafty JA builds yesterday from Jim's site. Are you saying there are even newer builds out?