New Stockfish with Lazy_SMP, but what about the TC bug ?

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

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by bob »

Waschbaer wrote:As far as i know, Unix, Linux and Windows are not realtime operating systems, so there is no guaranteed response time given und for this you can't call it a bug of the OS.
You, the programmer of applications has to be aware of it.

EDIT
If the heavy load of the system comes from a lot of programs/threads you are responsible for, don't let the OS choose what thread has to been stopped, do it by yourself, but then the lazy concept is looking wrong, isn't it?
I have always taken the approach that a tournament game never blocks anywhere. I use spin locks. When a thread had no work, it uses a spin loop waiting for a split block to join. Etc. Once you block, you open the door for arbitrarily long waits before your process is re-scheduled for execution. Of course the same problem can occur if you run more processes than cores, or if you have excessive interrupts going on to temporarily preempt a running process. I usually try to thin out the craplets that can cause problems so that I don't get preempted for any measurable amount of time...

If the linux kernel can spin for things it needs quickly, so can I. :)
TShackel
Posts: 313
Joined: Sat Apr 05, 2014 12:09 am
Location: Neenah, WI, United States

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by TShackel »

Dann Corbit wrote:The TCEC contest specifically disallows monkeying with UCI parameters other than a small, fixed set of them.

So I suggest that the default value should be changed.
Clearly, the chosen value is not a good one. None of the other entrants seem to be losing on time, so they have chosen more wisely.
You can do whatever you wnt with the parameters between stages. For instance komodo team changed contempt from 15 in stage 2 to 8 in stage. That's acceptable and the stockfish team will be able to change parameters before the superfinal.

Tim.
syzygy
Posts: 5975
Joined: Tue Feb 28, 2012 11:56 pm

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by syzygy »

Waschbaer wrote:As far as i know, Unix, Linux and Windows are not realtime operating systems, so there is no guaranteed response time given und for this you can't call it a bug of the OS.
You, the programmer of applications has to be aware of it.
If the OS gives no guaranteed response time, it is completely impossible for an application to give a guaranteed response time....

Windows is a consumer-oriented OS that is supposed to be usable for playing video games. It must therefore be responsive 99.9% of the time.

Windows and Linux are indeed not real-time operating systems, so they should not be used to run a nuclear plant.
EDIT
If the heavy load of the system comes from a lot of programs/threads you are responsible for, don't let the OS choose what thread has to been stopped, do it by yourself, but then the lazy concept is looking wrong, isn't it?
???
syzygy
Posts: 5975
Joined: Tue Feb 28, 2012 11:56 pm

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by syzygy »

Dann Corbit wrote:This is from the TCEC rules form:
And this is Komodo's configuration:
Protocol=UCI; Hash=32768; Table Memory=1024; Overhead=50; Contempt=8; Threads=20; Use Syzygy=true; SyzygyPath=C:/Syzygy; Syzygy Probe Limit=5; OwnBook=false; Ponder=false;
So this sentence:
Any configurable option not described above, are not adjusted in any way, except that "keep hash tables" or similar is usually enabled.
has to be taken cum grano salis.
Dann Corbit
Posts: 12870
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by Dann Corbit »

Seems likely that there is not a problem then, if the value 50 is changed to something large enough to prevent loss.

Windows has a real time timer accurate to 1 microsecond for Windows 8 or Windows Server 2012 and above. I imagine that timer could be used to prevent time loss (likely the machine in question has a modern operating system).

There is almost certainly a way to collect the same thing using Linux, I imagine. It's just querying the system hardware.
Jesse Gersenson
Posts: 593
Joined: Sat Aug 20, 2011 9:43 am

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by Jesse Gersenson »

Dann Corbit wrote:Seems likely that there is not a problem then, if the value 50 is changed to something large enough to prevent loss.

Windows has a real time timer accurate to 1 microsecond for Windows 8 or Windows Server 2012 and above. I imagine that timer could be used to prevent time loss (likely the machine in question has a modern operating system).

There is almost certainly a way to collect the same thing using Linux, I imagine. It's just querying the system hardware.
disclaimer: I have no idea what I'm talking about...

Can engines use GPS clocks? Would a very accurate clock solve whatever you're trying to solve, or is it more complicated than that?


Some quick reading suggests:

Code: Select all

#include <time.h>
http://linux.die.net/man/3/clock_gettime
CLOCK_REALTIME
System-wide realtime clock. Setting this clock requires appropriate privileges.
CLOCK_MONOTONIC
Clock that cannot be set and represents monotonic time since some unspecified starting point.
Or
http://www.cplusplus.com/reference/ctim ... S_PER_SEC/
Last edited by Jesse Gersenson on Thu Oct 29, 2015 12:22 pm, edited 1 time in total.
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by lucasart »

Jesse Gersenson wrote:
Dann Corbit wrote:Seems likely that there is not a problem then, if the value 50 is changed to something large enough to prevent loss.

Windows has a real time timer accurate to 1 microsecond for Windows 8 or Windows Server 2012 and above. I imagine that timer could be used to prevent time loss (likely the machine in question has a modern operating system).

There is almost certainly a way to collect the same thing using Linux, I imagine. It's just querying the system hardware.
disclaimer: I have no idea what I'm talking about...

Can engines use GPS clocks?

Can something be used from

Code: Select all

#include <time.h>
http://linux.die.net/man/3/clock_gettime
CLOCK_REALTIME
System-wide realtime clock. Setting this clock requires appropriate privileges.
CLOCK_MONOTONIC
Clock that cannot be set and represents monotonic time since some unspecified starting point.
Or
http://www.cplusplus.com/reference/ctim ... S_PER_SEC/
I'm afraid you (and Dan) are missing the point. It's not clock functions that are broken (even under heavy load). It's sleep functions.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Jesse Gersenson
Posts: 593
Joined: Sat Aug 20, 2011 9:43 am

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by Jesse Gersenson »

Lucas, I had a hunch (edited my message as you were responding, asking whether the timer function was at issue).

Ok, so it's the sleeper function. How do programs in the financial sector solve this problem?
Jesse Gersenson
Posts: 593
Joined: Sat Aug 20, 2011 9:43 am

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by Jesse Gersenson »

lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: New Stockfish with Lazy_SMP, but what about the TC bug ?

Post by lucasart »

Theory and practice sometimes clash. And when that happens, theory loses. Every single time.