LeelaWatcher icon indicating copy to clipboard operation
LeelaWatcher copied to clipboard

Unnecessary last pass move is added to saved sgf

Open lp200 opened this issue 7 years ago • 6 comments

also result is missing.

lp200 avatar Jan 31 '18 11:01 lp200

Thanks for your input, can you please separate these two issues and provide specific examples in the description for each one. It's particularly problematic to have feature requests (adding the result, which I don't believe has ever been present) and possible bugs (incorrect SGF, maybe a regression?) in the same ticket.

fsparv avatar Feb 01 '18 03:02 fsparv

Sorry An example of pass move.

304 (W G9) Move:G9 305 (B G8) Move:G8 306 (W D9) Move:D9 307 (B E9) Move:E9 308 (W resign) Move:resign

Uploaded SGF W[gk];B[gl];W[dk];B[ek])

Saved SGF W[gk];B[gl];W[dk];B[ek];W[ ])

lp200 avatar Feb 01 '18 07:02 lp200

I think I ran into the same issue, which I originally reported at https://github.com/pnprog/goreviewpartner/issues/56.

I had a quick check, and apparently, the issue lies at the end of the SGF file:

;W[fb];B[cc];W[dd];B[eb];W[cb];B[ ])

The last B ("black plays") property is empty B[ ] (two empty space). Apparently, this is a violation of SGF format, and makes Gomill (the sgf parsing library used by GRP) fails to parse this SGF file (I checked using the sgf checker).

As a temporary workaround, simply replace the B[ ] by B[]

miguno avatar May 11 '18 17:05 miguno

Also, this problem described here could also be the root cause of https://github.com/fsparv/LeelaWatcher/issues/34.

miguno avatar May 11 '18 17:05 miguno

Ah sorry folks I had forgotten about this. Thx for the additional comments. I'll see if I can address it soon. Spaces are indeed illegal as per https://www.red-bean.com/sgf/go.html#types, and the final resign move should probably not be recorded as a pass (which is the meaning of B[] or w[])

fsparv avatar May 15 '18 01:05 fsparv

Update 1.2.1 to release?@fsparv

ivysrono avatar Jun 27 '18 12:06 ivysrono