Saturday, 1 February 2014

Shredder Classic 4 in Arena 3.0

I wondered whether it was possible to get the Shredder Classic 4 engine working in Arena 3.0. The engine has a reputation for a human playing style, and should be a good choice of sparring partner, when I get the interface to the Novag Citrine working. I was not all that hopeful, because the Shredder 12 UCI is sold as a premium product. I found c:/ Programs (x86) / ShredderChess / Shredder Classic 4 / EngineClassic4, and successfully loaded it into Arena 3.0. It runs well, and allows an Elo level to be set. It does not, however, use  its own book. I decided to download the free Hiarcs Lite opening book:

http://www.hiarcs.com/chess-opening-book-free.htm

"HIARCS Reference Book Lite ABK format (12Mb) - for use under PC Windows Arena GUIs. An opening book reference including statistics from 62,664 top quality human games up to 2009. Includes human games >= 2550 Elo up to 2009. It excludes correspondence and computer games. Not tuned or intended for computer play - please use HIARCS own engine book for that."

This looks like a good opening book for my sparring partner. I set minimum percentage scores of 50% for White and 40% for black in Arena, which seemed like a good idea, but left the weights unchanged. It is not clear to me how the weighting formula works anyway. There is not a lot of detail in this book, but it is much more comprehensive than the Citrine's book, and I have got Chessbase Online on my iPad. What I do not have is an opening book generated from the games of lessor players!

Thursday, 23 January 2014

Stockfish DD with the Shredder Interface

Having got Stockfish DD working in Arena 3.0, I decided to install it in the Shredder user interface, which is common to my Shredder Classic 4, and the more expensive Shredder UCI and Deep Shredder. Please see my previous article for the details of downloading Stockfish DD and setting up the necessary files. To install Stockfish DD, select Extras → Engines → Install Engine, select UCI Engine, click OK, set Engine to the path name of the Stockfish DD executable, and click OK again.

Shredder describes the newly installed engine as Stockfish DD 64 bit SSE4.2 (1024 MB), and recognises the two CPUs on my PC. I set Threads to 2 in Extras→ Engines → Engine Options, which can also be reached by Extras → Options → Engine Options. I ticked Use Engine Book in Extras → Options → Book Options. The hash table size was already set to 1024 MB in Extras → Engines → Hash Tables. The engine currently in use can be changed by right clicking in the analysis pane at the bottom of the window and selecting Change Engine.

When I restarted Shredder, the number of threads was set back to 1, and the CPU usage dropped correspondingly.  I sent an email requesting help to support at shredderchess. Stefan Meyer-Kahlen responded very quickly. The cause of my problem was that Stockfish was telling Shredder that it wants one thread rather than two, despite my setting in the polyglot file. I set the number of threads to 2, clicked the Create Engine... button at the bottom of Engine Options, and saved the new engine as Shredder DD 2 CPU. This new engine kept the two threads on shutdown.

The Shredder board is a little less attractive than the Arena board:


This screen shot shows the results of Analyse Game for a game that I imported from the clipboard. Shredder incorrectly calls the bar chart showing the engine's evaluation after each move a histogram, which confused me until I read the manual very carefully. When in the opening book, the moves pane shows ratings and rating performances in addition to the percentage scores for each choice of move:


Nonetheless, Chessbase Online on my iPad has access to a much larger database. The Shredder Classic 4 User Manual can be found at:

http://www.shredderchess.com/chess-program/shredder-classic-4-windows.html

This manual is much clearer than the Arena Help text, largely because the Shredder interface is more standard and less confusing. I find Shredder easier to use than Arena 3.0 and less troublesome. It also appears to have much fewer bugs. It has less features, but is likely to satisfy most player's needs. You get regular on-line updates, and the support is good. The Shredder engine has a reputation for having a more human playing style than most engines, and playing a better simulation of a weaker human player. Currently, even Deep Shredder is about 200 ELO points weaker than the strongest engines, and Shredder Classic 4 is about 200 points weaker still on a 2 CPU machine (which is about 60 ELO points weaker than a 4 CPU machine). (See CCRL and CCRL Shredder.) Nonetheless, it is still very strong by human standards, and you can easily add other engines and opening books. Shredder Classic 4 is well worth considering at EUR 29.99. I am still using it.

Wednesday, 15 January 2014

Stockfish DD in Arena 3.0

I have got Stockfish DD and its opening book working in Arena 3.0. Stockfish DD is currently one of the strongest chess engines on the PC, and could even be the strongest. It is a free open source program. Arena is a free graphical user interface for chess. Arena 3.0 was the latest version of Arena when I downloaded it. Arena 3.5 was released a few days later, but perhaps I am better off with the older version for now. I hit some problems, so I have decided to write an idiots' guide, both for my own future reference, and to help others.

Arena Basics

Arena can be downloaded from:

http://www.playwitharena.com/

I did not have any problems installing Arena 3.0, or customising the appearance, so I will not dwell on that. Arena was installed by default in the directory c:/ Program Files (x86) / Arena. The Arena interface looks very attractive:


(You can click on these diagrams to enlarge them.)  You can start a new game with Game → New, and move the pieces by dragging and dropping them. The buttons under the move pane are:


The first four buttons in green advance and take back moves. The cog button instructs the engine to calculate, make a move and continue playing that colour. The Analyse button starts continuous analysis, and the Edit button allows the user to make moves for both sides. (When either of the last two buttons is clicked, it gains gains colour and an outline to indicate that it has been selected. The Demo button causes the engine to play against itself. When it is clicked, the cog button turns into a red X. Clicking this X stops the engine playing against itself.) The options at the bottom of the Game and Position menus allow PGN and FEN to be imported and exported from the clipboard.

Levels → Adjust allows a fixed time per move to be set. Levels → "Limit Playing Strength to Elo" can be used to weaken the Engine. This works for the 32 bit and 64 bit versions of Rybka supplied with Arena, but is greyed out for the other supplied engines, and Stockfish DD. (The time allowed for any engine can be reduced by a percentage, by clicking on Engine → Manage, selecting the Details tab and the Special sub-tab.) The engine can be prevented from thinking on your time by right clicking the mouse in the engine analysis pane at the bottom of the Arena window, and ensuring that Ponder is not ticked.

Installing Stockfish DD

There are no detailed instructions for installing Stockfish, but I got some much needed help from:

http://support.stockfishchess.org/discussions

Stockfish DD and its opening book can be downloaded from:

http://stockfishchess.org/download/

The download stockfish-dd-win, contains the directories:

src
src_c11
Windows

and the files:

Copying
polyglot
Readme

The directory Windows contains the files:

stockfish-dd-32
stockfish-dd-64-modern

The opening book download stockfish-231-book contains the file Book.bin.

The file readme has a .md extension, and I could not read it, but I found this on the web:

https://github.com/mcostalba/Stockfish/blob/master/Readme.md

I set up a directory called Stockfish Chess in c:/ Program Files (x86) / Stockfish Chess, and copied polyglot, Book.bin and stockfish-dd-64-modern into this directory.

My laptop has an Intel Core i3 processor (which has 2 cores and 4 threads), 3 GB of main memory and runs 64 bit Windows 7 Home Premium. The polyglot file has the default settings Threads = 1, Hash = 128 and OwnBook = false. The advice is to set Threads to the number of processor cores rather than the number of threads. I set Threads = 2. The hash table size is in MB. I set Hash = 1024. I also set OwnBook = true.

To install Stockfish DD in Arena, select Engines → Install New Engine... Set File Name to the path name of the engine program, and click Open.

(N.B. With these settings, I find that, when I run Stockfish DD, the CPU usage is typically 50%, with memory usage at just over 2GB. Arena shows the hash table usage as 0%. However, it also shows the CPU utilisation of the engine as 0%, which is certainly not true.)

Arena Engine Configuration

Right clicking the mouse in the engine analysis pane at the bottom of the Arena window, and clicking Configure Stockfish DD, brings up the dialogue:


I set the number of threads to 2, the hash table size to 1024 and ticked Own Book, mirroring my selections in the polyglot file.

Opening Books with Arena

Arena opening books are stored by default in the directory c:/ Program Files (x86) / Arena / Books. You can select one of them as the current Arena Main Book using Book → Manage, which brings up the dialogue:


You can use the Load button to select the book, and tick the Use Arena Main Book box to activate it.

There is a well hidden tick box for selecting the Arena Main Book rather than Stockfish's own book. Select Engines → Manage. Select the Details tab, click on the line for Stockfish DD, and select the Books sub-tab. This reveals a tick box labelled "Use Arena Main Books with this Engine." When Own Book is ticked, as described above:

* When "Use Arena Main Books with this Engine" is ticked, Stockfish uses the Arena Main Book to make its moves, and Arena also displays it in the move pane when Book/TB is selected.

* When "Use Arena Main Books with this Engine is not ticked, Stockfish uses its own book to make moves. Nonetheless, when the Book/TB tab is selected, the Arena Main Book is displayed. This is confusing, but it is also helpful because the Stockfish book is invisible to the user.

When Own Book is not ticked, but "Use Arena Main Books with this Engine is ticked, Stockfish uses the Arena Main Book, as we would expect. When neither box is ticked, Stockfish does not use a book at all. (The Arena engine configuration appears to override that in the polyglot file.)

Analysing a Game with Arena

I had a problem getting Arena to analyse a game, and generate a graph of the engine's evaluation of the position throughout the game. The key ingredient is to click Engines → Automatic Analysis, select the Output tab, and tick the "Save calculated values in game" box. You can then click the Start button on the Source tab to populate the graph. (Clicking to the right of the Permanent Statistics graph toggles it on and off, and right clicking on the graph itself brings up some options. Left clicking on the graph selects a move.)

Verdict

Stockfish DD is much faster on my PC than it is on the iPad. I found that Arena 3.0 frequently crashed or otherwise misbehaved, but I did not encounter any show stoppers. Arena mostly worked well, but was not easy to learn. There is no user manual, and the help text is often unclear and difficult to follow. There are a huge number of options; and the interface is not very intuitive, and sometimes does not follow the usual conventions. I persevered with Arena because it is the only interface that will connect to my Novag Citrine. That is however, still a future project. I am still making good use of the Citrine's on-board engine as a sparring partner.