Human projections on a probably undefined algorithmic effect

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

Moderators: hgm, Rebel, chrisw

rainhaus
Posts: 185
Joined: Sun Feb 01, 2009 7:26 pm
Location: Germany
Full name: Rainer Neuhäusler

Human projections on a probably undefined algorithmic effect

Post by rainhaus »

Hello,
the game below was played in one of my current tournaments with nine of the best freeware engines. In the game Komodo7 against Stockfish 7 you can see a very special treatment of a KPK-ending. In fact, a postgame analysis shows Komodo as the only participant which didn’t beat the pawn immediately in the 63rd move! The tournament was played without tablebases.

A few questions spontaneously come to my mind . Could be, a few of them are not intended to be taken too seriously :wink:

1 Do the programmer even know what his engine is exactly doing here ?

2 Has Komodo implemented some emotional routines delaying the end of a game?
… for example a more sadistical one: Komodo enjoys every move until grabbing the queen.
... or a compassionate one: Komodo allows mercifully the climax of promotion before the transfigured pawn had to be killed.

3 Is it only a lack of a command like (in lyric pseudo code):

If there could end a game one move
then there is nothing more to prove
endif

rn

See move 62 and following...

[pgn][Event "FETbasLopez"]
[Site "DESKTOP-i7-4790k"]
[Date "2016.01.03"]
[Round "1"]
[White "Komodo-7-64bit"]
[Black "Stockfish 7 x64 bmi2"]
[Result "1/2-1/2"]
[WhiteElo "3191"]
[BlackElo "3308"]
[ECO "C84"]
[Opening "Ruy Lopez"]
[Time "18:28:49"]
[Variation "Geschlossenes System, 6.Nc3 b5 7.Bb3 d6"]
[TimeControl "40/480:40/240:240"]
[Termination "normal"]
[PlyCount "129"]

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Nc3 b5 7.Bb3 d6 8.a4 b4
9.Nd5 Na5 10.Ba2 c5 11.c3 b3 12.Nxe7 Qxe7 13.Bxb3 Nxb3 14.Qxb3 Nxe4 15.d4
exd4 16.Re1 O-O 17.cxd4 Qb7 18.Qxb7 Bxb7 19.dxc5 dxc5 20.Be3 Rfe8 21.Rac1
Rac8 22.a5 f6 23.h3 Red8 24.Red1 Rxd1+ 25.Rxd1 Bc6 26.Nh4 g6 27.f3 Ng5 28.
Bxc5 Ba4 29.Rc1 Ne6 30.Be3 Rxc1+ 31.Bxc1 Nc5 32.b4 Nd3 33.Bd2 Kf7 34.g4
Ke6 35.Ng2 Bc6 36.f4 Kd5 37.f5 Kc4 38.Ne3+ Kd4 39.fxg6 hxg6 40.h4 Ne5 41.
Bc1 Nf3+ 42.Kf2 Nxh4 43.Bb2+ Ke4 44.Bxf6 Nf3 45.Nc4 Kf4 46.Nd6 Ne5 47.Ke2
Bf3+ 48.Kd2 Bxg4 49.b5 axb5 50.Bxe5+ Kxe5 51.Nxb5 Bc8 52.Ke3 Bb7 53.Nd4 g5
54.Nf3+ Bxf3 55.Kxf3 Kd6 56.Kg3 Kc6 57.Kg4 Kb5 58.Kf5 g4 59.Kf4 Kc6 60.Kg3
Kb5 61.a6 Kxa6 62.Kf4 g3 63.Kf3 g2 64.Kf2 g1=Q+ 65.Kxg1 1/2-1/2[/pgn]
User avatar
hgm
Posts: 27807
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Human projections on a probably undefined algorithmic ef

Post by hgm »

Rainer Marian wrote:1 Do the programmer even know what his engine is exactly doing here ?
Sure, this is well understood. In the end you get the same score, and minimax only cares what you get in the end, not how long it takes you to get it.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Human projections on a probably undefined algorithmic ef

Post by Evert »

hgm wrote:
Rainer Marian wrote:1 Do the programmer even know what his engine is exactly doing here ?
Sure, this is well understood. In the end you get the same score, and minimax only cares what you get in the end, not how long it takes you to get it.
While that is true, I would expect move ordering to try KxP first... I'm not sure what would cause the delay to bubble to the top of the move list.

All (or almost all) of my programs would recognise KK as a (legal) draw and terminate the search immediately with a draw score. Even if not, the evaluation would at most be 0 (lack of mate potential) and so it would always prefer capturing the pawn to leaving it on the board. I don't know, perhaps such things just cost Elo at Komodo's level (at lower levels it probably doesn't matter one way or the other).

Still, it looks weird, but these moves all preserve the draw, and there is no real reason to prefer one drawing move over another (at least as far as the engine knows)...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Human projections on a probably undefined algorithmic ef

Post by bob »

Rainer Marian wrote:Hello,
the game below was played in one of my current tournaments with nine of the best freeware engines. In the game Komodo7 against Stockfish 7 you can see a very special treatment of a KPK-ending. In fact, a postgame analysis shows Komodo as the only participant which didn’t beat the pawn immediately in the 63rd move! The tournament was played without tablebases.

A few questions spontaneously come to my mind . Could be, a few of them are not intended to be taken too seriously :wink:

1 Do the programmer even know what his engine is exactly doing here ?

2 Has Komodo implemented some emotional routines delaying the end of a game?
… for example a more sadistical one: Komodo enjoys every move until grabbing the queen.
... or a compassionate one: Komodo allows mercifully the climax of promotion before the transfigured pawn had to be killed.

3 Is it only a lack of a command like (in lyric pseudo code):

If there could end a game one move
then there is nothing more to prove
endif

rn

See move 62 and following...

[pgn][Event "FETbasLopez"]
[Site "DESKTOP-i7-4790k"]
[Date "2016.01.03"]
[Round "1"]
[White "Komodo-7-64bit"]
[Black "Stockfish 7 x64 bmi2"]
[Result "1/2-1/2"]
[WhiteElo "3191"]
[BlackElo "3308"]
[ECO "C84"]
[Opening "Ruy Lopez"]
[Time "18:28:49"]
[Variation "Geschlossenes System, 6.Nc3 b5 7.Bb3 d6"]
[TimeControl "40/480:40/240:240"]
[Termination "normal"]
[PlyCount "129"]

1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.O-O Be7 6.Nc3 b5 7.Bb3 d6 8.a4 b4
9.Nd5 Na5 10.Ba2 c5 11.c3 b3 12.Nxe7 Qxe7 13.Bxb3 Nxb3 14.Qxb3 Nxe4 15.d4
exd4 16.Re1 O-O 17.cxd4 Qb7 18.Qxb7 Bxb7 19.dxc5 dxc5 20.Be3 Rfe8 21.Rac1
Rac8 22.a5 f6 23.h3 Red8 24.Red1 Rxd1+ 25.Rxd1 Bc6 26.Nh4 g6 27.f3 Ng5 28.
Bxc5 Ba4 29.Rc1 Ne6 30.Be3 Rxc1+ 31.Bxc1 Nc5 32.b4 Nd3 33.Bd2 Kf7 34.g4
Ke6 35.Ng2 Bc6 36.f4 Kd5 37.f5 Kc4 38.Ne3+ Kd4 39.fxg6 hxg6 40.h4 Ne5 41.
Bc1 Nf3+ 42.Kf2 Nxh4 43.Bb2+ Ke4 44.Bxf6 Nf3 45.Nc4 Kf4 46.Nd6 Ne5 47.Ke2
Bf3+ 48.Kd2 Bxg4 49.b5 axb5 50.Bxe5+ Kxe5 51.Nxb5 Bc8 52.Ke3 Bb7 53.Nd4 g5
54.Nf3+ Bxf3 55.Kxf3 Kd6 56.Kg3 Kc6 57.Kg4 Kb5 58.Kf5 g4 59.Kf4 Kc6 60.Kg3
Kb5 61.a6 Kxa6 62.Kf4 g3 63.Kf3 g2 64.Kf2 g1=Q+ 65.Kxg1 1/2-1/2[/pgn]
Computers don't evaluate paths, they evaluate final positions. A position with bare kings is equal to any other position with bare kings, regardless of how you got there. Whether white plays Kxg3 or Kf3 doesn't matter, as eventually the king captures and it is over...
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Human projections on a probably undefined algorithmic ef

Post by cdani »

Evert wrote: While that is true, I would expect move ordering to try KxP first... I'm not sure what would cause the delay to bubble to the top of the move list.
I suppose is Like Andscacs, the first move is the hash move, not the best ordered one.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Human projections on a probably undefined algorithmic ef

Post by Evert »

cdani wrote:
Evert wrote: While that is true, I would expect move ordering to try KxP first... I'm not sure what would cause the delay to bubble to the top of the move list.
I suppose is Like Andscacs, the first move is the hash move, not the best ordered one.
Of course, I do that too.
But the point is this: the first time the node is visited, there is no hash move. So KxP should be the first move that is searched (I suppose one could search killers first, but I don't expect those to be there either), and it should return a draw score. No other move does better than this, so KxP gets recorded as the best move.

Or, differently: in order for one of the quiet moves to make it into the PV it must either have produced a better score than KxP, or it must have come from the TT. However, it should only have become a TT move if it did better than KxP when there was no TT move.

What I suspect is that either KxP doesn't immediately terminate the search (so it continues to shuffle the kings) and the evaluation returns random noise (just the king PST), or the evaluation realises that the pawn is lost and so awards it 0 points. Then the PST evaluation from the kings might give the defending side a small plus - or in fact a tempo bonus could do that too.

Whatever it is, it's almost certainly a cosmetic effect only, and so would probably cost Elo to "fix".
rainhaus
Posts: 185
Joined: Sun Feb 01, 2009 7:26 pm
Location: Germany
Full name: Rainer Neuhäusler

Re: Human projections on a probably undefined algorithmic ef

Post by rainhaus »

hgm wrote:
Rainer Marian wrote:1 Do the programmer even know what his engine is exactly doing here ?
Sure, this is well understood. In the end you get the same score, and minimax only cares what you get in the end, not how long it takes you to get it.
Sure, what clearly demonstrates that chess programming is many more than a minimax application. The question is, what code fails or is missing that Komodo didn’t play this endgame like a normal chess player or like all the other engines. Have a look at Evert’s posting.
rainhaus
Posts: 185
Joined: Sun Feb 01, 2009 7:26 pm
Location: Germany
Full name: Rainer Neuhäusler

Re: Human projections on a probably undefined algorithmic ef

Post by rainhaus »

cdani wrote:
Evert wrote: While that is true, I would expect move ordering to try KxP first... I'm not sure what would cause the delay to bubble to the top of the move list.
I suppose is Like Andscacs, the first move is the hash move, not the best ordered one.
In any case, Andscacs move is 63. Kxg3, of course.

Only now I realize you as the author of Andscacs. A lots of programmers in my thread, I feel honoured, indeed.
There is nothing better for a computer chess aficionado than a new strong origin engine. The Elo-increase of Andscacs within such a short time is remarkable, perhaps even unique. Reason enough making the newest version to the 10th participant in my tournament. I’ll report it soon in the ‘tournament and matches’.
Currently Gull is playing against Andscacs in a classical variation of the Queens Gambit Accepted. Andscacs will have a difficult game because Gull’s algorithm feel very fine in this opening. However, star and leader is Sugar Pro. The GNU-compliant stockfish derivation could win 7 games already, but the original up to now only three. This is why I love thematic tournaments. They don’t comply with the statistic Law of Large Numbers and skin-tight error bars but even machines show in this type of competition profile and individuality.
A final hint: i don't like manipulating the original engine name. If someone has nothing against standards then Andscacs 0.85 64 Bit POPCNT would be an alternative instead of the attributeless Andscacs.

The actual standing of the tournament

Code: Select all

    Engine                   Score   Su Gu St Fi Ko An Cr Ho Eq De    S-B
01: SugaR PrO v1.4 64 BMI2   10.0/14 ·· 01 =  =  =1 =1 1= 1  =1 1    65,50
02: Gull 3 x64 BMI2          8.5/14  10 ·· =  == == == 1  1  =  1=   57,75
03: Stockfish 7 x64 bmi2     8.5/14  =  =  ·· == =  1= == =1 =  =1   55,25
04: Fire_4_x64               8.0/15  =  == == ·· =  == == 10 =1 =    54,75
05: Komodo-7-64bit           7.5/14  =0 == =  =  ·· == =  =  1= =1   49,25
06: Andscacs                 6.5/15  =0 == 0= == == ·· =  =0 =  1    46,50
07: Critter_1.6a_64bit       6.0/14  0= 0  == == =  =  ·· == =  ==   41,75
08: Houdini_15a_x64          6.0/14  0  0  =0 01 =  =1 == ·· == =    39,50
09: Equinox 3.20-x64         5.5/14  =0 =  =  =0 0= =  =  == ·· ==   38,00
10: Deep Rybka 4.1 SSE42 x64 4.5/14  0  0= =0 =  =0 0  == =  == ··   30,75

71 of 90 games played
Name of the tournament: FETbasQGA_D27_24jan2016
Site/ Country: DESKTOP-i7-4790k, Germany
Level: Tournament 20/5 40/5 Rest:5
Hardware: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz mit 16,0 GB Speicher
Operating system: Windows 10 Home Home Edition (Build 9200) 64 bit
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Human projections on a probably undefined algorithmic ef

Post by mjlef »

If Komodo worked like all the other programs, it would not be Komodo.

Mark
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Human projections on a probably undefined algorithmic ef

Post by cdani »

Rainer Marian wrote: Only now I realize you as the author of Andscacs. A lots of programmers in my thread, I feel honoured, indeed.
There is nothing better for a computer chess aficionado than a new strong origin engine. The Elo-increase of Andscacs within such a short time is remarkable, perhaps even unique. Reason enough making the newest version to the 10th participant in my tournament. I’ll report it soon in the ‘tournament and matches’.
Thanks for your kind words and for letting Andscacs run in your tournament! Will be very interesting follow the results of the different engines in this different tournament :-)