New open-source engine, Bit-Genie

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

Moderator: Ras

User avatar
Gabor Szots
Posts: 1512
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New open-source engine, Bit-Genie

Post by Gabor Szots »

aryan1508 wrote: Mon Mar 22, 2021 5:54 amAbout the stop and quit command, I have to do a little bit of research for it. The best solution right now seems to run search on another thread.
I don't think I'd be happy to see it reserve 2 threads of my 4-core machine.
Gabor Szots
CCRL testing group
aryan1508
Posts: 31
Joined: Sat Mar 20, 2021 3:44 pm
Full name: Aryan Parekh

Re: New open-source engine, Bit-Genie

Post by aryan1508 »

Gabor Szots wrote: Mon Mar 22, 2021 8:31 am
aryan1508 wrote: Mon Mar 22, 2021 5:54 amAbout the stop and quit command, I have to do a little bit of research for it. The best solution right now seems to run search on another thread.
I don't think I'd be happy to see it reserve 2 threads of my 4-core machine.
Is there a better solution? I could read the stdin everyone time I check the time, but that would slow down the search a lot.
User avatar
RubiChess
Posts: 658
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: New open-source engine, Bit-Genie

Post by RubiChess »

Gabor Szots wrote: Mon Mar 22, 2021 8:31 am
aryan1508 wrote: Mon Mar 22, 2021 5:54 amAbout the stop and quit command, I have to do a little bit of research for it. The best solution right now seems to run search on another thread.
I don't think I'd be happy to see it reserve 2 threads of my 4-core machine.
You will hardly find a single engine that REALLY uses only n OS threads when you setoption name Threads value n
E.g. Stockfish running in Windows shows 4 threads in Taskmanager when it uses only one thread for searching. And 5 threads when you use 2 threads for searching. And so on.
One of the threads usually reads the UCI input in a blocking "readline". This is what Aryan probably wants to implement.
Important is that only n threads stress the CPU when searching. But I must admit, there is some potential of "cheating" using "relaxed" threads for whatever.

Regards, Andreas
aryan1508
Posts: 31
Joined: Sat Mar 20, 2021 3:44 pm
Full name: Aryan Parekh

Re: New open-source engine, Bit-Genie

Post by aryan1508 »

I've implemented it here https://github.com/Aryan1508/Bit-Genie/ ... rch_thread. What happens is A thread is used for the UCI loop since reading the stdin in C++ is 'blocking'. The other 'worker' thread demands cpu since it is used for searching
User avatar
Gabor Szots
Posts: 1512
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New open-source engine, Bit-Genie

Post by Gabor Szots »

aryan1508 wrote: Mon Mar 22, 2021 9:26 am I've implemented it here https://github.com/Aryan1508/Bit-Genie/ ... rch_thread. What happens is A thread is used for the UCI loop since reading the stdin in C++ is 'blocking'. The other 'worker' thread demands cpu since it is used for searching
OK, I'm going to use that for my testing.
Gabor Szots
CCRL testing group
User avatar
Gabor Szots
Posts: 1512
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New open-source engine, Bit-Genie

Post by Gabor Szots »

RubiChess wrote: Mon Mar 22, 2021 9:16 am You will hardly find a single engine that REALLY uses only n OS threads when you setoption name Threads value n
E.g. Stockfish running in Windows shows 4 threads in Taskmanager when it uses only one thread for searching. And 5 threads when you use 2 threads for searching. And so on.
One of the threads usually reads the UCI input in a blocking "readline". This is what Aryan probably wants to implement.
Important is that only n threads stress the CPU when searching. But I must admit, there is some potential of "cheating" using "relaxed" threads for whatever.
Thanks Andreas. Maybe that's the reason why I have so many time forfeits in my tournaments.
Gabor Szots
CCRL testing group
Guenther
Posts: 4718
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New open-source engine, Bit-Genie

Post by Guenther »

Gabor Szots wrote: Mon Mar 22, 2021 10:43 am
RubiChess wrote: Mon Mar 22, 2021 9:16 am You will hardly find a single engine that REALLY uses only n OS threads when you setoption name Threads value n
E.g. Stockfish running in Windows shows 4 threads in Taskmanager when it uses only one thread for searching. And 5 threads when you use 2 threads for searching. And so on.
One of the threads usually reads the UCI input in a blocking "readline". This is what Aryan probably wants to implement.
Important is that only n threads stress the CPU when searching. But I must admit, there is some potential of "cheating" using "relaxed" threads for whatever.
Thanks Andreas. Maybe that's the reason why I have so many time forfeits in my tournaments.
Do you mean time forfeits with Bit-Genie?
I had zero time losses in over 400 games now in CuteChess - may I ask, if this is perhaps under Arena? ;-)

(quite sure he could add a more defensive time management for 'those kind of GUIs')


Stats from those 400 games all at tc of 40/120

Code: Select all

Score of Rustic_Alpha2-64 vs Bit-Genie_r107-64: 93 - 74 - 33 [0.547]
...      Rustic_Alpha2-64 playing White: 43 - 34 - 23  [0.545] 100
...      Rustic_Alpha2-64 playing Black: 50 - 40 - 10  [0.550] 100
...      White vs Black: 83 - 84 - 33  [0.497] 200
Elo difference: 33.1 +/- 44.3, LOS: 92.9 %, DrawRatio: 16.5 %
200 of 200 games finished.

Player: Rustic_Alpha2-64
   "Draw by 3-fold repetition": 10
   "Draw by adjudication": 6
   "Draw by fifty moves rule": 7
   "Draw by insufficient mating material": 8
   "Draw by stalemate": 2
   "Loss: Black mates": 34
   "Loss: White mates": 40
   "Win: Black mates": 49
   "Win: Black wins by adjudication: user decision": 1
   "Win: White mates": 43
Player: Bit-Genie_r107-64
   "Draw by 3-fold repetition": 10
   "Draw by adjudication": 6
   "Draw by fifty moves rule": 7
   "Draw by insufficient mating material": 8
   "Draw by stalemate": 2
   "Loss: Black mates": 49
   "Loss: Black wins by adjudication: user decision": 1
   "Loss: White mates": 43
   "Win: Black mates": 34
   "Win: White mates": 40

Code: Select all

Score of Loki_120-64 vs Bit-Genie_100-64: 85 - 82 - 33 [0.507]
...      Loki_120-64 playing White: 42 - 40 - 18  [0.510] 100
...      Loki_120-64 playing Black: 43 - 42 - 15  [0.505] 100
...      White vs Black: 84 - 83 - 33  [0.502] 200
Elo difference: 5.2 +/- 44.2, LOS: 59.2 %, DrawRatio: 16.5 %
200 of 200 games finished.

Player: Loki_120-64
   "Draw by 3-fold repetition": 15
   "Draw by adjudication": 1
   "Draw by fifty moves rule": 8
   "Draw by insufficient mating material": 7
   "Draw by stalemate": 2
   "Loss: Black mates": 40
   "Loss: White mates": 42
   "Win: Black mates": 43
   "Win: White mates": 42
Player: Bit-Genie_100-64
   "Draw by 3-fold repetition": 15
   "Draw by adjudication": 1
   "Draw by fifty moves rule": 8
   "Draw by insufficient mating material": 7
   "Draw by stalemate": 2
   "Loss: Black mates": 43
   "Loss: White mates": 42
   "Win: Black mates": 40
   "Win: White mates": 42
https://rwbc-chess.de

[Trolls n'existent pas...]
User avatar
Gabor Szots
Posts: 1512
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New open-source engine, Bit-Genie

Post by Gabor Szots »

Guenther wrote: Mon Mar 22, 2021 11:00 am Do you mean time forfeits with Bit-Genie?
I had zero time losses in over 400 games now in CuteChess - may I ask, if this is perhaps under Arena? ;-)
Yes, under Arena, and not specific to Bit-Genie.
Gabor Szots
CCRL testing group
Guenther
Posts: 4718
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New open-source engine, Bit-Genie

Post by Guenther »

Gabor Szots wrote: Mon Mar 22, 2021 11:12 am
Guenther wrote: Mon Mar 22, 2021 11:00 am Do you mean time forfeits with Bit-Genie?
I had zero time losses in over 400 games now in CuteChess - may I ask, if this is perhaps under Arena? ;-)
Yes, under Arena, and not specific to Bit-Genie.
So you mean more specific to Arena? But this is already known, sorry.
(uci filter and changing some graphic display options / animations might help, but I never user Arena for good reasons)
https://rwbc-chess.de

[Trolls n'existent pas...]
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: New open-source engine, Bit-Genie

Post by mvanthoor »

Gabor Szots wrote: Mon Mar 22, 2021 11:12 am Yes, under Arena, and not specific to Bit-Genie.
As Guenther says; enable the UCI-filter, so Arena disregards the engine output for the first 5-10 seconds of the search, and disable most of the graphics. If you don't, these things take too much time in Arena's main thread. When it then comes back to interpreting the engine's move, it "thinks" the engine is too late... where actually, it's Arena itself that is too late.

I had the same thing when I first started to test Rustic, and fixed it with the above settings: enable UCI-filter, disable as much graphics as possible. Later, I changed the engine's output:

- Always output the search stats if an iteration has finished.
- Only output intermediate search stats (such as currmove, etc) every 2 seconds.

This makes the engine send the first 7-8 plies almost at once, and then updates every 2 seconds. (I don't like to set it so it only starts sending updates after 2 seoncds, because in that case, I'll miss the first 7-9 plies in the engine output.)

Then I switched to CuteChess, because I can run 4 games at the same time (and thus have 8 engines loaded). Two engines in one game therefore share a single core, back and forth.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL