Stockfish can't evaluate the KP vs K endgame?

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

Moderator: Ras

Zhu.Jianzhao
Posts: 59
Joined: Tue Sep 18, 2012 11:30 am
Location: Nanjing, China

Re: Stockfish can't evaluate the KP vs K endgame?

Post by Zhu.Jianzhao »

mar wrote: What version did you use? I tried some of the recent compiles and SF sees a loss for black (after Kf6).
I tired Stockfish 2.3.1 JA just now, got the same problem, it returns 0.00 after I entered Kf6.
Uri Blass
Posts: 11203
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Stockfish can't evaluate the KP vs K endgame?

Post by Uri Blass »

Nothing to do with evaluation of pawn endgames.

It is obvious that it is about evaluating first repetition and many engines evaluate first repetition as a draw because they are designed to play and not to analyze correctly and the programmers did not want to add code that is probably not productive for playing strength.

It is a disadvantage of the program but
I do not think that it is a bug because a bug is a behaviour that is different than the intention of the programmer.
Zhu.Jianzhao
Posts: 59
Joined: Tue Sep 18, 2012 11:30 am
Location: Nanjing, China

Re: Stockfish can't evaluate the KP vs K endgame?

Post by Zhu.Jianzhao »

mar wrote:
Zhu.Jianzhao wrote: Stockfish 20-02-13
Where to get it? Do you have a link?
from http://rybkaforum.net/cgi-bin/rybkaforu ... pid=462595
mar
Posts: 2685
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Stockfish can't evaluate the KP vs K endgame?

Post by mar »

Zhu.Jianzhao wrote:I tired Stockfish 2.3.1 JA just now, got the same problem, it returns 0.00 after I entered Kf6.
Yes Miguel is right - it's a repetion problem.

Code: Select all

position fen 6k1/8/6K1/6P1/8/8/8/8 w - - 0 1 moves g6f6
However, SF would never play Kf6 in the first position anyway. Not a bug then.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Stockfish can't evaluate the KP vs K endgame?

Post by michiguel »

mar wrote:
Zhu.Jianzhao wrote:I tired Stockfish 2.3.1 JA just now, got the same problem, it returns 0.00 after I entered Kf6.
Yes Miguel is right - it's a repetion problem.

Code: Select all

position fen 6k1/8/6K1/6P1/8/8/8/8 w - - 0 1 moves g6f6
However, SF would never play Kf6 in the first position anyway. Not a bug then.
It does not matter whether the engine plays Kf6 or not, if it is used to analyzed a game, it will give wrong results for positions with a repetition in its path.

Miguel
JVMerlino
Posts: 1412
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Stockfish can't evaluate the KP vs K endgame?

Post by JVMerlino »

michiguel wrote:
mar wrote:
Zhu.Jianzhao wrote:I tired Stockfish 2.3.1 JA just now, got the same problem, it returns 0.00 after I entered Kf6.
Yes Miguel is right - it's a repetion problem.

Code: Select all

position fen 6k1/8/6K1/6P1/8/8/8/8 w - - 0 1 moves g6f6
However, SF would never play Kf6 in the first position anyway. Not a bug then.
It does not matter whether the engine plays Kf6 or not, if it is used to analyzed a game, it will give wrong results for positions with a repetition in its path.

Miguel
So this is an analysis bug only, IMO. Most engines give a draw score in the search after one repetition to (barely) improve speed, right? I wonder if Bob would do a cluster run to see if one repetition has any noticeable ELO improvement compared to requiring two reps?

Anyway, my engine does the same thing. Seems like the easiest way to resolve this is to require two reps when in analysis mode, and only one rep when playing a game (on the assumption that the speed increase has value). "Bug" fixed.

jm
mar
Posts: 2685
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Stockfish can't evaluate the KP vs K endgame?

Post by mar »

michiguel wrote:It does not matter whether the engine plays Kf6 or not, if it is used to analyzed a game, it will give wrong results for positions with a repetition in its path.

Miguel
Yes, but detecting true 3-fold repetitions won't help in general because there is TT. This problem hasn't been solved yet AFAIK. Recently, there was a thread about a new approach (I don't remember), where the authors worked with paths I think. It would be awesome if this problem could be solved without loss of speed, but I fear this is not the case.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Stockfish can't evaluate the KP vs K endgame?

Post by michiguel »

JVMerlino wrote:
michiguel wrote:
mar wrote:
Zhu.Jianzhao wrote:I tired Stockfish 2.3.1 JA just now, got the same problem, it returns 0.00 after I entered Kf6.
Yes Miguel is right - it's a repetion problem.

Code: Select all

position fen 6k1/8/6K1/6P1/8/8/8/8 w - - 0 1 moves g6f6
However, SF would never play Kf6 in the first position anyway. Not a bug then.
It does not matter whether the engine plays Kf6 or not, if it is used to analyzed a game, it will give wrong results for positions with a repetition in its path.

Miguel
How do you know you are analyzing? you can't. If the engine is used with another tool to annotate the game, I cannot see how that could be done. IMHO, this is not a bug, but a flawed optimization.

Miguel
So this is an analysis bug only, IMO. Most engines give a draw score in the search after one repetition to (barely) improve speed, right? I wonder if Bob would do a cluster run to see if one repetition has any noticeable ELO improvement compared to requiring two reps?

Anyway, my engine does the same thing. Seems like the easiest way to resolve this is to require two reps when in analysis mode, and only one rep when playing a game (on the assumption that the speed increase has value). "Bug" fixed.

jm
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Stockfish can't evaluate the KP vs K endgame?

Post by Michel »

GNU Chess uses the single repetion rule only for repetions occurring within the search. For repetitions involving the games history it uses the threefold repetition rule. So it analyzes this position correctly.
JVMerlino
Posts: 1412
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Stockfish can't evaluate the KP vs K endgame?

Post by JVMerlino »

So this is an analysis bug only, IMO. Most engines give a draw score in the search after one repetition to (barely) improve speed, right? I wonder if Bob would do a cluster run to see if one repetition has any noticeable ELO improvement compared to requiring two reps?

Anyway, my engine does the same thing. Seems like the easiest way to resolve this is to require two reps when in analysis mode, and only one rep when playing a game (on the assumption that the speed increase has value). "Bug" fixed.

jm
How do you know you are analyzing? you can't. If the engine is used with another tool to annotate the game, I cannot see how that could be done. IMHO, this is not a bug, but a flawed optimization.

Miguel
Winboard's "analyze" command puts the engine in analysis mode. Does UCI not provide a similar command?

jm