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

⚡ Replace Chebyshev distance calculation with lookup table (double array) #957

Merged
merged 11 commits into from
Sep 7, 2024

Conversation

eduherminio
Copy link
Member

@eduherminio eduherminio commented Sep 5, 2024

Microbenchmarks give the lookup table as a clear winner, but reality seems to be different (as kinda usual):

Single array, [-5,0]

Score of Lynx-perf-chebyshevdistance-lookup-3702-win-x64 vs Lynx 3695 - main: 6232 - 6406 - 9792  [0.496] 22430
...      Lynx-perf-chebyshevdistance-lookup-3702-win-x64 playing White: 4648 - 1654 - 4914  [0.633] 11216
...      Lynx-perf-chebyshevdistance-lookup-3702-win-x64 playing Black: 1584 - 4752 - 4878  [0.359] 11214
...      White vs Black: 9400 - 3238 - 9792  [0.637] 22430
Elo difference: -2.7 +/- 3.4, LOS: 6.1 %, DrawRatio: 43.7 %
SPRT: llr -0.322 (-11.1%), lbound -2.25, ubound 2.89

Jagged array, [-3,1]

Score of Lynx-perf-chebyshevdistance-lookup-3718-win-x64 vs Lynx 3713 - main: 8119 - 8062 - 12774  [0.501] 28955
...      Lynx-perf-chebyshevdistance-lookup-3718-win-x64 playing White: 6031 - 2102 - 6345  [0.636] 14478
...      Lynx-perf-chebyshevdistance-lookup-3718-win-x64 playing Black: 2088 - 5960 - 6429  [0.366] 14477
...      White vs Black: 11991 - 4190 - 12774  [0.635] 28955
Elo difference: 0.7 +/- 3.0, LOS: 67.3 %, DrawRatio: 44.1 %
SPRT: llr 2.89 (100.0%), lbound -2.25, ubound 2.89 - H1 was accepted

@eduherminio eduherminio marked this pull request as ready for review September 7, 2024 12:01
@eduherminio eduherminio enabled auto-merge (squash) September 7, 2024 12:02
@eduherminio eduherminio changed the title ⚡ Replace Chebyshev distance calculation with lookup table ⚡ Replace Chebyshev distance calculation with lookup table (double array) Sep 7, 2024
@eduherminio eduherminio merged commit 309700e into main Sep 7, 2024
27 checks passed
@eduherminio eduherminio deleted the perf/ChebyshevDistance-lookup branch September 7, 2024 12:03
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