Sidonia Chess Programs  Online Documentation Incomplete First Draft
Chess Engine, Chess Interpreter, Game recorder, Game analysis
Sidonia_Engine

Introduction

The first, and most important component of the Sidonia project is the chess engine. The chess engine is a text based Windows program and it plays chess by receiving opponents move information and replying with the engine's move.

Chess engines are normally used with a graphic user interface (GUI) to draw the pieces, eg Arena. There are many chess engines with various playing strengths, and they usually conform to one of a couple of interface specifications.

A chess GUI usually comes with a chess engine of its own, to ensure that users of the GUI can play chess the moment the GUI is installed. In addition, they usually allow further chess engines (like Sidonia, but also Stockfish, Gaviota, etc) to be installed.

Downloading

Download as part of the whole Sidonia project.

Installing

Storing Sidonia

Sidonia.exe is a simple executable file, and you can put it in any directory you like. If you are using Arena as a GUI, I suggest putting it in a new directory called something like

C:\Program Files (x86)\Arena3\Engines\Sidonia

in the same sort of way as other engines would be stored, eg stockfish might be in

C:\Program Files (x86)\Arena3\Engines\stockfish

The exact directory name can depend on your operating systems version, where you installed it, and what GUI you are using.

You may find that Sidonia has DLLs for accessing RetroChess endgame tablebases, or FinalGen tablebases. Copy these to the same directory as the executable..

Running Sidonia from the command line

Once you have copied the executable to an appropriate location on your computer, you can test it runs using the command prompt command line interface started from the windows start menu.

cd "C:\Program Files (x86)\Arena3\Engines\Sidonia"
Sidonia.exe

The program should start running and depending on the version you may see a message like this

Sidonia version 0090

You can then quit the program by typing quit (and pressing enter of course).

quit

If you want to see a lot more text, you could try typing the command

uci

However these days chess engines are rarely run from the coomand line, they are run from GUIs so that people can see the pieces move. If you want to try running Sidonia as a coomand line program, it is worth reading either (or both) of the Chess Engine Protocol and Universal Chess Interface specifications, in order to know and understand the available commands. At the moment this manuak is being written as I discover the capabilities of the Doxygen documentation system.

Let the GUIs know about the chess engine

This applies to installing any new chess engine. You need to let the GUI know that the engine exists and where to find it. In Arena you will find the option to do this in the menus ...

Engines ... Install New Engine

It is likely that there will be 32 bit and 64 bit versions of the chess engine Sidonia and you will have to pick the one appropriate for your operating system and hardware. For example, on my 64 bit lpatop computer I select Sidonia0090_64bit.exe and it runs faster than Sidonia0090_32bit.exe due to the compiler using the processors 64 bit registers for passing parameters efficiently. On someone elses 32 bit laptop, I am forced to select Sidonia0090_32bit.exe as the 64 bit version cannot be executed.

Running Sidonia

Normally a chess engine is started by a Graphical User Interface (GUI) and the whole operation is invisible to the user. The user only normally sees the GUI and the moves the chess engine makes. The GUI may display analysis from the engine, either as a list of moves, or as a variation board. Again, this is done by communication between the GUI and the engine.

So the normal procedure for running Sidonia would be to start your chess GUI (eg Arena) and then to select Sidonia as the chess engine, instead of say Stockfish - which would give you a much harder game!

Below, there are some command line options which are supported by the Sidonia chess engine. However it is not envisaged that someone just trying to get a chess engine running for the first time worries their head about any command line options documented below. Most are obscure commands initially used for debugging (before the existence of the script interpreter) and are of doubtful use to anyone. They are documented here for the sake of completeness and for reference by the author.

Command line options

Running Sidonia from the command line

Starting Sidonia with a command line parameter of -help.

Sidonia0090_64bit.exe -help > help1.txt

produces a file containing

 Sidonia0090_64bit.exe usage:
 Sidonia0090_64bit.exe -hash  : determine the polyglot zobrish hash code for the position
 Sidonia0090_64bit.exe -depth : set the depth used for later options
 Sidonia0090_64bit.exe -moves : run a simple test of the move generator
 Sidonia0090_64bit.exe -perft : count nodes at the defined depth
 Sidonia0090_64bit.exe -pause : wait for user input
 Sidonia0090_64bit.exe -search: search for a move using iterative deepening
 Sidonia0090_64bit.exe -split : count nodes for each possible move
 Sidonia0090_64bit.exe -fen   : set the position used for later options
 Sidonia0090_64bit.exe -uci   : give the engine a uci command

This shows there are various command line options which have proven useful in the past for development and debugging. However, with the later development of the Sidonia Chess Interpreter, the sort of commands that have proved useful in the past, can now be combined in far more complicated and meaningful ways. So I suggest the command line options are not used, and the interpreter used instead. Here are some examples of command line options being used.

Sidonia -fen "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" -depth 2 -perft > perft2.txt

generates a file containing the line

 perft=400

Since a 2 ply deep search from the start position contains 400 possibilities, 20 * 20, as each player has 20 possible moves. 2 moves for each of 8 pawns makes 16 and 4 knight moves (2 for each knight).

At the moment the command is also generating some extra information that will perhaps be removed in the future. The full output for the command

 Sidonia -fen "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" -depth 6 -perft > perft6.txt

is

 rdtsc=2404FA8752AB7
 rdtsc=240532F7AC86E
 perft=119060324
 took 8 seconds
 rate=14882540 per second
 cycles per move 127

which shows some calculations based on the CPUs rdtsc instruction to give an idea of how many CPU clock cycles are required in move generation.

Some more command line examples.

 Sidonia -fen "4kbnr/4pppp/Bqbp4/3n4/3Q4/5N2/2P2PPP/1NB2RK1 w k - 0 19" -hash > hash.txt

produces the hexadecimal Polyglot hash code for the position (used as an index in Polyglot opening books)

 3C02227B6658CD1D

and

 Sidonia -fen "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" -depth 3 -split > split.txt

produces

 info string 20 moves a2a3 380,a2a4 420,b1c3 440,b1a3 400,b2b3 420,b2b4 421,c2c3 420,c2c4 441,d2d3 539,d2d4 560,e2e3 599,e2e4 600,f2f3 380,f2f4 401,g1h3 400,g1f3 440,g2g3 420,g2g4 421,h2h3 380,h2h4 420, = 8902
 total=8902

The perft command is frequently used when developing a chess move generator, to ensure that all legal moves and only legal moves are generated from any position. (Perft is now a standard term, but it originates from one software engineers performance test command.) Split is useful when a move generator is found to be faulty. The number of moves possible accorrding to one chess engine can then be compared to the number of moves generated by another.

To develop Sidonia I compared perft results and split results with those from a chess engine called Sharper.

How it works

This is not a software document, but here is an overview

dot_inline_dotgraph_1.png