SGF generated has a sub-tree for every move

The SGF generated when downloading is very strange. It generates a variation for every move made. In particular this messes with “go to end of game” features of sgf libraries/programs. Unless there is a particular reason I don’t see, I would consider this a bug - at least a misrepresentation of the intention: this is the main (linear) game line, and it adds unnecessary bloat (see last line of every file - it is cluttered with closing parentheses).

5 Likes

This issue has been raised before. See the relevant discussion here:

Technically, it does not violate the SGF standard, but it adds a lot of needless parentheses, and I fully support addressing this issues, as you suggest.

Interesting that you report that this causes issues with some other SGF programs. Which in particular?

I just bumped into an issue with WeiqiHub’s sgf parser. One particular case where this comes up is when the sgf reader is only concerned with the “main line” (like for a game without analysis)

While I agree, it’s probably still conformant, I wonder if it’s more than a matter of style. For a game record, the main branch seems semantically different than variations. Even in OGS goban repo, the move tree distinguishes between trunk_next and branches.


On second thought, i suppose parentheses doesnt really say anything about main vs. variation hmm. I think I can submit a PR to WQH to fix the parser

1 Like