Let me suggest a description about self-explaining data in which engines can tell chess GUIs how to display their data in the form of tables.
Table
1) Data (partly command)
- A row of a table requires data as an array. Each item has a column name and value. Value could be an integer, a real number or a string.
- A table may have few rows - an array of arrays:
Code: Select all
[["Ord": 5, "W": 60, "D": 20, "L": 20], ["Ord": 2, "W": 80, "D": 5, "15": 20]]
2) Table of 1 row (full command)
Code: Select all
uci json {"table": ["W": 60, "D": 20, "L": 20]}
If chess GUIs receive new data of the table, they will replace old table by new one.
3) Table of multi-rows
Code: Select all
uci json {"table": [["Ord": 1, "W": 60, "D": 20, "L": 20], ["Ord": 2, "W": 40, "D": 60, "L": 30]]}
If chess GUIs receive new data, they will replace old table by new one.
4) Table of multi-rows, update on-fly
We need a special column, named "depth", "row" or "move".
Code: Select all
uci json {"table": ["row": 1, "W": 60, "D": 20, "L": 20]}
Example data for Lc0:
Code: Select all
uci json {"table": ["move": "f2f4", "self depth": 351, "N": "33 (+ 3)", "P%": 2.98, "Q": -0.07531, "D": 0.209, "U": 0.18615, "Q+U": 0.11084, "V": -0.0719] }
If chess GUIs receive new data, they will replace the corresponding row (based on values of column "row", "depth", "move") in the table by new row. Column "depth" may be sorted descently when "row" ascently.
5) Multi tables
Tables may be distinguished by their names, the data format should be a map. Each time the engine should send data of one table only (not all multi-table data at once).
Code: Select all
uci json {"table": {"name" : "WDL stats", "data": ["row": 1, "W": 60, "D": 20, "L": 20]}}
Notes:
- The data structures to display tables are quite flexible, depend on needs.
- Reserved/key words: "table", "row", "depth", "move"
- All tables will be reset when side-to-move of the board changed
Chess GUIs may display those tables separately with other info and let users decide to view or hide them (e.g., via buttons)