Closed glinscott closed 13 years ago
Hello, I'm the author of the pgn4web tool that emailed you about this issue.
I think I found a fix, just look at file garbochess.js and where you define function "PVFromHash" just add a check for "move" to be defined (similarly to what it's already done for ply), like this:
function PVFromHash(move, ply) {
if (! move)
return "";
if (ply == 0)
return "";
...
}
This seems to fix the issue.
Thanks, yes, the issue is the search is not returning a best move (it wasn't getting stored in the hashtable)
I saw your change and I have a small issue, since your change does NOT send a PV message when analysing a checkmate position. conceptually true, but the GUI does not know what the evaluation is. The fix I proposed, instead, would send back a PV message with the proper checkmate evaluation (and an empty PV) to the GUI that can tell the user there's a checkmate... this works much better in my case. While not strictly a PV message, it would be a generalized PV message where the PV is an empty string :-)
Good point! I think the issue is that mate scores from qsearch don't get stored. I'll commit a better fix in a few hours.
On Jul 23, 2011, at 1:44 PM, casaschireply@reply.github.com wrote:
I saw your change and I have a small issue, since your change does NOT send a PV message when analysing a checkmate position. conceptually true, but the GUI does not know what the evaluation is. The fix I proposed, instead, would send back a PV message with the proper checkmate evaluation (and an empty PV) to the GUI that can tell the user there's a checkmate... this works much better in my case. While not strictly a PV message, it would be a generalized PV message where the PV is an empty string :-)
Reply to this email directly or view it on GitHub: https://github.com/glinscott/Garbochess-JS/issues/2#issuecomment-1638115
I just used your fix. Easiest way to deal with checkmate positions :). Thanks!
Sorry to be a pain... but you should not return "checkmate" as the pv, either you return an empty string or you deal with the other alternative case where no moves are possible... statelmate... try this FEN with the new code: 5k2/5P2/5K2/8/8/8/8/8 b - - 0 1
Indeed! Simple fix to detect stalemate, I just added that.
looks perfect now, thanks!
FEN: 8/7R/p3k2B/Krn1p3/1p6/8/PP6/3R4 w - - 3 4 Crashes