
Legal details
-------------

Fruit 1.0 Copyright 2004 Fabien Letouzey.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA

See the file "COPYING" for details.


General
-------

Today is 2004/03/17.  This is Fruit 1.0 (Cherry).

Fruit is a UCI-only chess engine.  This distribution comes up with a
Windows executable and platform-independent source code.

Sorry that "Fruit" looks like "Fritz" (it certainly sounds different
in English).  This is certainly unintentional (or is it?) :)


Official distribution URL
-------------------------

The official distribution web site is Leo Dijksman's WBEC Ridderkerk:
http://wbec-ridderkerk.nl/  This is where you should be looking for
Fruit updates in the future.


Compiling
---------

Fruit was developed on Linux using g++ (the GNU C++ compiler).

The source code has also been successfully compiled on Windows using
both MSVC and Intel C++ compilers.  Minor problems have been reported
on MacOS X (problems in the system header files; a work-around
involving changing the order of #include directives in Fruit's source
code was used).  I do not know about FreeBSD/OpenBSD/NetBSD or other
POSIX-compliant operating systems, but I don't expect many problems.

If you had problems getting Fruit compiled on your system, but somehow
managed it in the end, please let me know what changes were necessary
(see the README files for contact details).

At the very least, you should use the "-O2" option.
> g++ -O2 -o fruit *.cpp

These are the options I use:
> g++ -O3 -fomit-frame-pointer -fstrict-aliasing -fno-exceptions -fno-rtti -o fruit *.cpp
You will also want to add a suitable CPU option, for example
"-mcpu=athlon-xp".

If you know better options for g++ please let me know.  I will add a
benchmark feature in the future so that speed can be tested from the
command line.


Design goals
------------

Fruit was designed to help with the study of game-tree search
algorithms, in the special case of chess.  It is now released as a
chess engine, which is a somewhat different type of program.

Many design choices in Fruit were affected by "design goals" I had
chosen before writing the code.

For instance, I try to reduce the code size and prevent Fruit from
using more memory than is necessary (tables whose size can be
arbitrarily reduced such as the transposition table do not count).  I
intend to focus mainly on this aspect for the next version of Fruit
(for example by removing code that is not needed, and reducing
stack-size requirements).  Note here that I do not have special plans
to port Fruit onto PDAs, although this should be rather easy (in the
future!) for 32-bit platforms (but 16-bit ones are dying anyway).

About the playing style, I would like Fruit to play positional games
focusing mainly on pawn structure defects.  It is however possible
that playing style becomes a selectable option in the future, as long
as little extra code is needed (for example by giving large bonuses to
advanced pieces, making Fruit less passive).


XBoard / Winboard
-----------------

Fruit is a UCI-only engine.  This might change in the future.

If you don't have access to any UCI GUI, do not despair.  I am working
on a UCI adapter that makes it possible to use Fruit with XBoard,
which should be available for your system.  I hope to make PolyGlot
available around the end of march 2004.


Opening book
------------

Fruit 1.0 comes without an opening book.  This would have been too
much work for a "quick" release.  I'd like to think that users will be
happy to provide Fruit with home-made books however.

Also I don't have the expertise required to make one myself.


Tablebases
----------

Fruit does not use the so-called Nalimov tablebases, sorry for that.
This is unlikely to change in the future.

The reasons for my decision are:

- the source code by Eugene Nalimov is not "free of use" (although you
  don't have to pay for it)

- the design of the code does not work well with Fruit's "small memory
  footprint" requirement (for example the executable file would be twice
  as large with the TB code).

It must be said though that I have great respect for Eugene's
contribution to the computer-chess community.

As for Fruit I plan on using selected "bitbases" in the (far) future.


UCI options
-----------

You are advised to skip this section unless you are completely crazy
about computer chess.

Here I give you another chance to skip the section, as you should not
be reading this ...

- "Log" (true/false, default: false)

Use a log file?  This is not very useful in this version because fruit
only "logs" the UCI traffic, not internal events.

- "LogFile" (string, default: fruit.log)

The name of the file.

- "Aspiration Search" (true/false, default: false)

Using this might make Fruit search slightly faster.  Not tested
thoroughly!

- "Aspiration Window" (1-300 centipawns, default: 50)

A fine-tuning parameter for the option above.  I am not qualified to
recommend a value, but too small a value can hurt a lot.

- "Complete PV" (true/false, default: true)

When activated, the engine does not read hash-table *scores* at PV
nodes.  One effect is that the PV line is never truncated (it has
other effects too, of course).  Set to false to make Fruit use these
scores as other engines do.

- "NullMove" ("Always"/"Fail High"/"Never", default: "Fail High")

"Always" actually means the usual conditions (not in check, etc ...).
"Fail High" adds the condition that the static evaluation fails high.
Never use "Never" (ever)!

I expect that this option has little effect (assuming the first two
choices only).  I only added it because most engines do not use the
fail-high condition.

Independently of this option, verification search is used in the
endgame.

- "NullMove Reduction" (1-3 plies, default: 3)

3 is rather aggressive, especially in the endgame.  It is possible
that 2 leads to safer play.

- "PawnPush Extension" (true/false, default: false)

A common extension in other engines (pawns to 7th rank).  Activating
it would probably make Fruit stronger in the endgame.

- "SingleReply Extension" (true/false, default: false)

Another common extension.  Give it a try if Fruit gets checkmated too
often :) It also helps detecting draws by perpetual checks.

- "Checks in Quiescence" ("Always"/"After NullMove"/"Never", default:
"Always")

Note that Fruit only tries checks at the first ply of the quiescence
in this version.  "Always" was selected as the default because it
seemed like the "safe bet".  "After NullMove" might be a better
choice.  I also recommend against using "Never" here, because Fruit
has few tactical extensions, and no mate-threat detection.


History
-------

Fruit was written in early 2003, then hibernated for many months.  I
suddenly decided to remove some dust from it and release it after
seeing the great WBEC web site by Leo Dijksman!  Note that Fruit is
nowhere near ready to compete there because of the lack of xboard
support and opening book.

2004/03/17 Fruit 1.0 first stable release

Fruit 1.0 is as close to the original program as possible, with the
main exception of added UCI-handling code (Fruit was using a private
protocol before).  It is a very incomplete program, released "as is",
before I start heavily modifying the code (for good or bad).

You can find a succinct description of some algorithms that Fruit uses
in the file "TECHNICAL" (don't expect much).


Future?
-------

The future of Fruit is very uncertain.

I plan to release a cleaned-up version 1.1 (no idea when though), with
all unused/useless code removed (I want to remove some "optimised"
code that makes Fruit much larger than it should be).  This will most
likely result in a small speed drop, but I hope that this will be more
than compensated by the addition of some new features as described
below.

Fruit has so little chess knowledge that I hope a few "simple"
enhancements are going to improve the strength although nothing
spectacular is expected.  My general procedure will most likely be
watching Fruit playing games, and trying to recognise general mistake
"patterns" (I have already noticed a few).  I am talking about the
evaluation function here; if Fruit gets consistently outsearched I
will conclude that the opponent is too strong and move on to something
more productive (Pepito comes to mind for some reason) :)

Priorities will include adding:

- basic knowledge about drawn (also drawish?) endgames

- a bit of "material tuning", like "2 minors > R+P" or "don't exchange
  pieces when behind"

- selected features (depending on experimental results); for example
  "bad bishops", "rooks on open files", "doubled rooks on 7th ranks" or
  "connected passed pawns" (yes, Fruit has none of those!).

- a "smart" time management such as spending less time on "obvious"
  moves and more time when the score drops for instance

In the long term, I intend to work on the pawn-evaluation code.

I will also try to prevent Fruit from becoming too similar to other
engines.  This means that I will want to keep features even if they
hurt Fruit's results, as they would give Fruit a "personality".

I hope that I will be able to use original (as in "not too common")
ideas in move ordering and the quiescence search, although I can't be
optimistic.


Known bugs
----------

The following are all problems in the UCI-handling code:

The hash-table size can only be set at startup time (when Fruit is
loaded into the interface).  Fruit will ignore any subsequent requests
to change the size.  This is a bug due to my own laziness and not a
lame attempt to counter cripple-chess variants popular in some
interfaces.

Fruit might interrupt the search before the time limit is reached even
when in "movetime" mode.  This makes it harder to submit test suites
to Fruit in an automated manner.  This problem is due to Fruit
thinking it is playing a game in tournament conditions at all times.

The UCI "searchmoves" option of the "go" commands is not supported at
all.  I do not know when this option is used by interfaces but I think
it is only in special circumstances such as "find the second-best
move".

These problems should be fixed in version 1.1


Thanks
------

Big thanks go to:

- Dann Corbit for making Fruit Windows-compatible and spending a lot
  of time compiling, testing, making files available, giving improvement
  ideas, etc ...

- Leo Dijksman for hosting the Fruit distribution on his web site (see
  Links)

- Ingo Bauer for UCI testing of professional quality!

- Tord Romstad for testing MacOS X compatibility, and also Gothmog for
  giving back Fruit's king after capturing it.

- Aaron Gordon for his help in the past and in the future ...

Of course a "thanks" section is never complete, as for instance I
received a lot of help from CCC users (mostly via the search engine).


Links
-----

- engine lists and much more:

Leo Dijksman's WBEC Ridderkerk: http://wbec-ridderkerk.nl/
Alex Schmidt's UCIengines.de: http://www.uciengines.de/

- free chess GUIs:

Tim Mann's Chess Pages: http://www.tim-mann.org/xboard.html
Frank Quisinsky's Chess Page: http://www.amateurschach.de/_menue.htm

- computer-chess forums:

The Computer Chess Club (CCC): http://www.talkchess.com/
Volker Pittlik's Winboard Forum: http://f11.parsimony.net/forum16635/

- mostly programmer stuff (if you have several lives to spend):

Dann Corbit's FTP: ftp://cap.connx.com (do *not* use passive mode)

Sorry for the dozens I simply had to leave away (but you know them if
you went that far) ...


Contact me
----------

My name is Fabien Letouzey.  I am a 32-year-old frenchman, and live in
Cambridge UK at the moment.  Fruit is not my first chess engine, and I
also write programs for Othello, international draughts and recently
Awari.

You can contact me at fabien_letouzey@hotmail.com

Especially welcome are (not necessarily in order of importance):

- "Fruit Fan Club" T-shirts (which, rather surprisingly, seem hard to
  find at the moment)

- additional source code that give 500 extra Elo points (one liners
  preferred)

- Arena for Linux (without emulator)

Especially not welcome are reports of matches against Shredder that
Fruit lost 1000-0.


The end
-------

Thanks for listening, and have fun with Fruit!

Fabien Letouzey, 2004/03/17.

