On reaching maximum ply

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
MartinBryant
Posts: 69
Joined: Thu Nov 21, 2013 12:37 am
Location: Manchester, UK
Full name: Martin Bryant

On reaching maximum ply

Post by MartinBryant »

I know this occurs rarely, if ever, but I was intrigued when I noticed that Stockfish and Crafty handle it differently.

In Colossus I've always just returned the static evaluation.

Stockfish has this...
return (ss->ply >= MAX_PLY && !ss->inCheck) ? evaluate(pos) : VALUE_DRAW;

Crafty has this...
return beta;

Thoughts?
Why VALUE_DRAW (rather than the static evaluation) if you're in check?
Why beta?
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: On reaching maximum ply

Post by Sven »

When you are in check, the static eval is often unreliable so VALUE_DRAW is just "less random". And ignoring the current node by returning beta (which is negated by the parent so it can't raise his alpha) is "even less random".

Just my thoughts, don't know if the original authors had that in mind.
Sven Schüle (engine author: Jumbo, KnockOut, Surprise)
chrisw
Posts: 4313
Joined: Tue Apr 03, 2012 4:28 pm

Re: On reaching maximum ply

Post by chrisw »

MartinBryant wrote: Thu Apr 29, 2021 12:53 pm I know this occurs rarely, if ever, but I was intrigued when I noticed that Stockfish and Crafty handle it differently.

In Colossus I've always just returned the static evaluation.

Stockfish has this...
return (ss->ply >= MAX_PLY && !ss->inCheck) ? evaluate(pos) : VALUE_DRAW;

Crafty has this...
return beta;

Thoughts?
Why VALUE_DRAW (rather than the static evaluation) if you're in check?
SF evaluation function doesn’t handle in-check positions, so I guess they just default to DRAW in the absence of any other v.

Why beta?