For sure, SGF is simple and is made to store sequences. And it may appear like SGF is just what we need.
Amtiskaw wrote:As for spook's ideas, certainly JSON is far nicer to deal with than XML but I'm not exactly seeing the need. SGF is not "hard to parse", it is easy to parse. It is not hard to create collections, it is trivial.
If we get a little more technical it may become obvious.
What LeeLa Zero returns is something like this:
Code: Select all
info move Q16 visits 33 winrate 4346 prior 1673 lcb 4299 order 0 pv Q16 D4 D16 Q4 C6 C14 R6 R14 O3 info move D16 visits 33 winrate 4347 prior 1662 lcb 4298 order 1 pv D16 Q4 Q16 D4 C6 C14 R6 R14 O3 info move Q4 visits 33 winrate 4349 prior 1663 lcb 4293 order 2 pv Q4 D16 D4 Q16 R14 R6 C14 C6 O17 info move D4 visits 29 winrate 4340 prior 1644 lcb 4280 order 3 pv D4 Q16 D16 Q4 O17 F17 O3 F3 R6
This data is an array in itself.
Each element of this array has the following properties: move, winrate, priority, lcb, order and a sequence (which is a list of moves on itself).
We have to keep in mind that other AIs will have overlap, but may have more or less properties. I don't think you want to define a standard and dedicate it to 1 bot.
So, it should be very flexible.
So, what I propose in JSON is:
Code: Select all
stats: [
{
move: "Q16",
visits: 33,
winrate: 43.46,
priority: 1673,
lcb: 42.99,
order: 2
prediction: [Q16 D4 D16 Q4 C6 C14 R6 R14 O3]
},
{
move: "D16",
visits: 33,
winrate: 43.47,
priority: 1662,
lcb: 42.98,
order: 1
prediction: [D16 Q4 Q16 D4 C6 C14 R6 R14 O3]
},
...
]
Let's assume that we want to store information about a different kind of bot. (e.g. AlphaGo)
If it only mentions winrates, it could look like this:
Code: Select all
stats: [
{
move: "Q16",
winrate: 43.46,
},
{
move: "D16",
winrate: 43.47,
},
...
]
Now, let's continue and make things just a little more complicated.
In future, you may want to go 1 step further, and store statistics of multiple bots inside the same file, but still keeping them seperate:
So, for each move you would have:
Code: Select all
botStats: [
{
bot: "LeeLa Zero",
version: "0.16 weightXyZ",
stats: [ ... ]
},
{
bot: "AlphaGo",
version: "Master",
stats: [ ... ]
}
]
There is nothing in SGF that resembles this even a little. This is a totally new kind of structure. On top of that, it would be hard to keep SGF backwards compatible. Software developers aren't supposed to write their own XML or JSON parser. Nevertheless, each Baduk related software project has its own SGF parser. And as a result there are over 100 implementations of SGF parsers. The problem being: each one of these has small variations and trade-offs in how they handle ";[]\/()" characters in comments. So, if you try to create a new structure, there is a reasonable chance that you will break existing software. It's a minefield.