Bug 562793

Summary: pychess consumes 100% of the CPU when analyzers are enabled
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: pychessAssignee: Thomas Spura <tomspur>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 12CC: michel, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-09 10:18:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
pychess CPU use with analyzers enabled none

Description Steve Tyler 2010-02-08 12:33:02 UTC
Description of problem:
When the hint/spy analyzers are enabled, pychess constantly consumes 100% of the CPU.

Version-Release number of selected component (if applicable):
pychess-0.10-0.1.20100203svn.fc12.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Enable Pychess hint/spy analyzers in Settings:Preferences:Computer Opponents.
2. Select the lowest level of difficulty (number 1 on the slider).
3. Start game, but don't make any moves.
  
Actual results:
CPU use immediately reaches 100% and stays there.
This does not depend on whether the hint and/or spy display modes are enabled in the View menu.

Expected results:
CPU use is much less than 100%.

Additional info:
In pychess-0.8.2-4.fc12.noarch, if the analyzers are enabled, CPU use briefly reaches 100% after each move (on a different and slower system). Between moves, CPU use is around 3%.

I use gkrellm, gnome system monitor, and top to monitor CPU use.

Comment 1 Steve Tyler 2010-02-08 12:48:59 UTC
Created attachment 389506 [details]
pychess CPU use with analyzers enabled

CPU use shown by the "top" command before any moves have been made.

Comment 3 Thomas Spura 2010-02-09 10:18:33 UTC
WONTFIX from upstream :)

Comment 4 Steve Tyler 2010-02-09 17:34:53 UTC
(In reply to comment #3)
> WONTFIX from upstream :)    

Thanks for looking into this.
From the comments, it looks like working on this app. could be frustrating. :-)

ISTM, the analyzers could be configurable in the same way as the difficulty level --
with clairvoyant, smart, and dumb modes, say. :-)

The dumb mode would do about as much work as the easy level of difficulty and use little CPU, while possibly giving bad advice.

But, I won't reopen ...

Comment 5 Steve Tyler 2010-02-09 18:08:48 UTC
When both analyzers are enabled, pychess forks two additional processes, with each consuming about 50% of the CPU.

Since the board position and the side that is to move next are the same for both analyzers, running two analyzers seems to be inefficient.

But I know very little about chess algorithms ...

Comment 6 Steve Tyler 2010-02-10 21:54:41 UTC
Just put pychess-0.10-0.1.20100203svn.fc12.noarch on my laptop.

Those analyzers have it heated up to 62C, and the fan running continuously. Normal temp. is around 40C.

Maybe I will open a new bug requesting that pychess be ported to Deep Blue. :-)