GithubHelp home page GithubHelp logo

disservin / fast-chess Goto Github PK

View Code? Open in Web Editor NEW
55.0 55.0 17.0 4.86 MB

fast-chess is a command-line tool to run engine vs engine matches in chess.

License: MIT License

Makefile 0.63% C++ 97.79% Shell 1.41% CMake 0.17%
chess cli-app cpp

fast-chess's Introduction

fast-chess's People

Contributors

crippa1337 avatar developerpaul123 avatar disservin avatar kz04px avatar pgg106 avatar szilbalazs avatar vondele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fast-chess's Issues

Sides seem to be switched

Score of camel-rework-mate-in-plys vs camel-master: 1 - 0 - 1 [] 2
Elo difference: 190.85 +/- nan, LOS: 84.13 %, DrawRatio: 50.00 %
Ptnml:        WW     WD  DD/WL     LD     LL
Distr:         0      1      0      0      0
--------------------------------------------------
Started game 6 of 800 (camel-master vs camel-rework-mate-in-plys)
Finished game 1 (camel-rework-mate-in-plys vs camel-master): 0-1 {camel-rework-mate-in-plys got checkmated}
Started game 7 of 800 (camel-rework-mate-in-plys vs camel-master)
Finished game 2 (camel-master vs camel-rework-mate-in-plys): 1-0 {camel-rework-mate-in-plys got checkmated}
--------------------------------------------------
Score of camel-rework-mate-in-plys vs camel-master: 3 - 0 - 1 [] 4
Elo difference: 338.04 +/- nan, LOS: 95.84 %, DrawRatio: 25.00 %
Ptnml:        WW     WD  DD/WL     LD     LL
Distr:         1      1      0      0      0
--------------------------------------------------
Started game 8 of 800 (camel-master vs camel-rework-mate-in-plys)
Finished game 5 (camel-rework-mate-in-plys vs camel-master): 0-1 {camel-rework-mate-in-plys got checkmated}
Started game 9 of 800 (camel-rework-mate-in-plys vs camel-master)
Finished game 6 (camel-master vs camel-rework-mate-in-plys): 1/2-1/2 {Draw by 3-fold repetition}
--------------------------------------------------
Score of camel-rework-mate-in-plys vs camel-master: 4 - 0 - 2 [] 6
Elo difference: 279.59 +/- nan, LOS: 97.72 %, DrawRatio: 33.33 %
Ptnml:        WW     WD  DD/WL     LD     LL
Distr:         1      2      0      0      0
--------------------------------------------------
Started game 10 of 800 (camel-master vs camel-rework-mate-in-plys)
Finished game 7 (camel-rework-mate-in-plys vs camel-master): 0-1 {camel-rework-mate-in-plys got checkmated}
Started game 11 of 800 (camel-rework-mate-in-plys vs camel-master)
Finished game 8 (camel-master vs camel-rework-mate-in-plys): 1-0 {camel-rework-mate-in-plys got checkmated}
--------------------------------------------------
Score of camel-rework-mate-in-plys vs camel-master: 6 - 0 - 2 [] 8
Elo difference: 338.04 +/- nan, LOS: 99.28 %, DrawRatio: 25.00 %
Ptnml:        WW     WD  DD/WL     LD     LL
Distr:         2      2      0      0      0
--------------------------------------------------

Pass Arguments Directly to `cmd`

With cutechess-cli it's possible to set the engine command, but also pass arguments directly to it as one would any CLI application. Is it possible to do this with fast-chess?

For example, cutechess-cli supports this syntax:

-engine name="MyBot" cmd="Chess-Challenge.exe" arg="uci" arg="MyBot"

bug: crashes if PV output is on a different line

if an engine outputs its PV on a different line than the other stats, then fast-chess crashes.

#0  0x00007ffff7a61ee7 in ?? () from /usr/lib/libc.so.6
#1  0x0000555555599132 in fast_chess::Tournament::parseEngineOutput(fast_chess::Board const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long) const [clone .constprop.0] ()

make fast-chess crash safe

In case of engine crashes fast-chess should behave normall and either stop the tournament or continue normally

huge memory consumption with large number of rounds

Reproduction:

.\fast-chess.exe -engine name=stockfish1 cmd=./stockfish.exe -engine name=stockfish2 cmd=./stockfish.exe -rounds 10240000 \ 
 -each tc=10+0.1 -repeat -openings order=random file=UHO_XXL_2022_+110_+139.epd format=epd -concurrency 2

Cause:

Likely cause is that all game pairs are pregenerated instead of generated on the fly.

Broken round reporting

The round number reporting was broken by #89, before a round is finished multiple threads will use the same round_count resulting in a broken output for any concurrency > 1

crashes

Current master branch crashes after a few games for an invocation like:

./fast-chess -engine cmd=./stockfish.master name=m1 -engine cmd=./stockfish.master name=m2 -each tc=3+0.03 -rounds 200 -repeat -concurrency 32 -pgnout file=f3 -openings file=f3.epd format=epd

Compiled with -fsanitize=address I get:

==25896==ERROR: AddressSanitizer: heap-use-after-free on address 0x6020000090b0 at pc 0x7f532a0cef37 bp 0x7f5325ef8dc0 sp 0x7f5325ef8568
READ of size 8 at 0x6020000090b0 thread T3
    #0 0x7f532a0cef36 in __interceptor_memmove ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:810
    #1 0x55d7e373b0c9 in std::enable_if<std::__is_bitwise_relocatable<int, void>::value, int*>::type std::__relocate_a_1<int, int>(int*, int*, int*, std::allocator<int>&) /usr/include/c++/11/bits/stl_uninitialized.h:1011
    #2 0x55d7e373b0c9 in int* std::__relocate_a<int*, int*, std::allocator<int> >(int*, int*, int*, std::allocator<int>&) /usr/include/c++/11/bits/stl_uninitialized.h:1046
    #3 0x55d7e373b0c9 in std::vector<int, std::allocator<int> >::_S_do_relocate(int*, int*, int*, std::allocator<int>&, std::integral_constant<bool, true>) /usr/include/c++/11/bits/stl_vector.h:456
    #4 0x55d7e373b0c9 in std::vector<int, std::allocator<int> >::_S_relocate(int*, int*, int*, std::allocator<int>&) /usr/include/c++/11/bits/stl_vector.h:469
    #5 0x55d7e373b0c9 in void std::vector<int, std::allocator<int> >::_M_realloc_insert<int const&>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, int const&) /usr/include/c++/11/bits/vector.tcc:461
    #6 0x55d7e373b742 in std::vector<int, std::allocator<int> >::push_back(int const&) /usr/include/c++/11/bits/stl_vector.h:1198
    #7 0x55d7e373b742 in Process::initProcess(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<int, std::allocator<int> > const&) src/process/process_posix.hpp:112
    #8 0x55d7e370dc8b in fast_chess::UciEngine::startEngine() src/engines/uci_engine.cpp:41
    #9 0x55d7e372bd68 in fast_chess::Match::start(fast_chess::EngineConfiguration const&, fast_chess::EngineConfiguration const&, std::vector<int, std::allocator<int> > const&) src/matchmaking/match.cpp:95
    #10 0x55d7e3754dc9 in fast_chess::RoundRobin::playGame(std::pair<fast_chess::EngineConfiguration, fast_chess::EngineConfiguration> const&, std::function<void ()>, std::function<void (fast_chess::Stats const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, fast_chess::Opening const&, unsigned long) src/matchmaking/roundrobin.cpp:200
    #11 0x55d7e37448f9 in __invoke_impl<void, void (fast_chess::RoundRobin::*&)(const std::pair<fast_chess::EngineConfiguration, fast_chess::EngineConfiguration>&, std::function<void()>, std::function<void(const fast_chess::Stats&, const std::__cxx11::basic_string<char>&)>, const fast_chess::Opening&, long unsigned int), fast_chess::RoundRobin*&, std::pair<fast_chess::EngineConfiguration, fast_chess::EngineConfiguration>&, fast_chess::RoundRobin::create(const std::vector<fast_chess::EngineConfiguration>&)::<lambda(std::size_t, std::size_t, std::size_t)>::<lambda()>&, fast_chess::RoundRobin::create(const std::vector<fast_chess::EngineConfiguration>&)::<lambda(std::size_t, std::size_t, std::size_t)>::<lambda(const fast_chess::Stats&, const string&)>&, fast_chess::Opening&, long unsigned int&> /usr/include/c++/11/bits/invoke.h:74
    #12 0x55d7e37448f9 in __invoke<void (fast_chess::RoundRobin::*&)(const std::pair<fast_chess::EngineConfiguration, fast_chess::EngineConfiguration>&, std::function<void()>, std::function<void(const fast_chess::Stats&, const std::__cxx11::basic_string<char>&)>, const fast_chess::Opening&, long unsigned int), fast_chess::RoundRobin*&, std::pair<fast_chess::EngineConfiguration, fast_chess::EngineConfiguration>&, fast_chess::RoundRobin::create(const std::vector<fast_chess::EngineConfiguration>&)::<lambda(std::size_t, std::size_t, std::size_t)>::<lambda()>&, fast_chess::RoundRobin::create(const std::vector<fast_chess::EngineConfiguration>&)::<lambda(std::size_t, std::size_t, std::size_t)>::<lambda(const fast_chess::Stats&, const string&)>&, fast_chess::Opening&, long unsigned int&> /usr/include/c++/11/bits/invoke.h:96

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.