From fb1b8a5b9383b5debd967f635af7c682a59ce4c3 Mon Sep 17 00:00:00 2001 From: rektdie Date: Mon, 16 Nov 2026 19:42:32 +0100 Subject: [PATCH] mcts: document the arena split (8 edges per node) Measured over the 16 bench positions at 5 s, Hash 64 (local, single runs): collections main 200; edges per node 4: 217, 6: 183, 8: 184, 13: 184, 20: 249. 13 cut middlegame collections further but gave 2-3x more in the endgames; 8 stays close to main everywhere. Bench: 663779 Co-Authored-By: Claude Opus 5.5 --- src/mcts.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mcts.h b/src/mcts.h index 0810576..bf55c0b 100644 --- a/src/mcts.h +++ b/src/mcts.h @@ -56,11 +56,14 @@ u16 position_check(const Position& pos); // Two arenas: nodes and edges. Index 0 of each is null. class Tree { public: - // Edges per node the arenas are sized for. Measured in step 1 of the MCGS - // plan (docs/mcgs-log.md, edges per visited node): 13 on average in 5 s + // Edges per node the arenas are sized for: the edge arena gets 128 of + // every 160 bytes, the node arena 32. Measured in step 1 of the MCGS plan + // (docs/mcgs-log.md, edges per visited node): 13 on average in 5 s // searches without collections, 19-21 in middlegames, 3.6-5.5 in simple // endgames, and 3-9 right after collections (pruned nodes keep their node - // but lose their edges). See set_hash for the choice. + // but lose their edges). Over the 16 bench positions at 5 s and Hash 64, + // 8 gave 184 collections (main: 200), as few as 13 did, without 13's + // 2-3x more collections in the endgames (which fill the node arena first). static constexpr size_t EDGES_PER_NODE = 8; void resize_bytes(size_t bytes);