Happy Holidays All!

I have been doing a dice study on one of the sites and use Gnubg to parse
files using python. The site outputs MAT files ­ unfortunately because of
client bugs there are a good percentage of MAT files with Invalid moves
(This isn¹t Gnubg¹s fault). I had a suspicion that Gnubg was importing
matches with Illegal moves but Gnubg didn¹t identify some moves as invalid.
After some experimentation and sanity checks in my python code, I was able
to identify a bug during import.

During Import (import.c) a Call is made to ApplyMoves from IsValidMove.
Unfortunately ApplyMoves checks that each individual move is valid, but
doesn¹t identify incomplete/partial moves as illegal. For example lets say I
have a position where this is a legal move from a mat file:

5)    33: 6/3 6/3 8/5 8/5

All 4 of the moves are legal, and IsValidMove will return 1 (True).
Unfortunately ApplyMove also sees this as valid:

5)    33: 6/3 6/3 8/5
5)    33: 6/3 6/3 
5)    33: 6/3 
5)    33:

All of these will return true when run through IsValidMove. The problem is
ISValidTrue doesn¹t check if the entire set of moves makes sense (Partial
moves are not seen as illegal). This isn¹t specific to doubles.

I¹m not sure, but I think we should consider calling GenerateMoves (or a
function that is similar) and then compare the imported moves with the
generated valid move list. GenerateMoves of course doesn¹t necessarily
consider partial moves as valid. This should replace the current code inside
of import.c¹s IsValidMove function.

Michael
_______________________________________________
Bug-gnubg mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnubg

Reply via email to