Francesca - a chess playing program
===================================

(c) T.P.King 1991 - 2026
		
Disclaimer
==========

Francesca is a chess playing program. It has been
developed in my spare time over the last few years, and is
still in a very "rough and ready" form. Note that it comes
on an "as is" basis, with no guarantees whatsoever. If it 
breaks your computer, or does not function as you would like it 
to, tough!                     

Copyright
=========

This Winboard release of Francesca is copyrighted by the author,
but under terms that allow free distribution for non-commercial 
purposes. 

You are free to distribute the files which comprise this release,
for non-commercial purposes.

System Requirements
===================

Windows 7 or later, 64 bit with 256MB+ of RAM.

Opening Books
=============

Francesca has her own opening books, which aren't much good. You 
can use other books. To do this, remove (or rename) the book files
in Francesca's folder. Then, with the right interface (e.g. something
like Cutechess GUI), you can use other books.

Winboard Support
================

Francesca only supports Winboard at a very simple level. You can
play games against her, but many features such as setting up a 
position are not currently supported.

Author
======

Tom King,
U.K.

Email: tom@silentshark.co.uk
WWW: www.silentshark.co.uk

Getting up and going with the Winboard version of Francesca
===========================================================

1. Download the latest version of Tim Mann's Winboard program.

2. Install Winboard to the default location (c:\program files\winboard), 
chosing all the default options. 

3. Run Winboard, to check it is all working ok. Have a look at the 
Winboard help system, play some games, familiarize yourself.

4. Download the latest version of Francesca. 

5. Unzip Francesca to a folder, for instance c:\francesca

6. To configure Winboard so that it offers the option of using the Francesca 
engine when run, use notepad to edit the file c:\program files\winboard\winboard.ini.

7. Using notepad, In the "firstChessProgramNames" add an entry like this:

mad /fd=c:\francesca

and in the "secondChessProgramNames" add an entry like this:

mad /sd=c:\francesca

If you're not sure how to make this change, I've created an example winboard.ini file,
available on my website, www.silentshark.co.uk. 
You can examine this file to see how I made the changes described above, or use the 
file in place of the default winboard.ini file.

8. That's it! When you run Winboard, you will be able to select the Francesca engine 
from the drop-down list on the initial Winboard screen.

Hey, I've spotted a weakness/ bug in Francesca
==============================================

Have you? Let me know! Drop me a line, I like to hear comments from
other computer chess enthusiasts.


Release History - for the computer chess geeks out there!
=========================================================

V0.00 - First PC version - competed in QMW uniform platform competition,
      London, 1994. Came 15th out of 16.

V0.01 - Improved tree searching - released informally to friends.

V0.02 - Improved evaluation function - released informally to friends.

V0.03 - Timing problem noted. Not fixed yet. Simple endgame heuristics added.
      Search speed improved by 5%. Version without book has randomized
      openings. Beeps when machine moves. If a mate for / against is
      spotted, it makes move without searching deeper. Pawn scoring
      reduced.

V0.04 - V0.06 Minor fixes, and tweaks to evaluation function

v0.07 - Played in WMCCC, Paderborn 1995 - came 32nd, with one win, 
	four draws, and six losses

v0.08 - Lots of changes 
      - switched compiler to gcc 
      - hash tables
      - better move ordering
      - more forward pruning, more aggressive null move depth reduction
      - improved detection of draws by repetition and stalemate

v0.09 - better hasing scheme (two level)
      - less aggressive null move depth reduction
      - quiecence search speedups
      - fwd pruning as used at WMCCC reinstated
      - cleaned out useless code (extra params. to search() and quiesce())
      - "one response to check" extension added
      - first version to score over 2000 on the difficult BT2450 computer 
	test

v0.10 - quite a few bug fixes
      - evaluation tweaked (opening scoring)
      - timing problem fixed (for good, I hope) - looping of clock() handled
      - en passent bug fixed

v0.11 - speed increased by not generating all moves at one time
      - hash table inefficiency cured
      - illegal moves filtered out at root of tree
      - bug in "one response to check" fixed

v0.12 - new book for tournaments added
      - book problem on castling observed, but not cured (yet!)

v0.13 - smarter timing algorithm
      - more aggressive "king hunting" positional scoring
      - minor optimisations

v0.14 - three serious bugs cured (some indexes were writing off the
	ends of arrays - Yuk!)
      - slight speedup to the in_check() function.
      - PV problem cured once and for all.
     
v0.15 - split release into two executables - one for DOS, one for Windows
      - released informally to friends

v0.16 - tweak to discourage knights on edge of board
      - slight speedup (3%)
      - entered into WMCCC 1996, in Jakarta, Indonesia. Placed 13th
	out of 28

v0.17 - slight timing tweaks, and optimisations
      - entered into the Spanish Computer Chess Championship, 1996.
	Placed 2nd= out of 6

v0.20 - further slight optimisations
      - increased "aggressiveness" of Francesca
      - further timing tweaks, to avoid spending too long on early moves
      - writes moves of game in algebraic notation into the file, "chess.txt"
      - entered into WMCCC 1997, in Paris, France.
	placed 31st out of 34

v0.60 - complete rewrite of eval. function, all eval done in leaves
      - some bugs fixed, "aggressive forward pruning" introduced, so on
	good hardware, at long time levels, Francesca can search quite 
	deep.
      - entered into Spanish Computer Chess Championship, 1998.
	Placed 2nd (1st= on points, tie break on Buchwald demoted
	Francesca to second place), 5 wins, 1 loss, 0 draws. Nearly..

v0.63 - preliminary Winboard support added, and opening book expanded.
	competed in Frank Quisinsky and Kai Skibbe's 3rd Winboard               
	tournament. Placed 4th= out of 14 chess engines.

v0.67-v0.68 - competed in Frank Quisinsky and Kai Skibbe's 4th Winboard         
	tournament. Placed 11th out of 14. But hey, this was a *strong*         
	tournament! Francesca won some interesting games against strong
	commmercial programs such as Nimzo, Zarkov. :-)

v0.68c - fixed a minor bug which caused Francesca to occasionally miss possible
	draws. Unfortunately, this fix came too late for a game against Nimzo,
	where Francesca had an easy win, but allowed Nimzo an easy draw.
       - fixed a minor bug, which occasionally caused a crash in very
	simplified endings (e.g. KB vs K). Entered into WCCC99, operated 
	by Kai Skibbe.

**********************************************************************************

Release 0.78    April 2000, initial Winboard public release

Release 0.80    June 2000, slight performance and eval. tweaks. Support for
		larger opening books, initial support for Winboard
		incremental clock (note the incremental clock support is
		simplistic and not well tested. It is likely that Francesca
		plays weaker with the incremental clock option). Supplied
		with a larger opening book.

Release 0.80a   As 0.80, but compiled to use 32MB RAM, not 16MB!

Release 0.81    Slight tweak to lazy eval. and forward pruning parameters.
		Test scores remain similar to 0.80, but a serier of 106 blitz
		games against various opponents, hints at a 20-30 ELO increase.

Release 0.90    WMCCC 2000 (London) version. Eval tweaks, which extensive testing
		has shown to be beneficial. Compiled to run in under 16MB, to 
		enable as many people as possible to run the engine.

Experimental    Significant knowledge added to Francesca, resulting in a slower
Release, aka    program, but one which plays interesting chess.
M.A.D 0.01      M.A.D (Manic, Agressive, Dynamic)
		Whether this version is stronger than 0.90 is unknown.

Francesca       Extensive testing showed that Francesca M.A.D 0.01 was indeed
M.A.D 0.03      stronger than 0.90 at long time controls (by about 40 ELO, I estimate).
		M.A.D 0.03 incorporates a new book format, which stores book
		information in a more compact fashion. The book which was
		used by Francesca at the 2000 WMCCC, London is bundled in this
		release. This book contains about 50,000 moves.
		Also new is an elementary "learning" feature, designed 
		to encourage Francesca not to repeat games she loses.

Francesca       New, improved book. Slight tweaks to tree search. Now we just do a
M.A.D 0.04	null move around (beta, beta-1), looking for beta cutoffs. Better 
		reporting of the PV incorporated. Current estimate indicates that
		0.04 is over 25 ELO better than 0.03, and over 60 ELO better than
		v0.90.

Francesca	New timing algorithm. The playing level with the Winboard incremental
M.A.D 0.05	clock has improved considerably. Interestingly, after over 500 games
		(some with the standard clock, some with the incremental clock), against
		a variety of opponents, 0.05 is showing a +50 ELO increase over 0.04!

Francesca	Minor bugfix version - draws by repetition weren't being reported
M.A.D 0.06	correctly. This has been fixed.

Francesca	More bugfixes. Stalemate now being reported correctly, also endgame
M.A.D 0.07	scoring routines fixed. Hopefully, this version no longer needs the 
		dreaded /xreuse parameter to be supplied to Winboard.. What else? 
		Well, a new opening book is now in place. Move ordering at root of 
		the tree has been improved, although this may only show itself at
		longer time controls. Better time handling at very fast (e.g. g/2)
		time limits. After several thousand games against a variety of
		opposition, 0.07 is showing itself as 30 ELO better than 0.06

Francesca	Improved performance due to better optimization choices in compilation.
M.A.D 0.08	Pawn evals and king safety eval modified (hopefully improved), leading
		to a different style of play. Estimate 40 ELO better than 0.07, 70
		ELO better than 0.06, in many games against varied opposition. Also:
		At g/15 vs 0.06 (Athlon 900Mhz) W26, L14, D24
		At g/60 vs 0.06 (Athlon 900Mhz) W11, L3, D9
		At g/15 vs 0.07 (Athlon 900Mhz) W21, L11, D13

Francesca 	Bugfix version. First, I found one of the compiler switches which gave
M.A.D 0.08a	a slight speedup was doing weird things to variables.. yuk! So I switched
		it off. Second, I've changed the way Francesca reports promotions, so that
		the promotion itself is declared explicitly, e.g. a7a8q rather than a7a8.
		According to Carlos Pese, this was causing Francesca some problems under
		non-Winboard interfaces such as CM8000.

Francesca	Timing improvements, and Arena/ CM8000 compatibility improvements.
M.A.D 0.09	Francesca tries to spend more time on moves after fail-lows. Changes made
(Beta)	to Winboard code to enable Francesca to work under Arena, and maybe other
		interfaces.

Francesca 	Full release of 0.09. 0.09 has been confirmed to run under 				
M.A.D 0.09	Winboard, Arena, CM8000, CM9000, Chesspartner, ChessAssistant, Shredder Classic,
 		Fritz 8.. Under certain non-Winboard interfaces you will need to use the 
		WB2UCI adaptor..

Francesca	Fixed a bug which had been hanging around for a while - the infamous Francesca
M.A.D 0.10	castling bug. Although she did not try gross things (like trying to castle when
August 2005	in check, castle through check etc.), there was a bug which meant if a rook moved,
		then moved back to its original square, Francesca might think she could castle! Of
		course this is illegal. This has been fixed.
		Also, I've recompiled under MS Visual C++ 6 SP 6 which seems slightly quicker.
		Lastly, I'm now distributing two versions a "diet" version where hash tables take
		less than 16Mb, and a "standard" version where the hash tables take under 128Mb.
		[not released to public]

Francesca	Other programmers have been playing around with "late move reductions", also 
M.A.D 0.11	called "history pruning". The chess program "Fruit" apparently uses this, and
March 2006	gains a lot of strength through this pruning mechanism. So I've given it a whirl,
		too. Seems to give a slight strength improvement - somewhere around 40 ELO points?
		This release has three versions - "diet", "standard", and "lardy". The only difference
		is the memory used for hash tables. diet uses about 15Mb, standard uses about 110Mb,
		and lardy uses 580Mb. If you have sufficient memory, the versions with larger hash
		tables should play slightly stronger chess. The three versions are all bundled
		in the zip file, named dietmad.exe, mad.exe, lardymad.exe for diet, standard and
		lardy. Weird names, huh?

Francesca	Ok, here we have a few changes. 
M.A.D 0.13	First off, a little bugfix - a counter was writing off the end of an array. 
		Horrible. Could have caused all sorts of problems! 
		Second, I have recompiled with Microsoft Visual Studio 2003 for a useful speed boost,
		about 10%.
		Last, I have tweaked the eval. Some minor changes around scoring rooks and queens,
		and some improvements, I hope to pawn scoring.
		Testing (via a series of games against v0.11 and other opposition indicates a
		useful strength increase), somewhere around 25 ELO?

Francesca	The first update for a few years! A few changes, giving, I hope a boost of about 50 ELO.
M.A.D 0.14	Improved late move reductions - removed the pruning on history scores. Null move is now
		always R=3. Piece values tweaked. Optimisation to static-exchange-evaluator. A few eval
		tweaks, mainly around king safety. Recompiled with Microsoft C++ 2010..

Francesca	ok, a few changes, lots of testing, and about a 30 ELO improvement I hope.
M.A.D 0.15	LMR improvements (e.g. doing LMR at the root of the tree, varying reduction according
		to depth, and moves made). Some eval tweaks (things like greater bonus for outposts)..
		what else? Experimental "force" mode for Winboard/ Arena (only tested under Arena). 
		Again, three different versions using varying amounts of RAM. diet.exe - approx 16Mb,
		mad.exe - approx 128Mb, lardy.exe - approx 1Gb. 

Francesca	Bug fix x2. Tweak to make it work under latest Winboard (got broken in implementation of
M.A.D 0.15a	"force" command). Tweak to make it less likely to lose on time in quick games. Otherwise
		all as per 0.15

Francesca	Quite a few changes, can't remember them all!
M.A.D 0.16	More aggressive razoring, depths 1,2 and 3. Cured a nasty TT bug related to pondering.
		TT was not being updated when the pondered move was made. It's difficult to know what
		effect this would have, apart from it would be bad. Lots of little tweaks to get rid of
		all compiler warnings. Some eval tweaks, too - king safety, pawns especially.. hopefully
		about a 30 ELO improvement. Ditched the "diet" (low RAM) version. Now you get two versions,
		the standard one used about 150Mb of RAM, and the "lardy" version uses about 1Gb

Francesca	A few tweaks - sorted out a matescore/ hashing bug. Minor optimisations. Pondering bug 
M.A.D 0.17	sorted out. Tweak to timing algorithm to use more time if the best move keeps changing
(unreleased)	as we progress through the iterations..
		
Francesca	King safety toned back a bit. Lazy eval in main search and q. search. Testing over
M.A.D 0.18	several thousand games against Anmon, Colossus, Green Light Chess and Ruffian indicates 
		that 0.18 is 51 ELO better than 0.16, and 0.16 is 17 ELO better than 0.15.

Francesca	Can't remember all the changes! They were done back in May/ June 2011. As it's October,
M.A.D 0.19	I thought it worth releasing.. The signifant change was to use a score "scaling" feature
		between the middle and endgame. In previous versions of Francesca, it was very binary - 
		either a position was middlegame or it was endgame. In this version we calculate a mid-
		and end-game score for each position evaluation, then scale the score, depending on
		material left. Seems to help somewhat - private testing over 8000+ games indicates an
		improvement of around 30ELO.

		At the request of Pablo Urzua, I've also re-introduced a version which runs in less than
		32Mb of RAM (24Mb actually), to run on older computers. This is compiled without the 
		SSE2 extensions, so hopefully will run ok on ancient Pentium3's etc.. This version is
		called diet.exe. Please feedback if it's broken!

Francesca	Resurrected after hibernating for 8 years :-)
M.A.D 0.20	Things done
Jan 2019	- LMP implemented
		- PVS implemented
		- draw code improved
		- minor eval changes to phalanx scores, and other pawn scores
		- more aggressive fwd pruning, so-called 'static null move pruning'. Been using this for
		ages, but now prunes a lot more.
		- major SEE fix - was considering wrong piece as part of the recursive call :-(
		- minor tweak to fix minor q/r eval
		
		Hoping for a comfortable +50 ELO improvement over mad019. My testing shows an improvement
		of +80 ELO, but we shall see.
	
Francesca 0.21  Fixed problem with endgame king safety - bonus for centralising kings was way too low. This
Jan 2019	made quite a difference to play. Passed/candidate pawn improvements, more aggressive pruning
		(null move, and static null move and futility). Better aspiration windows. Minor speed 
		improvement in attack_wking() and attack_bking() functions (5%?). More efficient stalemate
		detection. Better check extensions - don't extend losing checks. 

		Hoping for approx +60 ELO improvement over 0.20.

Francesca 0.22  Fixed a nasty bug with draw scores - would sometimes think a position was drawn when in check.
March 2019	Lots of other changes: better move sorting, better history, null move more aggressive,
		LMR tweaks, more efficient hashing, slightly better timecontrol, fixed a bug in hashing.

		Testing shows improvement of at least +35 ELO vs 0.21

		Supplied in regular version (fran.exe - uses about 175Mb and lardy.exe - uses about 1.2GB RAM).
		Also supplied is a version called legacy.exe - uses about 175Mb, and should run on older
		PC's. It's still 64 bit, but is compiled without sse2 extensions and stuff. Thanks for
		letting me know about that issue, Guenther :-)
		
Francesca 0.23	A number of changes. Counter move history is a new addition, helping with LMR pruning. Fixed a
May 2019	bug relating to draw scores. Reintroduced internal iterative deepening. Change to history so
		we decrease history scores for moves which didn't improve alpha.

		Testing shows improvement of about +30 ELO vs 0.22

		Supplied in regular version (fran.exe - uses about 230Mb and lardy.exe - uses about 450Mb RAM).
		Also supplied is a version called legacy.exe - uses about 230Mb, and should run on older
		PC's. It's still 64 bit, but is compiled without sse2 extensions and stuff. 

Francesca 0.24  Bugfix on horrible e8g8 move, which Francesca seemed to sometimes decide was castling, even
May 2019	when it wasn't :-). Minor improvements to pruning, including even more aggressive LMR..

		Testing shows improvement of about +20 ELO vs 0.23..

Francesca 0.25  Bugfix when using external book - could mess up castling status in a specific situation, meaning
July 2019	sometimes Francesca wouldn't think she could castle, when she could. Nasty. Very minor eval tweaks
		to passers. Minor tweak to aspiration window. Improved root node ordering (ditched the old idea 
		about ordering moves depending on number of nodes searched). Some minor speed optimisations.

		Self play testing show improvement of about +48 ELO, so probably a bit less in the 'real world'.

Francesca 0.26	Lots of little changes! Change to IID, simplification. Slightly more aggressive LMR. Slighly less
November 2019	agressive futility pruning. A number of minor speed optimisations. Tweak to move ordering when
		in check. Slightly more agressive SEE pruning for quiet moves. Eval tweaks - greater malus for
		low mobility for pieces. More aggressive king attack eval. Minor tweaks to pawn scoring etc.

		Testing vs other versions of Francesca and other engines is showing an improvement of about 50 ELO

Francesca 0.27  Again, lots of small changes. Tweak to piece values to help value queen higher. Tweak to root LMR.
January 2020    Make sure checks right near the leaves of the tree don't get pruned. Change to 'improving' idea, now
		takes material and evaluation into account. Micro optimisations in qsearch and main search. More
		aggressive LMR for counter/histories. Piece values change gradually, according to game phase 
		(previously they changed suddenly when in late endgame). Minor eval tweaks and tuning - side to
		move bonus)

Francesca 0.28  More small changes. Bugfix to move ordering. Slight tweak to king eval. Slight search enhancements,
March 2020	such as not trying a null move on the PV. Better endgame (draw etc.) recognition. Trick of searching
		fail highs to reduced depth. 

		Self-testing showing +60 ELO improvement. Testing vs other engines, somewhat less. 

Francesca 0.29 	Lots of changes. Improved endgame recognition (helped by new way of tracking material). Small 
May 2020	performance optimisations. Better concept of threat in the eval (pawn and minor piece threats).
		Change to king safety to better consider threats and pieces in proximity to king. Bigger eval for 
		passed pawnscoring. Minor bugfixes. 

		Testing against other versions of Francesca and other engines shows a +45 ELO improvement at fast 
		timescales.

Francesca 0.29a Ooops! this fixes a bug when 'pondering' was switched on in 0.29. Everything else is the same :-)
	
Francesca 0.30  Small changes. Minor optimisations. More aggressive null move pruning. IID replaced by IIR (thanks
December 2020	to Ed Schroder). Tweak to futility to make more aggressive or not, depending on if position is 
		improving. Separate search functions when in check. Minor eval tweaks - tuning needed

		Testing against other versions of Francesca and other engines shows a +25 ELO improvement at fast 
		timescales. Happy Christmas. Hope 2021 is a better year and humanity conquers the coronavirus.

Francesca 0.30a Bugfixes (thanks Werner for flagging one!). Mate scores in TT tables not being stored correctly.
		Fixed a couple of memory errors. Fixed an error to do with pruning, which meant that some forward
		pruning was essentially random. Fixed another one where Francesca might choose to lose on time.
		As ever with bugfixes, you hope for a big strength improvement, but it was not to be. Still, the
		fixes may give a minor strength boost, and stop some embararssing moments in certain games :-)

Francesca 0.31  Quite a few changes, but only a small change in strength. Singular extensions added, some pruning
December 2021	weaks. Some eval tweaks around king safety. Used a different compiler, clang for a minor speed
		boost. Some bugfixes. Retired the lardy and legacy versions.

		Testing against other versions of Francesca and other engines shows a +26 ELO improvement at fast 
		timescales. Happy Christmas. Hope 2022 is a better year and humanity conquers the coronavirus.

Francesca 0.31a Ooops! This fixes a memory bug or two causing the occasional hang. Performance should be about same.
December 2021

Francesca 0.32	Some minor tweaks, including improved endgame (passed pawn knowledge). Hopefully +20 ELO over previous
September 2022	versions.

Francesca 0.33 	Adds full search support for opponent castling and en passant.
July 2026	Improves time management, tactical check extensions, passed-pawn evaluation, and king safety.
		Includes extensive search, evaluation, move-generation, and code-structure modernization.
		In final testing, 0.33 scored 52.1% over 1,000 games against 0.32, an estimated improvement of 
		approximately 15 Elo at g/60.

Francesca 0.34	Adds Lazy SMP support for stronger play using multiple CPU cores.
August 2026	Persistent helper searches independently explore the position while sharing the transposition table. 
		The main search remains responsible for time management and the played move.
		Single-thread play remains the default. To enable Lazy SMP, set `threads = 2`, `4`, or `8` in 
		francesca_search.cfg, or start the engine with, for example, `francesca.exe --set=threads=8`.
		Use no more threads than the number of suitable CPU cores available to the engine.
		Includes further search, threading, data-structure, and performance modernization while retaining the 
		chess improvements introduced in 0.33.
		In final 60/30 testing, T4 and T8 were estimated at approximately 89 and 112 Elo stronger than 0.33 
		respectively. In a separate 60/60 test, T8 gained approximately 36 Elo over T4.

Francesca 0.34a	Bugfix where in some situations, Francesca wasn't seeing opponent's castling moves in search