1. Introduction
---------------

Glaurung is a free UCI chess engine.  It is not a complete chess
program, but requires some UCI compatible GUI (like XBoard with
PolyGlot, eboard, Jos, Arena, Sigma Chess, Shredder, Chess Partner,
or Fritz) in order to be used comfortably.  Read the documentation for
your GUI of choice for information about how to use Glaurung with your
GUI.

Glaurung Lodz 2007 (32-bit unofficial Windows version) is the same 
engine which won the recent 6th Open Polish Computer Chess Championship.
Glaurung Lodz 2007 is actually very close to Glaurung 2 - e/5; the only 
changes worth mentioning are some new endgame knowledge for KRP vs KR 
and KRPP vs KRP endgames, a very minor improvement in passed pawn 
evaluation, and slightly more intelligent time managment in ponder on 
games.
 
Glaurung 2-epsilon/5 ("two minus epsilon fifths", or "two minus
epsilon divided by five") is a development version of Glaurung 2, a
complete rewrite of Glaurung.  It is still far from complete, and
lacks many important features.  It is also likely to not be entirely
stable, especially when running in Microsoft Windows.  For most users,
it is probably advisable to keep using the old Glaurung 1.2.1 until
the rewritten program grows more mature.

Beginning with version 2-epsilon/3, Glaurung has support for up to 
four CPUs.  Because the program currently cannot automatically detect
the number of CPUs on your computer, it uses only a single search thread
by default.  If your computer has two or more CPUs (this includes
dual-core CPUs like the Intel Core Duo or the AMD Athlon 64 X2), you
should set the "Threads" UCI parameter to the number of CPUs to obtain 
optimal performance.


2. Files
--------

This distribution of Glaurung consists of the following files:

  * Readme.txt, the file you are currently reading.

  * Copying.txt, a text file containing the GNU General Public
    License.

  * src/, a subdirectory containing the full source code, including a
    Makefile that can be used to compile Glaurung on Unix-like
    systems.  For further information about how to compile Glaurung
    yourself, read section 4 below.

  * Windows/, a subdirectory containing 32-bit and 64-bit Windows
    executables.

  * polyglot.ini, for using Glaurung with Fabien Letouzey's PolyGlot
    adapter.


3. Opening books
----------------

This version of Glaurung has experimental support for PolyGlot opening
books.  For information about how to create such books, consult the
PolyGlot documentation.  Currently, Glaurung requires that the book
file is named book.bin and is placed in Glaurung's working directory.


4. Compiling it yourself
------------------------

On Unix-like systems, it should usually be possible to compile
Glaurung directly from the source code with the included Makefile.
The exception is computer with big-endian CPUs, like PowerPC
Macintoshes.  Some of the bitboard routines in the current version of
Glaurung are endianness-sensitive, and won't work on a big-endian CPU.
Commenting out the line with "#define USE_32BIT_ATTACKS" near the
beginning of bitboard.h should solve this problem.

There is also a problem with compiling Glaurung on certain 64-bit 
systems, regardless of the endianness.  If Glaurung segfaults 
immediately after startup, try to comment out the line with 
"#define USE_FOLDED_BITSCAN" near the beginning of bitboard.h and
recompile.

Finally, even if Glaurung does work without any changes on your 64-bit
system, undefining USE_32BIT_ATTACKS and/or USE_FOLDED_BITSCAN may be
worth trying.  It is possible that this will give a slightly faster
executable.  On 32-bit systems, the default settings are probably
best.


5. History
----------

2007-05-06: Glaurung 2 - epsilon
--------------------------------

The first public release, and the first version of my new program
which is able to match the old Glaurung 1.2.1 on a single CPU.  Lots
of features and chess knowledge is still missing.

2007-05-10: Glaurung 2 - epsilon/2
----------------------------------

This version is very close to 2 - epsilon.  The major changes are:

  * A number of compatibility problems which appeared when trying to
    compile Glaurung 2 - epsilon on various operating systems and CPUs
    have been solved.

  * Fixed a major bug in the detection of rooks trapped inside a
    friendly king.

  * Added knowledge about several types of drawn endgames.

  * Fixed a few FRC related bugs.  FRC now works, but because of
    serious holes in the evaluation function the program plays very
    badly.

  * A slightly more sophisticated king safety evaluation.

2007-06-07: Glaurung 2 - epsilon/3
----------------------------------

The first public version with support for multiple CPUs.  Unless you
have a dual-core (or better) computer, use Glaurung with a PolyGlot
book, or runs games with ponder on, you may want to skip this version,
which is almost certainly no stronger than 2 - epsilon/2 when running
on a single CPU.  The main changes compared to the previous version
are:

  * Parallel search, with support for 1-4 CPUs.  The program currently
    always allocates a separate pawn hash table and material hash
    table for four threads, which is a pure waste of RAM if your
    computer has just a single CPU.  This will be fixed in a future
    version.

  * Fixed a bug in book randomization.  When using Polyglot books, the
    previous version would always select exactly the same move in the
    same position after a restart of the program.  Thanks to Pavel
    Hse for pointing this out.

  * Fixed a UCI pondering bug: Glaurung no longer instantly prints its
    best move when the maximum depth is reached during a ponder
    search, as the previous version did.  According to the UCI
    protocol, it is not allowed to print the best move before the
    engine has received the "stop" or "quit" command.

  * Additional search information:  The new version displays hash
    saturation and the current line(s) of search.

  * Several minor bug fixes and optimizations in the search and
    evaluation. 

2007-06-08: Glaurung 2 - epsilon/4
----------------------------------

A bugfix release, with only a single important change:

   * Fixed a very serious pondering bug.  As pointed out by Marc
     Lacrosse, the previous version would lose on time in almost every
     single game with pondering enabled.  The new version handles
     pondering correctly (or so I hope).  When playing with ponder
     off, the new version is identical to version 2 - epsilon/3.

2007-06-25: Glaurung 2 - epsilon/5
----------------------------------

Another minor update, including the following improvements and bug
fixes:

   * As Werner Schle discovered, the previous version would sometimes
     stop thinking and lose on time right before delivering checkmate
     (which is of course a very unfortunate moment to lose on time).
     I haven't been able to reproduce Werner's problem on my computer
     (probably because I run a different OS), but I have fixed the bug
     which I suspect caused the time losses.  I hope the time losses
     will no longer occur with 2 - epsilon/5.

   * The program is now slightly less resource-hungry on computers
     with less than 4 CPU cores: The previous version would always
     allocated separate pawn and material hash tables for four
     threads, even when running on a single-core CPU.  The new version
     only allocates pawn and material hash tables for the threads
     which are actually used.

   * A minor reorganization of the memory layout has made the parallel
     search about 10% more efficient (at least on my computer, but the
     results are likely to vary considerably on different systems).

   * The Intel Mac OS X binary is much faster than before, thanks to
     the Intel C++ compiler (previous versions were compiled with
     GCC).

   * A few other very minor bug fixes and enhancements.


6. Terms of use
---------------

Glaurung is free, and distributed under the GNU General Public License
(GPL).  Essentially, this means that you are free to do almost exactly
what you want with the program, including distributing it among your
friends, making it available for download from your web site, selling
it (either by itself or as part of some bigger software package), or
using it as the starting point for a software project of your own.

The only real limitation is that whenever you distribute Glaurung in
some way, you must always include the full source code, or a pointer
to where the source code can be found.  If you make any changes to the
source code, these changes must also be made available under the GPL.

For full details, read the copy of the GPL found in the file named
Copying.txt.


7. Feedback
-----------

The author's e-mail address is tord@glaurungchess.com
