BBC 1.0 release - UCI chess engine by CMK

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

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
maksimKorzh
Posts: 630
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

BBC 1.0 release - UCI chess engine by CMK

Post by maksimKorzh » Thu Sep 24, 2020 8:14 pm

Hey what's up guys, Code Monkey King's here.
Finally we've reached the state of the very first
release of BBC (Bit Board Chess) - a didactic chess
engine written BY NOOB and FOR NOOBS.

Release BBC 1.0: https://github.com/maksimKorzh/bbc/releases/tag/1.0
Source code: https://github.com/maksimKorzh/bbc

I was inspired by VICE series by Bluefever Software
but when I just started it was a rocket science to me)
So I've decided to make something similar, but using
the easiest C programming language's pattern possible.

BBC's page on CPW: https://www.chessprogramming.org/BBC
YouTube series (82 videos): https://www.youtube.com/watch?v=QUNP-Uj ... wfiWNI76Cs

Features

- bitboard board representation
- pre-calculated attack tables
- magic bitboards for sliding pieces
- encoding moves as integers
- copy/make approach for making moves
- negamax search with alpha beta pruning
- PV/killer/history move ordering
- iterative deepening
- PVS (Principle Variation Search)
- LMR (Late Move Reduction)
- NMP (Null Move Pruning)
- Transposition table (20MB fixed size)
- Material/PST (Positional Square Tables) evaluation
- Double/isolated/passed pawns evaluation
- Bishop & Queen mobility evaluation
- Very basic king safety
- UCI protocol

16 game match vs TSCP in BLITZ 2+1 (like in CCRL)

-----------------BBC 1.0-----------------
BBC 1.0 - TSCP : 15,5/16 15-0-1 (11111111=1111111) 97% +604
-----------------TSCP-----------------
TSCP - BBC 1.0 : 0,5/16 0-15-1 (00000000=0000000) 3% -604

PGN link: https://github.com/maksimKorzh/bbc/blob ... s_TSCP.pgn












Credits

This project would never be completed<br>
without the help of Talk Chess forum<br>
community members who has been helping me<br>
during the development process significantly<br>
I would like to thank to:<br>
<br>
- HaraldLuessen & Pedro Castro Elgarresta for neverending hints and technical support
- Jay Warendorff for testing development versions of BBC<br>
<br>
And all the subscribers watching my videos and<br>
motivating me to keep the development!<br>
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

User avatar
mvanthoor
Posts: 776
Joined: Wed Jul 03, 2019 2:42 pm
Full name: Marcel Vanthoor

Re: BBC 1.0 release - UCI chess engine by CMK

Post by mvanthoor » Thu Sep 24, 2020 8:44 pm

Congratulations :)

Pity that you lost one game against TSCP. If you had won 16-0, your Elo rating would be infinite :o
Author of Rustic.
Releases | Code | Docs

Pio
Posts: 264
Joined: Sat Feb 25, 2012 9:42 pm
Location: Stockholm
Contact:

Re: BBC 1.0 release - UCI chess engine by CMK

Post by Pio » Thu Sep 24, 2020 8:47 pm

mvanthoor wrote:
Thu Sep 24, 2020 8:44 pm
Congratulations :)

Pity that you lost one game against TSCP. If you had won 16-0, your Elo rating would be infinite :o
He did not loose a game. He drew one so he is still unbeaten. I guess TSCP played perfect chess and it was impossible to win 🤪

User avatar
maksimKorzh
Posts: 630
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: BBC 1.0 release - UCI chess engine by CMK

Post by maksimKorzh » Thu Sep 24, 2020 9:07 pm

mvanthoor wrote:
Thu Sep 24, 2020 8:44 pm
Congratulations :)

Pity that you lost one game against TSCP. If you had won 16-0, your Elo rating would be infinite :o
Well actually it was a draw.
I had TT of 98mb believe it or not...
I've reduced it to 20mb and started playing like this.
Also I've fixed timing bug - it dropped PV on less then 1500 ms due to to buffering.
I've added if (time > 1500) time -= 50 and that made a trick
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

User avatar
mvanthoor
Posts: 776
Joined: Wed Jul 03, 2019 2:42 pm
Full name: Marcel Vanthoor

Re: BBC 1.0 release - UCI chess engine by CMK

Post by mvanthoor » Thu Sep 24, 2020 9:34 pm

Ah, I see; a draw. I misread the results.

BBC is massively stronger than TSCP, and it has time management. It already has a lot of features... It will be an interesting opponent to play against in due time :)

It would be good to add a UCI-command to set the TT size. Most engines support this. In a tournament, engines get the same hash table size to equalize memory usage for playing. It would be unfair if one engine can store 32 MB of moves and the other has 64 MB.

With 20MB, you'd mostly be at a disadvantage in a tournament, and a list such as CCRL can't lower run a tournament with engines at 20 MB if they normally use 128 MB (for example), because it would skew the results. (The engines with established ratings, that would normally run with a hash of 128 MB would be weaker than normal, and so your engine would look like it's stronger than it really is.)
Author of Rustic.
Releases | Code | Docs

User avatar
maksimKorzh
Posts: 630
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: BBC 1.0 release - UCI chess engine by CMK

Post by maksimKorzh » Thu Sep 24, 2020 9:52 pm

mvanthoor wrote:
Thu Sep 24, 2020 9:34 pm
Ah, I see; a draw. I misread the results.

BBC is massively stronger than TSCP, and it has time management. It already has a lot of features... It will be an interesting opponent to play against in due time :)

It would be good to add a UCI-command to set the TT size. Most engines support this. In a tournament, engines get the same hash table size to equalize memory usage for playing. It would be unfair if one engine can store 32 MB of moves and the other has 64 MB.

With 20MB, you'd mostly be at a disadvantage in a tournament, and a list such as CCRL can't lower run a tournament with engines at 20 MB if they normally use 128 MB (for example), because it would skew the results. (The engines with established ratings, that would normally run with a hash of 128 MB would be weaker than normal, and so your engine would look like it's stronger than it really is.)
Sure, I'll add that. I just want to get some initial CCRL rating for this version first. Btw I can't see much difference between 20 and 98 mb I had before.
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

Gabor Szots
Posts: 757
Joined: Sat Jul 21, 2018 5:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: BBC 1.0 release - UCI chess engine by CMK

Post by Gabor Szots » Fri Sep 25, 2020 12:31 pm

Very long time ago I did an experiment and found that every doubling of hash size was worth about 5 Elos.
Gabor Szots
CCRL testing group

User avatar
mclane
Posts: 18388
Joined: Thu Mar 09, 2006 5:40 pm
Location: US of Europe, germany
Full name: Thorsten Czub
Contact:

Re: BBC 1.0 release - UCI chess engine by CMK

Post by mclane » Fri Sep 25, 2020 4:01 pm

Can you make it B strategy instead of AB ?
Why not ?
Would be interesting if it prunes away those branches that are not interesting.
I know it would weaken its ELO.

But on the other hand it would make more fun.
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....

User avatar
maksimKorzh
Posts: 630
Joined: Sat Sep 08, 2018 3:37 pm
Location: Ukraine
Full name: Maksim Korzh
Contact:

Re: BBC 1.0 release - UCI chess engine by CMK

Post by maksimKorzh » Fri Sep 25, 2020 4:16 pm

mclane wrote:
Fri Sep 25, 2020 4:01 pm
Can you make it B strategy instead of AB ?
Why not ?
Would be interesting if it prunes away those branches that are not interesting.
I know it would weaken its ELO.

But on the other hand it would make more fun.
The major approach of the development is to use PST only as described here:
viewtopic.php?f=2&t=68311&p=772515#p772515
This is both very exciting and something I'm incredibly interested in.
Wukong Xiangqi (Chinese chess engine + apps to embed into 3rd party websites):
https://github.com/maksimKorzh/wukong-xiangqi

Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ

User avatar
mclane
Posts: 18388
Joined: Thu Mar 09, 2006 5:40 pm
Location: US of Europe, germany
Full name: Thorsten Czub
Contact:

Re: BBC 1.0 release - UCI chess engine by CMK

Post by mclane » Fri Sep 25, 2020 4:21 pm

Yes I see but do you think it’s still state of the art to use this rudimentary thing ?

Why not try something different.
And create the strongest B strategy engine. Only relying on branches that are interesting or chosen ?
Why use brute force ?
Brute force is stupid, isn’t it ?
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....

Post Reply