Difference between revisions of "BBC"

From Chessprogramming wiki
Jump to: navigation, search
(16 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
a didactic bitboard chess engine by [[Maksim Korzh]] alias Code Monkey King, written in [[C]]. BBC is subject of a [https://en.wikipedia.org/wiki/YouTube YouTube] [https://en.wikipedia.org/wiki/Tutorial video tutorial] started in summer 2020 <ref>[https://youtu.be/QUNP-UjujBM Bitboard CHESS ENGINE in C: intro]</ref>, actually work in progress.
 
a didactic bitboard chess engine by [[Maksim Korzh]] alias Code Monkey King, written in [[C]]. BBC is subject of a [https://en.wikipedia.org/wiki/YouTube YouTube] [https://en.wikipedia.org/wiki/Tutorial video tutorial] started in summer 2020 <ref>[https://youtu.be/QUNP-UjujBM Bitboard CHESS ENGINE in C: intro]</ref>, actually work in progress.
 
The [[:Category:Open Source|open source engine]] is further published on [https://en.wikipedia.org/wiki/GitHub GitHub] <ref>[https://github.com/maksimKorzh/bbc GitHub - maksimKorzh/bbc: Bit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King]</ref>, and will be compliant to the [[UCI]] protocol.
 
The [[:Category:Open Source|open source engine]] is further published on [https://en.wikipedia.org/wiki/GitHub GitHub] <ref>[https://github.com/maksimKorzh/bbc GitHub - maksimKorzh/bbc: Bit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King]</ref>, and will be compliant to the [[UCI]] protocol.
While the series offers a nice introduction in interactive chess engine programming and [[Bitboards|bitboard]] techniques,  
+
While the series offers a nice introduction in chess engine programming and [[Bitboards|bitboard]] techniques,  
the advanced approach of [[Magic Bitboards]] to determine [[Sliding Piece Attacks|sliding piece attacks]] with all its lengthly initialization topics might be hard to understand and deterrent for the intended novice target group.
+
the advanced approach of [[Magic Bitboards]] to determine [[Sliding Piece Attacks|sliding piece attacks]] with all its lengthy initialization topics might be hard to understand and deterrent for the intended novice target group.
The linewise approaches of [[First Rank Attacks]] to intruduce occupancy lookups, followed by [[Kindergarten Bitboards]] - as intermediate step towards magics bitboards - seem didactically more appropriate.
+
The linewise approaches of [[First Rank Attacks]] to introduce occupancy lookups, followed by [[Kindergarten Bitboards]] - as intermediate step towards magics bitboards - seem didactically more appropriate. Anyway, a valuable video series covering various aspects of computer chess programming. '''BBC 1.0''' was released on September 24, 2020 <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75199 BBC 1.0 release - UCI chess engine by CMK] by [[Maksim Korzh]], [[CCC]], September 24, 2020</ref>, '''BBC 1.3''' on October 21, 2020, utilizing [[Stockfish NNUE|Stockfish's NNUE]] evaluation via [[Daniel Shawul|Daniel Shawul's]] [[Scorpio#ScorpioNNUE|Scorpio NNUE]] [[Scorpio#Bitbases|egbbdll]] probing library <ref>[http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75482 BBC 1.3 + Stockfish NNUE released!] by [[Maksim Korzh]], [[CCC]], October 21, 2020</ref>.
  
 
=See also=
 
=See also=
 
* [[BMCP]]
 
* [[BMCP]]
 +
* [[PeSTO]]
 
* [[Vice]]
 
* [[Vice]]
  
 
=Forum Posts=
 
=Forum Posts=
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74917 Comparing 4 move generators: 0x88 vs 10x12 vs 10x12 + bitboards HYBRID vs Pure MAGIC BITBOARDS] by [[Maksim Korzh]], [[CCC]], August 28, 2020
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=74917 Comparing 4 move generators: 0x88 vs 10x12 vs 10x12 + bitboards HYBRID vs Pure MAGIC BITBOARDS] by [[Maksim Korzh]], [[CCC]], August 28, 2020
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75017 Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King] by [[Maksim Korzh]], [[CCC]], September 06, 2020
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75155 Zobrist hashing tutorials on YouTube] by [[Maksim Korzh]], [[CCC]], September 19, 2020
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75199 BBC 1.0 release - UCI chess engine by CMK] by [[Maksim Korzh]], [[CCC]], September 24, 2020
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75204 How to rate my engine in CCRL?] by [[Maksim Korzh]], [[CCC]], September 25, 2020 » [[CCRL]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75380 BBC GUI release - PLAY IT ONLINE!] by [[Maksim Korzh]], [[CCC]], October 12, 2020 » [[#GUI|Web GUI Tutorial]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75415 How to scale stockfish NNUE score?] by [[Maksim Korzh]], [[CCC]], October 17, 2020 » [[Stockfish NNUE]], [[Scorpio#NNUE|Scorpio NNUE]]
 +
: [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=75415&start=3 Re: How to scale stockfish NNUE score?] by [[Daniel Shawul]], [[CCC]], October 17, 2020
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75418 Embedding Stockfish NNUE to ANY CHESS ENGINE: YouTube series] by [[Maksim Korzh]], [[CCC]], October 17, 2020 » [[NNUE]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75482 BBC 1.3 + Stockfish NNUE released!] by [[Maksim Korzh]], [[CCC]], October 21, 2020
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=75541 BBC 1.4 + Stockfish NNUE + Online GUI + Opening book - FINAL RELEASE!] by [[Maksim Korzh]], [[CCC]], October 25, 2020
  
 
=External Links=
 
=External Links=
 
== GitHub==
 
== GitHub==
 
* [https://github.com/maksimKorzh/bbc GitHub - maksimKorzh/bbc: Bit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King]
 
* [https://github.com/maksimKorzh/bbc GitHub - maksimKorzh/bbc: Bit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King]
 
+
* [https://github.com/maksimKorzh/uci-gui GitHub - maksimKorzh/uci-gui: Web based GUI for UCI chess engine]
 
==YouTube==
 
==YouTube==
# [https://youtu.be/QUNP-UjujBM Intro] » [[Bitboards]]
+
===BBC===
 +
'''Bitboard CHESS ENGINE in C'''
 +
# [https://youtu.be/QUNP-UjujBM Intro] » <span style="background-color: #ffffac;">[[Bitboards]]</span>
 
# [https://youtu.be/o-ySJ2EBarY Creating comfortable conditions for development]
 
# [https://youtu.be/o-ySJ2EBarY Creating comfortable conditions for development]
# [https://youtu.be/OTWG4dERdSc Generating pre-calculated PAWN ATTACK tables] » [[Pawn Attacks (Bitboards)]]
+
# [https://youtu.be/OTWG4dERdSc Generating pre-calculated PAWN ATTACK tables] » <span style="background-color: #ffffac;">[[Pawn Attacks (Bitboards)]]</span>
# [https://youtu.be/nZLuLn9JW0E Generating pre-calculated KNIGHT ATTACK table] » [[Knight Pattern#KnightAttacks|Knight Attacks]]
+
# [https://youtu.be/nZLuLn9JW0E Generating pre-calculated KNIGHT ATTACK table] » <span style="background-color: #ffffac;">[[Knight Pattern#KnightAttacks|Knight Attacks]]</span>
# [https://youtu.be/dWfwcfWg4XY Generating pre-calculated KING ATTACK tables] » [[King Pattern#KingAttacks|King Attacks]]
+
# [https://youtu.be/dWfwcfWg4XY Generating pre-calculated KING ATTACK tables] » <span style="background-color: #ffffac;">[[King Pattern#KingAttacks|King Attacks]]</span>
# [https://youtu.be/Obe1-u3S0Y4 Masking relevant bishop occupancy bits to form a key for MAGIC BITBOARDS] » [[Magic Bitboards]]
+
# [https://youtu.be/Obe1-u3S0Y4 Masking relevant bishop occupancy bits to form a key for MAGIC BITBOARDS] » <span style="background-color: #ffffac;">[[Magic Bitboards]]</span>
 
# [https://youtu.be/bL7LW3jntw0 Masking relevant ROOK OCCUPANCY BITS to form a key for MAGIC BITBOARDS]
 
# [https://youtu.be/bL7LW3jntw0 Masking relevant ROOK OCCUPANCY BITS to form a key for MAGIC BITBOARDS]
# [https://youtu.be/XFiZ3tjt7K4 Generating SLIDER PIECES ATTACKS on the fly for MAGIC BITBOARD purposes] » [[Sliding Piece Attacks]]
+
# [https://youtu.be/XFiZ3tjt7K4 Generating SLIDER PIECES ATTACKS on the fly for MAGIC BITBOARD purposes] » <span style="background-color: #ffffac;">[[Sliding Piece Attacks]]</span>
# [https://youtu.be/0F_aeUik91A Implementing BIT COUNT routine (Brian Kernighan's way)] » [[Population Count#BrianKernighansway|Population Count - Brian Kernighan's way]]
+
# [https://youtu.be/0F_aeUik91A Implementing BIT COUNT routine (Brian Kernighan's way)] » <span style="background-color: #ffffac;">[[Population Count#BrianKernighansway|Population Count - Brian Kernighan's way]]</span>
# [https://youtu.be/JhLgV2P9sBg Getting least significant 1st BIT INDEX] » [[BitScan#Index of LS1B by Popcount|Index of LS1B by Popcount]]
+
# [https://youtu.be/JhLgV2P9sBg Getting least significant 1st BIT INDEX] » <span style="background-color: #ffffac;">[[BitScan#Index of LS1B by Popcount|Index of LS1B by Popcount]]</span>
 
# [https://youtu.be/nyk3usU95IY Populating OCCUPANCY sets to multiply them later by MAGIC NUMBERS]
 
# [https://youtu.be/nyk3usU95IY Populating OCCUPANCY sets to multiply them later by MAGIC NUMBERS]
 
# [https://youtu.be/gaXLyW-yMvg Generating relevant OCCUPANCY BIT COUNT lookup tables for sliding pieces]
 
# [https://youtu.be/gaXLyW-yMvg Generating relevant OCCUPANCY BIT COUNT lookup tables for sliding pieces]
# [https://youtu.be/JjFYmkUhLN4 Implementing pseudo RANDOM NUMBER generator using XORSHIFT32 algorithm] » [[Pseudorandom Number Generator]]
+
# [https://youtu.be/JjFYmkUhLN4 Implementing pseudo RANDOM NUMBER generator using XORSHIFT32 algorithm] » <span style="background-color: #ffffac;">[[Pseudorandom Number Generator]]</span>
# [https://youtu.be/KqWeOVyOoyU Generating MAGIC NUMBER candidates]
+
# [https://youtu.be/KqWeOVyOoyU Generating MAGIC NUMBER candidates] » <span style="background-color: #ffffac;">[[Looking for Magics]]</span>
 
# [https://youtu.be/UnEu5GOiSEs Generating MAGIC NUMBERS via brute force trial and error method]
 
# [https://youtu.be/UnEu5GOiSEs Generating MAGIC NUMBERS via brute force trial and error method]
# [https://youtu.be/1lAM8ffBg0A Initializing SLIDER PIECES attack tables using PLAIN MAGIC BITBOARDS]
+
# [https://youtu.be/1lAM8ffBg0A Initializing SLIDER PIECES attack tables using PLAIN MAGIC BITBOARDS] » <span style="background-color: #ffffac;">[[Magic Bitboards#Plain|Plain Magic Bitboards]]</span>
# [https://youtu.be/ZBBju42pKvw Defining BITBOARDS, OCCUPANCIES and helper variables]
+
# [https://youtu.be/ZBBju42pKvw Defining BITBOARDS, OCCUPANCIES and helper variables] » <span style="background-color: #ffffac;">[[Bitboard Board-Definition]]</span>
# [https://youtu.be/iJ0VpXq90zY Printing CHESS BOARD position and game state variables]
+
# [https://youtu.be/iJ0VpXq90zY Printing CHESS BOARD position and game state variables] » <span style="background-color: #ffffac;">[[Chess Position]]</span>
# [https://youtu.be/IdFHFRiQtj8 Parsing FEN string to initialize BITBOARDS, OCUUPANCIES & board state]
+
# [https://youtu.be/IdFHFRiQtj8 Parsing FEN string to initialize BITBOARDS, OCUUPANCIES & board state] » <span style="background-color: #ffffac;">[[Forsyth-Edwards Notation]]</span>
 
# [https://youtu.be/KSs4KRQPOKE Getting QUEEN ATTACKS by looking up bishop & rook attack tables]
 
# [https://youtu.be/KSs4KRQPOKE Getting QUEEN ATTACKS by looking up bishop & rook attack tables]
# [https://youtu.be/v9CEqjliv3E Implementing routine to find out whether SQUARE IS ATTACKED]
+
# [https://youtu.be/v9CEqjliv3E Implementing routine to find out whether SQUARE IS ATTACKED] » <span style="background-color: #ffffac;">[[Square Attacked By]]</span>
# [https://youtu.be/eRvCLaa-3Rk Writing GENERATE MOVES function skeleton]
+
# [https://youtu.be/eRvCLaa-3Rk Writing GENERATE MOVES function skeleton] »<span style="background-color: #ffffac;">[[Move Generation]]</span>
# [https://youtu.be/62Hy1JEehqI Generating QUIET PAWN moves]
+
# [https://youtu.be/62Hy1JEehqI Generating QUIET PAWN moves] » <span style="background-color: #ffffac;">[[Pawn Pushes (Bitboards)]]</span>
# [https://youtu.be/cezEoX8WpWs Generating PAWN CAPTURE moves]
+
# [https://youtu.be/cezEoX8WpWs Generating PAWN CAPTURE moves] » <span style="background-color: #ffffac;">[[Pawn Attacks (Bitboards)#PawnCaptures|Pawn Captures]]</span>
# [https://youtu.be/TXvV2jVl7co Generating CASTLING MOVES]
+
# [https://youtu.be/TXvV2jVl7co Generating CASTLING MOVES] » <span style="background-color: #ffffac;">[[Castling]]</span>
 
# [https://youtu.be/clNvT1W93o4 Generating SLIDER & LEAPER piece MOVES by attack tables lookup]
 
# [https://youtu.be/clNvT1W93o4 Generating SLIDER & LEAPER piece MOVES by attack tables lookup]
# [https://youtu.be/ubX5lyIQoSs Binary formatting of MOVE ITEMS]
+
# [https://youtu.be/ubX5lyIQoSs Binary formatting of MOVE ITEMS] » <span style="background-color: #ffffac;">[[Encoding Moves]]</span>
# [https://youtu.be/gyf3mr1LI7A Encoding & decoding MOVE ITEMS]
+
# [https://youtu.be/gyf3mr1LI7A Encoding & decoding MOVE ITEMS]
 +
# [https://youtu.be/AINYYiV-83I Implementing MOVE LIST + ADD MOVE, PRINT MOVE, PRINT MOVE LIST functions] » <span style="background-color: #ffffac;">[[Move List]]</span>
 +
# [https://youtu.be/944aTQQnWAA Populating MOVE LIST with newly GENERATED MOVES]
 +
# [https://youtu.be/CsUelozl0a8 Preserving & restoring BOARD STATE aka COPY/MAKE approach] » <span style="background-color: #ffffac;">[[Copy-Make]]</span>
 +
# [https://youtu.be/coVPpTJN9iU Implementing MAKE MOVE function (moving pieces)] » <span style="background-color: #ffffac;">[[Make Move]]</span>
 +
# [https://youtu.be/nkRrQnhRo80 Implementing MAKE MOVE function (handling captures)] » <span style="background-color: #ffffac;">[[Captures]]</span>
 +
# [https://youtu.be/gnDyJImkfVo Implementing MAKE MOVE function (handling pawn promotions)] » <span style="background-color: #ffffac;">[[Promotions]]</span>
 +
# [https://youtu.be/5h5Z3bx0EKc Implementing MAKE MOVE function (handling enpassant moves)] » <span style="background-color: #ffffac;">[[En passant]]</span>
 +
# [https://youtu.be/J-k2p1g6VTQ Implementing MAKE MOVE function (handling double pawn pushes)] » <span style="background-color: #ffffac;">[[Pawn Push#DoublePush|Double Pawn Push]]</span>
 +
# [https://youtu.be/pHohRpH30a0 Implementing MAKE MOVE function (handling castling moves)] » <span style="background-color: #ffffac;">[[Castling]]</span>
 +
# [https://youtu.be/zOWPZ4fuLGg Implementing MAKE MOVE function (updating castling rights)] » <span style="background-color: #ffffac;">[[Castling Rights]]</span>
 +
# [https://youtu.be/ZBotXGrgbdg Implementing MAKE MOVE function (updating occupancy bitboards)] » <span style="background-color: #ffffac;">[[Occupancy]]</span>
 +
# [https://youtu.be/sg4AMsXYuk4 Implementing MAKE MOVE function (checking whether the king is in check)] » <span style="background-color: #ffffac;">[[Check]]</span>
 +
# [https://youtu.be/bK_dg_gMW6s Writing a cross-platform function for GETTING TIME IN MILLISECONDS]
 +
# [https://youtu.be/o0xCJDhbSUM Writing PERFT DRIVER function] » <span style="background-color: #ffffac;">[[Perft]]</span>
 +
# [https://youtu.be/p2VuC0xTPoc Writing PERFT TEST function]
 +
# [https://youtu.be/1gOYB9HelXk Connecting to the GUI (parse move string)] » <span style="background-color: #ffffac;">[[GUI]], [[UCI]]</span>
 +
# [https://youtu.be/giSqiH6aa_o Connecting to the GUI (parse "position" command)]
 +
# [https://youtu.be/lb46nX6gSBw Connecting to the GUI (parse "go" command)]
 +
# [https://youtu.be/rW2jzTA4kW4 Connecting to the GUI (main loop) + BONUS (TSCP vs BBC blitz game)] » <span style="background-color: #ffffac;">[[TSCP]]</span>
 +
# [https://youtu.be/CMshozGbBdw Implementing RUDIMENTARY EVALUATION (material score)] » <span style="background-color: #ffffac;">[[Evaluation]], [[Material]]</span>
 +
# [https://youtu.be/E2JzRNI1ODI Implementing RUDIMENTARY EVALUATION (positional piece scores)]
 +
# [https://youtu.be/b8OcJM3VeaU Writing NEGAMAX ALPHA BETA skeleton] » <span style="background-color: #ffffac;">[[Negamax]], [[Alpha-Beta]]</span>
 +
# [https://youtu.be/lAAdjCkWd9s Detecting CHECKMATE and STALEMATE] » <span style="background-color: #ffffac;">[[Checkmate]], [[Stalemate]]</span>
 +
# [https://youtu.be/WzEhVjdNByg Implementing QUIESCENCE SEARCH] » <span style="background-color: #ffffac;">[[Quiescence Search]]</span>
 +
# [https://youtu.be/NMNBWxinpPY Defining MVV LVA (Most Valuable Victim - Least Valuable Attacker) table] » <span style="background-color: #ffffac;">[[MVV-LVA|MVV/LVA]]</span>
 +
# [https://youtu.be/VeJnLN7jFm4 Writing SCORE MOVE function] » <span style="background-color: #ffffac;">[[Move Ordering]]</span>
 +
# [https://youtu.be/3-9tzzmtQQ0 Writing SORT MOVES function]
 +
# [https://youtu.be/DVSp_31iTBU Applying MOVE ORDERING to sort captures] » <span style="background-color: #ffffac;">[[Captures]]</span>
 +
# [https://youtu.be/MA6d1hZ1YBE Sorting KILLER & HISTORY moves] » <span style="background-color: #ffffac;">[[Killer Heuristic]], [[History Heuristic]]</span>
 +
# [https://youtu.be/LOR-dkAkUyM Collecting PV (Principle Variation) from the search] » <span style="background-color: #ffffac;">[[Principal Variation]]</span>
 +
# [https://youtu.be/yVyQSUYts0A Implementing ITERATIVE DEEPENING] » <span style="background-color: #ffffac;">[[Iterative Deepening]]</span>
 +
# [https://youtu.be/heJUljl_zNE Sorting PV moves + some BONUS TALK at the end]
 +
# [https://youtu.be/Gs4Zk6aihyQ Implementing PVS (Principle Variation Search)] » <span style="background-color: #ffffac;">[[Principal Variation Search]]</span>
 +
# [https://youtu.be/OLT0bU0SIeg Applying LMR (Late Move Reduction)] » <span style="background-color: #ffffac;">[[Late Move Reductions]]</span>
 +
# [https://youtu.be/n6xAzopULxU Applying NULL MOVE PRUNING] » <span style="background-color: #ffffac;">[[Null Move Pruning]]</span>
 +
# [https://youtu.be/1LmdOHshYkI Adjusting ASPIRATION WINDOW during iterative deepening] » <span style="background-color: #ffffac;">[[Aspiration Windows]]</span>
 +
# [https://youtu.be/azEmgbdiecc BUG ALERT!!! Fixing PVS duplication bug]
 +
# [https://youtu.be/t48NYINOekw Handling TIME CONTROLS (forked from VICE by BluefeverSoftware)] » <span style="background-color: #ffffac;">[[Vice]]</span>
 +
# [https://youtu.be/W7dah-dat8Q Zobrist HASHING (initialize random keys)] » <span style="background-color: #ffffac;">[[Zobrist Hashing]]</span>
 +
# [https://youtu.be/sV2C7hx-gOE Zobrist HASHING (generate hash key)]
 +
# [https://youtu.be/5EMLgIFv5Qg Zobrist HASHING (hash keys incremental updates)] » <span style="background-color: #ffffac;">[[Incremental Updates]]
 +
# [https://youtu.be/fEHjpzrcRxk Implementing HASH TABLE aka transposition table (define & initialize)] » <span style="background-color: #ffffac;">[[Transposition Table]]</span> <ref>[http://web.archive.org/web/20070809015843/www.seanet.com/%7Ebrucemo/topics/hashing.htm The Main Transposition Table] from [[Bruce Moreland|Bruce Moreland's]] [http://web.archive.org/web/20070607231311/www.brucemo.com/compchess/programming/index.htm Programming Topics]</ref>
 +
# [https://youtu.be/NcboP08y_JQ Implementing HASH TABLE aka transposition table (read/write hash entry)]
 +
# [https://youtu.be/HNtAt9RMJVs Implementing HASH TABLE aka transposition table (connecting to search)]
 +
# [https://youtu.be/4SXKBTGUkjk BUG ALERT! Fixing lack of enpassant & side hashing on null move]
 +
# [https://youtu.be/g1b_rT9VqAw More search BUG FIXES &CLEANUPS]
 +
# [https://youtu.be/XfeuxubYlT0 Handling MATING SCORES in HASH TABLE aka transposition table] » <span style="background-color: #ffffac;">[[Score#MateScores|Mate Scores]]</span>
 +
# [https://youtu.be/WcoOTg7Aq4E Sending MATING SCORES to GUI + some cleanups & adjustments]
 +
# [https://youtu.be/QhFtquEeffA Detecting THREE FOLD REPETITIONS] » <span style="background-color: #ffffac;">[[Repetitions]]</span>
 +
# [https://youtu.be/F8ueIueVsHI Final (hopefully!) SEARCH BUG FIXES]
 +
# [https://youtu.be/Yqpm6Ad4scI Improving EVALUATION (setting file & rank masks)] » <span style="background-color: #ffffac;">[[Evaluation]], [[Pawn Pattern and Properties]]</span>
 +
# [https://youtu.be/iwBkAEC4KSs Improving EVALUATION (initializing isolated & passed pawn masks)] » <span style="background-color: #ffffac;">[[Isolated Pawns (Bitboards)]], [[Passed Pawns (Bitboards)]]</span>
 +
# [https://youtu.be/CgvZMsJImJg Improving EVALUATION (double & isolated penalties, passed pawns bonus)]
 +
# [https://youtu.be/Bp4F_321j4I Improving EVALUATION (open & semi open file scoring)] » <span style="background-color: #ffffac;">[[Pawns and Files (Bitboards)]], [[Open File]]</span>
 +
# [https://youtu.be/iq2lxyjWZvA Improving EVALUATION (mobility and king safety)] » <span style="background-color: #ffffac;">[[Mobility]], [[King Safety]]</span>
 +
# [https://youtu.be/1SgnTKzWuss BBC 1.0 - RELEASE]
 +
# [https://youtu.be/JYF6A0xvvtY Improving BBC chess engine: TAPERED EVALUATION (getting game phase scores)] » <span style="background-color: #ffffac;">[[Tapered Eval]], [[PeSTO]]</span>
 +
# [https://youtu.be/bOmXClI6Xpw Improving BBC chess engine: TAPERED EVALUATION (interpolating scores) + BONUS: BBC vs VICE match!] » <span style="background-color: #ffffac;">[[Vice]]</span>
 +
===[[GUI]]===
 +
'''Web based GUI for UCI CHESS ENGINE'''
 +
# [https://youtu.be/_0uKZbHWVKM INTRO & DEMO]
 +
# [https://youtu.be/OjZy52Tt6mY Install dependencies, CREATE WEB APP & render the CHESS BOARD]
 +
# [https://youtu.be/9Hn1gnTYNS4 Connecting engine back-end & MAKING IT PLAY!]
 +
# [https://youtu.be/ZIyDWQN2buk Printing game status, FEN & PGN]
 +
# [https://youtu.be/ihHHW_CA72M Adding GAME CONTROL buttons]
 +
# [https://youtu.be/TlxgZRd8VWk Adding MOVE STATS]
 +
# [https://youtu.be/PWnypt2k56I Fixing layout & setting position from FEN string on button click]
 +
# [https://youtu.be/DCWtkpEF8KY Adding MOVE TIME & FIXED DEPTH controls]
 +
# [https://youtu.be/tqR4tRyfTIg Implementing DOWNLOAD PGN feature]
 +
# [https://youtu.be/w67CEEjqIjw Encapsulating CHESS ENGINE for SIMULTANEOUS PLAY]
 +
# [https://youtu.be/_u-VAFwY95U final adjustments and DEPLOY at pythonanywhere.com]
 +
===[[NNUE]]===
 +
'''Embedding Stockfish NNUE to ANY CHESS ENGINE'''
 +
# [https://youtu.be/zieTAE2zN9w Intro & demo] » <span style="background-color: #ffffac;">[[Stockfish NNUE]], [[Scorpio#NNUE|Scorpio NNUE]]</span>
 +
# [https://youtu.be/59Fp4JVNob0 Compiling existing ENGINE with NNUE library]
 +
# [https://youtu.be/puLvzQnUoH8 Extracting PIECES & SQUARES for direct NNUE probing]
 +
# [https://youtu.be/cOdPe1JvVU8 Incorporating NNUE SCORES into EVALUATION function]
 +
# [https://youtu.be/30L9hx6hsmg bug fixes & experiments]
 +
# [https://youtu.be/xFeJ9PBWpco WINDOWS compatibility added]
 +
# [https://youtu.be/Olnk9aa1zMI Switching to pure NNUE evaluation + important BUG FIX]
  
 
=References=  
 
=References=  
Line 58: Line 151:
 
[[Category:Acronym]]
 
[[Category:Acronym]]
 
[[Category:Didactic]]
 
[[Category:Didactic]]
 +
[[Category:NNUE]]

Revision as of 19:10, 26 October 2020

Home * Engines * BBC

BBC, (Bit Board Chess)
a didactic bitboard chess engine by Maksim Korzh alias Code Monkey King, written in C. BBC is subject of a YouTube video tutorial started in summer 2020 [1], actually work in progress. The open source engine is further published on GitHub [2], and will be compliant to the UCI protocol. While the series offers a nice introduction in chess engine programming and bitboard techniques, the advanced approach of Magic Bitboards to determine sliding piece attacks with all its lengthy initialization topics might be hard to understand and deterrent for the intended novice target group. The linewise approaches of First Rank Attacks to introduce occupancy lookups, followed by Kindergarten Bitboards - as intermediate step towards magics bitboards - seem didactically more appropriate. Anyway, a valuable video series covering various aspects of computer chess programming. BBC 1.0 was released on September 24, 2020 [3], BBC 1.3 on October 21, 2020, utilizing Stockfish's NNUE evaluation via Daniel Shawul's Scorpio NNUE egbbdll probing library [4].

See also

Forum Posts

Re: How to scale stockfish NNUE score? by Daniel Shawul, CCC, October 17, 2020

External Links

GitHub

YouTube

BBC

Bitboard CHESS ENGINE in C

  1. Intro » Bitboards
  2. Creating comfortable conditions for development
  3. Generating pre-calculated PAWN ATTACK tables » Pawn Attacks (Bitboards)
  4. Generating pre-calculated KNIGHT ATTACK table » Knight Attacks
  5. Generating pre-calculated KING ATTACK tables » King Attacks
  6. Masking relevant bishop occupancy bits to form a key for MAGIC BITBOARDS » Magic Bitboards
  7. Masking relevant ROOK OCCUPANCY BITS to form a key for MAGIC BITBOARDS
  8. Generating SLIDER PIECES ATTACKS on the fly for MAGIC BITBOARD purposes » Sliding Piece Attacks
  9. Implementing BIT COUNT routine (Brian Kernighan's way) » Population Count - Brian Kernighan's way
  10. Getting least significant 1st BIT INDEX » Index of LS1B by Popcount
  11. Populating OCCUPANCY sets to multiply them later by MAGIC NUMBERS
  12. Generating relevant OCCUPANCY BIT COUNT lookup tables for sliding pieces
  13. Implementing pseudo RANDOM NUMBER generator using XORSHIFT32 algorithm » Pseudorandom Number Generator
  14. Generating MAGIC NUMBER candidates » Looking for Magics
  15. Generating MAGIC NUMBERS via brute force trial and error method
  16. Initializing SLIDER PIECES attack tables using PLAIN MAGIC BITBOARDS » Plain Magic Bitboards
  17. Defining BITBOARDS, OCCUPANCIES and helper variables » Bitboard Board-Definition
  18. Printing CHESS BOARD position and game state variables » Chess Position
  19. Parsing FEN string to initialize BITBOARDS, OCUUPANCIES & board state » Forsyth-Edwards Notation
  20. Getting QUEEN ATTACKS by looking up bishop & rook attack tables
  21. Implementing routine to find out whether SQUARE IS ATTACKED » Square Attacked By
  22. Writing GENERATE MOVES function skeleton »Move Generation
  23. Generating QUIET PAWN moves » Pawn Pushes (Bitboards)
  24. Generating PAWN CAPTURE moves » Pawn Captures
  25. Generating CASTLING MOVES » Castling
  26. Generating SLIDER & LEAPER piece MOVES by attack tables lookup
  27. Binary formatting of MOVE ITEMS » Encoding Moves
  28. Encoding & decoding MOVE ITEMS
  29. Implementing MOVE LIST + ADD MOVE, PRINT MOVE, PRINT MOVE LIST functions » Move List
  30. Populating MOVE LIST with newly GENERATED MOVES
  31. Preserving & restoring BOARD STATE aka COPY/MAKE approach » Copy-Make
  32. Implementing MAKE MOVE function (moving pieces) » Make Move
  33. Implementing MAKE MOVE function (handling captures) » Captures
  34. Implementing MAKE MOVE function (handling pawn promotions) » Promotions
  35. Implementing MAKE MOVE function (handling enpassant moves) » En passant
  36. Implementing MAKE MOVE function (handling double pawn pushes) » Double Pawn Push
  37. Implementing MAKE MOVE function (handling castling moves) » Castling
  38. Implementing MAKE MOVE function (updating castling rights) » Castling Rights
  39. Implementing MAKE MOVE function (updating occupancy bitboards) » Occupancy
  40. Implementing MAKE MOVE function (checking whether the king is in check) » Check
  41. Writing a cross-platform function for GETTING TIME IN MILLISECONDS
  42. Writing PERFT DRIVER function » Perft
  43. Writing PERFT TEST function
  44. Connecting to the GUI (parse move string) » GUI, UCI
  45. Connecting to the GUI (parse "position" command)
  46. Connecting to the GUI (parse "go" command)
  47. Connecting to the GUI (main loop) + BONUS (TSCP vs BBC blitz game) » TSCP
  48. Implementing RUDIMENTARY EVALUATION (material score) » Evaluation, Material
  49. Implementing RUDIMENTARY EVALUATION (positional piece scores)
  50. Writing NEGAMAX ALPHA BETA skeleton » Negamax, Alpha-Beta
  51. Detecting CHECKMATE and STALEMATE » Checkmate, Stalemate
  52. Implementing QUIESCENCE SEARCH » Quiescence Search
  53. Defining MVV LVA (Most Valuable Victim - Least Valuable Attacker) table » MVV/LVA
  54. Writing SCORE MOVE function » Move Ordering
  55. Writing SORT MOVES function
  56. Applying MOVE ORDERING to sort captures » Captures
  57. Sorting KILLER & HISTORY moves » Killer Heuristic, History Heuristic
  58. Collecting PV (Principle Variation) from the search » Principal Variation
  59. Implementing ITERATIVE DEEPENING » Iterative Deepening
  60. Sorting PV moves + some BONUS TALK at the end
  61. Implementing PVS (Principle Variation Search) » Principal Variation Search
  62. Applying LMR (Late Move Reduction) » Late Move Reductions
  63. Applying NULL MOVE PRUNING » Null Move Pruning
  64. Adjusting ASPIRATION WINDOW during iterative deepening » Aspiration Windows
  65. BUG ALERT!!! Fixing PVS duplication bug
  66. Handling TIME CONTROLS (forked from VICE by BluefeverSoftware) » Vice
  67. Zobrist HASHING (initialize random keys) » Zobrist Hashing
  68. Zobrist HASHING (generate hash key)
  69. Zobrist HASHING (hash keys incremental updates) » Incremental Updates
  70. Implementing HASH TABLE aka transposition table (define & initialize) » Transposition Table [5]
  71. Implementing HASH TABLE aka transposition table (read/write hash entry)
  72. Implementing HASH TABLE aka transposition table (connecting to search)
  73. BUG ALERT! Fixing lack of enpassant & side hashing on null move
  74. More search BUG FIXES &CLEANUPS
  75. Handling MATING SCORES in HASH TABLE aka transposition table » Mate Scores
  76. Sending MATING SCORES to GUI + some cleanups & adjustments
  77. Detecting THREE FOLD REPETITIONS » Repetitions
  78. Final (hopefully!) SEARCH BUG FIXES
  79. Improving EVALUATION (setting file & rank masks) » Evaluation, Pawn Pattern and Properties
  80. Improving EVALUATION (initializing isolated & passed pawn masks) » Isolated Pawns (Bitboards), Passed Pawns (Bitboards)
  81. Improving EVALUATION (double & isolated penalties, passed pawns bonus)
  82. Improving EVALUATION (open & semi open file scoring) » Pawns and Files (Bitboards), Open File
  83. Improving EVALUATION (mobility and king safety) » Mobility, King Safety
  84. BBC 1.0 - RELEASE
  85. Improving BBC chess engine: TAPERED EVALUATION (getting game phase scores) » Tapered Eval, PeSTO
  86. Improving BBC chess engine: TAPERED EVALUATION (interpolating scores) + BONUS: BBC vs VICE match! » Vice

GUI

Web based GUI for UCI CHESS ENGINE

  1. INTRO & DEMO
  2. Install dependencies, CREATE WEB APP & render the CHESS BOARD
  3. Connecting engine back-end & MAKING IT PLAY!
  4. Printing game status, FEN & PGN
  5. Adding GAME CONTROL buttons
  6. Adding MOVE STATS
  7. Fixing layout & setting position from FEN string on button click
  8. Adding MOVE TIME & FIXED DEPTH controls
  9. Implementing DOWNLOAD PGN feature
  10. Encapsulating CHESS ENGINE for SIMULTANEOUS PLAY
  11. final adjustments and DEPLOY at pythonanywhere.com

NNUE

Embedding Stockfish NNUE to ANY CHESS ENGINE

  1. Intro & demo » Stockfish NNUE, Scorpio NNUE
  2. Compiling existing ENGINE with NNUE library
  3. Extracting PIECES & SQUARES for direct NNUE probing
  4. Incorporating NNUE SCORES into EVALUATION function
  5. bug fixes & experiments
  6. WINDOWS compatibility added
  7. Switching to pure NNUE evaluation + important BUG FIX

References

Up one Level