After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609815 - chess: Computer keeps thinking, does not play
chess: Computer keeps thinking, does not play
Status: RESOLVED FIXED
Product: gnome-chess
Classification: Applications
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-13 06:44 UTC by Niraj
Modified: 2013-05-01 04:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Saved game (315 bytes, application/x-chess-pgn)
2010-02-13 06:44 UTC, Niraj
Details
Log window: Tab #1 (333 bytes, text/plain)
2010-02-13 06:45 UTC, Niraj
Details
Log window: Tab #2 (646 bytes, text/plain)
2010-02-13 06:45 UTC, Niraj
Details
Log window: Tab #3 (862 bytes, text/plain)
2010-02-13 06:47 UTC, Niraj
Details
Saved game - session 2 (305 bytes, application/x-chess-pgn)
2010-02-13 12:20 UTC, Niraj
Details
Log window: session 2 (741 bytes, text/plain)
2010-02-13 12:21 UTC, Niraj
Details
Saved game from Jordan Bray (494 bytes, text/plain)
2011-08-30 20:08 UTC, Jordan Bray
Details
The version not including move 19. (351 bytes, application/x-chess-pgn)
2011-08-30 20:58 UTC, Jordan Bray
Details

Description Niraj 2010-02-13 06:44:38 UTC
Created attachment 153692 [details]
Saved game

Game settings, when the game began:
    Game name: Human versus GNU Chess
    Move Time: Five minutes
    White: Human
    Black: GNU Chess
    Difficulty:
        Black: Easy

I started a limited-time game against the computer in glchess. After a few moves, the computer did not respond with a move, and finally lost the game as it ran out of time. In a 5 minute game, I was left with 2 min 46 s, while the computer was left with a something over 3 min, when its turn began. It was only the 5th move.

The program was not hung, as the timer was ticking smoothly, and the program was responsive throughout, even after the game got over.

I am attaching the .pgn file for the game (stuck.pgn), as saved after the game got over.

Also attaching the following log files that came up after clicking "View > Show Logs":
    Application-Log.txt: The first tab in the log window.
    GNU-Chess-1.txt: The second tab in the log window, named "GNU Chess".
    GNU-Chess-2.txt: The second tab in the log window, also named "GNU Chess".

'GNU-Chess-2.txt' shows something interesting. All the moves mentioned in this file match with the moves that the computer actually made during the game. However, there are 2 things that I found strange:
    1) The last 2 lines in this log file are:

           4. ... g1f3
           My move is: g1f3

       However, the computer never played such a move.
    
    2) The numbering of moves in this file looks very confusing. For example the above move is numbered as 4, although this was the 5th move.
Comment 1 Niraj 2010-02-13 06:45:27 UTC
Created attachment 153693 [details]
Log window: Tab #1
Comment 2 Niraj 2010-02-13 06:45:51 UTC
Created attachment 153694 [details]
Log window: Tab #2
Comment 3 Niraj 2010-02-13 06:47:01 UTC
Created attachment 153695 [details]
Log window: Tab #3

This is the log file that shows a move (last line) that the chess engine seems to have thought of, but never played.
Comment 4 Niraj 2010-02-13 06:49:14 UTC
Sorry, it is meant to be "Log window: Tab #3".

(In reply to comment #3)
> Created an attachment (id=153695) [details]
> Log window: Tab #2
> 
> This is the log file that shows a move (last line) that the chess engine seems
> to have thought of, but never played.
Comment 5 Niraj 2010-02-13 12:18:24 UTC
Reproduced.

I played the game again, and the program behaved in the same way. The game had reached a very similar position (Both black knights pinned using bishops).

I just noticed that the last moved decided by the engine (as seen in the log file) is a valid move for white, whereas the computer was playing black!

Attached is the .pgn file (stuck-1.pgn) and the new log file (GNU-chess-3.txt).
Comment 6 Niraj 2010-02-13 12:20:43 UTC
Created attachment 153705 [details]
Saved game - session 2
Comment 7 Niraj 2010-02-13 12:21:39 UTC
Created attachment 153706 [details]
Log window: session 2
Comment 8 Jordan Bray 2011-08-30 20:06:56 UTC
I think I ran into the same bug, so I figured I'd attach my own PGN as well.

To duplicate on my PGN, make the move b4 as white as soon as it loads.
To make the game playable, load my PGN and make the move Rh1 as soon as it loads :/

Therefore, it's not confused on what it's playing as when the game starts up, it only pretends to be confused when the user makes a good move :). (or something else...)

I'm going to try to load up my game in gnuchess directly and see what happens.  I've never done that before, so if anyone has any pointers let me know.  Hopefully this isn't a bug in gnuchess. :/

Niraj, I was able to make your game playable by editing the PGN file.  The file you attached had your own move as the last move played, and I'm pretty sure glchess craps out when that happens.  If you edit it to remove your move (and remove the end of game at the end of your moves line), your game becomes playable.

15c15
< 1. e4 Nc6 2. Bb5 Nf6 3. d3 e5 4. Bg5 1-0
---
> 1. e4 Nc6 2. Bb5 Nf6 3. d3 e5 *

Thanks,
Jordan Bray
Comment 9 Jordan Bray 2011-08-30 20:08:01 UTC
Created attachment 195244 [details]
Saved game from Jordan Bray
Comment 10 Jordan Bray 2011-08-30 20:58:45 UTC
Created attachment 195249 [details]
The version not including move 19.

Make the move b4 as white, then gl/gnuchess has a chance of making Nxb3, which is an invalid chess move.  Ctrl+Z is your friend in duplicating this bug.
Comment 11 Michael Catanzaro 2013-01-02 19:56:18 UTC
In git master it is simply Nb3 rather than Nxb3, so I guess this is fixed somehow.  Ran this multiple times and everything looks fine. Jordan, can you still reproduce this, and if so on which version?

The entire program's been rewritten since Niraj's original report, so I didn't even bother looking into that.
Comment 12 Michael Catanzaro 2013-05-01 04:52:06 UTC
(In reply to comment #8)
> Niraj, I was able to make your game playable by editing the PGN file.  The file
> you attached had your own move as the last move played, and I'm pretty sure
> glchess craps out when that happens.  If you edit it to remove your move (and
> remove the end of game at the end of your moves line), your game becomes
> playable.

OK, got this fixed for the next stable release (3.8.2).  Thanks for identifying the problem!