@@ -1548,8 +1548,8 @@ def probe_wdl_table(self, board: chess.Board) -> int:
15481548 try :
15491549 table = typing .cast (WdlTable , self .wdl [key ])
15501550 except KeyError :
1551- if chess . popcount ( board .occupied ) > TBPIECES :
1552- raise KeyError (f"syzygy tables support up to { TBPIECES } pieces, not { chess . popcount ( board .occupied )} : { board .fen ()} " )
1551+ if board .piece_count ( ) > TBPIECES :
1552+ raise KeyError (f"syzygy tables support up to { TBPIECES } pieces, not { board .piece_count ( )} : { board .fen ()} " )
15531553 raise MissingTableError (f"did not find wdl table { key } " )
15541554
15551555 self ._bump_lru (table )
@@ -1567,8 +1567,8 @@ def probe_ab(self, board: chess.Board, alpha: int, beta: int, threats: bool = Fa
15671567 # positions that have more pieces than the maximum number of supported
15681568 # pieces. We artificially limit this to one additional level, to
15691569 # make sure search remains somewhat bounded.
1570- if chess . popcount ( board .occupied ) > TBPIECES + 1 :
1571- raise KeyError (f"syzygy tables support up to { TBPIECES } pieces, not { chess . popcount ( board .occupied )} : { board .fen ()} " )
1570+ if board .piece_count ( ) > TBPIECES + 1 :
1571+ raise KeyError (f"syzygy tables support up to { TBPIECES } pieces, not { board .piece_count ( )} : { board .fen ()} " )
15721572
15731573 # Special case: Variant with compulsory captures.
15741574 if self .variant .captures_compulsory :
@@ -1613,7 +1613,7 @@ def sprobe_ab(self, board: chess.Board, alpha: int, beta: int, threats: bool = F
16131613
16141614 threats_found = False
16151615
1616- if threats or chess . popcount ( board .occupied ) >= 6 :
1616+ if threats or board .piece_count ( ) >= 6 :
16171617 for threat in board .generate_legal_moves (~ board .pawns ):
16181618 board .push (threat )
16191619 try :
0 commit comments