Bug 192453

Summary: kpatience displays winnable and not-winnable for (nearly) same game state
Product: [Applications] kpat Reporter: H.H. <cyberbeat>
Component: solverAssignee: Stephan Kulow <coolo>
Status: CONFIRMED ---    
Severity: normal CC: aacid, andrew.crouthamel, hatto, kde-games-bugs-null
Priority: NOR Keywords: investigated, triaged
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: before move
after move
savegame
Aces up savegame where winnable goes back and forth
Demo Solver Bug
Demo solver bug for kpat 3.6
Demo solver bug for kpat 23.08.5 (Simple Simon)

Description H.H. 2009-05-12 16:55:43 UTC
Version:           3.1 (using 4.2.71 (KDE 4.2.71 (KDE 4.3 >= 20090428)) "release 1.2", KDE:KDE4:UNSTABLE:Desktop / openSUSE_11.0)
Compiler:          gcc
OS:                Linux (i686) release 2.6.25.11-0.1-pae

The solver displays "winnable", and after a reversible move, it displays "not winnable". See attached screenshot and savegame. I have had more cases of myterious solver-displays before.
Comment 1 H.H. 2009-05-12 16:56:20 UTC
Created attachment 33580 [details]
before move
Comment 2 H.H. 2009-05-12 16:56:40 UTC
Created attachment 33581 [details]
after move
Comment 3 H.H. 2009-05-12 16:57:06 UTC
Created attachment 33582 [details]
savegame
Comment 4 Stephan Kulow 2009-05-13 09:54:48 UTC
can you make it a bit easier for me in telling what move that is? I don't like "find the 10 mistakes in the right picture" games.
Comment 5 H.H. 2009-05-13 14:57:19 UTC
putting the top two cards from the 8th to the 5th deck. easy to see when opening both images in different tabs and switch.
Comment 6 Dan Keshet 2009-07-16 19:09:10 UTC
Created attachment 35390 [details]
Aces up savegame where winnable goes back and forth

Here is an aces-up game where clicking on the middle Ace toggles the state between winnable and unwinnable.
Comment 7 Hatto Von Hatzfeld 2009-10-16 11:43:10 UTC
Maybe this hint helps: I just have won a klondike game although it was shown as unwinnable. It seems that certain moves are not included in the calculation of the solver; in my case the play could be won only by move some cards temporarilly from the foundation back onto the playing piles.

I'll try to get an example as file later.
Comment 8 Hatto Von Hatzfeld 2009-10-16 13:41:51 UTC
Created attachment 37620 [details]
Demo Solver Bug

This attachment demonstrates the bug. Just load it as game in kpatience. The solver will evaluate it as unwinnable while you can easily move a King from the foundation to a free playing pile and win the game. At least that's what my system does which has these parametes:

KDE Version:      3.2 (KDE 4.3.2 "release 5", KDE:43 / OpenSUSE_11.1)
Application:      Patience Game 3.2
Operating System: Linux (i686) release 2.6.27.29-0.1-pae
Compiler:         gcc
Comment 9 Andrew Crouthamel 2018-09-20 03:11:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 H.H. 2018-09-20 09:54:56 UTC
I don't see, why the state was in needinfo, I answered the one question. A problem now is, that I can't load the save game anymore with the current version.
Comment 11 Andrew Crouthamel 2018-09-20 14:03:34 UTC
I'll change this to to REPORTED for later follow-up. Thanks for the update!
Comment 12 Albert Astals Cid 2018-09-20 17:21:28 UTC
Yes that savegame file is old and the legacy file loader fails to load it, someone with time and knowledge needs to figure out why, but that intersection of people probably doesn't exist at this time
Comment 13 Justin Zobel 2022-11-30 05:28:26 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 14 Hatto Von Hatzfeld 2022-11-30 14:55:48 UTC
(In reply to Hatto Von Hatzfeld from comment #8)
> Created attachment 37620 [details]
> Demo Solver Bug
> 
> This attachment demonstrates the bug. Just load it as game in kpatience. The
> solver will evaluate it as unwinnable while you can easily move a King from
> the foundation to a free playing pile and win the game. At least that's what
> my system does which has these parametes:
> 
> KDE Version:      3.2 (KDE 4.3.2 "release 5", KDE:43 / OpenSUSE_11.1)
> Application:      Patience Game 3.2
> Operating System: Linux (i686) release 2.6.27.29-0.1-pae
> Compiler:         gcc

I have tested this now with kpat 3.6, KDE Frameworks 5.44.0, on Linux (x86_64) release 5.4.0-132-generic, Ubuntu 18.04.6 LTS (Bionic Beaver)

The result is still the same.
Comment 15 Hatto Von Hatzfeld 2022-12-01 21:09:04 UTC
Created attachment 154208 [details]
Demo solver bug for kpat 3.6

This demo shows the bug. Steps to reproduce:
1. Open kpat and load the attached file. The solver says: solvable.
2. Drag and drop both king cards onto the target (foundations). The solver says: not solvable (which is wrong).
3. Drag and drop both king cards onto any of the play tiles. The solver stills says: not solvable. This is wrong and shows that the solver did not even try to solve it.
4. Revert the last move (using the menu or the short cut). Now the solver says: solvable (which is correct).

It seems that there are two bugs: The solver does not consider it a legal action to move a card from the target to a play pile, and it does not start the solving algorithm after each move.
Comment 16 Stephan Kulow 2023-02-28 14:22:56 UTC
That's correct, the solver does not try to move cards down as it's moving such kings up itself.
Comment 17 Hatto Von Hatzfeld 2025-10-07 19:29:12 UTC
Created attachment 185583 [details]
Demo solver bug for kpat 23.08.5 (Simple Simon)

This is a more essential bug demo for a newer version of kpat, just 2 steps away from the solution. To reproduce it:
1. Open kpat and load the attached file. The solver says: solvable.
2. Drag and drop 🂽 (Queen of Hearts) onto the King.
The solver says: not solvable – which is very obviously wrong.