Not working-at-all pondering is also a problem of movei for similiar reasons.There should be a new PolyGlot available on Dann's FTP site, but I can't access it at the moment (I could until last week).
It is very important that this version is tested because it has among other things the new code for "crippled pondering", which is much better than the not-working-at-all pondering that Leo insists on using despite my warnings ...
Does the "wrong remaining time" come straight from the xboard protocol?Not working-at-all pondering is also a problem of movei for similiar reasons.There should be a new PolyGlot available on Dann's FTP site, but I can't access it at the moment (I could until last week).
It is very important that this version is tested because it has among other things the new code for "crippled pondering", which is much better than the not-working-at-all pondering that Leo insists on using despite my warnings ...
In the case of movei it can cause losses on time in less than 1/100 of the cases based on my experience.
Movei practically use the correct remaining time when it needs to decide if to do another iteration but it is using wrong remaining time when it needs to stop in the middle of the iteration.
In most cases it does not stop at the middle of the iteration and even if it stops in the middle of the iteration movei has a rule never to use more than half of the remaining time so even using the previous remaining time usually does not cause losing on time.
Uri
I did not expect winboard to send the remaining time after every half move and the bug is simply a result of not thinking about the problem.Does the "wrong remaining time" come straight from the xboard protocol?Not working-at-all pondering is also a problem of movei for similiar reasons.There should be a new PolyGlot available on Dann's FTP site, but I can't access it at the moment (I could until last week).
It is very important that this version is tested because it has among other things the new code for "crippled pondering", which is much better than the not-working-at-all pondering that Leo insists on using despite my warnings ...
In the case of movei it can cause losses on time in less than 1/100 of the cases based on my experience.
Movei practically use the correct remaining time when it needs to decide if to do another iteration but it is using wrong remaining time when it needs to stop in the middle of the iteration.
In most cases it does not stop at the middle of the iteration and even if it stops in the middle of the iteration movei has a rule never to use more than half of the remaining time so even using the previous remaining time usually does not cause losing on time.
Uri
That is, did you expect clocks to be updated after each half move (which would certainly help, but might break some really old engines)?
Fabien.
That's it, I can now see it.There should be a new PolyGlot available on Dann's FTP site, but I can't access it at the moment (I could until last week).
I think you have been discussing this for some days nowI did not expect winboard to send the remaining time after every half move and the bug is simply a result of not thinking about the problem.Does the "wrong remaining time" come straight from the xboard protocol?Not working-at-all pondering is also a problem of movei for similiar reasons.There should be a new PolyGlot available on Dann's FTP site, but I can't access it at the moment (I could until last week).
It is very important that this version is tested because it has among other things the new code for "crippled pondering", which is much better than the not-working-at-all pondering that Leo insists on using despite my warnings ...
In the case of movei it can cause losses on time in less than 1/100 of the cases based on my experience.
Movei practically use the correct remaining time when it needs to decide if to do another iteration but it is using wrong remaining time when it needs to stop in the middle of the iteration.
In most cases it does not stop at the middle of the iteration and even if it stops in the middle of the iteration movei has a rule never to use more than half of the remaining time so even using the previous remaining time usually does not cause losing on time.
Uri
That is, did you expect clocks to be updated after each half move (which would certainly help, but might break some really old engines)?
Fabien.
I mainly test with ponder off and in this case movei has the correct remaining time when it starts to calculate.
The situation is different with ponder on and I simply did not think about it when I implemented pondering.
Winboard send the time command before sending the opponent move.
I updated max_time that is half of the remaining time when I got the time command but I did not update another related varaible stop_time that is updated
only when movei starts to calculate(after getting the expected move it does not need to start to calculate)
The solution was simply to delete stop_time and use start_time+max_time instead it and this soplution is implemented in my latest version but not in the public version.
Getting the time command immediately every half ply could not help because movei starts to ponder immediately after making a move and check for winboard commands only during the search so in that case movei may still have the wrong stop_time that is updated only in the beginning of the search.
Uri
I think you have been discussing this for some days nowI did not expect winboard to send the remaining time after every half move and the bug is simply a result of not thinking about the problem.Does the "wrong remaining time" come straight from the xboard protocol?Not working-at-all pondering is also a problem of movei for similiar reasons.There should be a new PolyGlot available on Dann's FTP site, but I can't access it at the moment (I could until last week).
It is very important that this version is tested because it has among other things the new code for "crippled pondering", which is much better than the not-working-at-all pondering that Leo insists on using despite my warnings ...
In the case of movei it can cause losses on time in less than 1/100 of the cases based on my experience.
Movei practically use the correct remaining time when it needs to decide if to do another iteration but it is using wrong remaining time when it needs to stop in the middle of the iteration.
In most cases it does not stop at the middle of the iteration and even if it stops in the middle of the iteration movei has a rule never to use more than half of the remaining time so even using the previous remaining time usually does not cause losing on time.
Uri
That is, did you expect clocks to be updated after each half move (which would certainly help, but might break some really old engines)?
Fabien.
I mainly test with ponder off and in this case movei has the correct remaining time when it starts to calculate.
The situation is different with ponder on and I simply did not think about it when I implemented pondering.
Winboard send the time command before sending the opponent move.
I updated max_time that is half of the remaining time when I got the time command but I did not update another related varaible stop_time that is updated
only when movei starts to calculate(after getting the expected move it does not need to start to calculate)
The solution was simply to delete stop_time and use start_time+max_time instead it and this soplution is implemented in my latest version but not in the public version.
Getting the time command immediately every half ply could not help because movei starts to ponder immediately after making a move and check for winboard commands only during the search so in that case movei may still have the wrong stop_time that is updated only in the beginning of the search.
Uri
and I am sorry I missed it because I had similar problems
myself. Elephant lost on time while pondering. My solution
was: stop pondering when winboard sends 'time' (and not
the usermove) and then just wait for the usermove (and
while doing this accept the 'otim' command). There is a
new state pondering_done recognized in the main loop.
When winboard sends the usermove I change the state back
to ponder_on and start thinking my own move with the time
calculated based on the 'time' command. Up to now there
is no correction with the waiting time but it already works.
I have increased some time safety margins too. It seems the
empty wait for winboard input loop reacts faster than the
every few thousand node lookup in the search.
Harald
Hm. I answered a question you had not asked. And because I amI think you have been discussing this for some days now
and I am sorry I missed it because I had similar problems
myself. Elephant lost on time while pondering. My solution
was: stop pondering when winboard sends 'time' (and not
the usermove) and then just wait for the usermove (and
while doing this accept the 'otim' command). There is a
new state pondering_done recognized in the main loop.
Correct.
This was not my problem because I always stop pondering after getting the time command and wairted for otime command and the user move.
I do not know.Hm. I answered a question you had not asked. And because I amI think you have been discussing this for some days now
and I am sorry I missed it because I had similar problems
myself. Elephant lost on time while pondering. My solution
was: stop pondering when winboard sends 'time' (and not
the usermove) and then just wait for the usermove (and
while doing this accept the 'otim' command). There is a
new state pondering_done recognized in the main loop.
Correct.
This was not my problem because I always stop pondering after getting the time command and wairted for otime command and the user move.
doing another (weaker?) kind of pondering our engines are too
different and cannot have the same solutions.
Do you know whether winboard sends the commands time, otim and
the usermove in maximal speed or is there a time delay between
them?
Another question: Is it possible that winboard needs some
extra time with the last move in a time control M moves in N
seconds. Perhaps it is testing if a flag fell.
correctly I observed a bigger difference between my time
control and winboard's time at the last move. But I am not
sure and I see no reason for such a behavior on fast PCs.
Exaggerated:
... 50000 msec for 10 moves ...
Winboard says "time 10000 msec for 2 moves".
I tell my engine "use 4000 msec for one move". (defensive)
Winboard says "time 5000 msec for 1 move". (where are 1000 msec?)
I tell my engine "use 3000 msec for one move". (very defensive at last move)
Now I successfully pass the time control. (with +100 msec,
Winboard says "time 50100 msec for 10 moves". (where are 1900 msec?)
...
Perhaps I still have a hidden problem.
Harald
I believe a correct implementation in an xboard engine is as follows:I think you have been discussing this for some days now
and I am sorry I missed it because I had similar problems
myself. Elephant lost on time while pondering. My solution
was: stop pondering when winboard sends 'time' (and not
the usermove) and then just wait for the usermove (and
while doing this accept the 'otim' command). There is a
new state pondering_done recognized in the main loop.
When winboard sends the usermove I change the state back
to ponder_on and start thinking my own move with the time
calculated based on the 'time' command. Up to now there
is no correction with the waiting time but it already works.
I have increased some time safety margins too. It seems the
empty wait for winboard input loop reacts faster than the
every few thousand node lookup in the search.
Harald
^^^2) don't modify your pondering when you receive time or otim, a user move will arrive soon
I am practically in infinite mode before getting the opponent move.I believe a correct implementation in an xboard engine is as follows:I think you have been discussing this for some days now
and I am sorry I missed it because I had similar problems
myself. Elephant lost on time while pondering. My solution
was: stop pondering when winboard sends 'time' (and not
the usermove) and then just wait for the usermove (and
while doing this accept the 'otim' command). There is a
new state pondering_done recognized in the main loop.
When winboard sends the usermove I change the state back
to ponder_on and start thinking my own move with the time
calculated based on the 'time' command. Up to now there
is no correction with the waiting time but it already works.
I have increased some time safety margins too. It seems the
empty wait for winboard input loop reacts faster than the
every few thousand node lookup in the search.
Harald
1) don't allocate time when you start pondering (you don't have correct clock info at that time); so just search in "infinite" mode
2) don't modify your pondering when you receive time or otim, a user move will arrive soon
3) when you receive the usermove and it matches the move you were pondering on, then allocate the search time (without interrupting the search); that is, calculate the values for your internal max_time variable etc ... and leave "infinite" mode.
Unfortunately I can't do this in PolyGlot because UCI does not allow time to be "allocated" *during* pondering (it must be done when starting it, and WinBoard won't send me the needed information).
Fabien.
When I get the time command I wait passively for a move because I assume that a move is going to come immediately.^^^2) don't modify your pondering when you receive time or otim, a user move will arrive soon
Of course you need to update your global time/otim variables everytime you receive those, but my point is that the values will only be used later.
Fabien.
I thought about it, but it fails if the last move was searched in pondering mode.Maybe polyglot can claulcate the relevant information based on the time that the engine used when it played the last move and the time control.
You can always assume slightly less time then the calculated time in order to be careful because you cannot trust the calculated time to be the same as the time that winboard is going to send.
Note that I am talking about behaviour of the interface with only winboard enginesWhen I get the time command I wait passively for a move because I assume that a move is going to come immediately.^^^2) don't modify your pondering when you receive time or otim, a user move will arrive soon
Of course you need to update your global time/otim variables everytime you receive those, but my point is that the values will only be used later.
Fabien.
If there is an interface that does not give a move immediately after the time command then it is a bad behaviour of the interface.
I agree, but what's the point?When I get the time command I wait passively for a move because I assume that a move is going to come immediately.^^^2) don't modify your pondering when you receive time or otim, a user move will arrive soon
Of course you need to update your global time/otim variables everytime you receive those, but my point is that the values will only be used later.
Fabien.
If there is an interface that does not give a move immediately after the time command then it is a bad behaviour of the interface.
I think that in this case the search time for UCI engines is the difference between clock time of both engines(winboard engines may decide to ponder on more than one move so I can claim nothing general about them).I thought about it, but it fails if the last move was searched in pondering mode.Maybe polyglot can claulcate the relevant information based on the time that the engine used when it played the last move and the time control.
You can always assume slightly less time then the calculated time in order to be careful because you cannot trust the calculated time to be the same as the time that winboard is going to send.
The engine will report search time, not clock time.
Fabien.
I assumed you meant trusting time as reported by the engines. This can't be done of course, as they would count search done during the opponent time as well.Maybe polyglot can claulcate the relevant information based on the time that the engine used when it played the last move and the time control.Unfortunately I can't do this in PolyGlot because UCI does not allow time to be "allocated" *during* pondering (it must be done when starting it, and WinBoard won't send me the needed information).
You can always assume slightly less time then the calculated time in order to be careful because you cannot trust the calculated time to be the same as the time that winboard is going to send.
Return to Archive (Old Parsimony Forum)
Users browsing this forum: No registered users and 19 guests