Difference between revisions of "KnightCap"

From Chessprogramming wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
'''KnightCap''',<br/>
 
'''KnightCap''',<br/>
a [[XBoard]] compliant [[Open Source Engines|open source chess engine]] under the [[Free Software Foundation#GPL|GNU General Public License]] by [[Andrew Tridgell]] <ref>[[Andrew Tridgell]] ('''1997'''). ''KnightCap — a parallel chess program on the AP1000+''.</ref>, [[Jonathan Baxter]] and [[Lex Weaver]].  
+
a [[XBoard]] compliant [[:Category:Open Source|open source chess engine]] under the [[Free Software Foundation#GPL|GNU General Public License]] by [[Andrew Tridgell]] <ref>[[Andrew Tridgell]] ('''1997'''). ''KnightCap — a parallel chess program on the AP1000+''.</ref>, [[Jonathan Baxter]] and [[Lex Weaver]].  
 
To [[Automated Tuning|tune]] it's [[Evaluation|evaluation]] in game play, it uses [[Temporal Difference Learning|temporal difference learning]] applied to [[Minimax|minimax]] search in chess, [[Temporal Difference Learning#TDLeaf|TDLeaf]] <ref>[[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1997''') ''Knightcap: A chess program that learns by combining td(λ) with minimax search''. 15th International Conference on Machine Learning</ref> <ref>[https://groups.google.com/group/rec.games.chess.computer/msg/4d6c328e8e8e0cd4 Re: Bit Board Bonkers?? - other alternatives] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], August 9, 1997</ref>. KnightCap features an own [[GUI]] with an optional [[3D Graphics Board]] <ref>[https://groups.google.com/group/rec.games.chess.computer/msg/ded7e4e4304d8d4e Re: Going commercial, maybe] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], March 9, 1997</ref>, and played multiple [[Australasian National Computer Chess Championship|Australasian National Computer Chess Championships]], and won two times, last one the [[NC3 2006]].  
 
To [[Automated Tuning|tune]] it's [[Evaluation|evaluation]] in game play, it uses [[Temporal Difference Learning|temporal difference learning]] applied to [[Minimax|minimax]] search in chess, [[Temporal Difference Learning#TDLeaf|TDLeaf]] <ref>[[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1997''') ''Knightcap: A chess program that learns by combining td(λ) with minimax search''. 15th International Conference on Machine Learning</ref> <ref>[https://groups.google.com/group/rec.games.chess.computer/msg/4d6c328e8e8e0cd4 Re: Bit Board Bonkers?? - other alternatives] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], August 9, 1997</ref>. KnightCap features an own [[GUI]] with an optional [[3D Graphics Board]] <ref>[https://groups.google.com/group/rec.games.chess.computer/msg/ded7e4e4304d8d4e Re: Going commercial, maybe] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], March 9, 1997</ref>, and played multiple [[Australasian National Computer Chess Championship|Australasian National Computer Chess Championships]], and won two times, last one the [[NC3 2006]].  
  
Line 13: Line 13:
 
==[[Search]]==
 
==[[Search]]==
 
The program performs a [[Iterative Deepening|iterative deepening]] [[Parallel Search|parallel]] [[MTD(f)]] search utilizing the [[Shared Hash Table|shared transposition table]]. The variation of MTD(f) that KnightCap uses includes some convergence acceleration heuristics  
 
The program performs a [[Iterative Deepening|iterative deepening]] [[Parallel Search|parallel]] [[MTD(f)]] search utilizing the [[Shared Hash Table|shared transposition table]]. The variation of MTD(f) that KnightCap uses includes some convergence acceleration heuristics  
that prevent the very slow convergence that can sometimes plague MTD(f) implementations. [[Selectivity]] is due to [[Null Move Pruning|null move pruning]], [[Razoring|razoring]] and various [[Extensions|extensions]]. The [[Transposition Table|transposition table]] with 128 bit entries keeps separate [[Depth|depth]] and [[Score|scores]] for the [[Lower Bound|lower]] and [[Upper Bound|upper bound]]. The [[Move Ordering|move ordering]] system is a combination of the commonly used [[History Heuristic|history]], [Killer Heuristic|killer]], [[Refutation Table|refutation]] and transposition table, along with [[Enhanced Transposition Cutoff|ETC]].
+
that prevent the very slow convergence that can sometimes plague MTD(f) implementations. [[Selectivity]] is due to [[Null Move Pruning|null move pruning]], [[Razoring|razoring]] and various [[Extensions|extensions]]. The [[Transposition Table|transposition table]] with 128 bit entries keeps separate [[Depth|depth]] and [[Score|scores]] for the [[Lower Bound|lower]] and [[Upper Bound|upper bound]]. The [[Move Ordering|move ordering]] system is a combination of the commonly used [[History Heuristic|history]], [[Killer Heuristic|killer]], [[Refutation Table|refutation]] and transposition table, along with [[Enhanced Transposition Cutoff|ETC]].
  
 
==[[Evaluation]]==
 
==[[Evaluation]]==
Line 56: Line 56:
  
 
=Publications=
 
=Publications=
 +
==1997 ...==
 
* [[Andrew Tridgell]] ('''1997'''). ''KnightCap — a parallel chess program on the AP1000+''. [http://ftp.riken.jp/pub/net/samba/tridge/knightcap_pcw97.ps.gz zipped ps]
 
* [[Andrew Tridgell]] ('''1997'''). ''KnightCap — a parallel chess program on the AP1000+''. [http://ftp.riken.jp/pub/net/samba/tridge/knightcap_pcw97.ps.gz zipped ps]
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1997'''). ''Knightcap: A chess program that learns by combining td(λ) with minimax search''. 15th International Conference on Machine Learning, [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.54.8263&rep=rep1&type=pdf pdf] via [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54.8263 citeseerX]
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1997'''). ''Knightcap: A chess program that learns by combining td(λ) with minimax search''. 15th International Conference on Machine Learning, [http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.54.8263&rep=rep1&type=pdf pdf] via [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.54.8263 citeseerX]
Line 61: Line 62:
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1999'''). ''TDLeaf(lambda): Combining Temporal Difference Learning with Game-Tree Search''. [https://www.chatbots.org/journal/australian_journal_of_intelligent_information_processing_systems/ Australian Journal of Intelligent Information Processing Systems], Vol. 5 No. 1, [http://arxiv.org/abs/cs/9901001 arXiv:cs/9901001]
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1999'''). ''TDLeaf(lambda): Combining Temporal Difference Learning with Game-Tree Search''. [https://www.chatbots.org/journal/australian_journal_of_intelligent_information_processing_systems/ Australian Journal of Intelligent Information Processing Systems], Vol. 5 No. 1, [http://arxiv.org/abs/cs/9901001 arXiv:cs/9901001]
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1999'''). ''KnightCap: A chess program that learns by combining TD(lambda) with game-tree search''. [https://arxiv.org/abs/cs/9901002 arXiv:cs/9901002]
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''1999'''). ''KnightCap: A chess program that learns by combining TD(lambda) with game-tree search''. [https://arxiv.org/abs/cs/9901002 arXiv:cs/9901002]
 +
==2000 ...==
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''2000'''). ''Learning to Play Chess Using Temporal Differences''. [http://www.dblp.org/db/journals/ml/ml40.html#BaxterTW00 Machine Learning, Vol 40, No. 3], [http://www.cs.princeton.edu/courses/archive/fall06/cos402/papers/chess-RL.pdf pdf]  
 
* [[Jonathan Baxter]], [[Andrew Tridgell]], [[Lex Weaver]] ('''2000'''). ''Learning to Play Chess Using Temporal Differences''. [http://www.dblp.org/db/journals/ml/ml40.html#BaxterTW00 Machine Learning, Vol 40, No. 3], [http://www.cs.princeton.edu/courses/archive/fall06/cos402/papers/chess-RL.pdf pdf]  
 
* [[Marco Block-Berlitz]] ('''2003'''). ''Reinforcement Learning in der Schachprogrammierung''. Studienarbeit, [[Free University of Berlin]], advisor: [[Raúl Rojas]], [http://page.mi.fu-berlin.de/block/Skripte/Reinforcement.pdf pdf] (German)
 
* [[Marco Block-Berlitz]] ('''2003'''). ''Reinforcement Learning in der Schachprogrammierung''. Studienarbeit, [[Free University of Berlin]], advisor: [[Raúl Rojas]], [http://page.mi.fu-berlin.de/block/Skripte/Reinforcement.pdf pdf] (German)
 +
* [[Marco Block-Berlitz|Marco Block]], Maro Bader, [http://page.mi.fu-berlin.de/tapia/ Ernesto Tapia], Marte Ramírez, Ketill Gunnarsson, Erik Cuevas, Daniel Zaldivar, [[Raúl Rojas]] ('''2008'''). ''Using Reinforcement Learning in Chess Engines''. Concibe Science 2008, [http://www.micai.org/rcs/ Research in Computing Science]: Special Issue in Electronics and Biomedical Engineering, Computer Science and Informatics, Vol. 35, [http://page.mi.fu-berlin.de/block/concibe2008.pdf pdf]
  
 
=Forum Posts=
 
=Forum Posts=
 +
==1997 ...==
 
* [https://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/1f7ba9d3c31f071 KnightCap 1.0] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], February 27, 1997  
 
* [https://groups.google.com/group/rec.games.chess.computer/browse_frm/thread/1f7ba9d3c31f071 KnightCap 1.0] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], February 27, 1997  
 
* [https://groups.google.com/d/msg/rec.games.chess.computer/Wl7A-v-gWYQ/QLuvAp0l4_gJ Parallel searching] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], March 22, 1997 » [[Parallel Search]]
 
* [https://groups.google.com/d/msg/rec.games.chess.computer/Wl7A-v-gWYQ/QLuvAp0l4_gJ Parallel searching] by [[Andrew Tridgell]], [[Computer Chess Forums|rgcc]], March 22, 1997 » [[Parallel Search]]
Line 76: Line 80:
 
* [https://www.stmintz.com/ccc/index.php?id=28584 Parameter Tuning] by [[Jonathan Baxter]], [[CCC]], October 01, 1998 » [[Automated Tuning]]
 
* [https://www.stmintz.com/ccc/index.php?id=28584 Parameter Tuning] by [[Jonathan Baxter]], [[CCC]], October 01, 1998 » [[Automated Tuning]]
 
* [https://www.stmintz.com/ccc/index.php?id=28647 KnightCap and Windows] by [[Torsten Schoop]], [[CCC]], October 02, 1998
 
* [https://www.stmintz.com/ccc/index.php?id=28647 KnightCap and Windows] by [[Torsten Schoop]], [[CCC]], October 02, 1998
 +
==2000 ...==
 
* [https://www.stmintz.com/ccc/index.php?id=100829 KnightCap installation question] by [[Sven Reichard]], [[CCC]], March 08, 2000
 
* [https://www.stmintz.com/ccc/index.php?id=100829 KnightCap installation question] by [[Sven Reichard]], [[CCC]], March 08, 2000
 
* [https://www.stmintz.com/ccc/index.php?id=306311 Question about the KnightCap find_pins function] by Matthew White, [[CCC]], July 14, 2003 » [[Pin]]
 
* [https://www.stmintz.com/ccc/index.php?id=306311 Question about the KnightCap find_pins function] by Matthew White, [[CCC]], July 14, 2003 » [[Pin]]
Line 90: Line 95:
  
 
'''[[Engines|Up one level]]'''
 
'''[[Engines|Up one level]]'''
[[Category:Open Source]][[Category:GPL]]
+
[[Category:Open Source]]
 +
[[Category:GPL]]
 +
[[Category:XBoard]]
 +
[[Category:Linux]]
 +
[[Category:MTD(f)]]

Latest revision as of 20:04, 9 September 2020

Home * Engines * KnightCap

KnightCap's 3D Board [1]

KnightCap,
a XBoard compliant open source chess engine under the GNU General Public License by Andrew Tridgell [2], Jonathan Baxter and Lex Weaver. To tune it's evaluation in game play, it uses temporal difference learning applied to minimax search in chess, TDLeaf [3] [4]. KnightCap features an own GUI with an optional 3D Graphics Board [5], and played multiple Australasian National Computer Chess Championships, and won two times, last one the NC3 2006.

Description

Board Representation

KnightCap maintains an incremental updated attack table of 64 piece-sets - for each square indicating all pieces attacking or defending that square. Despite move generation, this approach pays off in determining in-check, and square control evaluation.

Search

The program performs a iterative deepening parallel MTD(f) search utilizing the shared transposition table. The variation of MTD(f) that KnightCap uses includes some convergence acceleration heuristics that prevent the very slow convergence that can sometimes plague MTD(f) implementations. Selectivity is due to null move pruning, razoring and various extensions. The transposition table with 128 bit entries keeps separate depth and scores for the lower and upper bound. The move ordering system is a combination of the commonly used history, killer, refutation and transposition table, along with ETC.

Evaluation

Conventional

KnightCap uses a quite slow evaluation function that evaluates a number of computationally expensive features such as board control to reasonably accurately consider the presence of hung, trapped and immobile pieces, and further has some asymmetric evaluation as well as search terms with a leaning towards careful play.

TD Considerations

One major modification for TDLeaf was that all evaluation coefficients became part of a weight vector. Another significant modification that was required was an increase in the bit resolution of the evaluation type so that a numerical partial derivative of the evaluation function with respect to the evaluation coefficient vector could be obtained with reasonable accuracy. To ensure small fluctuations in the relative values of leaf nodes did not produce large temporal differences, the raw linear leaf evaluation score was squashed to a ±1 range of a hyperbolic tangent sigmoid function with 0.25 equivalent a material superiority of one pawn. The outcome of the game was set to 1 for a win, -1 for a loss and 0 for a draw. Negative values of temporal differences (dt) were left unchanged as any decrease in the evaluation from one position to the next can be viewed as mistake. However, positive values of dt can occur simply because the opponent has made a blunder. To avoid KnightCap trying to learn to predict its opponent’s blunders, all positive temporal differences were set to zero unless KnightCap predicted the opponent’s move [6].

Selected Games

NC3 2006, round 2, Bodo - KnightCap

[Event "NC3 2006"]
[Site "RedHill, Canberra, Australia"]
[Date "2006.08.20"]
[Round "2"]
[White "Bodo"]
[Black "KnightCap"]
[Result "0-1"]

1.d4 h6 2.e4 a6 3.Nf3 d6 4.Nc3 e6 5.Bc4 Nc6 6.O-O Nf6 7.Qe2 b5 8.Bb3 Na5 
9.e5 dxe5 10.dxe5 Nd7 11.Rd1 Bb7 12.Bf4 Nxb3 13.axb3 Bc5 14.Ne4 Bb6 15.c3 
Qe7 16.Bg3 O-O 17.Bh4 Qe8 18.b4 Bd5 19.Rd2 Qc8 20.Re1 Re8 21.Qd3 Nf8 22.Nd4 
Ng6 23.Bg3 Qb7 24.Qe2 Rad8 25.f3 Qa7 26.Kh1 Bb7 27.Red1 Rd5 28.Nc2 Red8 
29.Rd3 Rxd3 30.Rxd3 Rd5 31.h4 Ne7 32.h5 Nf5 33.Bf4 Qa8 34.g3 Ne7 35.Kg2 Qd8 
36.Rxd5 Nxd5 37.Bc1 Ne7 38.Nc5 Bxc5 39.bxc5 Qd5 40.b4 Nf5 41.Bd2 Qa2 42.Bf4 
Qb1 43.Qd2 Bd5 44.Na3 Qb3 45.Nc2 Qa4 46.Kf2 a5 47.g4 Ne7 48.bxa5 Qxa5 49.Nb4 
Qa7 50.Be3 Qa8 51.Qd1 c6 52.Kg2 Qb8 53.Qd4 Qa7 54.Qd2 Qc7 55.Qd4 Qa5 56.Bf2 
Qa1 57.Qd2 Kf8 58.Bh4 Qa7 59.Bf2 Qd7 60.Qd3 Kg8 61.Be3 Qc8 62.Qd2 Qd8 63.Qd4 
Kh8 64.Qf4 Qf8 65.g5 hxg5 66.Qxg5 Nf5 67.Nxd5 cxd5 68.Bg1 Qa8 69.Bf2 Kg8 
70.Bg1 Qa2+ 71.Bf2 Kh7 72.Qc1 Nh4+ 73.Kg3 Qc4 74.Qd2 Kg8 75.Qb2 Nf5+ 76.Kg2 
Qd3 77.c6 Qc4 78.c7 Qxc7 79.Qxb5 Nh6 80.Be3 Qd8 81.Bxh6 gxh6 82.Qb4 Qg5+ 
83.Qg4 Qxg4+ 84.fxg4 f6 85.exf6 Kf7 86.Kh1 Kxf6 87.Kh2 Kg5 88.Kg3 e5 89.Kf3 
Kh4 90.Kg2 Kxg4 91.Kf2 Kf4 92.Kg1 Ke3 93.Kf1 e4 94.Ke1 Kd3 95.Kf2 e3+ 96.Kg3 
Ke4 97.Kg2 e2 98.Kf2 Kd3 99.c4 Kd2 0-1

See also

Publications

1997 ...

2000 ...

Forum Posts

1997 ...

2000 ...

External Links

References

  1. Welcome to the KnightCap home page
  2. Andrew Tridgell (1997). KnightCap — a parallel chess program on the AP1000+.
  3. Jonathan Baxter, Andrew Tridgell, Lex Weaver (1997) Knightcap: A chess program that learns by combining td(λ) with minimax search. 15th International Conference on Machine Learning
  4. Re: Bit Board Bonkers?? - other alternatives by Andrew Tridgell, rgcc, August 9, 1997
  5. Re: Going commercial, maybe by Andrew Tridgell, rgcc, March 9, 1997
  6. Jonathan Baxter, Andrew Tridgell, Lex Weaver (1997) Knightcap: A chess program that learns by combining td(λ) with minimax search. 15th International Conference on Machine Learning
  7. Re: KnightCap source code by Jim Ablett, CCC, February 19, 2016

Up one level