SMP search stability

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
jdart
Posts: 3824
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

SMP search stability

Post by jdart » Sat Jan 24, 2009 7:21 pm

I have noticed that I'm getting somewhat varying results re-running the same tests with 2 CPUs. I expect some variance in number of nodes but I'm also seeing some cases where a solution move is found at different depths on a re-run. There are lots of examples, but one is this:

[D] r1br1qk1/bp1n1pp1/2p2n1p/p4N2/5PP1/P1N1P2P/BPQB4/R4RK1 w - -

bm is g5.

So here is output from one run:
"arasan10.19" bm g5
0 0.00 Ne7+ -3.17 4
0 0.00 b4 -1.12 9
0 0.00 g5 +0.00 14
0 0.00 a4 +0.08 17
0 0.00 Bc4 +0.28 26
0 0.00 Kh2 +0.60 35
0 0.00 Kg2 +0.72 40
1 0.00 Kg2 +0.48 118
2 0.00 Kg2 +0.72 966
3 0.00 Kg2 +0.60 3215
4 0.02 Kg2 +0.64 11489
4 0.03 Nxh6+! +1.10 17529
4 0.03 Nxh6+ +1.71 18359
5 0.03 -- +1.21 24387
5 0.05 Nxh6+ +0.39 25965
5 0.06 Kg2 +0.56 44177
5 0.10 Kh2 +0.57 59697
6 0.31 Kh2 +0.52 200452
6 0.46 g5! +1.07 356722
6 0.53 g5 +1.24 402474
7 0.66 -- +0.74 536396
7 0.88 g5 +0.03 683157
7 1.19 Kh2 +0.44 1044314
8 1.88 Kh2 +0.44 1778817
8 2.75 Kg2 +0.52 2787947
9 4.53 Kg2 +0.36 4542218
10 7.75 Kg2 +0.42 8172850
10 9.39 g5 +0.43 10031604
11 11.96 g5 +0.75 12810265

and here is another:

"arasan10.19" bm g5
0 0.00 Ne7+ -3.17 4
0 0.00 b4 -1.12 9
0 0.00 g5 +0.00 14
0 0.00 a4 +0.08 17
0 0.00 Bc4 +0.28 26
0 0.00 Kh2 +0.60 35
0 0.00 Kg2 +0.72 40
1 0.00 Kg2 +0.48 118
2 0.00 Kg2 +0.72 966
3 0.01 Kg2 +0.60 3215
4 0.01 Kg2 +0.64 11489
4 0.03 Nxh6+! +1.10 17529
4 0.03 Nxh6+ +1.71 18359
5 0.04 -- +1.21 24387
5 0.04 Nxh6+ +0.39 25965
5 0.07 Kg2 +0.56 44177
5 0.09 Kh2 +0.57 59697
6 0.32 Kh2 +0.52 200452
6 0.46 g5! +1.07 354900
6 0.54 g5 +1.24 402461
7 0.65 -- +0.74 534858
7 0.87 g5 +0.03 680090
7 1.21 Kh2 +0.44 1050021
7 1.31 Kg2 +0.52 1165350
8 2.03 Kg2 +0.56 1776563
9 3.73 Kg2 +0.48 3447993
10 7.67 Kg2 +0.37 7801540
11 15.07 Kg2 +0.28 16030645
11 20.09 g5 +0.56 21793945

My first take was that I ought to be getting the same score and same move selection (if moves are not equal in score) at the same depths. Moves can get searched with different windows but ultimately you are trying to find the highest score and the ordering or which thread is doing the search should not matter. I've tried to ensure that doing the search from searchSMP (called after a split in my code) and the regular search does all the same extensions, etc.

But I can think of some factors that could cause variation. For example, I use LMR based on history so you could get some variance due to that.

Any others have experience with this/opinions on it? Should I worry about this?

--Jon

Gian-Carlo Pascutto
Posts: 1184
Joined: Sat Dec 13, 2008 6:00 pm
Contact:

Re: SMP search stability

Post by Gian-Carlo Pascutto » Sat Jan 24, 2009 7:24 pm

Sounds absolutely normal and expected to me.

bob
Posts: 20549
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: SMP search stability

Post by bob » Sat Jan 24, 2009 10:50 pm

It is a hash table issue. To prove this to yourself, don't use the hash scores at all. Use the moves for ordering, but no scores. And 99.9% of that behavior will vanish...

Post Reply