7

I use Arena GUI together with stockfish in engine games. I want to download a 6-piece tablebase but that is just a lot of work (and perhaps unnecessary). If I download the tablebase (syzygy), does stockfish work with it or just waits for the board to have 6-pieces and then the tablebase makes its moves?

Here is what I mean in more detail

Stockfish working with the tablebase

I assume I have the following position:

(Note: currently I am not talking about the best moves, just an example)

[Event "Computer Chess Game"]
[White "Stockfish 8"]
[Black "Wais Kamal"]
[Result "1-0"]
[SetUp "1"]
[FEN "2k4b/3r4/8/8/1Q1q4/8/4R3/2KB4 w - - 0 1 "]

1. Qxd4 Rxd4 1-0

Stockfish consults the tablebase about what happens after Qxd4 Rxd4 (without continuing to evaluate the rest of the line). If this line is winning it goes for it.

Stockfish working alone

Stockfish continues to play the game until six pieces are left on the board, then the tablebase makes the moves.

Which one of these actually takes place?

  • The initial position is won for white, but capturing the black queen is a severe blunder. No idea why black would surrender that... – Deduplicator Nov 24 '17 at 20:43
  • Currently I am not talking about the best moves, just an example. – Wais Kamal Nov 24 '17 at 22:33
12

play the game until six pieces

Stockfish doesn't do that, that's not what tablebase is for. Briefly, tablebase boosts engine search well before six-men position reached on the board.

Let's do an exercise, add the board 5 pieces. Now you have 10 pieces on the board, and it's not something you can find in any tablebase. However, during the engine search whenever Stockfish trades down to 6 pieces, it can instantly use the tablebase information. The tablebase information gives Stockfish whether's the position is a win/loss/drawn without ever going down to anything like 5 pieces. Therefore, the search is faster and more efficient.

EDIT:

The relevant code is https://github.com/official-stockfish/Stockfish/blob/master/src/search.cpp:

// Step 4a. Tablebase probe
if (!rootNode && TB::Cardinality)
{
    int piecesCount = pos.count<ALL_PIECES>();

    if (    piecesCount <= TB::Cardinality
        && (piecesCount <  TB::Cardinality || depth >= TB::ProbeDepth)
        &&  pos.rule50_count() == 0
        && !pos.can_castle(ANY_CASTLING))
    {

ProbeDepth is by default 6. Stockfish checks how many pieces, if it's no more than 6 it consults the tablebase information. Otherwise, regular search.

  • So does stockfish consult the tablebase prior to reaching a position with 6 pieces on the board? – Wais Kamal Nov 24 '17 at 8:21
  • @WaisKamal I updated with relevant code. SF does the checking. – SmallChess Nov 24 '17 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.