Giter Site home page Giter Site logo

maksimkorzh / bbc Goto Github PK

View Code? Open in Web Editor NEW
61.0 8.0 18.0 27.47 MB

Bit Board Chess (BBC) - The easiest to understand bitboard chess engine by Code Monkey King

License: GNU General Public License v3.0

C 91.67% Makefile 0.11% C++ 7.68% HTML 0.07% Python 0.47%

bbc's Issues

Aspiration window with "wrong" depth ?

Hi Maksim,

First of all, a HUGE THANKS for your code and video tutorials on YouTube. You inspired me to retake my old chess engine Chess0 and include the NNUE evaluation. It has been a success thanks to you and Daniel Shawul.

I'm now trying to optimize the search code, and I'm learning from your code a lot! However, there's one thing I still don't get:

In your search_position, you set a kind of aspiration window (alpha = alpha - 50; beta = beta + 50). If you fall outside and try to do a full search, you tell in your comment that it should be a full-width window at the same depth. However, after doing "continue" in the code below, current_depth gets incremented when starting the loop over (current_depth++).

See code below:

    // we fell outside the window, so try again with a full-width window (and the same depth)
    if ((score <= alpha) || (score >= beta)) {
        alpha = -infinity;    
        beta = infinity;      
        // current_depth--    should you add this to search at the same depth??
        continue;
    }

Thanks again for the excellent video tutorials and taking all the time. I'm sure it has inspire many more people!

Cheers,
--Claudio

Issues with Arena

Hi Maksym

I was running a test with my engine and noticed a couple of issues. The TC was Blitz 2/6 and BBC started using negative time so Arena aborted. Also sometimes BBC generates a null PV, eg:

2020-09-26 17:50:37.284<--2:info score cp 0 depth 10 nodes 2193409 time 2954 pv

Here is the log from two games:

BBC1 vs Plankton64mt_04.txt

Cheers, Ian

Evaluation/Search observation

Thanks so much for the YouTube tutorial. It was a pleasure following it.

One thing I noticed, with the custom eval, given this position:

r4rk1/p1p2ppp/1p1nb3/2p1n3/2P2P1N/BP2P3/P1B3PP/R3K2R b - - 0 1

The engine seems to pick (at any depth) e5c4

If I set the passed pawn bonuses to 0, then it gives more sensible, e5c6;. At the moment,
not sure if its the eval, size of the bonuses, or the search.

updated to c++ and embedded nnue

Hi Maksim-
Congrats on a fine programming effort and a great engine!

I took the liberty to:

  • update the code to C++ (std::C++17)
  • separate source and header files
  • embed the nnue eval file (via incbin)
  • optimize code base via Clang/Resharper C++ guidelines

You can find it here:
https://github.com/FireFather/bbc

BBC-1.1 Quick Run

Just FYI...
This version still has illegal moves in the PV according to cutechess-cli.
However, there were no time forfeits with 1.1 (1.0 had many).

Match results:
Score of BBC-10 vs BBC-11: 27 - 103 - 8 [0.225] 138
... BBC-10 playing White: 15 - 50 - 3 [0.243] 68
... BBC-10 playing Black: 12 - 53 - 5 [0.207] 70
... White vs Black: 68 - 62 - 8 [0.522] 138
Elo difference: -215.2 +/- 68.0, LOS: 0.0 %, DrawRatio: 5.8 %

Bug report: Eval crash w/ SF NNUE

The eval function crashes repeatedly on BBC Chess Engine v1.3/1.4 with Stockfish NNUE (with the eval file placed under the same directory as the engine), as a result of which the eval score stays at 0.00 and the engine plays randomly).

Chess GUIs/OS platforms used for testing:
Tarrasch v3.13b @Windows 10
JerryFX v4.2.1 @Windows 10
JerryFX v4.2.1 @Linux (OpenSUSE)

UCI-responses sent too early

Hi Maksim,

There's a small problem with BBC which could cause a problem in some user interfaces, now or in the future.

When the engine is started, it immediately sends "id name", "id author", and "uciok" to the user interface. However, the engine should wait until it receives 'uci' before sending those responses. It does sent them when receiving 'uci', but there may be a user interface that sees "uciok", thinks you're done, and then your engine won't have a name or an author when the GUI loads it.

Just remove sending the commands at startup and everything should be fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.