Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ conforms to CNP 1.0 if it passes every session that applies to it.
| Directory | What it checks | Applies to |
| --- | --- | --- |
| `lifecycle/` | `initialize`, `ping`, `shutdown`, `exit`, cancelling, and the errors around them (spec 4, 5, 9) | Every node |
| `engine/` | Searches, stop and cancel, each engine capability, and pondering's hit and miss (spec 7) | Engine nodes |
| `engine/` | Searches, stop and cancel, each engine capability, pondering's hit and miss, and the search tree: reading it, its errors and limits, during a search and cancelled (spec 7) | Engine nodes |
| `voice/` | Voices, models, refusing bad requests, and audio for a listen that isn't there (spec 8) | Voice nodes |
| `preferences/` | The draft preferences extension's read (`spec/preferences.md`) | Nodes that keep preferences |
| `games/` | The draft games extension: a save, its retry, a reused version, get, list, searching, deleting, importing and a game's source (`spec/games.md`) | Nodes that keep games (searching, deleting, importing and sources: those that offer them) |
Expand Down
11 changes: 11 additions & 0 deletions conformance/engine/tree-cancel.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{"session": "tree-cancel", "description": "$/cancelRequest drops a tree, which answers Cancelled, and the next tree isn't Busy because of it (spec 4.1, 7.8)", "requires": ["engine", "engine.tree"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/tree", "params": {"position": {"fen": "r1bqkb1r/pppp1ppp/2n2n2/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4"}, "depth": 12, "plies": 1}}}
{"send": {"jsonrpc": "2.0", "method": "$/cancelRequest", "params": {"id": 2}}}
{"send": {"jsonrpc": "2.0", "id": 3, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 2, "plies": 1}}}
{"expectAll": [{"id": 2, "error": {"code": -32800, "message": "$string"}}, {"id": 3, "result": {"tree": "$string", "bestMove": "$move"}}]}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
9 changes: 9 additions & 0 deletions conformance/engine/tree-checkmated.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{"session": "tree-checkmated", "description": "a tree of a position with no legal move answers at once: no best move, no score, depth 0, and the root alone (spec 7.8)", "requires": ["engine", "engine.tree"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/tree", "params": {"position": {"fen": "rnb1kbnr/pppp1ppp/8/4p3/6Pq/5P2/PPPPP2P/RNBQKBNR w KQkq - 1 3"}, "depth": 6}}}
{"expect": {"id": 2, "result": {"tree": "$string", "depth": 0, "bestMove": null, "score": "$absent", "pv": [], "recorded": {"nodes": 1}, "root": {"move": "$absent", "childCount": 0, "subtree": 0}, "children": []}}}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
18 changes: 18 additions & 0 deletions conformance/engine/tree-errors.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{"session": "tree-errors", "description": "a handle the node never gave is Expired, a path to no node of the tree and a depth of 0 are InvalidParams, and an invalid FEN is InvalidPosition (spec 7.8, 9)", "requires": ["engine", "engine.tree"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/treeNode", "params": {"tree": "never-given", "path": []}}}
{"expect": {"id": 2, "error": {"code": -32018, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 3, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 0}}}
{"expect": {"id": 3, "error": {"code": -32602, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 4, "method": "engine/tree", "params": {"position": {"fen": "not a fen"}, "depth": 2}}}
{"expect": {"id": 4, "error": {"code": -32011, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 5, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 2, "plies": 1, "limit": 0}}}
{"expect": {"id": 5, "result": {"tree": "$bind:TREE", "children": []}}}
{"comment": "No root move goes from e1 to e8, and the tree records one ply only."}
{"send": {"jsonrpc": "2.0", "id": 6, "method": "engine/treeNode", "params": {"tree": "$ref:TREE", "path": ["e1e8"]}}}
{"expect": {"id": 6, "error": {"code": -32602, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
11 changes: 11 additions & 0 deletions conformance/engine/tree-limits.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{"session": "tree-limits", "description": "a tree deeper than maxTreeDepth, or recording more plies than maxTreePlies, is LimitExceeded, not trimmed (spec 6.3, 7.8)", "requires": ["engine", "engine.tree", "limits.maxTreeDepth", "limits.maxTreePlies"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 4294967295}}}
{"expect": {"id": 2, "error": {"code": -32012, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 3, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 2, "plies": 4294967295}}}
{"expect": {"id": 3, "error": {"code": -32012, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
11 changes: 11 additions & 0 deletions conformance/engine/tree-unsupported.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{"session": "tree-unsupported", "description": "a node without tree refuses engine/tree and engine/treeNode with Unsupported (spec 6.1, 7.8)", "requires": ["engine", "!engine.tree"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 2}}}
{"expect": {"id": 2, "error": {"code": -32014, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 3, "method": "engine/treeNode", "params": {"tree": "t1", "path": []}}}
{"expect": {"id": 3, "error": {"code": -32014, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
12 changes: 12 additions & 0 deletions conformance/engine/tree-while-searching.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{"session": "tree-while-searching", "description": "a tree is answered while a search runs: it counts toward maxConcurrentTrees, not maxConcurrentSearches (spec 7.8)", "requires": ["engine", "engine.tree"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/search", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "limits": {"infinite": true}}}}
{"send": {"jsonrpc": "2.0", "id": 3, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"}, "depth": 3, "plies": 1}}}
{"expect": {"id": 3, "result": {"tree": "$string", "depth": 3, "bestMove": "$move", "root": "$object", "children": "$array"}}}
{"send": {"jsonrpc": "2.0", "method": "$/cancelRequest", "params": {"id": 2}}}
{"expect": {"id": 2, "error": {"code": -32800, "message": "$string"}}}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
17 changes: 17 additions & 0 deletions conformance/engine/tree.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{"session": "tree", "description": "engine/tree answers with a handle, the search's result and the root's first children, and engine/treeNode reads the root and a child by its path, a page at a time (spec 7.8)", "requires": ["engine", "engine.tree"]}
{"send": {"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocol": "1.0", "client": {"name": "cnp-conformance", "version": "1.0"}}}}
{"expect": {"id": 1, "result": {"protocol": "1.0", "node": {"name": "$string", "version": "$string", "license": "$string"}, "capabilities": "$object"}}}
{"send": {"jsonrpc": "2.0", "id": 2, "method": "engine/tree", "params": {"position": {"fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", "moves": ["e2e4", "e7e5"]}, "depth": 4, "plies": 2, "limit": 1}}}
{"expect": {"id": 2, "result": {"tree": "$bind:TREE", "expiresMs": "$integer", "depth": 4, "nodes": "$integer", "timeMs": "$integer", "bestMove": "$move", "score": "$object", "pv": "$array", "recorded": {"plies": 2, "nodes": "$integer", "decisions": "$integer", "truncated": false}, "root": {"move": "$absent", "depth": 4, "score": "$object", "childCount": "$integer", "subtree": "$integer", "decisions": "$array"}, "children": [{"move": "$bind:FIRST", "depth": "$integer", "childCount": "$integer", "subtree": "$integer", "decisions": "$array"}]}}}
{"comment": "The root again, and its first child, which must be the same."}
{"send": {"jsonrpc": "2.0", "id": 3, "method": "engine/treeNode", "params": {"tree": "$ref:TREE", "path": [], "limit": 1}}}
{"expect": {"id": 3, "result": {"node": {"move": "$absent", "depth": 4, "childCount": "$integer"}, "children": [{"move": "$ref:FIRST"}]}}}
{"comment": "The first child alone, with a limit of 0, then with all its children."}
{"send": {"jsonrpc": "2.0", "id": 4, "method": "engine/treeNode", "params": {"tree": "$ref:TREE", "path": ["$ref:FIRST"], "limit": 0}}}
{"expect": {"id": 4, "result": {"node": {"move": "$ref:FIRST", "depth": "$integer", "childCount": "$integer", "subtree": "$integer", "decisions": "$array"}, "children": []}}}
{"send": {"jsonrpc": "2.0", "id": 5, "method": "engine/treeNode", "params": {"tree": "$ref:TREE", "path": ["$ref:FIRST"]}}}
{"expect": {"id": 5, "result": {"node": {"move": "$ref:FIRST"}, "children": "$array"}}}
{"send": {"jsonrpc": "2.0", "id": 99, "method": "shutdown"}}
{"expect": {"id": 99, "result": null}}
{"send": {"jsonrpc": "2.0", "method": "exit"}}
{"expectExit": 0}
Loading
Loading