Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by maksimKorzh »

Hey what's up guys, Code Monkey King's here.

Before anything else I'd like to pay a tribute to Gerd Isenberg who has kindly added some pages about me and my chess engines into a CPW:
CMK: https://www.chessprogramming.org/Maksim_Korzh
BBC: https://www.chessprogramming.org/BBC
THANKS YOU SO MUCH GERD!

Also I'd like to thanks all those of you guys who has inspired and supported me with this series.

Now let's get to the point.

I'm now working on Bitboard CHESS ENGINE in C YouTube series (the simplest to understand bitboard engine!):
https://www.youtube.com/watch?v=o-ySJ2E ... wfiWNI76Cs

Source code of the current development state:
https://github.com/maksimKorzh/chess_pr ... test/bbc.c
NOTE: make sure to compile with GCC. It's developed under linux but simultaneously cross compiled for windows, see makefile:
https://github.com/maksimKorzh/chess_pr ... t/makefile

A few words about the engine we're developing:
- bitboard board representation
- pre-calculated attack tables
- magic bitboards for generating sliding pieces attacks (including tutorial on how to generate magic numbers, based on idea by Tord Romstad)
- copy/make approach for making moves and taking them back
- make move function level of distinguishing between quite move and captures (for later quiescence search purposes)
- perft testing

some controversial implementations:
- global variables are used everywhere it's possible (see reasons WHY below)
- copy/make happens within a function stack (COPY -> MAKE -> COPY BACK)

A few words about the reasons behind the particular implementation (I know about OOP, encapsulation, passing pointers etc.):
- global variables are simplest to understand so viewer can focus on chess programming techniques instead of C programming best practices
- global variables save lots of source lines because no need for never ending initialization.
- current copy/make implementation is forced by the global variables and also saves some source lines

A few words about the purposes of creating this tutorial series and goals I'm targeting:
- low entry threshold (use only basic knowledge of C programming to avoid viewers getting distracted by advanced C programming techniques)
- create the simplest implementation of the complex magic bitboards based chess engine
- create as implementation agnostic as possible source code so anyone can USE THE IDEAS without any plagiarism
- create MODULAR engine, e.g. while implementing search & move ordering avoid touching code written before
- literally sacrifice almost anything for the TRUE DIDACTIC purposes

CURRENT DEVELOPMENT STATE:
We've just passed the perft test, so it's just the right time to JUMP IN for NEWCOMERS.
Assuming modular approach while writing this engine you don't need to know how move generator works in order to make use of it,
so you can kick start with actually making engine play chess via following upcoming tutorials!

NEXT STEPS:
- implement a minimal UCI interaction to debug search & evaluation in the GUI (extended UCI protocol is coming later)
- implement negamax search with alpha beta pruning (fail-hard framework)
- MVV/LVA/killer/history/PV heuristics for move ordering
- bitboard evaluation
- and much more...

SUMMARY:
Most likely my work won't be interesting to experienced chess engine developers for I'm targeting the novice auditory.
I wish I could have this like tutorials back in those days when just started chess programming.
Current series is dedicated to everyone HAVING ISSUES with READING OPEN SOURCE chess engine's code.
(I'm starting understanding it after about 5 years of chess programming)
So even if you have a very basic understanding of C programming language (or coming from high level languages like JS or Python) these tutorials are just the case for you!
ChessRenewal
Posts: 15
Joined: Thu Jul 25, 2019 7:13 pm
Full name: Jay Warendorff

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by ChessRenewal »

Your Bitboard Chess Engine in C YouTube series is marvelous. I am very interested in all of the details on how a bitboard chess engine works and your series has very detailed explanations which is exactly what I want to know. I am fairly new to C programming coming from having more experience in programming in a higher level language so I appreciate your focus on the chess programming rather than the C programming. Maybe after the initial version of the bitboard engine is completed, a second version can be made with more refined C language constructs if that would result in a speedup. But already it is very nice to see that move generation is significantly faster than in your array based chess engine. Now that you have implemented move generation, I especially look forward to your further development of the code having the engine beginning to make moves and later being able to play against other engines. Thank you very much!
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by maksimKorzh »

ChessRenewal wrote: Mon Sep 07, 2020 12:36 am Your Bitboard Chess Engine in C YouTube series is marvelous. I am very interested in all of the details on how a bitboard chess engine works and your series has very detailed explanations which is exactly what I want to know. I am fairly new to C programming coming from having more experience in programming in a higher level language so I appreciate your focus on the chess programming rather than the C programming. Maybe after the initial version of the bitboard engine is completed, a second version can be made with more refined C language constructs if that would result in a speedup. But already it is very nice to see that move generation is significantly faster than in your array based chess engine. Now that you have implemented move generation, I especially look forward to your further development of the code having the engine beginning to make moves and later being able to play against other engines. Thank you very much!
Hi Chess Renewal

Thanks for such an inspiring feedback!
Maybe after the initial version of the bitboard engine is completed, a second version can be made with more refined C language constructs if that would result in a speedup
The style of C programming doesn't affect performance itself. It's the matter of techniques being involved. Say we could create take_back() function to save time on copying board state, but the trick is that BBC leave a HUGE field of improvements. It tries to implement the simplest techniques possible - those that are IMO best for DIDACTIC purposes. It's kind of like a bare minimum to make engine solid)

If you want to have a look at "real" code see fruit-reloaded:
https://github.com/Akusari/Fruit-reload ... master/src

Btw, I'm very tempted to know whether it would be as clear as BBC to you))) Please let me know! I just want to check my hypothesis on having big trouble in understanding of "best practices" code for beginners and non C programmers. Fruit reloaded is a fantastic didactic engine, probably the best one ever BUT I've started understanding it's code after years of practice)
Now that you have implemented move generation, I especially look forward to your further development of the code having the engine beginning to make moves and later being able to play against other engines.
Yup))) The most exciting topics are just about to begin) Just a few boring videos to connect engine to GUI so we could debug in GUI and then we go for search & evaluation watching how it becomes stronger and stronger!
ChessRenewal
Posts: 15
Joined: Thu Jul 25, 2019 7:13 pm
Full name: Jay Warendorff

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by ChessRenewal »

Fruit reloaded looks very interesting, but in terms of the level I am presently at in understanding C language programming and chess engine algorithms your bitboard engine with commented code and extensive video discussions is much more instructive for me now and probably for a long time to come. When you come to implementing algorithms such as the transposition table and others, please provide explanations of how they work. Your video series is certainly an invaluable contribution to all who would like to understand and make a chess engine!
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by maksimKorzh »

ChessRenewal wrote: Tue Sep 08, 2020 5:21 am Fruit reloaded looks very interesting, but in terms of the level I am presently at in understanding C language programming and chess engine algorithms your bitboard engine with commented code and extensive video discussions is much more instructive for me now and probably for a long time to come. When you come to implementing algorithms such as the transposition table and others, please provide explanations of how they work. Your video series is certainly an invaluable contribution to all who would like to understand and make a chess engine!
I'll do my best! Thanks!
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by maksimKorzh »

Hey what's up guys, Code Monkey King's here with a new update:

BBC has crushed TSCP in BLITZ 5+0!

-----------------BBC [new]-----------------
BBC [new] - TSCP : 11,0/16 11-5-0 (1010011110111011) 69% +139
-----------------TSCP-----------------
TSCP - BBC [new] : 5,0/16 5-11-0 (0101100001000100) 31% -139


PGN link: https://github.com/maksimKorzh/chess_pr ... C_TSCP.pgn
Video overview with comments on evaluation updates:

Output of ELOStat tool (based on above PGN):
Program Elo + - Games Score Av.Op. Draws

1 BBC [new] : 1721 216 192 16 68.8 % 1585 0.0 %
2 TSCP : 1585 192 216 16 31.2 % 1721 0.0 %

(I used TSCP's classical time control rating as "start rating param" - is that correct?)

Here're some typical games:
[pgn][Event "Arena Tournament"]
[Site "maksim-Inspiron-3582"]
[Date "2020.09.24"]
[Round "1"]
[White "BBC [new]"]
[Black "TSCP"]
[Result "1-0"]
[BlackElo "1650"]
[ECO "D01"]
[Opening "Richter-Veresov, 3.Nf3"]
[Time "00:40:25"]
[Variation "2.Nf3 Nf6"]
[WhiteElo "2200"]
[TimeControl "300+0"]
[Termination "normal"]
[PlyCount "139"]
[WhiteType "program"]
[BlackType "program"]

1. Nf3 {(Ng1-f3 d7-d5 d2-d4 Nb8-c6 Nb1-c3 Ng8-f6 e2-e3 Bc8-f5 Bf1-d3 Bf5xd3
Qd1xd3) -0.00/11 9} d5 2. d4 {-0.00/12 9} Nf6 3. Nc3 {(Nb1-c3 e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ian Game"]
[Time "01:28:27"]
[Variation "3.Nxe5"]
[WhiteElo "1650"]
[TimeControl "300+0"]
[Termination "normal"]
[PlyCount "164"]
[WhiteType "program"]
[BlackType "program"]

1. e4 e5 {-0.00/12 9} 2. Nf3 Nf6 {-0.00/11 9} 3. Nxe5 Qe7 {-0.00/11 9} 4.
d4 {(d2d4 d7d6 e5f3 e7e4 c1e3 b8c6 b1c3 e4e7) +0.43/7 9} d6 {-0.00/11 9} 5.
Nf3 {(e5f3 e7e4 c1e3 f6d5 b1d2 e4e7 d2c4 b8c6) +0.38/7 9} Nxe4 {-0.00/11 8}
6. Be3 {(f1b5 c8d7 b5e2 b8c6 d4d5 c6e5 e1g1) +0.27/6 9} Nc6 {(Nb8-c6 Nb1-d2
Ne4-f6 Bf1-c4 Bc8-d7 O-O d6-d5 Bc4-e2 O-O-O Rf1-e1) -0.00/10 8} 7. Bb5
{(f1b5 c8d7 d4d5 c6e5 b5d7 e7d7 e1g1) +0.47/6 9} Bd7 {-0.00/11 8} 8. O-O
{(b5c6 d7c6 d4d5 c6b5 b1d2 f7f5 d2e4 f5e4) +0.40/6 8} d5 {(d6-d5 c2-c4
d5xc4 Bb5xc4 O-O-O Nb1-c3 Qe7-b4 Nc3xe4 Qb4xc4 Rf1-e1) -0.00/10 7} 9. Bxc6
{(b1d2 e8c8 f1e1 d8e8 d2e4 e7e4) +0.25/6 8} Bxc6 {-0.00/11 7} 10. Ne5
{(f3e5 e7e6 e5c6 e6c6 f2f3 e4f6) +0.29/6 8} Bb5 {(Bc6-b5 Rf1-e1 O-O-O
Nb1-d2 f7-f6 Nd2xe4 d5xe4 a2-a4 f6xe5 a4xb5 e5xd4) -0.00/11 7} 11. Re1
{(f1e1 e7b4 d1c1 f8d6 c2c3 b4a5 b1d2 d6e5 d4e5) +0.34/7 7} O-O-O {-0.00/10
7} 12. a4 {(a2a4 b5d7 f2f3 e4f6 b1c3 d8e8) +0.35/6 7} Ba6 {-0.00/11 6} 13.
Qg4+ {(d1g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-d8 Kb4-c5 Qd8-d5+ Kc5-b4 Qd5-c6 Kb4-b3
Qc6-e6+) +10.20/19 0} 77. Kd6 {(d5d6 g1d4 d6c6 f4e4 c6b5 d4c3 b5b6 e4d4)
-9.30/7 0} Ke4 {(Kf4-e4 Kd6-c6 Ke4-e5 Kc6-c7 Ke5-d5 Kc7-b7 Qg1-g6 Kb7-c7
Kd5-e5 Kc7-d7 Qg6-b6 Kd7-e7 Qb6-b7+ Ke7-d8 Ke5-d5 Kd8-e8) +10.20/15 0} 78.
Kc6 {(d6c6 g1d4 c6b5 e4d5 b5a5 d4c5 a5a4 c5d6) -9.30/7 0} Qd4 {-0.00/18 0}
79. Kb5 {(c6b5 e4d5 b5a5 d4c5 a5a4 c5b6 a4a3) -9.40/6 0} Kd5 {(Ke4-d5
Kb5-a6 Qd4-b2 Ka6-a7 Kd5-c6 Ka7-a6 Qb2-a3+) +M4/18 0} 80. Ka6 {(b5a6 d4b4
a6a7 d5c6 a7a8 b4b7) -99.94/7 0} Qb4 {(Qd4-b4 Ka6-a7 Kd5-c6 Ka7-a8 Qb4-b7+)
+M3/19 0} 81. Ka7 {(a6a7 d5c6 a7a8 b4b7) -99.96/5 0} Kc6 {(Kd5-c6 Ka7-a8
Qb4-b7+) +M2/19 0} 82. Ka6 {(a7a6 b4b6) -99.98/3 0} Qb6# {(Qb4-b6+) +M1/19
0} 0-1
[/pgn]

BBC's YouTube series is going on!
We're going to add more evaluation features soon!
Join: https://www.youtube.com/watch?v=QUNP-Uj ... wfiWNI76Cs
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by mvanthoor »

BBC does not run perft(7) correctly, but perft(6) does work. I compiled the engine on Windows (under MSYS2), with the following results.

- Replaced your UCI-loop with this:

Code: Select all

parse_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
perft_test(6);
result, correct for perft(6)

Code: Select all

Depth: 6
Nodes: 119060324
Time: 4110
Then:

Code: Select all

parse_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
perft_test(7);
Result:

Code: Select all

 Depth: 7
Nodes: -1099065436
Time: 223063
Rustic's output for:

Code: Select all

./rustic.exe --perft 7
(It runs all the depths, up to and including the requested depth, just like iterative deepening, in preparation of a hash table addition.)

Code: Select all

Perft 1: 20 (0 ms, inf leaves/sec)
Perft 2: 400 (0 ms, inf leaves/sec)
Perft 3: 8902 (0 ms, inf leaves/sec)
Perft 4: 197281 (4 ms, 49320250 leaves/sec)
Perft 5: 4865609 (120 ms, 40546741 leaves/sec)
Perft 6: 119060324 (2968 ms, 40114664 leaves/sec)
Perft 7: 3195901860 (79147 ms, 40379317 leaves/sec)
Total time spent: 82239 ms
Execution speed: 40370558 leaves/second

Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by maksimKorzh »

mvanthoor wrote: Thu Sep 24, 2020 11:28 am BBC does not run perft(7) correctly, but perft(6) does work. I compiled the engine on Windows (under MSYS2), with the following results.

- Replaced your UCI-loop with this:

Code: Select all

parse_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
perft_test(6);
result, correct for perft(6)

Code: Select all

Depth: 6
Nodes: 119060324
Time: 4110
Then:

Code: Select all

parse_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
perft_test(7);
Result:

Code: Select all

 Depth: 7
Nodes: -1099065436
Time: 223063
Rustic's output for:

Code: Select all

./rustic.exe --perft 7
(It runs all the depths, up to and including the requested depth, just like iterative deepening, in preparation of a hash table addition.)

Code: Select all

Perft 1: 20 (0 ms, inf leaves/sec)
Perft 2: 400 (0 ms, inf leaves/sec)
Perft 3: 8902 (0 ms, inf leaves/sec)
Perft 4: 197281 (4 ms, 49320250 leaves/sec)
Perft 5: 4865609 (120 ms, 40546741 leaves/sec)
Perft 6: 119060324 (2968 ms, 40114664 leaves/sec)
Perft 7: 3195901860 (79147 ms, 40379317 leaves/sec)
Total time spent: 82239 ms
Execution speed: 40370558 leaves/second

Thanks for info! I guess something wrong with node count assuming it's negative, most likely not enough bits in long integer.
Anyway thanks you for report!
User avatar
maksimKorzh
Posts: 771
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by maksimKorzh »

mvanthoor wrote: Thu Sep 24, 2020 11:28 am BBC does not run perft(7) correctly, but perft(6) does work. I compiled the engine on Windows (under MSYS2), with the following results.

- Replaced your UCI-loop with this:

Code: Select all

parse_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
perft_test(6);
result, correct for perft(6)

Code: Select all

Depth: 6
Nodes: 119060324
Time: 4110
Then:

Code: Select all

parse_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
perft_test(7);
Result:

Code: Select all

 Depth: 7
Nodes: -1099065436
Time: 223063
Rustic's output for:

Code: Select all

./rustic.exe --perft 7
(It runs all the depths, up to and including the requested depth, just like iterative deepening, in preparation of a hash table addition.)

Code: Select all

Perft 1: 20 (0 ms, inf leaves/sec)
Perft 2: 400 (0 ms, inf leaves/sec)
Perft 3: 8902 (0 ms, inf leaves/sec)
Perft 4: 197281 (4 ms, 49320250 leaves/sec)
Perft 5: 4865609 (120 ms, 40546741 leaves/sec)
Perft 6: 119060324 (2968 ms, 40114664 leaves/sec)
Perft 7: 3195901860 (79147 ms, 40379317 leaves/sec)
Total time spent: 82239 ms
Execution speed: 40370558 leaves/second

But how do you like the games??
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Bitboard CHESS ENGINE in C: YouTube series by Code Monkey King

Post by mvanthoor »

maksimKorzh wrote: Thu Sep 24, 2020 12:16 pm But how do you like the games??
The games are fine :) Consistently beating TSCP is one of the goals of most engine developers when they are just starting out. I hope the two games you've posted are not 'accidents', and that you can actually win a 100 game match against TSCP. If so, you can estimate your engine's approximate strength. (TSCP is rated around CCRL 1700). You should now set up a gauntlet tournament to see where your engine falls. Don't just try to improve your results against TSCP, or you might end up tuning your engine to explicitly defeat TSCP and perform worse against other engines.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL