===================================================================
KnightX 4.6b
Copyright 2025 Christophe Jolly
The tablebase code is by Eugene Nalimov
Web: http://technochess.free.fr
Email: technochess@free.fr
===================================================================

- Linux 64 bits application for x86-64 processors
- Windows 64 bits application for x86-64 processors
- Tested with the Graphical user interfaces XBoard 4.9.1 Linux, Winboard 4.8.0 Windows, CuteChess 1.0.0 Linux
- Use Nalimov tablebases (.emd files)
- Implements the Winboard protocol version 2 and partially the UCI protocol of April 2004
- Features with Winboard protocol: play game, analyze, resign, edit position, move now
- Features with UCI protocol: play game, analyze

If the program doesn't run on a particular Linux, please send an email to the address above. The program has been tested on Debian 12 and CentOS 7

If you have a directory containing the Nalimov tablebases files,
write the path in the config file.
See Updates below.

Winboard command-line (Windows)
-------------------------------
If Knightx is installed in "kndir" directory,
then the command-line is: Winboard -fcp Knightx193 -fd kndir
to start winboard with Knightx.
For example: Winboard -fcp Knightx193 -fd C:\KNIGHTX

XBoard command-line (Linux)
---------------------------
If Knightx is installed in "kndir" directory,
then the command-line is: xboard -fcp knightx193_linux64 -fd kndir
to start XBoard with Knightx.
For example: xboard -fcp knightx193_linux64 -fd /home/user/knightx

Knightx config-file
-------------------
The best is to set the parameters in this file and not use any command-line parameter.
Edit the file "knightx.cfg"
Set the lines "HASHTABLE=size" and "TABLEBASE=directory"
See below for the hash size value and the tablebase directory.
Note: the command-line parameters have precedence over the
config-file parameters.
Since v1.93, the hash table size can be changed in the Xboard/Winboard interface.
Since v1.97, the tablebase directory can be changed in the Xboard/Winboard interface.

Knightx command-line
--------------------
Knightx [-hN] [-dDIRECTORY]

N is the hash-table size and is a number between 21 and 26

value		hash table memory size
;21		32 MB
;22		64 MB
;23		128 MB
;24		256 MB
;25		512 MB
;26		1024 MB

without argument, the default hash-table size is 256 MB

DIRECTORY is the path to a directory containing the Nalimov tablebase files.
For example: "-dC:\Chess_Tb\Nalimov"
You can specify several directories by separating them with a ;
the default tablebase directory is the directory of KnightX.

Release Notes
-------------
v4.6b
	Restored the pieces values to the v4.5 values. The Pesto table pieces values of v4.6 were not appropriate.
	
v4.6a
	Bug fix release. Since v4.5, the engine was considering the under promotion as a queen promotion when it was played by the opponent.
	Thanks to Gabor Szots for reporting the problem.

v4.6, October 2025
	Passed pawns evaluation improved
	Futility prunings improved
	Conditions for stopping the search changed
	More evaluation function parameters automatically tuned
	Modified the transposition hash table index calculation

v4.5, June 2025
	King safety improved, more evaluation function parameters automatically tuned
	Simplified the hash tables index calculation
	Reduced the time margin in the time management
	Fixed a bug that caused the program to reject a promotion capture move
	
v4.4, April 2025
	Tree searching: seach selectivity improved
	Evaluation function simplified in start and middle game
	Time management: more time margin to avoid clock close to zero in long games
	UCI protocol: analyze position for x seconds

v4.3, January 2025
	Tree searching: seach selectivity improved
	king and knight/bishop vs king and pawn evaluation improved
	The pawns hash table now use less space for the benefit of the Transposition table
	UCI protocol: analyze position mode now functional

v4.2, November 2024
	Singular move extension, History table changed, Passed pawns evaluation improvement, evaluation of draw positions in pawnless endings, some bug fixes
	
v4.11, August 2024
	King safety changed to favor castling
	Compiled with gcc 12.2

v4.1, July 2024
	King safety and mobility evaluation modifications
	Quiescence search when in check modifications
	Better play in finals with pawns and 1 piece on each side
	Pondering is always off for the moment. the code needs an update

v4.0, May 2024
	King safety and mobility evaluation improvement
	Tree searching parameters adjustment
	Displays the principal variation as soon as a better move has been found (fail high move)
	
v3.9, December 2023
	Fixed a limitation in the loading of a FEN position. The engine couldn't always set a position containing doubled pawns
	Doesn't stop the search when a mate has been found
	New search function at the root position
	Tree searching parameters adjustment
	Positional evaluation parameters adjusted with the Texel's tuning method
	
v3.8, July 2023
	Tree searching: depth reduction and late move pruning conditions, filling of the history table
	Positional evaluation: rooks and passed pawns positioning

v3.7b, March 2023
	Tree searching: depth extensions, reductions and parameters adjustment
	Positional evaluation: parameters adjustment
	Time management improvement
	The 3.7 and 3.7a versions have played several tournaments for evaluation and have not been released

v3.6a, December 2022
	Bug fixes in the capture search transposition table, the root search, the null move pruning conditions
	Passed pawns evaluation, King safety evaluation for uncastled king
	The Windows executable is now compiled with the Mingw-w64 Linux cross compiler
	The 3.6 version has played one tournament and has not been released

v3.5, September 2022
	Tree searching improvements
	Positional evaluation function simplified
	Correction in passed pawns and rook evaluation
	King and queen positioning

v3.4, July 2022
	Change in the history table update
	King and rook positioning in finals, passed pawns evaluation
	Sends the principal variation in algebraic notation in the XBoard/Winboard output window (instead of coordinate notation)

v3.3, June 2022
	Search selectivity improvement
	King positioning in finals, connected pawns evaluation

v3.2, February 2022
	Tree searching improvements
	Positional evaluation improvements
	Tuned search parameters and eval parameters
	
v3.1, November 2021
	Positional evaluation improvements in rooks endings, knights endings
	Increased search selectivity, backward pawns evaluation
	Optimisation of the evaluation, better search speed
	Tuned search parameters and eval parameters

v3, October 2021
	Tree searching improvements
	Positional evaluation improvements
	
v2.91, September 2021
	Fixed two regressions in v2.9
	Positional evaluation improvement
	Tuned search parameters and eval parameters

v2.9, August 2021
	Tree searching improvements
	Positional evaluation improvements
	The Nalimov endgame tablebases are now usable when using the UCI protocol

v2.8, May 2021
	Tree searching improvements
	Positional evaluation improvements
	Fixed a crash that occured when the "logfile" option was activated
	The incremental time setting when using the UCI protocol can be expressed now in 1/10th of seconds
	
v2.7, March 2021
	Tree searching improvements
	Positional evaluation improvements
	New option "logfile" to record games in the file {program name}.log

v2.61, February 2021
	Correction of an uninitialized variable in the evaluation function
	Restored the uci protocol. Use it only for playing tournaments in applications that don't support the winboard protocol
	Correction in the uci protocol's time management: when using an incremental clock like "game in 2 minutes+1 second/move", the program was consuming almost all of its time in a few moves, then played moves instantly for the rest of the game
	
v2.6, February 2021
	Tree searching improvements
	Positional evaluation improvements
	Correction of the hash table memory size allocated in memory. It was twice the size specified in the Knightx.cfg file

v2.5, December 2020
	Tree searching improvements
	Positional evaluation improvements
	Correction of the analyze mode not working correcly in the linux version

v2.4, September 2020
	Improvements from v2.3 and correction of regressions since v2.2
	Correction in tablebase probing when the side to move has the "en passant" capture right

v2.3, June 2020
	Tree searching correction and improvements
	Positional evaluation improvements

v2.21, June 2020
	Tree searching improvements
	Positional evaluation improvements

v2.1b, June 2020
	Corrections

v2.0, May 2020
	Tree searching corrections and improvements
	Positional evaluation improvements
	
v1.99, May 2020
	Tree searching improvements
	Positional evaluation improvements in finals
	Options use_book and resign in the xboard/winboard gui
	
v1.98, January 2020
	King safety and tree searching improvements, positional evaluation bug fix
	
v1.97a, October 2019
	Fixed a tablebase probing problem (sometimes missed the winning move and drawed the game)
	(nothing to do with a missing tablebase file)

v1.97, October 2019
	Fixed a buffer overrun crash that occured when the principal variation was too long
	Positional evaluation fixes and tree searching improvement
	Fixed a Nalimov tablebase path problem. Now the program can get the tb path configured in winboard/xboard/arena (nalimov:path)

v1.96, September 2019
	positional evaluation improvements
	tree searching improvements
	no more use the Nalimov tablebases (was not working)

v1.95, July 2019
	tree searching improvements
	positional evaluation improvements

v1.94 bug fixes, June 2019
	Fixed a buffer overrun crash at the start of the program when the path is too long
	Plays a move when resigning (if not, Arena waits forever the move)
	
v1.94, May 2019
	tree searching improvements
	king safety improvement
	option 'use_book' to not use the opening book

v1.93, Feb 2019
	64 bits Linux and Windows executable (do not use 64 bits bitboards however)
	tree searching improvements
	winboard protocol command for setting the hash table size

v1.92,Mar.13.2005
	Improved mobility.

v1.91a,Mar.1.2005
	Modified king safety.
	'setboard' winboard command implemented.

v1.91,Jan.2.2005
	Removed a problematic section of evaluation code relative to the pieces distance to kings.
	Small change in search depth extensions.
	New and larger opening book, imported from the file Fritz4.fbk.

v1.90a,Dec.11.2004
	Modified king safety.

v1.90,Dec.6.2004
	Improved search, pawns evaluation, king safety.
	Modified some book lines.

v1.86,Nov.3.2004
	Fixed a bug in the synchronization of threads. The program could sometimes loop forever when the thread switching was slow.
	Optimized data structure: 10 to 20% faster.
	Ported to Linux. Compiled with gcc 3.3.1 for x86.

v1.85,Oct.9.2004
	King safety.
	Knights+pawns endings.
	Bigger opening book. 13000 positions.

v1.84,July.15.2004
	v1.81 King safety. Search and evaluation changed. Better in combinations.
	New opening book entirely based on computer games (the former book contained old human openings).

v1.83,May.2.2004
	Improved king safety.
	Rooks behind passed pawns in finals.
	Improved speed.

v1.82,Feb.12.2004
	New king safety.

v1.81,Dec.20.2003
	Evaluation and quiescence search have been simplified to improve the speed significantly.
	Eval coefs adjusted, bishops pair value and passed pawn values changed.
	
v1.80a,Oct.28.2003
	Fixed a buffer overflow problem that might caused a crash sometimes.
	Filled some holes in the opening book.

v1.80,Oct.19.2003
	Removed many bad lines in the opening book.
	Eval modified. King safety's weight a little reduced.
	Longer hash table signature to avoid some collisions that occured sometimes.

v1.79,Sep.7.2003
	Added chess knowledge.
	Constant null move depth reduction.
	Faster generation of replies to check.

v1.78b,Jul.19.2003
	fixed 2 bugs in the evaluation. (a bug was there since v1.75)

v1.78a,Jun.22.2003
	fixed 2 bugs in the evaluation.

v1.78,Jun.15.2003
	improved search, pawns eval and time management (game in n minutes)
	fixed a bug in the eval of lone kings+pawns
	added the hashtable option n=24 (203MB of total memory used)
	added/changed opening book lines

v1.77,Dec.21.2002
	Eval of good/bad bishops.
	Bug fixed in time management. Sometimes losed on time when increment time was >10s.
	Displays more info in analyze mode window.

v1.76a,Oct.16.2002
	Analyze mode.
	Changed eval of trading pieces.
	Book learning improvement.
	Larger opening book: previous book + some recent computer games.

v1.75a,Feb.16.2002
	Error fixed in the book learning. wasn't effective.

v1.75,Feb.10.2002
	Slight changes in eval and time management.
	New opening book format. (file is Knightx.bo2)
	New book learning.

v1.74,Dec.18.2001
	King safety improved.
	Pawns structure eval correction.
	Book learning, log file.
	Opening book additions.
	
v1.73,Nov.25.2001
	Bug fixed in the search (all Knightx versions had this bug)
	Bug fixed in the ksafety (Knightx 1.71-1.72 had this bug)
	opening book additions

v1.72,Nov.18.2001
	search changed
	eval adjusted, ksafety slightly improved
	opening book additions

v1.71A,Sep.23.2001
	v1.71 10 to 15% faster than the previous release. (compiler changed)
	opening book additions
		
v1.71,Jul.14.2001
	eval adjusted
	takes slightly more time to think in k.o. games
	stops the game when there is some insufficient material

v1.70,Jun.30.2001
	eval changed significantly
	opening book add
	compiler changed
	
v1.62,Apr.12.2001
	fixed v1.61 problem: sometimes the game result wasn't caught immediately by winboard.
	wider alpha/beta window at the root, scores storage in hash table changed.

v1.61,Mar.24.2001
	the synchronization problems with the Fritz interface seem to be solved.
	since v1.60, supports the reset (hashtable) command of Fritz, hashtable not cleared before each move.
	eval (king safety, finals) and search (extensions) changed
	opening book add

v1.60,Jan.17.2001
	eval changed, coefficients adjusted
	opening book add

v1.58A,Jan.2.2001
	fixes:
	color to move wasn't correct after editing a position
	could crash when thinking was interrupted very quickly
	
v1.58,Dec.30.2000
	supports the edit (position) command
	pondering restored (was never activated)
	eval changed

v1.57, Dec.11.2000
	more speed/depth
	some eval improvements and fixes
	time management improved
	opening book add

v1.56, Oct.15.2000
	eval improved
	tablebase transposition in tree search
	fixed random choice of opening book moves problem	
	opening book add

v1.55, Aug.28.2000
	eval improved
	tablebase bug fix (when two queens of the same color)
	pondering bug fix
	opening book add

v1.54, Jun.22.2000
	mobility eval fix
	opening book changed
	
v1.53, Mar.15.2000
	new selectivity. v1.53-v1.52: 8-4
	now reads a config file (Knightx.cfg) to get the program's parameters
	opening book changed

v1.52, Feb.15.2000
	better time managing in blitz games. v1.52-v1.51: 5.5-2.5 in game/5mn
	resigns when game is lost
	opening book changed

v1.51, Jan.15.2000
	made small corrections to evaluation
	move sort changed
	opening book changed

v1.50, Dec.20.99
	positional improvements
	pays more attention on king safety
	pondering
	fixed interface problem with winboard which occured sometimes when program was mated

v1.4X, Dec.7.99
	"-d" option added

v0
	Created in 1996.
	Search and evaluation in C language.
	The program was initially a windows application called TechnoChess.

	
