GithubHelp home page GithubHelp logo

Comments (37)

tico-tico avatar tico-tico commented on July 18, 2024

I'm using Komodo 8 as a tutor if it matters.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I use direct prints (running in pycharm or sciteru) or debug when things get tough.

I've been able to replicate the problem, adding sensitivity (999) to tutor (Options/Configuration).
It is necessary to test this previous to menu, because it couldn´t be necessary.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I have replaced
line 778:

           if (pointsBest - pointsUser) > 0:

with

            difpts = self.configuracion.tutorDifPts
            difporc = self.configuracion.tutorDifPorc
            if self.mrmTutor.mejorRMQue(rmUser, difpts, difporc):

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

I can't test right now, but I still can't understand how this if related to the problem. Please take another look at the debug output. The things break on line 813. The bug is really unpredictable and I really don't know how to reproduce it properly.
BTW I have sensitivity 0 difference in points and 10 in percents.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

This if determine if the tutor must work.

Previously:

  • if difpoints > 0 then:
    - if second opportunity (self.chance) then shows a menu:
    -----> if you select tutor, then:
    -----------> tutor routine test difpoints and difporc, in your case if difporc (10%) is greater than current difference, then exit, and doesn´t show tutor window.

from lucaschess.

fonkap avatar fonkap commented on July 18, 2024

Hello Lucas, hello Tico.

I think I've seen this problem before (or a very related one).
I think that if the position is mate and for any reason tutor finds a different mate, this problem appears.
I haven't got time to test your patch, but I have another one I think it can help.

In GestorEntMaq, line 765:

if not siElegido and self.siTutorActivado:

Change for:

mate = jg.posicion.siTerminada() and jg.siJaque
if not siElegido and self.siTutorActivado and not mate:

Then Tutor will never be offered if position is checkmate.
Please give me some time and I'll test the solution more and I'll provide some test cases.

Tico, could you confirm that the problem appears when the position is checkmate?
If not, could you provide a position (FEN) and configuration when the problem appears?

Greetings.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I have uploaded the last code.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Here's the FEN r1b2bnr/2p2kp1/p1ppp2p/4Pp2/3P4/4B3/PPP2PPP/RN1QK2R w KQ - 0 10

If I play (for instance) pawn to c3 without @lukasmonk's fix from #29 (comment), the click on Show tutor ignored.
If I play this move with the @lukasmonk's fix, no prompt is shown at all unless I play something really stupid like Qd1g4. I guess the difference in score wasn't enough to show the tutor prompt. I should have paid more attention to numbers.:))

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

BTW should it show There are XX best moves if Avaliable hints == 0? It shows now.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Another one. I don't know where it comes from.

Traceback (most recent call last):
  File "Code\QT\TabElementos.pyo", line 220, in mouseReleaseEvent
    
  File "Code\QT\Tablero.pyo", line 1284, in intentaMover
    
  File ".\Code\GestorEntMaq.py", line 815, in mueveHumano
    if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
  File "Code\Tutor.pyo", line 67, in elegir
    
  File "Code\Tutor.pyo", line 160, in hazListaRM
    
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

BTW should it show There are XX best moves if Avaliable hints == 0? It shows now.

I believe it can help to the user, it is a minimal help.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

Another one. I don't know where it comes from.

Traceback (most recent call last):
File "Code\QT\TabElementos.pyo", line 220, in mouseReleaseEvent

File "Code\QT\Tablero.pyo", line 1284, in intentaMover

File ".\Code\GestorEntMaq.py", line 815, in mueveHumano
if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
File "Code\Tutor.pyo", line 67, in elegir

File "Code\Tutor.pyo", line 160, in hazListaRM

TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

This is a problem before changes.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

This is a problem before changes.

nope, i had this with all your changes. not sure how to reproduce it.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

I was able to reproduce last exception.

Play against engine of your choice starting with this FEN 1r3kN1/p5pp/2p1Qp2/3P4/2B5/P7/P1PP1PPP/RNB1K2R w KQ - 5 16 against Monkey.

you - e6e7, ignore tutor select my move
monkey - f8g8
you - d5c6
monkey - g8h8

take back twice (you get to the beginning).

play e6e7 again but press show tutor, you should get exception after this.

Traceback (most recent call last):
  File "Code\QT\TabElementos.pyo", line 220, in mouseReleaseEvent
    
  File "Code\QT\Tablero.pyo", line 1284, in intentaMover
    
  File ".\Code\GestorEntMaq.py", line 815, in mueveHumano
    if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
  File "Code\Tutor.pyo", line 67, in elegir
    
  File "Code\Tutor.pyo", line 160, in hazListaRM
    
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

from lucaschess.

fonkap avatar fonkap commented on July 18, 2024

Wow Tico that was a detailed explanation!, I am able to reproduce the problem too.
This bug has something to do with "The tutor thinks while you think" feature. If you uncheck it, the problem dissapears.
BUT, I think you are running old code (my exception is slightly different from yours) please be sure you are using the last code from GitHub.

Lucas, I think this problem is caused when in the function hazListaRM, the list self.mrmTutor.liMultiPV contains old movements, then self.pgn(desde, hasta, coronacion) inside pb.pgnSP returns None (because the move is impossible in the current board) producing the exception.

I think there is a problem in tutor initialization when "The tutor thinks while you think" feature is on. Im also trying to fix this.

from lucaschess.

fonkap avatar fonkap commented on July 18, 2024

I found an easier way to reproduce the problem:
Play against engine of your choice starting with normal starting position against Monkey.

you - a2a4, ignore tutor select my move
monkey - a move
take back once (you get to the beginning).

play a2a4 again but press show tutor, you should get exception after this.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

I found an easier way to reproduce the problem:
Play against engine of your choice starting with normal starting position against Monkey.

you - a2a4, ignore tutor select my move
monkey - a move
take back once (you get to the beginning).

play a2a4 again but press show tutor, you should get exception after this.

no exception here. tried Deepfish and Komodo

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I believe it is fixed.
As fonkap indicated, problem is in relation to tutor working in background, it is not stopped when go back.
I have uploaded new code with the changes.
Thank you very much tico and fonkap.

from lucaschess.

fonkap avatar fonkap commented on July 18, 2024

Now it is working perfectly fine for me. Tested both my case and Tico's.

Thank you Lucas!

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Yes! Perfect! 👍

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

Great help!

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

And another one ;)

Traceback (most recent call last):
  File ".\Code\QT\TabElementos.py", line 220, in mouseReleaseEvent
    self.tablero.intentaMover(self, event.scenePos(), event.button())
  File ".\Code\QT\Tablero.py", line 1284, in intentaMover
    if not self.mensajero(desde, hasta):
  File ".\Code\GestorEntMaq.py", line 816, in mueveHumano
    if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
  File ".\Code\Tutor.py", line 67, in elegir
    self.listaRM = self.hazListaRM(posUsuario)  # rm,nombre
  File ".\Code\Tutor.py", line 160, in hazListaRM
    nombre += " " + rm.abrTexto()
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

not sure how to reproduce it yet

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I have reopen the issue until it is fixed.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Unfortunately I can't reproduce the exception. The only thing I know about it, it had Show tutor () in popup menu, I guess it means checkmate.
@lukasmonk, since the issue is hard to catch, I think you should release the current version 'coz it has important fixes.
Thanks.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

problem is in relation to tutor working in background

Can it be similar to this traceback

Traceback (most recent call last):
  File ".\Code\QT\TabElementos.py", line 220, in mouseReleaseEvent
  File ".\Code\QT\Tablero.py", line 1284, in intentaMover
  File ".\Code\GestorWashing.py", line 682, in mueveHumano
  File ".\Code\Tutor.py", line 67, in elegir
  File ".\Code\Tutor.py", line 160, in hazListaRM
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'unicode'

i just got in Washing machine, when after two takebacks I tried to make a move? Sorry, the traceback is a bit crippled, I guess python optimized out all debug stuff out of *.pyo files.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

In python, traceback doesn´t change when different level of optimization is selected.
Washing machine and takeback, are the main clues.
I have done some changes, but there is yet a problem.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I hope it is fixed now.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Now it's better! 👍

Something unrelated:

  1. Open Opponent for young players -> Albums -> select any. Click the close button (red cross in top-right corner)
TypeError: closeEvent() takes exactly 1 argument (2 given)
  1. Are you aware that PRAGMA page_size = 8192 in your code does nothing 'coz (quote from manual):

The page_size pragma will only set in the page size if it is issued before any other SQL statements that cause I/O against the database file. SQL statements that cause I/O against the database file include "CREATE", "SELECT", "BEGIN IMMEDIATE", and "PRAGMA journal_mode=WAL".

Now program's option databases are created with default 1024 page size. Not a big deal, just for your information.

Speaking of 8192, isn't 4096 is better because it's equal to the most common file system cluster size?

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024
  1. Fixed
  2. Fixed
    Thank you very much.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024
  1. Fixed

you've missed Code/SQL/Base.py

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Tools -> Openings -> Personal opening guide

First move (button under the chessboard) always

Traceback (most recent call last):
  File ".\Code\QT\WBG_InfoMove.py", line 110, in procesarTB
  File ".\Code\QT\WBG_InfoMove.py", line 292, in MoverInicio
  File ".\Code\QT\WBG_InfoMove.py", line 240, in colocatePartida
AttributeError: 'WInfomove' object has no attribute 'partida'

Previous move (button under the chessboard) if no moves left

Traceback (most recent call last):
  File ".\Code\QT\WBG_InfoMove.py", line 110, in procesarTB
  File ".\Code\QT\WBG_InfoMove.py", line 303, in MoverAtras
  File ".\Code\QT\WBG_InfoMove.py", line 209, in colocate
  File ".\Code\QT\WBG_InfoMove.py", line 292, in MoverInicio
  File ".\Code\QT\WBG_InfoMove.py", line 240, in colocatePartida
AttributeError: 'WInfomove' object has no attribute 'partida'

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

Fixed both bugs.
Thank you very much

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Yep, exceptions are eliminated.

I have a question, should LC in the opening guide allow to make a new move if I return some moves back? Just to try another opening. Or it's possible only from the start pressing big Start position button.

BTW First move (button under the chessboard) doesn't remove highlight for current move (blue text) as Previous move does.

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

There are some bugs in relation to this.
I´ll try to fix.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Play -> Play against an engine of your choice. Make several moves. Cancel (note: tutor is still pondering), Reinit, (edit:) make a move, agree to see tutor suggestion.

Traceback (most recent call last):
  File ".\Code\QT\TabElementos.py", line 220, in mouseReleaseEvent
    self.tablero.intentaMover(self, event.scenePos(), event.button())
  File ".\Code\QT\Tablero.py", line 1284, in intentaMover
    if not self.mensajero(desde, hasta):
  File ".\Code\GestorEntMaq.py", line 822, in mueveHumano
    if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
  File ".\Code\Tutor.py", line 67, in elegir
    self.listaRM = self.hazListaRM(posUsuario)  # rm,nombre
  File ".\Code\Tutor.py", line 160, in hazListaRM
    nombre += " " + rm.abrTexto()
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'unicode'

from lucaschess.

lukasmonk avatar lukasmonk commented on July 18, 2024

I believe it is fixed now.
Thank you very much.

from lucaschess.

tico-tico avatar tico-tico commented on July 18, 2024

Tutor stops pondering if I press Help to move. It resumes after next move. Is that OK?

from lucaschess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.