From 98af17f50aa7fdb20656f7e73fe0a95aeee652e8 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sat, 12 Sep 2026 11:12:28 +0200 Subject: [PATCH] Update mixing function to avoid fixed point 0 This modification ensures that the mixing function no longer allows the canonical value 0 to always win window comparisons. --- theory-minimizer_selection.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/theory-minimizer_selection.md b/theory-minimizer_selection.md index f30afc2..469e412 100644 --- a/theory-minimizer_selection.md +++ b/theory-minimizer_selection.md @@ -20,15 +20,7 @@ The hash function is a 64-bit mixing function (splitmix64-style finalizer) appli $$H(x) = \text{mix64}(x \oplus s), \quad s = \lfloor 2^{64}/\varphi \rfloor = \texttt{0x9e3779b97f4a7c15}$$ -``` -H(x): - x ← x ⊕ 0x9e3779b97f4a7c15 - x ← x ⊕ (x >> 30) - x ← x × 0xbf58476d1ce4e5b9 - x ← x ⊕ (x >> 27) - x ← x × 0x94d049bb133111eb - return x ⊕ (x >> 31) -``` +$$\begin{aligned} x &\gets x \oplus \texttt{0x9e3779b97f4a7c15} \\ x &\gets x \oplus (x \gg 30) \\ x &\gets x \times \texttt{0xbf58476d1ce4e5b9} \\ x &\gets x \oplus (x \gg 27) \\ x &\gets x \times \texttt{0x94d049bb133111eb} \\ x &\gets x \oplus (x \gg 31) \end{aligned}$$ The XOR seed avoids the finalizer's fixed point at 0 ($\text{mix64}(0) = 0$), which would otherwise make an all-A m-mer (canonical value 0) win every window comparison.