Author: Robert Hyatt
Date: 06:10:40 06/20/00
Go up one level in this thread
On June 20, 2000 at 07:00:08, Gian-Carlo Pascutto wrote: >On June 19, 2000 at 19:48:09, Tom Kerrigan wrote: > >>>I call movegen for every move in the game, then again for each move for >>>that move (disambiguation in the convertor - sp?), and if the move is a check >>>again for each move for each move (check or mate?). >> >>I assume you are doing all this generation to determine if a move should be >>followed by a '+' or a '#'. When parsing moves, I believe you can safely ignore >>those symbols. > >I use the same internal format->SAN conversion routine everywhere, >so I cant cripple it and I didn't want to add another function when it was >going to be replaced anyway. > >>When I am parsing my opening book PGN file, I call my move generator once per >>move, then I call makemove()/undo() for each move that's generated to determine >>legality, then I call san() on each move to see if the string matches the >string that was read from the PGN file. Even though I do all this work, I can >parse a few hundred games per second. Maybe around a thousand. > >I suppose your san() function does not have to generate moves itself but >can use the movelist from elsewhere, so movegen only needs to be done once. > >I could probably do that too, and go a lot faster, but I've looked at the >new faile sources and it uses a nice algorithm from the extract program. > >It does a reverse conversion, i.e. it converts the SAN to internal move format >rather than the other way around. Only needs to do movegen once, and is a lot >more tolerance to psuedo-SAN than doing string-matching. > >-- >GCP Ignore this. To parse a move, I do the following: generate all moves use the input text to eliminate moves from the list, one by one. IE if the input move starts with N, then I eliminate everything but knight moves. I then parse source/destination/promotion/check/etc and eliminate moves that don't fit the requirement. If I end up with one move, it is _the_ move. If I end up with zero, the move parsed is illegal. If I end up with more than one move left, the move parsed is ambiguous. Doing this, I can parse way over 1,000 games per second on a single cpu 450mhz processor. It takes me about 20 minutes to parse 1.5M games . I don't think you are going to do this often enough to worry about how long it takes, just so it doesn't take a week. In Cray Blitz, we built the book by parsing each move, and then doing a short search from each resulting position to be sure we weren't walking into obvious blunders. If a score was exceptionally low or high, the search was extended to a couple of minutes if needed. It took us a few days to build our book because of this, but we didn't do it very often. And yes, that was _days_ as in 24 hour non-stop computing.
This page took 0.01 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.