Test position: Tough sac 19.Bg6!! (Hector-So)

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

Moderators: hgm, Rebel, chrisw

Albert Silver
Posts: 3019
Joined: Wed Mar 08, 2006 9:57 pm
Location: Rio de Janeiro, Brazil

Test position: Tough sac 19.Bg6!! (Hector-So)

Post by Albert Silver »

[D]r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - - 0 19

Hector found the very strong 19.Bg6!! in this position. The main line goes 19.Bg6!! hxg6 20.hxg6 Nd4 21.Rf7 Qd8 22.Qg4!

For the record, Hector missed 22.Qg4! and played 22.Qf4? but his concept was immaculate.
"Tactics are the bricks and sticks that make up a game, but positional play is the architectural blueprint."
User avatar
Eelco de Groot
Posts: 4567
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Test position: Tough sac 19.Bg6!! (Hector-So)

Post by Eelco de Groot »

[Event "19th Sigeman & Co"]
[Site "Malmo SWE"]
[Date "2011.06.13"]
[Round "5"]
[White "Hector,J"]
[Black "So,W"]
[Result "0-1"]
[WhiteElo "2588"]
[BlackElo "2667"]
[EventDate "2011.06.09"]
[ECO "C13"]

1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Be7 5. e5 Nfd7 6. h4 O-O 7. Qg4 f6 8.
Nf3 Rf7 9. exf6 Nxf6 10. Qg3 Nc6 11. O-O-O Qf8 12. h5 Bb4 13. Bxf6 Rxf6 14.
Bd3 Bd6 15. Ne5 Rxf2 16. Rdf1 Bxe5 17. dxe5 Rxf1+ 18. Rxf1 Qe7 19. Bg6 hxg6
20. hxg6 Nd4 21. Rf7 Qd8 22. Qf4 Nf5 23. g4 Nh4 24. Rxg7+ Kxg7 25. Qf7+ Kh6
26. Qh7+ Kg5 27. Qh5+ Kf4 28. Ne2+ Ke3 29. g5 Nf3 30. Kd1 Qxg5 31. Qh7 Kf2
0-1
Albert Silver wrote:[D]r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - - 0 19

Hector found the very strong 19.Bg6!! in this position. The main line goes 19.Bg6!! hxg6 20.hxg6 Nd4 21.Rf7 Qd8 22.Qg4!

For the record, Hector missed 22.Qg4! and played 22.Qf4? but his concept was immaculate.
Rainbow Serpent does not find it, only for a moment there is a Fail High, but if Bg6 forced sees where that leads after some Fail Lows, and Fail Highs when the search window drops too much. The routine for calculating the new searchwindow is a bit impatient :? Eventually it gets a score for hxg6 inside the searchwindow but then thinks not accepting the offer refutes it. It needs more hardware I think to properly search the moves, 256 Mb is not enough. The variation or score may not be accurate enough, I will let it run a bit longer, I suppose the analysis of 19...Nd8 could be improved upon, f.e. is 20. Bxh7+?! the right idea?

r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - -

Engine: eXperimental Tommy Cooper - Rainbow Serpent Build 209 (Athlon 2009 MHz, 256 MB)
Latest mini-change: Forward mobility implementation, but poorly tuned
by Tord Romstad, Marco Costalba, Joona Kiiski

1/01 0:00 +3.31 19.Bxh7+ (1.179) 3

2/02 0:00 +3.31 19.Bxh7+ Kxh7 (1.976) 6

3/04 0:00 +2.62 19.Bxh7+ Kxh7 20.Rh1 Kg8 (3.096) 9

4/04 0:00 -0.56 19.Bxh7+ Kxh7 20.Nxd5 exd5 (23.608) 62

4/06 0:00 -0.08 19.Rf6 Nxe5 20.Rf2 Nxd3+ 21.cxd3 Kh8 (34.046) 87

4/06 0:00 +2.30 19.h6 Nb4 20.Qf2 Nxd3+ 21.cxd3 Bd7 (55.167) 125

4/06 0:00 +2.34 19.a3 Kh8 20.h6 Bd7 21.hxg7+ Qxg7 (80.054) 165

5/06 0:00 +0.84 19.a3 Bd7 20.a4 Rf8 21.Bxh7+ Kxh7 (197.054) 280

5/06 0:00 +1.93 19.h6 Nb4 20.a3 Nxd3+ 21.cxd3 Kh8 (247.686) 310

5/06 0:00 +1.94 19.Nb5 Nb4 20.Qf2 Nxd3+ 21.cxd3 a6 (257.998) 311

6/06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 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rh1 Nb4
22.Bxh7+ Kxh7 23.a3 Nxc2 (248.356.049) 555

24/10 7:51 0.00 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rh1 Nb4
22.Bxh7+ Kxh7 23.a3 Nxc2 (260.573.110) 552

25/30 10:07 0.00 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rxf8+ Qxf8
22.Nb5 Nb4 23.Nd6 Nxd3+ 24.cxd3 Qf1+
25.Kd2 Qa1 26.Qf4 Qxb2+ 27.Kd1 Qb1+
28.Ke2 h6 29.Qf7+ Kh8 30.Qxd7 Qc2+
31.Kf3 Qd1+ 32.Kf2 (332.717.859) 547

26/08 12:17 0.00 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rxf8+ Qxf8
22.Nb5 Nb4 (398.442.616) 540

27/12 20:47 0.00 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rxf8+ Qxf8
22.c3 a6 23.Kb1 Kh8 24.Ka1 Qd8 (683.477.593) 548

28/12 29:27 -0.16 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rxf8+ Qxf8
22.a3 a6 23.h6 g6 24.Qe3 d4 (973.728.493) 551

29/18 59:41 -0.31 19.Nb5 Bd7 20.Nxc7 Rf8 21.Rxf8+ Qxf8
22.Nb5 Be8 23.c3 Bxh5 24.Nd6 Qd8
25.b4 Qd7 26.Kb2 a6 27.b5 axb5 (1.989.686.287) 555


But now after 19. Bg6 I get the same score, -0.31:


[D]r1b3k1/ppp1q1pp/2n1p1B1/3pP2P/8/2N3Q1/PPP3P1/2K2R2 b - -

Engine: eXperimental Tommy Cooper - Rainbow Serpent Build 209 (Athlon 2009 MHz, 256 MB)
Latest mini-change: Forward mobility implementation, but poorly tuned
by Tord Romstad, Marco Costalba, Joona Kiiski

1/01 0:00 +0.96 19...hxg6 (1.698) 113

2/04 0:00 -0.12 19...hxg6 20.hxg6 Bd7 21.Rf7 (16.847) 366

3/07 0:00 +0.96 19...hxg6 20.Qxg6 Nxe5 21.Qg3 d4
22.Qxe5 dxc3 (18.259) 396

4/10 0:00 -0.12 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qf4 Nf5 23.Qb4 Nh6 24.Rf4 (19.725) 428

5/07 0:00 +0.20 19...hxg6 20.hxg6 Nd4 21.Rh1 Nf5
22.Qh2 Nh6 (23.288) 375

6/09 0:00 +0.20 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Kb1 Nf5 23.Qh3 Nh6 (52.635) 421

7/08 0:00 -0.20 19...hxg6 20.hxg6 Bd7 21.Rf7 d4
22.Rxe7 Nxe7 23.Qf4 (79.510) 464

8/11 0:00 +0.32++ 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qf4 Nf5 23.Qb4 Nh6 24.Rf4 Nf5 (146.446) 494

8/08 0:00 -0.30 19...hxg6 20.hxg6 b6 21.Rf7 Qxf7
22.gxf7+ Kxf7 23.Nb5 (267.135) 503

9/09 0:01 +0.02++ 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Kb1 Nf5 23.Qg4 Nh6 (539.228) 515

9/09 0:01 +0.34++ 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Kb1 Nf5 23.Qg4 Nh6 (654.242) 523

9/11 0:01 +0.28 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Rf4 Nf5 23.Qh2 Nh6 24.g4 Qg5 (705.380) 525

10/11 0:02 +1.05++ 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Rf4 Nf5 23.Qh2 Nh6 24.g4 Qg5 (1.073.380) 532

10/15 0:02 +1.10 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qf2 Nf5 23.Qc5 b6 24.Qb4 Nh6
25.Rf1 Nf5 26.Kb1 Qg5 (1.265.543) 525

11/13 0:02 +1.16 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qg4 Nf5 23.Qh5 Nh6 24.Rf4 Bd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4 Nf5 23.Qh5 Nh6 24.g4 Nxf7
25.gxf7+ Kf8 26.Qh8+ Kxf7 27.Qxd8 (264.079.618) 557

27/02 10:53 +1.21-- 19...hxg6 20.hxg6 (359.472.799) 549

27/02 22:36 +0.27-- 19...hxg6 20.hxg6 (673.589.688) 496

27/09 24:31 -1.56-- 19...hxg6 20.hxg6 a5 21.Rh1 Nb4
22.Rh8+ Kxh8 23.Qh3+ Kg8 (720.840.427) 489

27/25 32:50 -2.84++ 19...hxg6 20.hxg6 Bd7 21.Rh1 Qe8
22.Qh4 Qxg6 23.Qh8+ Kf7 24.Rf1+ Ke7
25.Qxa8 Be8 26.Qxb7 Qg5+ 27.Kb1 Qxe5
28.Na4 Qd6 29.Nc5 Qxc5 30.Qxc7+ Bd7
31.Qg3 Ke8 (1.016.893.950) 516

27/23 33:25 -2.48++ 19...hxg6 20.hxg6 Bd7 21.Rh1 Qe8
22.Qh4 Qxg6 23.Qh8+ Kf7 24.Rf1+ Ke7
25.Qxa8 Be8 26.Qxb7 Qg5+ 27.Kb1 Qxe5
28.Qc8 d4 29.Nd1 Bg6 30.Qa8 Kd6 (1.035.566.265) 516

27/05 36:30 -1.75++ 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8 (1.140.050.246) 520

27/19 136:43 -1.64 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qg4 Nf5 23.Qh5 Qh4 24.Qh7+ Qxh7
25.Rf8+ Kxf8 26.gxh7 c6 27.h8Q+ Kf7
28.Nxd5 cxd5 (4.127.322.975) 503


27/07 177:08 -0.31 19...Nd8 20.Bxh7+ Kxh7 21.Rf4 Nf7
22.Rg4 Nh6 (5.451.741.328) 512
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
Eelco de Groot
Posts: 4567
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Test position: Tough sac 19.Bg6!! (Hector-So)

Post by Eelco de Groot »


28/15 318:46 -1.91 19...Nd8 20.Nb5 Bd7 21.Nd6 h6 22.Nf7 Nxf7
23.Rxf7 Qxf7 24.Bxf7+ Kxf7 25.c4 Kg8
26.cxd5 exd5 (10.601.956.442) 554

28/16 320:40 -1.64 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qg4 Nf5 23.Qh5 Qh4 24.Qh7+ Qxh7
25.Rf8+ Kxf8 26.gxh7 c6 27.h8Q+ (10.661.230.824) 554

29/37 469:59 -2.00 19...hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qg4 Nf5 23.Qh5 Nh6 24.g4 Qe8
25.Rf4 c6 26.Ne2 Bd7 27.g5 Nf5
28.Nd4 Kf8 29.Qh8+ Ke7 30.Nxf5+ exf5
31.Qxg7+ Kd8 32.Qf6+ Kc7 (15.816.744.941) 560

29/15 470:25 -1.91 19...Nd8 20.Nb5 Bd7 21.Nd6 h6 22.Nf7 Nxf7
23.Rxf7 Qxf7 24.Bxf7+ Kxf7 25.c4 Kg8
26.cxd5 exd5 (15.831.264.993) 560
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
Eelco de Groot
Posts: 4567
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Test position: Tough sac 19.Bg6!! (Hector-So)

Post by Eelco de Groot »

Black tried some other options but they also did not work. Stopped the engine now. The sacrifice is correct it seems, not with very high evaluations but better than any alternative move. Now we have to find that one ply earlier. Maybe the tuning of Forward Mobility can be improved further, but move 22.Qg4 is crucial for the variation. And pretty hard to find for a single core engine.

29/12 788:46 -1.66 19...h6 20.Nb5 Qg5+ 21.Qxg5 hxg5
22.Nxc7 Rb8 23.Bf7+ Kh7 24.Nxe6 Nxe5
25.Nf8+ (27.228.931.041) 575

30/12 805:58 -1.66 19...h6 20.Nb5 Qg5+ 21.Qxg5 hxg5
22.Nxc7 Rb8 23.Bf7+ Kh7 24.Nxe6 Nxe5
25.Nf8+ (27.867.798.400) 576

31/02 859:41 -2.02-- 19...h6 20.Nb5 (29.662.564.200) 575

31/03 906:10 -2.02 19...Bd7 20.Rf7 hxg6 (31.265.061.231) 575

32/14 1028:56-2.38-- 19...Bd7 20.Rf7 Qxf7 21.Bxf7+ Kxf7
22.h6 gxh6 23.Qf4+ Kg7 24.Qg4+ Kf7
25.Nxd5 Nxe5 26.Qf4+ (35.543.645.295) 575


best move: h7-h6 time: 1072:26.407 min n/s: 578.274 nodes: 37.209.910.451
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
Eelco de Groot
Posts: 4567
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Double Pass Futility Pruning in Quiescence Search.

Post by Eelco de Groot »

I am sure Peter Martan can improve on this with Rebel Q3 or my version of that, Rebel Q5T 8-) After another try the testposition now seems a bit easier than before, thanks to the "double pass" Futility Pruning in the quiescense search, as mentioned in the programming forum and based on an idea from John Merlino to only do recaptures after a certain negative depth in the quiescence search. This was also already implemented in Gaviota so it may have been around much longer. Maybe since the seventies :) in the time of Chess 4.6 :) I'm using a very soft version of that that just does heavier futility pruning if a capture move is not in the PV and not capturing on the same square as the previous move. It seems a logical way of limiting the number of full evals needed in the QS. But there is an immediate effect visible on all the evaluations, not what you maybe would anticipate; shorter time to depth/branching factor change.

I like the effect so far, I was thinking of implementing null move in quiescence search again but this is probably better. And it is a soft effect, you could try more pruning easily, this was just my second try, the first one had no effect at all, not even on speed so I hope the Visual C++ compiler actually manages to do this second pass of Fuitility Pruning in parallel with the other tests, in quiescence search that would make a big difference because it is called very often, quiescence search by far the most time consuming part of search IIRC.


[D]r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - -

Engine: eXperimental Tommy Cooper - Rainbow Serpent Build 212 (Athlon 2009 MHz, 256 MB)
Latest change: Double Pass Futility Pruning in Quiescence Search on non recapture moves
by Tord Romstad, Marco Costalba, Joona Kiiski

1/01 0:00 +3.31 19.Bxh7+ (1.179) 5

2/02 0:00 +3.31 19.Bxh7+ Kxh7 (1.976) 8

3/04 0:00 +2.62 19.Bxh7+ Kxh7 20.Rh1 Kg8 (3.096) 12

4/04 0:00 -0.56 19.Bxh7+ Kxh7 20.Nxd5 exd5 (23.603) 83

4/06 0:00 -0.08 19.Rf6 Nxe5 20.Rf2 Nxd3+ 21.cxd3 Kh8 (34.027) 109

4/06 0:00 +2.30 19.h6 Nb4 20.Qf2 Nxd3+ 21.cxd3 Bd7 (55.148) 160

4/06 0:00 +2.34 19.a3 Kh8 20.h6 Bd7 21.hxg7+ Qxg7 (80.051) 197

5/06 0:00 +1.27 19.a3 Bd7 20.Kb1 Rf8 21.Bxh7+ Kxh7 (214.132) 318

5/04 0:00 +2.07 19.h6 Nb4 20.Qf3 gxh6 (243.885) 339

6/08 0:00 +1.55 19.h6 Nb4 20.Qf4 Nxd3+ 21.cxd3 Bd7
22.hxg7 Qxg7 (334.479) 375

6/06 0:00 +1.81 19.Kb1 Nb4 20.Nb5 Nxd3 21.cxd3 a6 (376.133) 382

7/06 0:01 +1.33-- 19.Kb1 Nb4 20.Nb5 Nxd3 21.cxd3 a6 (482.688) 406

7/15 0:01 +1.48 19.h6 Nb4 20.Be2 Kh8 21.hxg7+ Qxg7
22.Qh4 Nc6 23.Bd3 Bd7 24.Rh1 Nxe5
25.Bxh7 Qxg2 26.Bd3+ (538.711) 415

8/08 0:01 +1.55 19.h6 Nb4 20.Be2 Bd7 21.a3 Nc6
22.Qf4 Rf8 (734.224) 435

9/10 0:03 +1.23-- 19.h6 Bd7 20.Kb1 Nb4 21.hxg7 Nxd3
22.cxd3 Qxg7 23.Qh4 Rf8 (1.748.303) 490

9/10 0:05 +0.81-- 19.h6 Bd7 20.Kb1 Nb4 21.hxg7 Nxd3
22.cxd3 Qxg7 23.Qh4 Rf8 (2.590.502) 503

9/12 0:07 +0.83 19.Rf2 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qh8+ Ke7
31.Qxg7+ Kd8 32.Qf8+ (321.750.114) 528

25/12 76:25 +0.95 19.Bg6 a6 20.Rf7 Qxf7 21.Bxf7+ Kxf7
22.h6 gxh6 23.Qf4+ Kg8 24.Qxh6 Bd7 (2.504.291.226) 546

26/04 97:30 +1.67 19.Bg6 h6 20.Nb5 Bd7 (3.222.441.227) 550

27/04 97:52 +1.67 19.Bg6 h6 20.Nb5 Bd7 (3.234.073.666) 550

28/04 98:46 +1.67 19.Bg6 h6 20.Nb5 Bd7 (3.262.461.110) 550

29/02 132:50 +1.47-- 19.Bg6 hxg6 (4.392.662.508) 551

29/08 148:14 +1.20-- 19.Bg6 hxg6 20.hxg6 Nd4 21.Rh1 Nf5
22.Qh2 Nh4 (4.915.237.592) 552

29/09 153:46 +1.47 19.Bg6 Bd7 20.Rf7 hxg6 21.Rxe7 Nxe7
22.hxg6 Rf8 23.Qg5 (5.093.144.748) 551

30/03 167:17 +1.68++ 19.Bg6 Bd7 20.Rf7 (5.449.834.138) 542

30/02 194:17 +1.37-- 19.Bg6 hxg6 (6.297.318.175) 540

30/02 269:53 +1.75++ 19.Bg6 Kh8 (8.518.596.808) 526

30/12 289:18 +1.28 19.Bg6 hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qg4 Nf5 23.Qh5 Nh6 24.Ne2 Qe8 (9.039.639.881) 520

31/08 297:30 +1.60++ 19.Bg6 hxg6 20.hxg6 Nd4 21.Rf7 Qd8
22.Qg4 Nf5 (9.228.031.590) 516

31/02 323:20 +1.12-- 19.Bg6 hxg6 (9.827.162.408) 506

31/05 380:21 +1.71 19.Bg6 h6 20.Nb5 Nd8 21.Nxc7 (11.599.577.451) 508


best move: Bd3-g6 time: 383:08.750 min n/s: 508.195 nodes: 11.682.763.399

Codechange in Stockfish 2.0, new code is:

Code: Select all

      // Extra Futility pruning
      if (   !PvNode
          && !isCheck
          && !moveIsCheck
          &&  move != ttMove
          &&  enoughMaterial
          && !move_is_promotion(move)
          && !pos.move_is_passed_pawn_push(move)
          && depth < -5*ONE_PLY
          && move_to&#40;move&#41; != move_to&#40;&#40;ss-1&#41;->currentMove&#41; // not a recapture
          && ply > 5&#41;
      &#123;
          futilityValue =  2*&#40;ss->eval + evalMargin&#41; - &#40;ss-2&#41;->eval - &#40;ss-2&#41;->evalMargin
                         + beta - bestValue
                         + pos.endgame_value_of_piece_on&#40;move_to&#40;move&#41;)
                         + &#40;move_is_ep&#40;move&#41; ? PawnValueEndgame &#58; VALUE_ZERO&#41;; // &#91;This second pass filter value should be at least FutilityMarginQS lower&#93;

          if &#40;futilityValue < alpha&#41;
          &#123;
              if &#40;futilityValue > bestValue&#41;
                  bestValue = futilityValue;
              continue;
          &#125;
      &#125;
this new block is simply added right after the other tests for futility here:

Code: Select all


    // Loop through the moves until no moves remain or a beta cutoff occurs
    while (   alpha < beta
           && &#40;move = mp.get_next_move&#40;)) != MOVE_NONE&#41;
    &#123;
      assert&#40;move_is_ok&#40;move&#41;);

      moveIsCheck = pos.move_is_check&#40;move, ci&#41;;

      // Futility pruning
      if (   !PvNode
          && !isCheck
          && !moveIsCheck
          &&  move != ttMove
          &&  enoughMaterial
          && !move_is_promotion&#40;move&#41;
          && !pos.move_is_passed_pawn_push&#40;move&#41;)
      &#123;
          futilityValue =  futilityBase
                         + pos.endgame_value_of_piece_on&#40;move_to&#40;move&#41;)
                         + &#40;move_is_ep&#40;move&#41; ? PawnValueEndgame &#58; VALUE_ZERO&#41;;

          if &#40;futilityValue < alpha&#41;
          &#123;
              if &#40;futilityValue > bestValue&#41;
                  bestValue = futilityValue;
              continue;
          &#125;
      &#125;

      // Detect non-capture evasions that are candidate to be pruned
      evasionPrunable =   isCheck
                       && bestValue > value_mated_in&#40;PLY_MAX&#41;
                       && !pos.move_is_capture&#40;move&#41;
                       && !pos.can_castle&#40;pos.side_to_move&#40;));

      // Don't search moves with negative SEE values
      if (   !PvNode
          && (!isCheck || evasionPrunable&#41;
          &&  move != ttMove
          && !move_is_promotion&#40;move&#41;
          &&  pos.see_sign&#40;move&#41; < 0&#41;
          continue;

      // Don't search useless checks
      if (   !PvNode
          && !isCheck
          &&  moveIsCheck
          &&  move != ttMove
          && !pos.move_is_capture_or_promotion&#40;move&#41;
          &&  ss->eval + PawnValueMidgame / 4 < beta
          && !check_is_dangerous&#40;pos, move, futilityBase, beta, &bestValue&#41;)
      &#123;
          if &#40;ss->eval + PawnValueMidgame / 4 > bestValue&#41;
              bestValue = ss->eval + PawnValueMidgame / 4;

          continue;
      &#125;

      // Extra Futility pruning
      if (   !PvNode
          && !isCheck
          && !moveIsCheck
          &&  move != ttMove
          &&  enoughMaterial
          && !move_is_promotion&#40;move&#41;
          && !pos.move_is_passed_pawn_push&#40;move&#41;
          && depth < -5*ONE_PLY
          && move_to&#40;move&#41; != move_to&#40;&#40;ss-1&#41;->currentMove&#41; // not a recapture
          && ply > 5&#41;
      &#123;
          futilityValue =  2*&#40;ss->eval + evalMargin&#41; - &#40;ss-2&#41;->eval - &#40;ss-2&#41;->evalMargin
                         + beta - bestValue
                         + pos.endgame_value_of_piece_on&#40;move_to&#40;move&#41;)
                         + &#40;move_is_ep&#40;move&#41; ? PawnValueEndgame &#58; VALUE_ZERO&#41;;

          if &#40;futilityValue < alpha&#41;
          &#123;
              if &#40;futilityValue > bestValue&#41;
                  bestValue = futilityValue;
              continue;
          &#125;
      &#125;

      // Update current move
      ss->currentMove = move;
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
Eelco de Groot
Posts: 4567
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Double Pass Futility Pruning in Quiescence Search.

Post by Eelco de Groot »

I should have added that in Rainbow Serpent different evalMargins are used but I think the principle still stands and should work in Stockfish with some tinkering perhaps. Who knows, it might work better but it is not tested there by me.

Eelco
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
peter
Posts: 3186
Joined: Sat Feb 16, 2008 7:38 am
Full name: Peter Martan

Re: Double Pass Futility Pruning in Quiescence Search.

Post by peter »

Eelco de Groot wrote:I am sure Peter Martan can improve on this with Rebel Q3 or my version of that, Rebel Q5T 8-)
Hi Eelco!
:)
Rebel Q5T sounds very interesting!
Q3 doesn't solve this, as far as I saw till now, even if it has Bg6 soon in its calculations once and again, it doesn't keep it:

r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - - 0 1

Analysis by ProDeo 1.6Q3:

1.h6 Kh8 2.Df4 gxh6 3.Dxh6 Ld7 4.Th1
+- (2.18) Tiefe: 6 00:00:00 101kN
1.Lxh7+
+- (2.18) Tiefe: 6 00:00:00 143kN
1.h6 Kh8 2.Df4 gxh6 3.Dxh6 Ld7 4.Th1
+- (2.18) Tiefe: 6 00:00:00 143kN
1.h6 Ld7 2.a3 Kh8 3.Sb5 g5 4.Sxc7
+- (1.64) Tiefe: 7 00:00:00 440kN
1.h6 Ld7 2.a3 Kh8 3.Sb5 g5 4.Sxc7
+- (1.64) Tiefe: 8 00:00:00 1038kN
1.Kb1 Ld7 2.Sb5 Le8 3.a3 g6 4.hxg6
+- (1.73) Tiefe: 8 00:00:01 1514kN
1.Kb1 Ld7 2.Sb5 Le8 3.c4 dxc4 4.Le4 g6 5.hxg6
+/- (1.08) Tiefe: 9 00:00:01 2529kN
1.h6 Ld7 2.Sb5 Kh8 3.c3 g6 4.Sxc7 Tf8 5.Txf8+ Dxf8
+- (1.64) Tiefe: 9 00:00:02 3461kN
1.Lg6 +- (1.64) Tiefe: 9 00:00:03 5652kN
1.h6 Ld7 2.Sb5 Kh8 3.c3 g6 4.Sxc7 Tf8 5.Txf8+ Dxf8
+- (1.64) Tiefe: 9 00:00:03 5652kN
1.h6 Ld7 2.Sb5 Kh8 3.c3 g6 4.Sxc7 Tf8 5.Txf8+ Dxf8
+- (1.64) Tiefe: 10 00:00:03 7190kN
1.Lg6 +- (1.64) Tiefe: 10 00:00:04 7887kN
1.h6 Ld7 2.Sb5 Kh8 3.c3 g6 4.Sxc7 Tf8 5.Txf8+ Dxf8
+- (1.64) Tiefe: 10 00:00:04 7887kN
1.h6 Ld7 2.Df4 Le8 3.g4 a6 4.Dd2 Kh8
+- (1.41) Tiefe: 11 00:00:08 17767kN
1.h6 Ld7 2.Th1 g6 3.Lxg6 hxg6 4.Dxg6+ Kh8 5.Th2 Tg8 6.Dd3 Sxe5 7.De3
+/- (1.21) Tiefe: 12 00:00:38 87386kN
1.Lg6 +/- (1.21) Tiefe: 12 00:00:40 90622kN
1.h6 Ld7 2.Th1 g6 3.Lxg6 hxg6 4.Dxg6+ Kh8 5.Th2 Tg8 6.Dd3 Sxe5 7.De3
+/- (1.21) Tiefe: 12 00:00:41 90622kN
1.h6 Ld7 2.Th1 g6 3.Kd1 Tf8 4.Lxg6 hxg6 5.Dxg6+ Kh8 6.Se2 Tg8 7.Df6+ Dxf6 8.exf6 e5 9.h7 Txg2 10.f7
+/- (0.86) Tiefe: 13 00:01:54 264mN
1.Lg6 +/- (0.86) Tiefe: 13 00:01:55 266mN
1.h6 Ld7 2.Th1 g6 3.Kd1 Tf8 4.Lxg6 hxg6 5.Dxg6+ Kh8 6.Se2 Tg8 7.Df6+ Dxf6 8.exf6 e5 9.h7 Txg2 10.f7
+/- (0.86) Tiefe: 13 00:02:00 266mN
1.a3 Ld7 2.Df4 a6 3.g4 b5 4.h6 b4 5.Sb1
+/- (1.06) Tiefe: 13 00:02:39 362mN
1.a3 Ld7 2.Kb1 Tf8 3.Txf8+ Kxf8
+/= (0.47) Tiefe: 14 00:06:34 879mN
1.h6 Ld7 2.Th1 g6 3.Tf1 Tf8 4.a4 Txf1+ 5.Lxf1 Sb4 6.Df2 Lc6 7.Dg3 Kh8
+/- (0.96) Tiefe: 14 00:07:43 1043mN

Best in time is Junior with material values lowered drastically and the positional ones risen, I could call it Gambit Junior.
:)

r1b3k1/ppp1q1pp/2n1p3/3p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6 2.Sb5 Dg5+ 3.Dxg5 hxg5 4.Lf7+ Kh7 5.Sxc7 Tb8 6.Lxe6 Lxe6 7.Sxe6 Kg8 8.Sxg5 Sxe5 9.Tf5 Te8 10.g3
+/- (1.11) Tiefe: 22 00:04:32 6544mN
1.Lg6 h6 2.Sb5 Dg5+ 3.Dxg5 hxg5 4.Lf7+ Kh7 5.Sxc7 Tb8 6.Lxe6 Lxe6 7.Sxe6 Kh6 8.Tf5 Kxh5 9.Txg5+ Kh6
+/- (1.10) Tiefe: 23 00:06:21 8982mN
1.Lg6 h6 2.Sb5 Dg5+ 3.Dxg5 hxg5 4.Lf7+ Kh7 5.Sxc7 Tb8 6.Te1 Kh6 7.Le8
+/- (1.03) Tiefe: 24 00:11:09 15598mN

As a matter of fact only Zappa Mex.2 "Aggressor Dissident" could do it in a similar time and with the probably best main variant:

r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - - 0 1

Analysis by Zappa Mexico IIAD:

1.h6 Sb4 2.Lxh7+ Kxh7 3.hxg7 Dxg7 4.Th1+ Kg8
+- (2.79) Tiefe: 10/26 00:00:01 662kN
1.h6 Sb4 2.Lxh7+ Kxh7 3.hxg7 Dxg7 4.Th1+
+- (2.79) Tiefe: 10/28 00:00:01 1035kN
1.h6 Ld7 2.Kb1 Kh8 3.Lxh7 gxh6 4.Ld3 Dg5
+- (2.80) Tiefe: 11/28 00:00:01 2109kN
1.h6 Ld7 2.Kb1 Kh8 3.Lxh7 gxh6 4.Ld3 Dg5
+- (2.80) Tiefe: 11/28 00:00:01 2533kN
1.h6 Ld7 2.a3 Tf8 3.Th1 g6 4.Lxg6 hxg6 5.Dxg6+
+- (2.46) Tiefe: 12/33 00:00:01 4263kN
1.h6 Ld7 2.a3 Tf8 3.Th1 g6 4.Lxg6 hxg6 5.Dxg6+
+- (2.46) Tiefe: 12/35 00:00:02 7489kN
1.h6 Ld7 2.Th1 g6 3.Lxg6 Kh8 4.Lh5 Tg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+ Dxf8 10.gxh6
+- (1.58) Tiefe: 20/59 00:05:10 3081mN
1.Lg6 hxg6 2.hxg6 Sd4 3.Tf7 Dd8 4.Dg4 Sf5 5.Dh5 Sh6 6.Tf1 Ld7 7.g4 De7 8.g5 Tf8 9.Txf8+ Dxf8 10.gxh6
+- (1.68) Tiefe: 21/61 00:05:42 3393mN

And then I have to admit this was on 12 cores.

P.S. With some more MP- luck Zappa Aggressor Dissident just in time to edit made it even some faster here:

r1b3k1/ppp1q1pp/2n1p3/3pP2P/8/2NB2Q1/PPP3P1/2K2R2 w - - 0 1

Analysis by Zappa Mexico IIAD:

1.h6 Ld7 2.Kb1 Kh8 3.Lxh7 gxh6 4.Ld3 Dg5
+- (2.80) Tiefe: 11/28 00:00:01 2081kN
...
1.h6 Ld7 2.Th1 g6 3.Lxg6 hxg6 4.Dxg6+ Kh8 5.h7 Tf8 6.Dg4 Sxe5 7.Dh5 Tf5 8.Dh2 Sc4 9.Dxc7
+/- (1.29) Tiefe: 18/55 00:00:44 433mN
1.Lg6 hxg6 2.hxg6 Sd4 3.Tf7 Dd8 4.Dg4 Sf5 5.Dh5 Dh4 6.Dh7+ Dxh7 7.Tf8+ Kxf8 8.gxh7 Ke7 9.h8D
+- (1.45) Tiefe: 18/55 00:01:29 873mN
1.Lg6 hxg6 2.hxg6 Sd4 3.Tf7 Dd8 4.Dg4 Sf5 5.Dh5 Dh4 6.Dh7+ Dxh7 7.Tf8+ Kxf8 8.gxh7 Ke7 9.h8D
+- (1.45) Tiefe: 18/55 00:01:30 887mN
1.Lg6 hxg6 2.hxg6 Sd4 3.Tf7 Dd8 4.Dg4 Sf5 5.Dh5 Dh4 6.Dh7+ Dxh7 7.Tf8+ Kxf8 8.gxh7 Ke7 9.h8D d4 10.Se4
+- (1.59) Tiefe: 19/57 00:01:36 940mN
1.Lg6 hxg6 2.hxg6 Sd4 3.Tf7 Dd8 4.Dg4 Sf5 5.Dh5 Dh4 6.Dh7+ Dxh7 7.Tf8+ Kxf8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