Page 1 of 4

Banksia - Yet another Chess Tournament Manager

Posted: Mon Jul 01, 2019 12:03 pm
by phhnguyen
I have just released my new open source: Banksia - a Chess Tournament Manager for chess engines (it helps chess engines fighting each other)!

Some features:
- Command line interface (cli)
- Small, fast
- Simple and short (in term of design and implementation)
- Support chess engines with UCI protocol
- Tournament: concurrency, round robin, edp opening, ponderable
- Controlled mainly by 2 json files (one for configurations of engines, one for tournament management). That is very flexible, easy way to set up and change
- Controllable by the keyboard when games playing (type anything from the keyboard to display the help)
- Written in standard C++11 (can be easily compiled and run in many systems such as MacOS, Windows, Linux)
- Open source, MIT license

The project is here:

https://github.com/nguyenpham/Banksia

Because of being small, simple logic/design, "pure" standard C++11, using very little resource, free (MIT license) I hope it be easy to use and helpful and/or embedded in some projects.

However it is still in early stage, it should have many bugs and missing some functions, not comfortable for use. Please help me to test it (especially for large scale, longtime tournaments), find, fix bugs as well as improve it. Thanks.

/Pham

Re: Banksia - Yet another Chess Tournament Manager

Posted: Mon Jul 01, 2019 7:23 pm
by Roland Chastain
Hello! Interesting project.

I could compile it with Visual Studio 2017.

I made a quick test and here is what happened:

Code: Select all

C:\Roland\echecs\sources\banksia>banksia -jsonpath C:\Roland\echecs\sources\banksia\tour.json
Banksia, Chess Tournament Manager, by Nguyen Pham - version 0.01
type: roundrobin, time control: 40/3.5:0.5, #players: 3, #matches: 6, concurrency: 1, ponder: off, book: no
Game started 1 of 6 (Alouette-A 0.0.7 vs Alouette-B 0.0.7)
Assertion failed: board.isValid(), file c:\roland\echecs\sources\banksia\src\game\game.cpp, line 204
The problem comes after the move g2h1 on this position:
[d]rnb1k1nr/3p4/p5p1/8/1P2P3/B3Q2N/P5qP/R3KN1R b KQkq - 0 26

I didn't look into the source code, but I suspect that this has a relation with castling rights.

I attach all the files. :wink:

Re: Banksia - Yet another Chess Tournament Manager

Posted: Tue Jul 02, 2019 1:25 am
by phhnguyen
Roland Chastain wrote: Mon Jul 01, 2019 7:23 pm I didn't look into the source code, but I suspect that this has a relation with castling rights.
Yes, it is a bug about clearing castling rights. The bug is fixed. Please help me to test again. Thank you a lot!

Re: Banksia - Yet another Chess Tournament Manager

Posted: Tue Jul 02, 2019 8:50 am
by Roland Chastain
OK, it works now.

Code: Select all

C:\Roland\echecs\sources\banksia>banksia -jsonpath C:\Roland\echecs\sources\banksia\tour.json
Banksia, Chess Tournament Manager, by Nguyen Pham - version 0.02
type: roundrobin, time control: 40/3.5:0.5, #players: 3, #matches: 6, concurrency: 1, ponder: off, book: no
Game started 1 of 6 (Alouette-A 0.0.7 vs Alouette-B 0.0.7)
Game completed 1 of 6 (Alouette-A 0.0.7 vs Alouette-B 0.0.7): 0-1 (mate)
Game started 2 of 6 (Alouette-B 0.0.7 vs Alouette-A 0.0.7)
Game completed 2 of 6 (Alouette-B 0.0.7 vs Alouette-A 0.0.7): 1/2-1/2 (stalemate)
Game started 3 of 6 (Alouette-A 0.0.7 vs Alouette-C 0.0.7)
Game completed 3 of 6 (Alouette-A 0.0.7 vs Alouette-C 0.0.7): 1/2-1/2 (stalemate)
Game started 4 of 6 (Alouette-C 0.0.7 vs Alouette-A 0.0.7)
Game completed 4 of 6 (Alouette-C 0.0.7 vs Alouette-A 0.0.7): 1-0 (mate)
Game started 5 of 6 (Alouette-B 0.0.7 vs Alouette-C 0.0.7)
Game completed 5 of 6 (Alouette-B 0.0.7 vs Alouette-C 0.0.7): 1-0 (mate)
Game started 6 of 6 (Alouette-C 0.0.7 vs Alouette-B 0.0.7)
Game completed 6 of 6 (Alouette-C 0.0.7 vs Alouette-B 0.0.7): 1/2-1/2 (stalemate)
----------------------------------
rank name games wins draws
Alouette-A 0.0.7        4       0.0%    50.0%
Alouette-C 0.0.7        4       25.0%   50.0%
Alouette-B 0.0.7        4       50.0%   50.0%

----------------------------------

Re: Banksia - Yet another Chess Tournament Manager

Posted: Wed Jul 03, 2019 2:05 pm
by phhnguyen
Roland Chastain wrote: Tue Jul 02, 2019 8:50 am OK, it works now.
Thanks Roland Chastain :)

I have updated the code to fix some bugs, improve interface and support opening books in pgn format (edp was supported).

Re: Banksia - Yet another Chess Tournament Manager

Posted: Wed Jul 03, 2019 2:43 pm
by Roland Chastain
phhnguyen wrote: Wed Jul 03, 2019 2:05 pm Thanks Roland Chastain :)

I have updated the code to fix some bugs, improve interface and support opening books in pgn format (edp was supported).
You're welcome. Unfortunately I cannot compile the new version. :?

Code: Select all

Erreur	C2039	'time_t' : n'est pas membre de 'std'	Banksia	c:\roland\echecs\sources\banksia\src\base\comm.h	149	
It's with Visual Studio 2017.

Re: Banksia - Yet another Chess Tournament Manager

Posted: Wed Jul 03, 2019 3:52 pm
by phhnguyen
Thanks! Just fixed it. Missing a declare of <ctime>. Not sure why in my system (Xcode + MacOS) it is fine to compile but not in Visual Studio + Windows.

Re: Banksia - Yet another Chess Tournament Manager

Posted: Wed Jul 03, 2019 6:05 pm
by Roland Chastain
phhnguyen wrote: Wed Jul 03, 2019 3:52 pm Thanks! Just fixed it. Missing a declare of <ctime>. Not sure why in my system (Xcode + MacOS) it is fine to compile but not in Visual Studio + Windows.
Thank you for the fix. It's OK now.

But, while we speak of compilation, I inform you that I tried without success to compile with g++ (MinGW). Maybe it is also just a missing declaration? Here is an abstract of g++ output:

Code: Select all

C:\Roland\echecs\sources\banksia\projects>g++ -std=c++11 -c ../src/3rdparty/json/*.cpp -O3 -DNDEBUG

C:\Roland\echecs\sources\banksia\projects>g++ -std=c++11 -c ../src/3rdparty/process/process.cpp ../src/3rdparty/process/process_win.cpp -O3 -DNDEBUG
In file included from ../src/3rdparty/process/process.cpp:1:0:
../src/3rdparty/process/process.hpp:118:8: error: 'mutex' in namespace 'std' does not name a type
   std::mutex close_mutex;
        ^~~~~
../src/3rdparty/process/process.hpp:124:8: error: 'thread' in namespace 'std' does not name a type
   std::thread stdout_thread, stderr_thread;
        ^~~~~~
There is also this. Maybe an encoding issue?

Code: Select all

In file included from ../src/game/configmng.cpp:26:0:
../src/game/configmng.h:107:53: error: stray '\303' in program
         bool updateOptionValue(const std::string& naÇYme, const std::string& val);
                                                     ^
../src/game/configmng.h:107:54: error: stray '\237' in program
         bool updateOptionValue(const std::string& naÇYme, const std::string& val);

Re: Banksia - Yet another Chess Tournament Manager

Posted: Thu Jul 04, 2019 2:52 am
by phhnguyen
Thank Roland!
Roland Chastain wrote: Wed Jul 03, 2019 6:05 pm But, while we speak of compilation, I inform you that I tried without success to compile with g++ (MinGW). Maybe it is also just a missing declaration? Here is an abstract of g++ output:

Code: Select all

C:\Roland\echecs\sources\banksia\projects>g++ -std=c++11 -c ../src/3rdparty/json/*.cpp -O3 -DNDEBUG

C:\Roland\echecs\sources\banksia\projects>g++ -std=c++11 -c ../src/3rdparty/process/process.cpp ../src/3rdparty/process/process_win.cpp -O3 -DNDEBUG
In file included from ../src/3rdparty/process/process.cpp:1:0:
../src/3rdparty/process/process.hpp:118:8: error: 'mutex' in namespace 'std' does not name a type
   std::mutex close_mutex;
        ^~~~~
../src/3rdparty/process/process.hpp:124:8: error: 'thread' in namespace 'std' does not name a type
   std::thread stdout_thread, stderr_thread;
        ^~~~~~
I don't know that issue nor solution. It is a 3rd party code. In my system (which I have just downloaded and installed MinGW yesterday) g++ can compile that code without any problem. All needed headers (<thread> and <mutex>) have been declared already in process.hpp.

Perhaps try to reinstall MinGW? Anyone knows and has a solution?
Roland Chastain wrote: Wed Jul 03, 2019 6:05 pm There is also this. Maybe an encoding issue?

Code: Select all

In file included from ../src/game/configmng.cpp:26:0:
../src/game/configmng.h:107:53: error: stray '\303' in program
         bool updateOptionValue(const std::string& naÇYme, const std::string& val);
                                                     ^
../src/game/configmng.h:107:54: error: stray '\237' in program
         bool updateOptionValue(const std::string& naÇYme, const std::string& val);
That is an interesting issue. I accidentally added a strange character into the middle of a variant name of a function (the name is not important since we may omit it too). All compilers I have tried before (g++, Xcode in MacOS and Visual Studio in Windows) did not care nor refuse to that extra character but g++ in MinGW :)
It is fixed.
Thanks again!

Re: Banksia - Yet another Chess Tournament Manager

Posted: Thu Jul 04, 2019 3:45 am
by Roland Chastain
phhnguyen wrote: Thu Jul 04, 2019 2:52 amThank Roland!
You're welcome.

Ok, it isn't a problem, I will continue with Visual Studio. :wink: