[bug #27642] Clock jumps strangely in engine mode

View: New views
9 Messages — Rating Filter:   Alert me  

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.gnu.org/bugs/?27642>

                 Summary: Clock jumps strangely in engine mode
                 Project: XBoard
            Submitted by: None
            Submitted on: Fri 09 Oct 2009 07:31:33 AM UTC
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Start xboard with engine(s) and "-tc 3 -inc 0"
After a move is made (not book move) opponents clock gets
started. The first second seems to be always exactly a second.
But then a shorter (varying length) second gets inserted.
This was not the case in version 4.2.7.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #1, bug #27642 (project xboard):

Does this also happen when you run XBoard with the option "-niceEngines 20"?
It could be that what you see is the result of the engins and xboard competing
for CPU. I have no explanation why such contention would be different than in
4.2.7, but nothing was changed in this area compared to 4.2.7.

H.G. Muller

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #2, bug #27642 (project xboard):

"-niceEngines 20" doesn't change anything.
You have to try several times. Sometimes the 2nd second
is almost of normal length and sometimes it's almost
completely skipped.

If your clock is already at less than 10secs ,say 8.3
after engine moves your clock jumps to 7.9 then remains there
for a short time then jumps to 6.9 then continues running normally in 0.1
decrements.
Looks almost as if the clock isn't drawn to the screen for a short time after
engine has moved.

Probably related: In xboard 4.2.7 an -inc gets added to your
clock right after your move. With the new xboard, the inc is added to your
clock after the engine has moved.

Additionally I just saw this:
xboard -tc 0 -inc 20
xboard: bad timeControl option 0
Segmentation fault

Again, 4.2.7 handles this case correctly.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #3, bug #27642 (project xboard):

Between 4.4.0.alpha1 and alpha2 there was a change in function
MakeMove in backend.c:
"forwardMostMove++;" was shifted down and all references in between changed.
These explanation comments were added:

 //    forwardMostMove++; // [HGM] bare: moved downstream
...
    forwardMostMove++; // [HGM] bare: moved to after ApplyMove, to make sure
clock interrupt finds complete board

When I undo these changes, clock works normally again.
This also effects the moment when -inc gets added, as suspected
in my last post.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #4, bug #27642 (project xboard):

OK, thanks for tracing this down. I had gotten as far as concluding that the
first tick after a clock switch was always 1000 ms, rather than the remaining
fractional second on the new side-to-move's clock, and that this was
compensated only on the next tick, but had not found the reason yet.

The problem is that SwitchClock() uses forwardMostMove, so after the 'bare'
patch it was using the time of the wrong player to decide on the tick length.
The proper fix is to move SwitchClocks() and the two timeRemaining-referring
lines behind it to after the forwardMostMove++.

This means that the time for performing the move on the board is now added to
the time of the player that just moved, rather than the player that is going
to move, but this should not really make a difference, as this should be only
micro-seconds.

Again, thanks for spotting the bug, and for locating it!
H.G. Muller

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #5, bug #27642 (project xboard):


comment #2:
>Additionally I just saw this:
>xboard -tc 0 -inc 20
>xboard: bad timeControl option 0
>Segmentation fault
>
>Again, 4.2.7 handles this case correctly.

This should be already fixed in git. Someone else had reported this already.
(commit f9fe58c6ea5c0938364cd9bd0b434ee66e0f7272)

Let me know if it doesn't work for you.

ARUN

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #27642 (project xboard):

                  Status:                    None => Ready For Test        

    _______________________________________________________

Follow-up Comment #6:

fixed in git (commit de954fa0f31cc935b5ad61819a04de2713cd98ed)

Please test.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #7, bug #27642 (project xboard):

I don't know, if I (as the original submitter) am supposed to post my test
result. Nevertheless, it works now. Also the Segfault is repaired. Thanks.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard

[bug #27642] Clock jumps strangely in engine mode

by Per Bothner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #27642 (project xboard):

                  Status:          Ready For Test => Fixed                  
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #8:

thanks for testing and reporting the bug in the first place.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27642>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/



_______________________________________________
Bug-XBoard mailing list
Bug-XBoard@...
http://lists.gnu.org/mailman/listinfo/bug-xboard