Skip to content

Use BCH construction to generate values for Zobrist hashing - #1130

Merged
codedeliveryservice merged 4 commits into
codedeliveryservice:mainfrom
87flowers:bch2
Sep 9, 2026
Merged

Use BCH construction to generate values for Zobrist hashing#1130
codedeliveryservice merged 4 commits into
codedeliveryservice:mainfrom
87flowers:bch2

Conversation

@87flowers

@87flowers 87flowers commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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

@codedeliveryservice
codedeliveryservice merged commit 31d9cd6 into codedeliveryservice:main Sep 9, 2026
23 checks passed
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.

2 participants