About lags

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

About lags

Post by michiguel »

A new version of Gaviota (planned to be released today but I will hold it at least until tomorrow) measures the lag between the GUI and the engine, and tries to speed up if it sees that the GUI is stealing too much time (a feature that can be turned on or off). Today, in the HGM server, Gaviota panicked against Thinker because the first lag after book was 10 seconds and as a consequence, thought it should rush it if all the lags will be like this. I need to buffer this, but, is the GUI supposed to steal time from the engine if timeseal is used?

The lag is being measured as the difference between the gaviota's internal clock and what xboard thinks it is remaining with the command 'time'.

Miguel (average lags were otherwise ~0.5 seconds)
LOG:

Previous position not found in score sheet
Current position has aging id: 0
Estimated Average LAG = 10372 ms
moves_played: 15, x:3 y:37
remaining_csec: 27200, SAFETY:1000

Clocktest.n=0
set timer to 0.001000 , max_ply 64, panic time: 136.000000
97 1: 0.0 +0.83 16.Qg3
772 2: 0.0 +0.65 16.a4 bxa4
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: About lags

Post by michiguel »

michiguel wrote:A new version of Gaviota (planned to be released today but I will hold it at least until tomorrow) measures the lag between the GUI and the engine, and tries to speed up if it sees that the GUI is stealing too much time (a feature that can be turned on or off). Today, in the HGM server, Gaviota panicked against Thinker because the first lag after book was 10 seconds and as a consequence, thought it should rush it if all the lags will be like this. I need to buffer this, but, is the GUI supposed to steal time from the engine if timeseal is used?

The lag is being measured as the difference between the gaviota's internal clock and what xboard thinks it is remaining with the command 'time'.

Miguel (average lags were otherwise ~0.5 seconds)
LOG:

Previous position not found in score sheet
Current position has aging id: 0
Estimated Average LAG = 10372 ms
moves_played: 15, x:3 y:37
remaining_csec: 27200, SAFETY:1000

Clocktest.n=0
set timer to 0.001000 , max_ply 64, panic time: 136.000000
97 1: 0.0 +0.83 16.Qg3
772 2: 0.0 +0.65 16.a4 bxa4
There is something very funny, it looks like all the 'time' commands sent by xboard are rounded to the second. Is that because the ICS does that? that explains the lags I observed.

Miguel
User avatar
hgm
Posts: 27809
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: About lags

Post by hgm »

Apparently some ICS use sec, others msec. XBoard seems to decide what is the case based on the reported time for the move: if it contains a period, it assumes msec are used. (I see this is a bug in my background observe code: I always assume seconds.)

I still dont see how you could get a lag of 10 sec by rounding to sec...
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: About lags

Post by michiguel »

hgm wrote:Apparently some ICS use sec, others msec. XBoard seems to decide what is the case based on the reported time for the move: if it contains a period, it assumes msec are used. (I see this is a bug in my background observe code: I always assume seconds.)

I still dont see how you could get a lag of 10 sec by rounding to sec...
I am looking at it and it must be a separate issue. The 10 sec may be a bug in my code and most probably is, because I never felt there was a 10 seconds delay. But, the other ones are a product of rounding. (EDIT: I mean the ones I said were ~0.5 sec)

Miguel
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: About lags

Post by michiguel »

michiguel wrote:
hgm wrote:Apparently some ICS use sec, others msec. XBoard seems to decide what is the case based on the reported time for the move: if it contains a period, it assumes msec are used. (I see this is a bug in my background observe code: I always assume seconds.)

I still dont see how you could get a lag of 10 sec by rounding to sec...
I am looking at it and it must be a separate issue. The 10 sec may be a bug in my code and most probably is, because I never felt there was a 10 seconds delay. But, the other ones are a product of rounding. (EDIT: I mean the ones I said were ~0.5 sec)

Miguel
Yes, found the problem and I fixed it. It was related to pondering and how the clock was updated with ponder hits. This is what happens when you test your engine with ponder off. First tournament, and a ghost shows up. Now that those spikes are gone, the average lag is few ms because sometimes is +0.9 seconds but sometimes is -0.9 seconds. The cause of those swings is the 1 second resolution and the rounding. After a dozen of moves, everything averages out.

Miguel