verify: add the verify command to VERIFY builds (checks a and b)

(a) Along random games from standard and Chess960 positions (50 games of
up to 300 plies from each of 7 FENs), the incremental key and the position
check equal those of the same position set up from its FEN.

(b) After a 30000-playout search on four positions (standard, middlegame,
pawn endgame, Chess960): three forced collections down to 1/2, 1/4 and 1/8
of the tree, each compared with a snapshot taken by move path (visits, q,
u, base, state, key, check, and every edge). Survivors must be unchanged,
pruned nodes must keep visits and q with u = q and base = visits, both
arenas must end within their targets, and no pruned node may have more
visits than a kept one. Then a reroot two plies down the best line must
keep that subtree exactly. verify_tree runs after each step.

Only compiled with -DRIGBY_VERIFY_TREE. Bench: 663779

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rektdieandclaude committed 2026-11-16 19:37:17 +01:00
1 parent 6629525938
commit 226106e50a
3 files changed
+205

No files matched your search

+5
View File
@@ -334,6 +334,11 @@ void uci_loop() {
is >> playouts;
e.stop();
run_bench(playouts);
#ifdef RIGBY_VERIFY_TREE
} else if (cmd == "verify") {
e.stop();
e.searcher.self_test();
#endif
} else if (!cmd.empty()) {
send("info string unknown command: " + cmd);
}