Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🦈 IMP: Prefetching Transposition Table Entries #3

Merged
merged 3 commits into from
May 31, 2023

Conversation

TheBlackPlague
Copy link
Owner

🎯 Summary

This PR aims to improve memory access performance by a notable amount. This is done by prefetching the Transposition Table Entry couple instructions before it is needed. The CPU fetches it into the L1 cache (as specified by the Prefetch hint) in parallel with the instructions that would run just before the entry is needed so that when it is required, it may be taken instantly from the L1 cache (high-speed access).

👏 Acknowledgements

  • Jay Honnold: Jay initially suggested this for StockNemo; however, due to the nature of the .NET Runtime and its tendency to move memory around, the prefetching wasn't practical (and never gained ELO). This changes in StockDory's C++ World. Awesome suggestion, Jay! 🙌

📈 ELO

STC:

ELO   | 12.71 +- 7.53 (95%)
SPRT  | 10.0+0.10s Threads=1 Hash=16MB
LLR   | 2.97 (-2.94, 2.94) [0.00, 5.00]
GAMES | N: 4760 W: 1474 L: 1300 D: 1986

LTC:

ELO   | 14.66 +- 7.98 (95%)
SPRT  | 60.0+0.60s Threads=1 Hash=256MB
LLR   | 3.00 (-2.94, 2.94) [0.00, 5.00]
GAMES | N: 3888 W: 1121 L: 957 D: 1810

@TheBlackPlague TheBlackPlague added the + ELO This change gains ELO. label May 29, 2023
@TheBlackPlague TheBlackPlague self-assigned this May 29, 2023
@TheBlackPlague TheBlackPlague marked this pull request as ready for review May 31, 2023 11:17
@TheBlackPlague TheBlackPlague merged commit df04152 into master May 31, 2023
@TheBlackPlague TheBlackPlague deleted the tt-prefetch branch May 31, 2023 11:20
@TheBlackPlague TheBlackPlague added the = DOC This change doesn't improve the documentation. label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
= DOC This change doesn't improve the documentation. + ELO This change gains ELO.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant