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

⚡ Make TaperedEvaluationTerm fields constant #1174

Merged
merged 15 commits into from
Nov 17, 2024

Conversation

eduherminio
Copy link
Member

@eduherminio eduherminio commented Nov 16, 2024

Make TaperedEvaluationTerm constant using source generators, without having to hardcode the Utils.Pack everywhere formula.

I don't expect this to bring any improvement (or regression) per se, it's more of a proof of concept previous to the compile time calculation of TaperedEvaluationTermByXYZ (int[]), which could take advantage of .NET 8 perf improvements in constant array initialization via ReadOnlySpan<T>.

See experiment/source-generators branch for reference, and eduherminio/SourceGenerators_PoC.

Test  | perf/sourcegen-const-TaperedEvaluationTerm
Elo   | 1.15 +- 2.51 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=32MB
LLR   | 2.90 (-2.25, 2.89) [-3.00, 1.00]
Games | 31748: +8911 -8806 =14031
Penta | [767, 3683, 6893, 3740, 791]
https://openbench.lynx-chess.com/test/948/

@eduherminio eduherminio marked this pull request as ready for review November 17, 2024 21:35
@eduherminio eduherminio enabled auto-merge (squash) November 17, 2024 21:36
@eduherminio eduherminio merged commit 747c248 into main Nov 17, 2024
27 checks passed
@eduherminio eduherminio deleted the perf/sourcegen-const-TaperedEvaluationTerm branch November 17, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant