Use BCH construction to generate values for Zobrist hashing - #1130
Merged
Conversation
codedeliveryservice
merged commit Sep 9, 2026
31d9cd6
into
codedeliveryservice:main
23 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I constructed a 2^9 -> 64 linear hash from a nested BCH code. This allows for near-optimal collision avoidance for any truncation of the resulting linear hash. The innermost nested code bits are used for the key fragment stored in the TT (lowest 21 bits of hash). Subsequent code bits are ordered from MSB downwards (because of how TT index generation is done).
Based on:
J. P. Grossman and L. Jakab, "Using the BCH construction to generate robust linear hash functions," Information Theory Workshop, San Antonio, TX, USA, 2004, pp. 250-253.
STC with hash pressure
Elo | 2.66 +- 1.97 (95%)
SPRT | 8.0+0.08s Threads=1 Hash=2MB
LLR | 2.94 (-2.25, 2.89) [0.00, 3.00]
Games | N: 33600 W: 8675 L: 8418 D: 16507
Penta | [154, 3935, 8392, 4138, 181]
https://recklesschess.space/test/15692/
LTC with hash pressure
Elo | 1.96 +- 1.54 (95%)
SPRT | 40.0+0.40s Threads=1 Hash=8MB
LLR | 2.90 (-2.25, 2.89) [0.00, 3.00]
Games | N: 46368 W: 11519 L: 11258 D: 23591
Penta | [30, 5236, 12394, 5491, 33]
https://recklesschess.space/test/15691/
Bench: 2801205