Draw position showing mate score

Discussion of chess software programming and technical issues.

Moderator: Ras

tttony
Posts: 273
Joined: Sun Apr 24, 2011 12:33 am

Draw position showing mate score

Post by tttony »

Hello fellow programmers! Happy New Year!

Here I am starting the year with a problem! :mrgreen:

[d]8/8/4K2k/7P/7P/3B4/8/8 w - - 0 1

Here is the output

Code: Select all

FEN: 8/8/4K2k/7P/7P/3B4/8/8 w - - 0 1 

Skiull 0.5 x64 POPCNT:
   1	00:00	         273	273	+5,25	Bd3-e2
   2	00:00	       1.464	1.464	+5,45	Bd3-e2 Kh6-g7
   3	00:00	       3.003	3.003	+5,45	Bd3-e2 Kh6-g7 Ke6-e5
   4	00:00	       8.493	8.493	+5,50	Bd3-e2 Kh6-g7 Ke6-e5 Kg7-f8
   5	00:00	      21.205	21.205	+5,50	Bd3-e2 Kh6-g7 Ke6-e5 Kg7-f8 Be2-f3
   6	00:00	      71.435	4.464.687	+5,55	Bd3-g6 Kh6-g7 Ke6-e5 Kg7-h6 Bg6-f7 Kh6-g7
   7	00:00	     151.560	9.472.500	+5,55	Bd3-g6 Kh6-g7 Ke6-e5 Kg7-h6 Bg6-f7 Kh6-g7 Bf7-c4
   8	00:00	     336.484	10.854.322	+5,55	Bd3-g6 Kh6-g7 Ke6-e5 Kg7-h6 Bg6-f7 Kh6-g7 Bf7-c4 Kg7-h6
   9	00:00	     473.685	10.078.404	+M7	Bd3-g6 Kh6-g7 Ke6-e7 Kg7-h6 Bg6-f7 Kh6-g7 h5-h6+ Kg7-h7 Ke7-e6
  10	00:00	   1.099.509	10.087.238	+M7	Bd3-e2 Kh6-g7 Ke6-e7 Kg7-g8 h5-h6 Kg8-h8 Ke7-f7 Kh8-h7 Be2-f3
  11	00:00	   2.941.182	10.466.839	+11,40	Bd3-g6 Kh6-g7 Bg6-e8 Kg7-f8 h5-h6 Kf8xe8 h6-h7 Ke8-d8 h7-h8Q+ Kd8-c7 Ke6-d5
  12	00:00	   3.604.410	10.040.139	+M9	Bd3-g6 Kh6-g7 Ke6-e5 Kg7-h6 Ke5-f5 Kh6-g7 Kf5-g5 Kg7-g8 h5-h6 Kg8-f8 Kg5-f6
  13	00:00	   5.316.918	8.966.134	+M11	Bd3-g6 Kh6-g7 Ke6-e5 Kg7-h6 Ke5-f5 Kh6-g7 Kf5-e6 Kg7-h6 Ke6-e7 Kh6-g7 Bg6-e8
  14	00:01	   9.135.404	8.482.269	+M10	Bd3-g6 Kh6-g7 Ke6-e5 Kg7-h6 Ke5-f5 Kh6-g7 Kf5-g5 Kg7-h8 h5-h6 Kh8-g8 Kg5-f5
I just came across this position and is a dead draw but my engine has problems with it, showing mate in the score and in the pv line there is no even mate, I've been debugging and I just tested:

0.1 version that has only vanilla alphabeta, no null move, no TT, no killer or history moves and it does not shows mate score
0.2 does not shows mate score but the score goes up, this version has TT
0.3 shows mate score :roll:

So I'm guessing that is a TT problem(?)

My engine is very basic only with PST from CPW, TT, null move, killer, history heuristic, detect repetition, 50 rule move some basics material draw, so it has no code to handle this kind of end game positions but it shouldn't show mate score

I just tested it against Stockfish 12 and lost the game

[pgn][Event "Computer chess game"]
[Site "ARENA 3.0"]
[Date "2021.01.01"]
[Round "?"]
[White "Stockfish 12"]
[Black "Skiull 0.5 x64 POPCNT"]
[Result "1-0"]
[BlackElo "2000"]
[Time "19:49:54"]
[WhiteElo "2000"]
[TimeControl "180+2"]
[SetUp "1"]
[FEN "8/8/4K2k/7P/7P/3B4/8/8 w - - 0 1"]
[Termination "normal"]
[PlyCount "35"]
[WhiteType "program"]
[BlackType "program"]

1. Be2 {(Bd3-e2 Kh6-g7 Be2-f3 Kg7-g8 h5-h6 Kg8-h8 Bf3-e2 Kh8-h7 Ke6-f7
Kh7-h8 Kf7-f6 Kh8-h7 Be2-g4 Kh7-h8 Kf6-g6 Kh8-g8 Bg4-e6+ Kg8-h8 Be6-d7
Kh8-g8 Bd7-e8 Kg8-h8 h4-h5 Kh8-g8 Be8-d7 Kg8-h8 Bd7-f5 Kh8-g8 Kg6-g5 Kg8-h8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