lynx-chess / Lynx

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

⚡ Use fixed pointer trick in pinned arrays #966

Closed eduherminio closed 2 weeks ago

eduherminio commented 2 weeks ago

Use fixed (int* ptr = &_array[0]) for accessing history arrays in helpers.

Test  | perf/fixed-trick-pinned
Elo   | -1.53 +- 2.86 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | -2.26 (-2.25, 2.89) [0.00, 3.00]
Games | 23364: +6493 -6596 =10275
Penta | [558, 2665, 5317, 2606, 536]
https://openbench.lynx-chess.com/test/679/