lynx-chess / Lynx

Chess Engine, written in C#
https://lichess.org/@/Lynx_BOT
MIT License
39 stars 3 forks source link

⚡ Refactor `Game.PositionHashHistory` into a private array #991

Closed eduherminio closed 1 week ago

eduherminio commented 1 week ago

Transform Game.PositionHashHistory into an internal array instead of a public List and treat it as a stack

With a pointer the tip of the stack is tracked.

Test  | perf/game-positionhashHistory-manual-stack
Elo   | 4.26 +- 5.04 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | 2.90 (-2.25, 2.89) [-5.00, 0.00]
Games | 7752: +2236 -2141 =3375
Penta | [181, 861, 1709, 932, 193]
https://openbench.lynx-chess.com/test/704/