Bug of the week

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Bug of the week

Post by Robert Pope »

What PV and node count does a one-ply search from your engine return for this position?

[d]4kb1r/1pp1ppp1/r1n2n2/pQ1p2Bp/Pq1PP1bP/R1N2N2/1PP2PP1/4KB1R b Kk e3

Bug report to follow.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Bug of the week

Post by Robert Pope »

So, my program returned something on the lines of score=6, nodes=18696, pv=f6e4

I didn't think much about it, since I didn't expect a big PV line from a 1 ply search.

In implementing TD-leaf, I had to walk through the PV to calculate partial derivatives at the leaf, and I found that Evaluate() at the PV leaf wasn't the same as the backed up score. After some digging, I discovered that the PV from Quiesce() kept getting discarded by alpha beta.


Now, it returns pv=f6e4 b5b4 a5b4 f1a6 b4a3 a6b7 e4g5 h4g5 g4f3 b7c6

Much more informative! All this also points out how bad Quiesce can explode if you don't pare losing SEE trades, which I still need to implement. Everybody else probably finishes ply 1 in 100 nodes, instead of 18,000.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Bug of the week

Post by Robert Pope »

Perhaps, just as embarrassing, Beaches appears to have the same PV bug. But it can get through the ply 1 search in under 1000 nodes, though.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Bug of the week

Post by cdani »

Andscacs 0.82

info depth 1 seldepth 11 score cp 49 nodes 548 nps 182666 time 3 pv d5e4 f3e5
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Bug of the week

Post by Henk »

No futility/delta pruning

Code: Select all

1    0.30   0.035       30101   f6e4 
User avatar
Lasse Hansen
Posts: 27
Joined: Wed May 28, 2008 1:07 pm
Location: Porsgrunn, Norway

Re: Bug of the week

Post by Lasse Hansen »

Code: Select all

d1(20) t=0.00s s=0.24 N=2041 0knps BF=2041.00 HT=0.00 HTQ=116
   PV(7)1... Nxe4 2. Qxd5 Nxc3 3. Rxc3 Bxf3 4. Qxf3 Nxd4
Hehe, guess I also have a somewhat exploding quiescense search :)
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Bug of the week

Post by Henk »

By the way what margin can you give in qsearch for futility. A capture may end in a fork or a connected dangerous passed pawn pair that may promote into a queen soon. So you never know if a capture is futile.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Bug of the week

Post by Robert Pope »

Lasse Hansen wrote:

Code: Select all

d1(20) t=0.00s s=0.24 N=2041 0knps BF=2041.00 HT=0.00 HTQ=116
   PV(7)1... Nxe4 2. Qxd5 Nxc3 3. Rxc3 Bxf3 4. Qxf3 Nxd4
Hehe, guess I also have a somewhat exploding quiescense search :)
Well, 2000 certainly beats 18000. :)
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Bug of the week

Post by sje »

Running on a year 2002 iMac, Symbolic says:

Code: Select all

[] sf 4kb1r/1pp1ppp1/r1n2n2/pQ1p2Bp/Pq1PP1bP/R1N2N2/1PP2PP1/4KB1R b Kk - 0 1
[] s 1
SI: Iteration 0: begin
PV: [-1.107/1/0.006/24] 1... Bc8 2. exd5
PV: [-1.098/1/0.007/87] 1... Bd7 2. Qxb4 axb4 3. Bxa6 bxa3 4. exd5 bxa6 5. dxc6 Bxc6 6. bxa3
PV: [+0.188/1/0.007/162] 1... Bxf3 2. gxf3
SI: Iteration 0: end
SI: Iteration 1: begin
PV: [+0.188/2/0.008/462] 1... Bxf3 2. gxf3
SI: Iteration 1: end
SI: Iteration 2: begin
PV: [+0.178/3/0.011/2,194] 1... Bxf3 2. gxf3 Rb6
SI: Iteration 2: end
SI: Iteration 3: begin
PV: [+0.228/4/0.015/5,220] 1... Bxf3 2. gxf3 Rb6 3. Qxb4 Rxb4
PV: [+0.943/4/0.025/11,010] 1... Rb6 2. Qxb4 axb4 3. a5 bxa3 4. axb6 dxe4
SI: Iteration 3: end
SI: Iteration 4: begin
PV: [+1.106/5/0.037/17,238] 1... Rb6 2. Qxb4 axb4 3. a5 Bxf3 4. axb6 bxa3 5. gxf3 cxb6
SI: Iteration 4: end
SI: Iteration 5: begin
PV: [+0.943/6/0.128/92,136] 1... Rb6 2. Qxb4 axb4 3. a5 bxa3 4. axb6 dxe4
PV: [+1.106/6/0.190/139,437] 1... Bxf3 2. gxf3 Rb6 3. Qxb4 axb4 4. a5 bxa3 5. axb6 cxb6
SI: Iteration 5: end
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Bug of the week

Post by Rebel »

-0.48 1..Nxe4 2.Qxb4 axb4 3.Bxa6 bxa3 4.Bxb7 [3072 nodes].

But you can try this classic one at one ply.

[d] 8/PPPPPPPP/8/2k2K2/8/8/pppppppp/8 w - -


I get 439.893 nodes.