official-stockfish / Stockfish

A free and strong UCI chess engine
https://stockfishchess.org/
GNU General Public License v3.0
11.6k stars 2.28k forks source link

Stockfish_15_x64_avx2 return None of score in checkmate chance #4121

Closed woosungchu closed 2 years ago

woosungchu commented 2 years ago

Black side, this is checkmate chance but stockfish engine return 'None' of score at move[d4=>c5]

why it return None of score?

    def stockfish(board, depth):
      with chess.engine.SimpleEngine.popen_uci('stockfish_15_x64_avx2.exe') as sf:
        result = sf.analyse(board, chess.engine.Limit(depth=depth))
        score = result['score'].black().score() #black side
        return score

image

why it return None of score?

woosungchu commented 2 years ago

if anyone want to test follow these moves

d4,Nf6,Nc3,d5,Nh3,Bxh3,gxh3,e6,b4,Bxb4,Bd2,Bxc3,Bxc3,Ne4,Bb4,Qf6,c3,Nc6,Bg2,Nxf2,Qa4,Nxh1,Bxh1,Qh4+,Kd2,Qf4+,e3,Qxh2+,Kd3,a6,e4,b5,Qc2,Nxb4+,cxb4,Qg3+,Kd2,O-O,e5,a5,bxa5,Rxa5,a4,c5,Qxc5,Qf2+,Kc3,g6,Kb4,Raa8,Qxb5,Qxd4+,Ka3,Qxa1+,Kb3,Qxh1,a5,Rfc8,a6,Qa1,Qb7,Rc3+,Kb4,Rc4+,Kb5,Rd8,Kb6,Qd4+,Kb5
dubslow commented 2 years ago

user error (probably with the python), issue can be closed

./stockfish 
Stockfish 010822 by the Stockfish developers (see AUTHORS file)
position fen 3r2k1/1Q3p1p/P3p1p1/1K1pP3/2rq4/7P/8/8 b - - 0 1
go depth 2
info string NNUE evaluation using nn-ad9b42354671.nnue enabled
info depth 1 seldepth 1 multipv 1 score mate 1 nodes 46 nps 46000 tbhits 0 time 1 pv d4c5
info depth 2 seldepth 2 multipv 1 score mate 1 nodes 87 nps 87000 tbhits 0 time 1 pv d4c5
bestmove d4c5
woosungchu commented 2 years ago

yes it is python and user error