CPW Eval issues

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

CPW Eval issues

Post by ZirconiumX »

I implemented the King tropism function in FruitFly 1.1 'Banana' and it was a little too powerful.

In this complex Ruy Lopez, Breyer Variation (my personal favourite), Sigma Chess proudly exclaims mate in -4871!

[D]r2qrbk1/1b3p2/p2p1np1/1pnPp2p/P1p1P3/2P1BNNP/1PBQ1PP1/R3R1K1 w - - 0 19

And from the horse's mouth:
info depth 14 seldepth 30 score cp 29543 time 73478 nodes 9806465 pv a1b1
It also ruins the chess engine's strength (it thinks Bxc5 dxc5 then Qh6?? is the best move)

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: CPW Eval issues

Post by bob »

ZirconiumX wrote:I implemented the King tropism function in FruitFly 1.1 'Banana' and it was a little too powerful.

In this complex Ruy Lopez, Breyer Variation (my personal favourite), Sigma Chess proudly exclaims mate in -4871!

[D]r2qrbk1/1b3p2/p2p1np1/1pnPp2p/P1p1P3/2P1BNNP/1PBQ1PP1/R3R1K1 w - - 0 19

And from the horse's mouth:
info depth 14 seldepth 30 score cp 29543 time 73478 nodes 9806465 pv a1b1
It also ruins the chess engine's strength (it thinks Bxc5 dxc5 then Qh6?? is the best move)

Matthew:out
Simply suggests that the score you produce is way too big, not that the idea won't work. Obviously if you have some max score like "checkmated" you can never allow your eval to produce a number that large. But also, you can't let it produce a positional score large enough to get up into the mate range either...

There's not a chess programmer around that has not done this by accident, most commonly with an unitialized variable so that the score you return is actually above +infinity or below -infinity... And you see an endless loop of fail high or fail low, because you can't widen the window enough so that the score falls inside...
yl84
Posts: 21
Joined: Tue Sep 07, 2010 6:37 pm

Re: CPW Eval issues

Post by yl84 »

I agree with Bob's idea.
An other possibility: my engine find that this position is still in the opening book; so maybe there could be a bug in the hashtable and in the transition from opening book to real play? Though not very realistic for an engine of the class of Fruit.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: CPW Eval issues

Post by ZirconiumX »

Bob,

I scale it down by a factor 100 and it seems to be at an acceptable level.

Yves,

I just picked that position and gave it a go infinite command.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: CPW Eval issues

Post by bob »

ZirconiumX wrote:Bob,

I scale it down by a factor 100 and it seems to be at an acceptable level.

Yves,

I just picked that position and gave it a go infinite command.

Matthew:out
Advice. ALWAYS check "the edge conditions". That is, make sure that the outer reaches of such a term doesn't to bananas. I've had a completely working program that would hang in a fail-high loop and lose on time every now and then. Because the piece of code, in the right position, would produce a score greater than +infinity...

an uninitialized variable has been another interesting issue.
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: CPW Eval issues

Post by ZirconiumX »

My values are initialized, for both colours.

Mattthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.