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 668553 - iagno AI sometimes freezes
iagno AI sometimes freezes
Status: RESOLVED FIXED
Product: iagno
Classification: Applications
Component: general
git master
Other All
: High critical
: ---
Assigned To: iagno-maint
iagno-maint
: 674978 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-01-24 03:46 UTC by Allison Karlitskaya (desrt)
Modified: 2013-09-08 17:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Search to a constant depth (1.97 KB, patch)
2013-09-08 17:17 UTC, Michael Catanzaro
committed Details | Review

Description Allison Karlitskaya (desrt) 2012-01-24 03:46:50 UTC
Play a level 3 computer against itself and the AI will go into an infinite loop.  It takes the entire app down with it because it blocks the mainloop.  Sometimes even when it doesn't freeze, it causes noticeable lags.

So really, this is two bugs:

  1) the AI sometimes gets stuck

  2) the AI should probably be moved into a separate thread
Comment 1 Jeremy Bicha 2012-02-20 01:23:08 UTC
I noticed something similar (perhaps the same thing tonight). It is very easy to get the computer stuck (reproducible, within a few moves). In fact, I'm having trouble finishing a game. The command line message is:

** WARNING **: computer-player.vala:73: Computer chose an invalid move: 0,0
Comment 2 Robert Ancell 2012-02-20 02:37:02 UTC
The invalid move message definitely indicates the AI screwed up...
Comment 3 Thomas Andersen 2012-03-07 19:06:37 UTC
I just pushed a fix for this to master:
http://git.gnome.org/browse/gnome-games/commit/?id=b2554eaa4b96e56e43bc29859b1fcd13984ad2f9
Comment 4 Tiffany Antopolski 2012-03-15 04:20:32 UTC
Should this bug be closed?
Comment 5 Thomas Andersen 2012-03-15 06:33:22 UTC
I think that there could still be another AI-hang bug. During my tests I experienced a hang at least once. I left this bug open to post any problems I find during testing here.
Comment 6 Matthias Clasen 2012-03-21 03:02:29 UTC
Also filed in Fedora against 3.3.91: https://bugzilla.redhat.com//show_bug.cgi?id=803438
Comment 7 Thomas Andersen 2012-03-21 07:22:27 UTC
The fedora bug is definitely the one fixed for 3.3.92 in comment #3.
Comment 8 Matthias Clasen 2012-03-21 10:27:44 UTC
thats great, thanks
Comment 9 mars1 2012-04-18 03:58:05 UTC
I don't know about vala, but I saw you mistake check game over. For example next game,
f5f6f7g7h7g5d3f8e6d6e7f4h5h8e3h6c7h4g6c6d7c8b6a6b5g8c5g4a7a8b8b7e8d8h3a4a5g3a3a2h2f3c4b3b4h1b2b1g2c3c2c1d2d1 -56
This game is over at 58 pieces, and score is 1:57. But if black is 0, then score always become 0:64.
Even if pieces is less than 64, and one player score is not 0, if both player can not place anywhere, then the game is over.
Comment 10 mars1 2012-04-19 02:21:41 UTC
Now iagno doesn't judge above game is over, and search next, but can not place anywhere, and crash.
Comment 11 Michael Catanzaro 2013-08-17 16:23:30 UTC
*** Bug 674978 has been marked as a duplicate of this bug. ***
Comment 12 Michael Catanzaro 2013-08-17 16:24:51 UTC
Still an issue,
Comment 13 Philipp Bielefeldt 2013-08-27 10:07:50 UTC
Same occurs to me (iagno 3.6) when playing against AI, and not restricted to level 3.
Comment 14 Michael Catanzaro 2013-09-08 17:17:39 UTC
Towards the end of the game the search depth jumps from 3/5/7 (easy/normal/hard) to 15/17/19.  That means the AI is computing all its possible moves, all your possible countermoves, all its possible moves in response to those countermoves, and so on for 15 moves into the future.  That's understandably taking several minutes to complete, making it impossible to finish any game that gets that far.

The following fix has been pushed:
9746987 Search to a constant depth
Comment 15 Michael Catanzaro 2013-09-08 17:17:43 UTC
Created attachment 254425 [details] [review]
Search to a constant depth

Towards the game the search depth jumps from 3/5/7 (easy/normal/hard) to
15/17/19, which takes several minutes to complete and causes the game to
hang during that time.  This is making it pretty much impossible to
finish a game of Iagno unless one player is completely eliminated before
that point.

Search instead to a constant depth of 3/5/7 throughout the game.  It
might make sense to go a bit deeper towards the end of the game when
playing on Hard, but 3/5/7 should work fairly well.