Skip to main content
17 votes
Accepted

Returning scores for all possible moves from a chess engine

Of course there's a way: I'm going to show you one way of doing it on your own, using only free software. We'll write a small script in Python (I'm using v2.7) and only use the wonderful python-chess ...
Ellie's user avatar
  • 12k
8 votes
Accepted

What exactly means centipawns field in stockfish/uci output?

It's the score of the current position, but it is computed by static evaluation (i.e. counting pieces, pawns, pawn structure, king safety, mobility, etc.) of positions arising in the program's search ...
Glorfindel's user avatar
  • 24.9k
8 votes
Accepted

Why does Stockfish give a negative score in a theoretical win for white?

Because Black is to move, and for Black the position is evaluated as being 42.76 pawns behind.
Glorfindel's user avatar
  • 24.9k
8 votes
Accepted

Reasonable engines to test against (Not StockFish)

Since your engine supports UCI, I would suggest checking out lichess.org. You can make a BOT account there and test against several other BOTs and people as well! Also, you can get your BOT rated in ...
Laschet Jain's user avatar
7 votes
Accepted

I'm confused by UCI Pondering and Time Control

First the GUI sends the position string with the ponder move as the last move in this string. Then the GUI sends "go ponder". This makes little sense to me, but UCI is very much a kludge. Note that ...
Post-It-Note's user avatar
7 votes
Accepted

how does a uci engine draw or resign?

UCI chess engines don't offer/accept a draw, nor resign a position. This is the GUI's responsibility. You are welcome to add new uci options (setoption and option) for your engine, but don't expect ...
SmallChess's user avatar
  • 22.5k
6 votes
Accepted

Is there a list of hidden/deleted Stockfish commands?

Look at the source code: https://github.com/official-stockfish/Stockfish/blob/master/src/uci.cpp // Additional custom non-UCI commands, mainly for debugging else if (token == "flip") pos....
SmallChess's user avatar
  • 22.5k
6 votes

Reading PGN files using thr Stockfish engine

Stockfish is an engine that's called by apps that read PGN files, it doesn't read the PGN data itself. There are many very good free apps that can read PGN files and analyse the games they contain ...
Edward Little's user avatar
6 votes

Piping Stockfish input

Solution: Use 'expect' script as shown below. Tested with stockfish_8_x64_modern. BlindKungFuMaster: "I think the main problem is that the uci protocol is a dialog." I agree! #!/usr/bin/...
Alexey Lvov's user avatar
6 votes
Accepted

Weird Stockfish UCI output for d2d4 before and after

Stockfish is an engine that follows the UCI protocol. In this protocol, the score shown is from the side point of view (SPOV) and not white point of view (WPOV). When you push d2d4, the side to move ...
ferdy's user avatar
  • 4,115
4 votes

How can I know the Elo rating of my chess engine?

Lichess.org has a bot API and allows bot accounts to play rated games against human players. See this article.
Eric Jiang's user avatar
4 votes

Is there a list of hidden/deleted Stockfish commands?

I have created this gist which is the best documentation I could find - most links I found where dead https://gist.github.com/aliostad/f4470274f39d29b788c1b09519e67372
Aliostad's user avatar
  • 141
4 votes
Accepted

Stockfish: Engine suddenly changed the side?

The reason is very simple: position startpos moves e2e4 d7d6 d2d4 e7e6 g1f3 c8d7 f1d3 h7h6 e1g1 c7c5 f1e1 e8f8 This is invalid. The position before e8f8 is: e8f8 is invalid because Black has a ...
SmallChess's user avatar
  • 22.5k
4 votes
Accepted

How to use the Ponder option in stockfish / UCI

The only purpose of the "Ponder" UCI option in Stockfish is to inform the engine about that you will use pondering so that it can consider this fact in its time management, as can be seen in https://...
Fabian Fichter's user avatar
4 votes
Accepted

When to use Clear Hash

If your goal is to get the highest quality of analysis, then the short answer is "never". The reason is that if you analyze similar positions within a game, then the existing hash table entries can ...
Fabian Fichter's user avatar
4 votes
Accepted

Python script to let stockfish selfplay 10 games from a given position

This should get you started, up to you to add extra features based on your objective (such as saving the games and moves, etc.) import chess import chess.engine import os import sys arguments = sys....
Ellie's user avatar
  • 12k
4 votes
Accepted

Why is stockfish not accepting my move?

There is an issue with the syntax you are using. According to the UCI protocol you should use position startpos moves e2e4, i.e., the moves keyword is missing in your command.
Fabian Fichter's user avatar
4 votes
Accepted

Unable To Communicate with UCI through Java Program

info depth 1 seldepth 1 multipv 1 score cp 539 nodes 83 nps 41500 tbhits 0 time 2 pv e5f6 info depth 2 seldepth 2 multipv 1 score cp 790 nodes 182 nps 91000 tbhits 0 time 2 pv e4d5 b7b6 e5f6 obviously ...
SmallChess's user avatar
  • 22.5k
4 votes
Accepted

Obtain information about a a position from Stockfish

If you do not want to use a library/API to get this information, then you will need to implement some parsing to get it, but in principle (almost) all the info you need is available via (non-standard) ...
Fabian Fichter's user avatar
4 votes
Accepted

UCI Play Colors

The engine receives a position command. Example 1: position startpos In startpos, the side to move is white. The startpos is just equal to a fen: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - ...
ferdy's user avatar
  • 4,115
4 votes

How to tell which engine is going to play white or black in UCI Protocol?

In uci protocol, there is a command position <info> that is sent to the engine. This command has an info which side to play. Example: position startpos That tells the engine to play white ...
ferdy's user avatar
  • 4,115
3 votes

How do UCI chess engines handle the 50-move or threefold repetition rules when playing against other engines?

Drawing is usually done by the hosting application / GUI. Stockfish even has a nasty bug producing totally ridiculous moves if you play on after move 50. BTW, UCI does not specify offering a draw, ...
Jens's user avatar
  • 246
3 votes

How do UCI chess engines handle the 50-move or threefold repetition rules when playing against other engines?

Your engine doesn't need to offer a draw. This is the responsibility for GUI. A good GUI should stop the game for 50 moves or three-repetition. If you want to run game matches, try: https://github....
SmallChess's user avatar
  • 22.5k
3 votes

SAN for nullmove?

Νικόλαος Μανωλακος asked: What would the SAN representation [of a null move] be? Several possibilities present themselves as to what the SAN notation can be, but none that I have found claim to be ...
Charles Rockafellor's user avatar
3 votes
Accepted

How to read score from stockfish - inconsistent response every call?

The reason is simple - hashing. The first time you run the analysis, the engine stored the computed positions in a hash-table. This table was not clear the next time you run the analysis. Next time, ...
SmallChess's user avatar
  • 22.5k
3 votes

Why am I getting different behaviour between using stockfish as a child node process and a CLI called process?

It was me who suggested you to come here because you'd need to understand what's happening. The guys on Stackoverflow wouldn't have the knolwedge to answer you. Firstly, this is definitely your fault ...
SmallChess's user avatar
  • 22.5k
3 votes

How to connect a UCI chess engine play on FICS?

I use ChessPartner 6.0.4.3 r.click in the Internet Console and choose Properties Autoseek Cmd: getgame\n Login script: set chanoff 1 set silence 1 set tell 0 set formula !computer & !...
Floppy's user avatar
  • 31
3 votes

Reading PGN files using thr Stockfish engine

You can use 2 programs to do that. Use pgn-extract to format the pgn files in a good format. This pgn-extract is available at this url: download pgn-extract You need this CLI tool: UCI analyzer ...
Olivier Roset's user avatar
3 votes

Reasonable engines to test against (Not StockFish)

http://computer-chess.org/doku.php?id=computer_chess:wiki:lists:chess_engine_list Arasan GreKo Crafty Rodent Toga etc
SmallChess's user avatar
  • 22.5k
3 votes
Accepted

Can all UCI engines output a FEN for the current position or is it just StockFish?

From reading various chess source codes, mostly before 2005, I can state that most don't a FEN output. Any that would allow for a non-starting position should accept FEN, as it's just a special form ...
Mike Jones's user avatar
  • 5,170

Only top scored, non community-wiki answers of a minimum length are eligible