Strange PV showed by Isa

Discussion of chess software programming and technical issues.

Moderator: Ras

Daniel Anulliero
Posts: 773
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Strange PV showed by Isa

Post by Daniel Anulliero »

hi all !

Hi just noticed a strange thing in my ehgine :
When Isa is in check and when the TT is enabled it shows a strange PV line :

Here is a simple position :
[d]rnbqkbnr/ppp2ppp/3p4/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 0 1


I've implemented in Isa eight search modes :

1 : Alpha beta simple
2 : PVS simple
3 : Alpha beta + TT
4 : PVS + TT
5 : Alpha beta + TT + Nul move
6 : PVS + TT + Nul move
7 : Alpha beta + TT + Nul move + LMR
8 : PVS + TT + Nul move + LMR


PV showed at mode 1 :

Code: Select all

temps max : 3000

1 -31 187 0 c8d7 b1c3 d7b5 c3b5
2 -2 1083  0 c7c6 b5c4 f8e7
3 -32	5669	0 c8d7 b5c4 g8f6 d2d3
4 -12  32884 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 194000 4 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1
mode 2 :

Code: Select all

temps max : 3050

1 31 72 0 b1c3 d7b5 c3b5
2 71 171 0 b5d7 b8d7 e1g1
3 32 1985 0 b5c4 g8f6 d2d3
4 64 4846 0 b5d7 b8d7 e1g1 f8e7 d2d4
5 54 75347 1 b5e2 g8f6 d2d3 f8e7 e1g1
6 70 182477 5 b5d7 b8d7 e1g1 f8e7 b1c3 g8f6 d2d4
mode 3 (and others with TT enabled) :

Code: Select all

temps max : 3000

1 -31 187 0 c8d7 b1c3 d7b5 c3b5
2 -31 0 0
3 -32 4814 0 c8d7 b5c4 g8f6 d2d3
4 -32 0 0
5 -54 169226 3 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1
6 -54 0 3
modes 5 to 8 show also 0 at depths 2 , 4 , 6 , 8 , etc....

I don't know why but it's indeed a big bug with my TT lol
It arrive ONLY when Isa is in check

Any lights please , I'm lost !!
Robert Pope
Posts: 570
Joined: Sat Mar 25, 2006 8:27 pm
Location: USA
Full name: Robert Pope

Re: Strange PV showed by Isa

Post by Robert Pope »

If I'm reading it right, it is searching zero nodes in the even plies. So I would put in a breakpoint after the 3 ply search and physically step through and see what happens. If it is doing a probe and return, then you can note what the probe is, and add a breakpoint for when you are recording that TT entry.
Daniel Anulliero
Posts: 773
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Strange PV showed by Isa

Post by Daniel Anulliero »

Yes you're reading right
When in check isa show only 0 in even depths...
I'll try breakpoints and we'll see ... Thx !
Note :
Pv showed at mode 2 was à copy paste error from me , false pv :oops:
D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Re: Strange PV showed by Isa

Post by D Sceviour »

The FEN shows white to move, but it is black to move in check.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Strange PV showed by Isa

Post by Sven »

Daniel Anulliero wrote:Yes you're reading right
When in check isa show only 0 in even depths...
I'll try breakpoints and we'll see ... Thx !
Note :
Pv showed at mode 2 was à copy paste error from me , false pv :oops:
Are you probing TT at the root node? I can't think of many other explanations for an empty PV.
Daniel Anulliero
Posts: 773
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Strange PV showed by Isa

Post by Daniel Anulliero »

Sven Schüle wrote:
Daniel Anulliero wrote:Yes you're reading right
When in check isa show only 0 in even depths...
I'll try breakpoints and we'll see ... Thx !
Note :
Pv showed at mode 2 was à copy paste error from me , false pv :oops:
Are you probing TT at the root node? I can't think of many other explanations for an empty PV.
Yes ... :oops: then we found the bug ?
Daniel Anulliero
Posts: 773
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Strange PV showed by Isa

Post by Daniel Anulliero »

D Sceviour wrote:The FEN shows white to move, but it is black to move in check.
Mmm I copied Fen from Arena ... May be there's not only Isa that have bugs
:wink:
Daniel Anulliero
Posts: 773
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Strange PV showed by Isa

Post by Daniel Anulliero »

Ok I have fixed something : Isa don't probe now at root node (stupid bad typo)
Now I have these outputs with the same position :
[d]rnbqkbnr/ppp2ppp/3p4/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 0 1


Code: Select all

only alpha beta :
1 -31 187 0 c8d7 b1c3 d7b5 c3b5
2 -2 1083 0 c7c6 b5c4 f8e7
3 -32 5669 0 c8d7 b5c4 g8f6 d2d3
4 -12 32884 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 194000 5 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1

only PVS :
1 -31 256 0 c8d7 b1c3 d7b5 c3b5
2 -2 1612 0 c7c6 b5c4 f8e7
3 -32 8033 0 c8d7 b5c4 g8f6 d2d3
4 -12 46429 1 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 192006 5 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1

alpha beta + TT :
1 -31 187 0 c8d7 b1c3 d7b5 c3b5
2 -2 1083 0 c7c6 b5c4 f8e7
3 -49 2368 0 c7c6 b5d3 f8e7 e1g1
4 -12 17279 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 156098 4 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1
6 -19 610107 17 c7c6 b5e2 f8e7 b1c3 g8f6 d2d4 e8g8 d4e5

PVS + TT :
1 -31 256 0 c8d7 b1c3 d7b5 c3b5
2 -2 1612 0 c7c6 b5c4 f8e7
3 -49 2672 0 c7c6 b5d3 f8e7 e1g1
4 -12 14009 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 132068 3 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1
6 -19 639414 16 c7c6 b5e2 g8f6 b1c3 f8e7 d2d4 e8g8 d4e5

alpha beta + TT + Nulmove
1 -31 187 0 c8d7 b1c3 d7b5 c3b5
2 -2 1083 0 c7c6 b5c4 f8e7
3 -49 2368 0 c7c6 b5d3 f8e7 e1g1
4 -12 17279 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 156098 3 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1
6 -19 610107 16 c7c6 b5e2 f8e7 b1c3 g8f6 d2d4 e8g8 d4e5

PVS + TT + Nulmove
1 -31 256 0 c8d7 b1c3 d7b5 c3b5
2 -2 1612 0 c7c6 b5c4 f8e7
3 -49 2672 0 c7c6 b5d3 f8e7 e1g1
4 -12 14009 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -54 132068 3 c8d7 b5e2 g8f6 d2d3 f8e7 e1g1
6 -19 639414 16 c7c6 b5e2 g8f6 b1c3 f8e7 d2d4 e8g8 d4e5

alpha beta + TT + Nulmove + LMR
1 -31 187 0 c8d7 b1c3 d7b5 c3b5
2 -2 1483 0 c7c6 b5c4 f8e7
3 -49 1675 0 c7c6 b5d3 f8e7 e1g1
4 -12 9779 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -33 30918 1 c8d7 b5d7 b8d7 e1g1 g8f6 d2d3 f8e7
6 -19 162884 4 c7c6 b5e2 g8f6 b1c3 f8e7 d2d4 e8g8 d4e5
7 -15 375189 12 c8d7 b5e2 g8f6 e1g1 f8e7 b1c3 e8g8 d2d4

PVS + TT + Nulmove + LMR
1 -31 256 0 c8d7 b1c3 d7b5 c3b5
2 -2 1920 0 c7c6 b5c4 f8e7
3 -49 2165 0 c7c6 b5d3 f8e7 e1g1
4 -12 8963 0 c7c6 b5d3 f8e7 e1g1 c8g4
5 -33 30977 0 c8d7 b5d7 b8d7 e1g1 g8f6 d2d3 f8e7
6 -19 190587 5 c7c6 b5e2 f8e7 b1c3 g8f6 d2d4 e8g8 d4e5
7 -15 330680 12 c8d7 b5e2 g8f6 e1g1 f8e7 b1c3 e8g8 d2d4
8 -11 132125 14 c8d7 b5d7
9 -31 668057 28 c8d7 b5d7 b8d7 e1g1 f8e7 b1c3 g8f6 d2d3 e8g8 c1e3 f8e8
Ok I'm happy , Isa don't show an empty PV cool !
But ... I noticed a lot of new problems :roll:
**When Isa is in check the depth decrease dramaticaly , I don't know why ... here Isa has only five legal move and two very bad moves (Qd7 and Ke7 , rapidly pruned)
**PVS search seems less ineficient than simple alpha beta , I don't know if it is normal
etc .. If you notice another things , feel free to post here
:wink:

LMR increase the depth by 3 and must be in all engines ! but dificult to tune very well
bests
Dany
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Strange PV showed by Isa

Post by Sven »

Daniel Anulliero wrote:
Sven Schüle wrote:
Daniel Anulliero wrote:Yes you're reading right
When in check isa show only 0 in even depths...
I'll try breakpoints and we'll see ... Thx !
Note :
Pv showed at mode 2 was à copy paste error from me , false pv :oops:
Are you probing TT at the root node? I can't think of many other explanations for an empty PV.
Yes ... :oops: then we found the bug ?
Seems so, after considering your later post. Of course you may *probe* at the root node but then use the result for move ordering only, not for cutting the subtree, that's what I meant. The empty PV looked so familiar to me ...
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Strange PV showed by Isa

Post by Sven »

Daniel Anulliero wrote:If you notice another things , feel free to post here
Results with Nullmove look exactly identical to those without Nullmove, with all other search features being the same. That would imply to me that your Nullmove implementation is either not working at all, or only working in higher depths.