Expand nodes on their second visit #3

Merged
claude merged 1 commits from expand-second-visit-nn into main 2026-11-15 10:41:04 +01:00
Collaborator

Most leaves are visited only once. Their first visit now only settles terminal states and evaluates the position; the move list, the priors and the child nodes are created when search comes back a second time. The root is expanded before the first playout, so a search always has a move.

  • Motivation: with the value network the tree is full on nearly every move at 8+0.08 with Hash=64 (hashfull 1000 in a 30-ply self-play diagnostic). With this change many moves stay at 320-890.
  • Rebased from the earlier expand-second-visit branch onto the network main, without the tree collection it was built on.

SPRT

https://bench.rektdie.com/test/5285/

Elo   | 31.92 +- 15.09 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=64MB
LLR   | 2.96 (-2.94, 2.94) [0.00, 10.00]
Games | N: 764 W: 260 L: 190 D: 314
Penta | [9, 56, 201, 88, 28]

Correctness

  • The -DRIGBY_VERIFY_TREE build passed 1700 tree checks in UCI-driven self-play with 1 MB and 16 MB Hash.
  • A 1-playout search still returns a move.
  • The bench is deterministic.

Bench: 546018

🤖 Generated with Claude Code

Most leaves are visited only once. Their first visit now only settles terminal states and evaluates the position; the move list, the priors and the child nodes are created when search comes back a second time. The root is expanded before the first playout, so a search always has a move. - **Motivation:** with the value network the tree is full on nearly every move at 8+0.08 with Hash=64 (hashfull 1000 in a 30-ply self-play diagnostic). With this change many moves stay at 320-890. - Rebased from the earlier `expand-second-visit` branch onto the network `main`, without the tree collection it was built on. ## SPRT https://bench.rektdie.com/test/5285/ ``` Elo | 31.92 +- 15.09 (95%) SPRT | 8.0+0.08s Threads=1 Hash=64MB LLR | 2.96 (-2.94, 2.94) [0.00, 10.00] Games | N: 764 W: 260 L: 190 D: 314 Penta | [9, 56, 201, 88, 28] ``` ## Correctness - The `-DRIGBY_VERIFY_TREE` build passed 1700 tree checks in UCI-driven self-play with 1 MB and 16 MB Hash. - A 1-playout search still returns a move. - The bench is deterministic. Bench: 546018 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude added 1 commit 2026-11-15 10:40:56 +01:00
Most leaves are visited only once. Their first visit now only settles
terminal states and evaluates the position; the move list, the priors
and the child nodes are created when search comes back a second time.
The root is expanded before the first playout, so a search always has a
move.

With the value network the tree is full on nearly every move at
8+0.08 with Hash=64 (hashfull 1000 in a 30-ply self-play diagnostic);
with this change many moves stay at 320-890. The -DRIGBY_VERIFY_TREE
build passed 1700 tree checks in UCI-driven self-play with 1 MB and
16 MB Hash, and a 1-playout search still returns a move.

Rebased from the earlier expand-second-visit branch onto the network
main, without the tree collection it was built on.

Bench: 546018

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude merged commit 0d5713f7f0 into main 2026-11-15 10:41:04 +01:00
claude deleted branch expand-second-visit-nn 2026-11-15 10:41:04 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rektdie/Rigby#3