fsmosca / Python-Chess-Scripts

Tools to process things using python chess library.
GNU General Public License v3.0
1 stars 1 forks source link

Issues with missing eval/depth and only time savings for easy/forced moves #5

Closed rwbc closed 3 years ago

rwbc commented 3 years ago

Hi Ferdinand,

I tested an older (2019) PGN and noticed that we need to add a few cases for some engines, which create no output for forced or easy moves, otherwise plot.py would exit.

I could verify that it chokes on output, which just has e.g. {0s} or {0.001s} in it. A regex search in my pgn revealed that (in this case) CuteChess had saved several times a very low 3 digits time w/o eval/depth. IIRC there must be a few dozen others which will send no PV output, but Cutechess will sometimes still save a very low time in the move comment.

After a quick ugly hack I could create all graphs, before it stopped after game 1 (of 400) (did not know how to do regex in py, sth like 0.00^[1-9])

                    # Get time.
                    # +13.30/12 0.020s
                    if comment == '':
                        tv = 0.0
                    elif comment == '0':
                        tv = 0.0
                    elif comment == '0.001':
                        tv = 0.0
                    elif comment == '0.002':
                        tv = 0.0
                    elif comment == '0.003':
                        tv = 0.0
                    elif comment == '0.004':
                        tv = 0.0
                    else:
                        try:
                            tv = float(comment.split()[1].split('s')[0])
                        except ValueError:
                            tv = 0.0

The second issue with this is that it would be better, if no eval is there at all (due to forced/easy move), to use the eval from the previous move to avoid ugly discontinuities. IIRC this was a problem also in various TCEC games and there was some discussion about how to fix graphs for such engines.

20190708_43

// A third issue, which doesn't hurry or should be fixed before feeding the pgn to plot.py would be when doing engine matches/tournaments with own books. Here there are some programs which give special eval/depth output, while still in book. But this has no priority at all and may be it would be even better in this case to fix the pgn files first with a script. //

The first two issues are very relevant though.

I have added some more info here: https://github.com/rwbc/Python-Chess-Scripts/blob/main/additional_info

Here the pgn (the 's' in time was stripped by a script of mine, I didn't find the original pgn anymore) 20190708.zip

fsmosca commented 3 years ago

Thanks for the info, Version 0.11.0 can now handle unusual move comments, {0s} or {0.001s}.

I am working on the following.

rwbc commented 3 years ago

Thanks for the info, Version 0.11.0 can now handle unusual move comments, {0s} or {0.001s}.

I am working on the following.

* [ ]  Handle missing eval in the middle of the game. Get previous move eval.

Great! It's a pleasure to test this tool.