Incremental NNUE accumulator in quiescence #9

Merged
claude merged 1 commits from nnue-incremental into main 2026-11-15 15:18:28 +01:00
Collaborator

Every quiescence node built the network's hidden layer from the whole board (about 30 pieces × 2 perspectives × 128 weights), a third of a middlegame playout. The accumulator (both perspectives) is now built once at the root of the quiescence search and passed down; each child gets a copy updated with the two to four features the move changes (normal move, capture, en passant, promotion, castling). i16 sums wrap the same way in any order, so the values, and the search, are exactly the same as before.

Playouts per second at 100k playouts, main → this (two runs each):

Position main this
startpos 688k 705k +2%
QGD middlegame 453k 495k +9%
Kiwipete 128k 161k +26%
Sicilian middlegame 385k 440k +14%
rook endgame 881k 905k +3%
bench 3.87M 4.39M +14%

SPRT (non-regression)

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

Elo   | 27.50 +- 10.61 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=64MB
LLR   | 3.07 (-2.94, 2.94) [-5.00, 0.00]
Games | N: 1608 W: 575 L: 448 D: 585
Penta | [28, 107, 443, 162, 64]

Correctness

  • On 3,240,535 moves from random games (276,756 captures, 3,676 castles, 433 en passant, 30,900 promotions) the updated accumulator is byte for byte equal to a fresh one, and a whole game played on updates alone does not drift.
  • The bench is identical to main.

Bench: 546966

🤖 Generated with Claude Code

Every quiescence node built the network's hidden layer from the whole board (about 30 pieces × 2 perspectives × 128 weights), a third of a middlegame playout. The accumulator (both perspectives) is now built once at the root of the quiescence search and passed down; each child gets a copy updated with the two to four features the move changes (normal move, capture, en passant, promotion, castling). i16 sums wrap the same way in any order, so the values, and the search, are exactly the same as before. Playouts per second at 100k playouts, `main` → this (two runs each): | Position | main | this | | | --- | --- | --- | --- | | startpos | 688k | 705k | +2% | | QGD middlegame | 453k | 495k | +9% | | Kiwipete | 128k | 161k | +26% | | Sicilian middlegame | 385k | 440k | +14% | | rook endgame | 881k | 905k | +3% | | bench | 3.87M | 4.39M | +14% | ## SPRT (non-regression) https://bench.rektdie.com/test/5290/ ``` Elo | 27.50 +- 10.61 (95%) SPRT | 8.0+0.08s Threads=1 Hash=64MB LLR | 3.07 (-2.94, 2.94) [-5.00, 0.00] Games | N: 1608 W: 575 L: 448 D: 585 Penta | [28, 107, 443, 162, 64] ``` ## Correctness - On 3,240,535 moves from random games (276,756 captures, 3,676 castles, 433 en passant, 30,900 promotions) the updated accumulator is byte for byte equal to a fresh one, and a whole game played on updates alone does not drift. - The bench is identical to `main`. Bench: 546966 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude added 1 commit 2026-11-15 15:18:21 +01:00
Every quiescence node built the network's hidden layer from the whole
board: about 30 pieces x 2 perspectives x 128 weights, a third of a
middlegame playout. The accumulator (both perspectives) is now built
once at the root of the quiescence search and passed down; each child
gets a copy updated with the two to four features the move changes
(normal move, capture, en passant, promotion, castling). i16 sums wrap
the same way in any order, so the values, and the search, are exactly
the same as before.

Playouts per second at 100k playouts, main -> this (two runs each):

  startpos           688k -> 705k   +2%
  QGD middlegame     453k -> 495k   +9%
  Kiwipete           128k -> 161k   +26%
  Sicilian middle    385k -> 440k   +14%
  rook endgame       881k -> 905k   +3%
  bench              3.87M -> 4.39M +14%

Checked: on 3,240,535 moves from random games (276,756 captures, 3,676
castles, 433 en passant, 30,900 promotions) the updated accumulator is
byte for byte equal to a fresh one, and a whole game played on updates
alone does not drift. The bench is identical to main.

Bench: 546966

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude merged commit 786783d7d1 into main 2026-11-15 15:18:28 +01:00
claude deleted branch nnue-incremental 2026-11-15 15:18:29 +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#9