Ignoring threads option, is it valid?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
CMCanavessi
Posts: 1142
Joined: Thu Dec 28, 2017 4:06 pm
Location: Argentina

Ignoring threads option, is it valid?

Post by CMCanavessi »

I saw this piece of code in an engine:

Code: Select all

				//hack to bypass 1 thread mcts
				if (uci_threads == 1 && uci_mcts == true)
					uci_threads = 2;
Now, is that really valid/honest? From a user's point of view, if I set 1 thread, I want the engine to use 1 thread, not 2.
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls
niel5946
Posts: 174
Joined: Thu Nov 26, 2020 10:06 am
Full name: Niels Abildskov

Re: Ignoring threads option, is it valid?

Post by niel5946 »

If the piece of code is really meant to use two threads even though one is requested, it is dishonest. Perhaps it could be called cheating since it would give the engine an advantage in single-threaded tournaments.
May I ask which engine it is from?

PS. A better solution would probably be to have two different builds. One which uses A/B and one which uses MCTS and has the minimum amount of threads set to two by default. That way there won't be any dishonesty.
Author of Loki, a C++ work in progress.
Code | Releases | Progress Log |
amanjpro
Posts: 883
Joined: Sat Mar 13, 2021 1:47 am
Full name: Amanj Sherwany

Re: Ignoring threads option, is it valid?

Post by amanjpro »

niel5946 wrote: Sat Jul 31, 2021 6:51 pm If the piece of code is really meant to use two threads even though one is requested, it is dishonest. Perhaps it could be called cheating since it would give the engine an advantage in single-threaded tournaments.
May I ask which engine it is from?

PS. A better solution would probably be to have two different builds. One which uses A/B and one which uses MCTS and has the minimum amount of threads set to two by default. That way there won't be any dishonesty.
I didn't need to ask... It was fire
Ras
Posts: 2487
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Ignoring threads option, is it valid?

Post by Ras »

CMCanavessi wrote: Sat Jul 31, 2021 6:43 pmNow, is that really valid/honest?
Engine designs that use N+1 threads are common e.g. if one thread is a dedicated input thread that sleeps as long as there is no input to process, which is why such an input thread is not counted against threads in terms of UCI.

Another possibility is to have two threads that can do chess-wise calculations, but only one of them is active at each point in time because they have some interlock mechanism on application level. This would still count as one UCI thread. Such a design may make sense if you have both an A/B and an MCTS search and want to keep them cleanly separated.

However, if this engine actually uses two calculation threads that are active at the same time, that's cheating.
Rasmus Althoff
https://www.ct800.net
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: Ignoring threads option, is it valid?

Post by kranium »

CMCanavessi wrote: Sat Jul 31, 2021 6:43 pm I saw this piece of code in an engine:

Code: Select all

				//hack to bypass 1 thread mcts
				if (uci_threads == 1 && uci_mcts == true)
					uci_threads = 2;
Now, is that really valid/honest? From a user's point of view, if I set 1 thread, I want the engine to use 1 thread, not 2.
Carlos-
This is in the binaries of Fire 8.NN.MC.1 date 7/29/21
It's a temporary bugfix...and is used only when/if the 'experimental' MCTS mode is 'on'

https://github.com/FireFather/fire/issues/5

The number of threads being used is announced by Fire in the UCI GUI at game start, so I don't think there should be any confusion.
In the meantime, I suggest only using MCTS mode in a tour that is 2 or more threads...

or if you prefer
download the 1st release of NN.MC binaries that are available from 7/27/21 Fire 8.NN.MC which do not contain the hack
and you can see the broken 1 thread mcts

this is something fairly simple I just haven't had time to properly address it.
I'll try to address it soon
Norm