Commit 3818962
Fix analysis engine receiving bare 'go' instead of 'go infinite' (#63)
* Debounce navigation buttons in review mode to prevent GUI freeze
When analysis is running and the user presses navigation buttons rapidly,
stop the analysis immediately but defer restarting it until 300ms after
the last button press. This avoids repeated blocking engine stop/start
cycles that make the GUI unresponsive.
Agent-Logs-Url: https://github.com/fsmosca/Python-Easy-Chess-GUI/sessions/71d680e7-f5da-483b-86f3-c7daf8a96f24
Co-authored-by: fsmosca <22366935+fsmosca@users.noreply.github.com>
* Make review mode navigation fully non-blocking
Replace blocking stop_review_analysis() on navigation press with
non-blocking search.stop() signal. The join+restart is deferred to the
debounce handler which fires 300ms after the last button press, by which
time the old thread has already exited.
Also skip stale analysis messages from the old position during debounce
to prevent incorrect UI updates.
Agent-Logs-Url: https://github.com/fsmosca/Python-Easy-Chess-GUI/sessions/0e57255b-5a2d-4189-9dc6-ce5b07d5f43f
Co-authored-by: fsmosca <22366935+fsmosca@users.noreply.github.com>
* Fix RunEngine thread blocking on engine.play() after kill signal
When the analysis thread is interrupted via _kill.set(), if no bestmove
was found yet (bm is None), RunEngine.run() falls through to
engine.play(board, Limit(depth=None)) — an unconstrained synchronous
call that blocks the thread indefinitely. This makes join() hang and
freezes the GUI.
Fix: skip the engine.play() fallback when _kill is set, and also make
the move delay loop respect the kill signal.
Agent-Logs-Url: https://github.com/fsmosca/Python-Easy-Chess-GUI/sessions/225e88fb-0a7d-479d-8208-22d1eb8867e0
Co-authored-by: fsmosca <22366935+fsmosca@users.noreply.github.com>
* Fix analysis engine receiving 'go' instead of 'go infinite'
python-chess's engine.analysis() checks `if limit:` to decide whether
to send 'go infinite'. Since Limit() with all-None fields is a truthy
dataclass instance, passing Limit(depth=None) caused python-chess to
send bare 'go' without the 'infinite' token. The engine received 'go'
with no parameters and sat idle.
Fix: pass limit=None (not Limit()) for tc_type='infinite' with no
depth constraint, so python-chess takes the else branch and sends
'go infinite'. Also guard the engine.play() fallback against limit=None.
Agent-Logs-Url: https://github.com/fsmosca/Python-Easy-Chess-GUI/sessions/d96d5ff9-9d28-43b2-bd39-3600dbd677ec
Co-authored-by: fsmosca <22366935+fsmosca@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: fsmosca <22366935+fsmosca@users.noreply.github.com>1 parent 8541edb commit 3818962
1 file changed
Lines changed: 84 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
555 | 556 | | |
556 | 557 | | |
557 | 558 | | |
558 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
559 | 563 | | |
560 | | - | |
561 | | - | |
| 564 | + | |
| 565 | + | |
562 | 566 | | |
563 | 567 | | |
564 | 568 | | |
| |||
690 | 694 | | |
691 | 695 | | |
692 | 696 | | |
693 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
694 | 700 | | |
695 | 701 | | |
696 | 702 | | |
697 | 703 | | |
698 | 704 | | |
699 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
700 | 710 | | |
701 | 711 | | |
702 | 712 | | |
| |||
829 | 839 | | |
830 | 840 | | |
831 | 841 | | |
832 | | - | |
833 | | - | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
834 | 845 | | |
835 | 846 | | |
836 | 847 | | |
| |||
2929 | 2940 | | |
2930 | 2941 | | |
2931 | 2942 | | |
2932 | | - | |
2933 | | - | |
2934 | | - | |
2935 | | - | |
2936 | | - | |
2937 | | - | |
2938 | | - | |
2939 | | - | |
2940 | | - | |
2941 | | - | |
2942 | | - | |
2943 | | - | |
2944 | | - | |
2945 | | - | |
2946 | | - | |
2947 | | - | |
2948 | | - | |
2949 | | - | |
2950 | | - | |
2951 | | - | |
2952 | | - | |
2953 | | - | |
2954 | | - | |
2955 | | - | |
2956 | | - | |
2957 | | - | |
2958 | | - | |
2959 | | - | |
2960 | | - | |
2961 | | - | |
2962 | | - | |
2963 | | - | |
2964 | | - | |
2965 | | - | |
2966 | | - | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
2967 | 2983 | | |
2968 | 2984 | | |
2969 | 2985 | | |
| |||
3107 | 3123 | | |
3108 | 3124 | | |
3109 | 3125 | | |
3110 | | - | |
3111 | | - | |
3112 | | - | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
3113 | 3137 | | |
3114 | 3138 | | |
3115 | 3139 | | |
| |||
3200 | 3224 | | |
3201 | 3225 | | |
3202 | 3226 | | |
3203 | | - | |
3204 | | - | |
3205 | | - | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
3206 | 3241 | | |
3207 | 3242 | | |
3208 | 3243 | | |
| |||
0 commit comments