Skip to content

Commit

Permalink
update wyhash to 4.2
Browse files Browse the repository at this point in the history
more severe wyhash32 broken seeds, less bad wyhash32low seeds.
64bit wyhash is still fine.
  • Loading branch information
rurban committed Oct 5, 2023
1 parent 33ff5b1 commit 984ab6a
Show file tree
Hide file tree
Showing 14 changed files with 1,131 additions and 1,124 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ SMhasher
| [t1ha0_aes_avx1](doc/t1ha0_aes_avx1) | 22714.85 | 48.12 | 226.52 (16)| 843 | LongNeighbors, machine-specific (x64 AVX.txt)|
| [t1ha0_aes_avx2](doc/t1ha0_aes_avx2.txt) | 56919.46 | 36.70 | 233.14 (2) | 792 | LongNeighbors, machine-specific (x64 AVX2) |
| [wyhash32](doc/wyhash32.txt) | 2532.89 | 48.40 | 484.57 (1) | 426 | 4 bad and broken seeds, 32-bit |
| [wyhash32low](doc/wyhash32low.txt) | 22892.78 | 28.87 | 242.56 (4) | 474 | 12 bad and broken seeds |
| [wyhash](doc/wyhash.txt) | 23254.03 | 28.47 | 216.10 (3) | 474 | |
| [wyhash32low](doc/wyhash32low.txt) | 22393.77 | 29.04 | 243.40 (3) | 474 | 5 bad seeds |
| [wyhash](doc/wyhash.txt) | 22540.23 | 28.87 | 236.16 (8) | 474 | |
| [umash32](doc/umash32.txt) | 21427.57 | 42.12 | 255.55 (5) |1530 | |
| [umash32_hi](doc/umash32_hi.txt) | 21483.12 | 42.65 | 251.09 (4) |1530 | |
| [umash64](doc/umash64.txt) | 21690.08 | 41.67 | 238.01 (4) |1530 | |
Expand Down
2 changes: 1 addition & 1 deletion doc/air.html
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ <h1 id="smhasher">SMhasher</h1>
<td align="right">21.59</td>
<td align="right">380.88 (29)</td>
<td align="right">474</td>
<td align="left">12 bad and broken seeds</td>
<td align="left">5 bad seeds</td>
</tr>
<tr class="good">
<td align="left"><a href="umash32.txt">umash32</a></td>
Expand Down
8 changes: 4 additions & 4 deletions doc/i686.html
Original file line number Diff line number Diff line change
Expand Up @@ -1401,9 +1401,9 @@ <h1 id="smhasher">SMhasher</h1>
</tr>
<tr class="good">
<td align="left"><a href="wyhash32.txt">wyhash32</a></td>
<td align="right">2864.35</td>
<td align="right">58.48</td>
<td align="right">194.74 (1)</td>
<td align="right">1864.46</td>
<td align="right">63.82</td>
<td align="right">206.87 (5)</td>
<td align="right">426</td>
<td align="left">4 bad and broken seeds, 32-bit</td>
</tr>
Expand All @@ -1413,7 +1413,7 @@ <h1 id="smhasher">SMhasher</h1>
<td align="right">26.83</td>
<td align="right">182.34 (1)</td>
<td align="right">474</td>
<td align="left">12 bad and broken seeds</td>
<td align="left">5 bad seeds</td>
</tr>
<tr class="good">
<td align="left"><a href="umash32.txt">umash32</a></td>
Expand Down
2 changes: 1 addition & 1 deletion doc/intel.html
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@ <h1 id="smhasher">SMhasher</h1>
<td align="right">29.59</td>
<td align="right">205.43 (2)</td>
<td align="right">474</td>
<td align="left">12 bad and broken seeds</td>
<td align="left">5 bad seeds</td>
</tr>
<tr class="good">
<td align="left"><a href="umash32.txt">umash32</a></td>
Expand Down
2 changes: 1 addition & 1 deletion doc/phone.html
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ <h1 id="smhasher">SMhasher</h1>
<td align="right">25.49</td>
<td align="right">363.49 (5)</td>
<td align="right">556</td>
<td align="left">12 bad and broken seeds</td>
<td align="left">5 bad seeds</td>
</tr>
<tr class="good">
<td align="left"><a href="umash32.txt">umash32</a></td>
Expand Down
2 changes: 1 addition & 1 deletion doc/ryzen3.html
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ <h1 id="smhasher">SMhasher</h1>
<td align="right">22.32</td>
<td align="right">466.74 (5)</td>
<td align="right">474</td>
<td align="left">12 bad and broken seeds</td>
<td align="left">5 bad seeds</td>
</tr>
<tr class="good">
<td align="left"><a href="umash32.txt">umash32</a></td>
Expand Down
14 changes: 7 additions & 7 deletions doc/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -1601,9 +1601,9 @@ <h1 id="smhasher">SMhasher</h1>
</tr>
<tr class="good">
<td align="left"><a href="wyhash.txt">wyhash</a></td>
<td align="right">23254.03</td>
<td align="right">28.47</td>
<td align="right">216.10 (3)</td>
<td align="right">22540.23</td>
<td align="right">28.87</td>
<td align="right">236.16 (8)</td>
<td align="right">474</td>
<td align="left"></td>
</tr>
Expand All @@ -1617,11 +1617,11 @@ <h1 id="smhasher">SMhasher</h1>
</tr>
<tr class="good">
<td align="left"><a href="wyhash32low.txt">wyhash32low</a></td>
<td align="right">22892.78</td>
<td align="right">28.87</td>
<td align="right">242.56 (4)</td>
<td align="right">22393.77</td>
<td align="right">29.04</td>
<td align="right">243.40 (3)</td>
<td align="right">474</td>
<td align="left">12 bad and broken seeds</td>
<td align="left">5 bad seeds</td>
</tr>
<tr class="good">
<td align="left"><a href="umash32.txt">umash32</a></td>
Expand Down
1,277 changes: 642 additions & 635 deletions doc/wyhash.txt

Large diffs are not rendered by default.

117 changes: 64 additions & 53 deletions doc/wyhash32.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------
--- Testing wyhash32 "wyhash v4 (32-bit native)" GOOD
--- Testing wyhash32 "wyhash v4.2 (32-bit native)" GOOD

[[[ Sanity Tests ]]]

Expand All @@ -10,58 +10,58 @@ Running AppendedZeroesTest .......... PASS
[[[ Speed Tests ]]]

Bulk speed test - 262144-byte keys
Alignment 7 - 0.664 bytes/cycle - 1900.30 MiB/sec @ 3 ghz
Alignment 6 - 0.581 bytes/cycle - 1661.12 MiB/sec @ 3 ghz
Alignment 5 - 0.537 bytes/cycle - 1537.42 MiB/sec @ 3 ghz
Alignment 4 - 0.585 bytes/cycle - 1675.04 MiB/sec @ 3 ghz
Alignment 3 - 0.665 bytes/cycle - 1901.60 MiB/sec @ 3 ghz
Alignment 2 - 0.664 bytes/cycle - 1901.14 MiB/sec @ 3 ghz
Alignment 1 - 0.598 bytes/cycle - 1710.32 MiB/sec @ 3 ghz
Alignment 0 - 0.538 bytes/cycle - 1537.86 MiB/sec @ 3 ghz
Average - 0.604 bytes/cycle - 1728.10 MiB/sec @ 3 ghz

Small key speed test - 1-byte keys - 41.00 cycles/hash
Small key speed test - 2-byte keys - 41.97 cycles/hash
Small key speed test - 3-byte keys - 44.41 cycles/hash
Small key speed test - 4-byte keys - 52.30 cycles/hash
Small key speed test - 5-byte keys - 42.99 cycles/hash
Alignment 7 - 0.652 bytes/cycle - 1865.04 MiB/sec @ 3 ghz
Alignment 6 - 0.652 bytes/cycle - 1864.97 MiB/sec @ 3 ghz
Alignment 5 - 0.652 bytes/cycle - 1863.99 MiB/sec @ 3 ghz
Alignment 4 - 0.651 bytes/cycle - 1863.89 MiB/sec @ 3 ghz
Alignment 3 - 0.652 bytes/cycle - 1864.72 MiB/sec @ 3 ghz
Alignment 2 - 0.652 bytes/cycle - 1865.19 MiB/sec @ 3 ghz
Alignment 1 - 0.652 bytes/cycle - 1864.86 MiB/sec @ 3 ghz
Alignment 0 - 0.651 bytes/cycle - 1863.00 MiB/sec @ 3 ghz
Average - 0.652 bytes/cycle - 1864.46 MiB/sec @ 3 ghz

Small key speed test - 1-byte keys - 42.00 cycles/hash
Small key speed test - 2-byte keys - 42.00 cycles/hash
Small key speed test - 3-byte keys - 42.00 cycles/hash
Small key speed test - 4-byte keys - 43.00 cycles/hash
Small key speed test - 5-byte keys - 43.00 cycles/hash
Small key speed test - 6-byte keys - 43.00 cycles/hash
Small key speed test - 7-byte keys - 43.16 cycles/hash
Small key speed test - 7-byte keys - 43.00 cycles/hash
Small key speed test - 8-byte keys - 43.00 cycles/hash
Small key speed test - 9-byte keys - 55.00 cycles/hash
Small key speed test - 10-byte keys - 55.00 cycles/hash
Small key speed test - 11-byte keys - 55.00 cycles/hash
Small key speed test - 12-byte keys - 61.00 cycles/hash
Small key speed test - 13-byte keys - 60.99 cycles/hash
Small key speed test - 14-byte keys - 61.00 cycles/hash
Small key speed test - 15-byte keys - 61.00 cycles/hash
Small key speed test - 16-byte keys - 61.00 cycles/hash
Small key speed test - 17-byte keys - 67.00 cycles/hash
Small key speed test - 18-byte keys - 67.00 cycles/hash
Small key speed test - 19-byte keys - 83.20 cycles/hash
Small key speed test - 20-byte keys - 90.00 cycles/hash
Small key speed test - 21-byte keys - 85.31 cycles/hash
Small key speed test - 22-byte keys - 90.00 cycles/hash
Small key speed test - 23-byte keys - 90.00 cycles/hash
Small key speed test - 24-byte keys - 85.92 cycles/hash
Small key speed test - 25-byte keys - 78.91 cycles/hash
Small key speed test - 26-byte keys - 79.00 cycles/hash
Small key speed test - 27-byte keys - 79.88 cycles/hash
Small key speed test - 28-byte keys - 85.35 cycles/hash
Small key speed test - 29-byte keys - 89.45 cycles/hash
Small key speed test - 30-byte keys - 85.00 cycles/hash
Small key speed test - 31-byte keys - 84.98 cycles/hash
Average 66.543 cycles/hash
Small key speed test - 9-byte keys - 55.99 cycles/hash
Small key speed test - 10-byte keys - 56.00 cycles/hash
Small key speed test - 11-byte keys - 56.00 cycles/hash
Small key speed test - 12-byte keys - 61.90 cycles/hash
Small key speed test - 13-byte keys - 61.92 cycles/hash
Small key speed test - 14-byte keys - 61.91 cycles/hash
Small key speed test - 15-byte keys - 61.93 cycles/hash
Small key speed test - 16-byte keys - 61.94 cycles/hash
Small key speed test - 17-byte keys - 68.00 cycles/hash
Small key speed test - 18-byte keys - 68.00 cycles/hash
Small key speed test - 19-byte keys - 68.00 cycles/hash
Small key speed test - 20-byte keys - 74.00 cycles/hash
Small key speed test - 21-byte keys - 74.00 cycles/hash
Small key speed test - 22-byte keys - 74.00 cycles/hash
Small key speed test - 23-byte keys - 74.00 cycles/hash
Small key speed test - 24-byte keys - 74.80 cycles/hash
Small key speed test - 25-byte keys - 80.00 cycles/hash
Small key speed test - 26-byte keys - 80.00 cycles/hash
Small key speed test - 27-byte keys - 80.00 cycles/hash
Small key speed test - 28-byte keys - 86.49 cycles/hash
Small key speed test - 29-byte keys - 86.09 cycles/hash
Small key speed test - 30-byte keys - 86.30 cycles/hash
Small key speed test - 31-byte keys - 86.25 cycles/hash
Average 63.823 cycles/hash

[[[ 'Hashmap' Speed Tests ]]]

std::unordered_map
Init std HashMapTest: 677.353 cycles/op (104334 inserts, 1% deletions)
Running std HashMapTest: 309.853 cycles/op (13.8 stdv)
Init std HashMapTest: 665.891 cycles/op (104334 inserts, 1% deletions)
Running std HashMapTest: 298.668 cycles/op (5.1 stdv)

greg7mdp/parallel-hashmap
Init fast HashMapTest: 310.034 cycles/op (104334 inserts, 1% deletions)
Running fast HashMapTest: 243.131 cycles/op (10.9 stdv) ....... PASS
Init fast HashMapTest: 319.793 cycles/op (104334 inserts, 1% deletions)
Running fast HashMapTest: 206.871 cycles/op (5.1 stdv) ....... PASS

[[[ Avalanche Tests ]]]

Expand Down Expand Up @@ -715,24 +715,35 @@ MomentChi2 for deriv b0 : 0.666467

Skipping PRNG test; it is designed for hashes >= 64-bits

Input vcode 0x00000001, Output vcode 0x00000001, Result vcode 0x00000001
Verification value is 0x00000001 - Testing took 806.595032 seconds
-------------------------------------------------------------------------------
[[[ BadSeeds Tests ]]]

Testing 4 internal secrets:
0x51a43a0f
Broken seed 0x51a43a0f => 0 with key[16] of all 0 bytes confirmed => hash 0 !!!!
0x522235ae
Broken seed 0x522235ae => 0 with key[16] of all 0 bytes confirmed => hash 0 !!!!
0x99ac2b20 !!!!
Bad seed 0x99ac2b20 for len 16 confirmed => hashes: 1163385220 1163385220 1583405780 1651789912 1693585424 3481276758 !!!!
Testing collisions ( 32-bit) - Expected 0.0, actual 1 (286331153.07x) (1) !!!!
0x9a4f1376
Broken seed 0x9a4f1376 => 0 with key[16] of all 0 bytes confirmed => hash 0 !!!!

Testing the first 0xffffffff seeds ...
4 threads starting...
at 0 at 40000000 at 80000000 at c0000000 41ffffff 81ffffff 1ffffff 43ffffff 83ffffff 3ffffff 45ffffff 85ffffff 5ffffff 47ffffff 87ffffff 7ffffff 49ffffff 89ffffff 9ffffff 4bffffff 8bffffff bffffff 4dffffff 8dffffff dffffff 4fffffff 8fffffff fffffff
at 0 at 40000000 at 80000000 at c0000000 0x01ffffff 0x41ffffff 0x81ffffff 0x43ffffff 0x83ffffff 0x03ffffff 0x85ffffff 0x45ffffff 0x05ffffff 0x87ffffff 0x07ffffff 0x47ffffff 0x09ffffff 0x89ffffff 0x49ffffff 0x0bffffff 0x8bffffff 0x4bffffff 0x0dffffff 0x8dffffff 0x4dffffff 0x0fffffff 0x8fffffff 0x4fffffff
Broken seed 0x51a43a0f => 0 with key[16] of all 0 bytes
51ffffff 91ffffff
0x11ffffff 0x51ffffff 0x91ffffff
Broken seed 0x522235ae => 0 with key[16] of all 0 bytes
11ffffff 53ffffff 93ffffff 13ffffff 55ffffff 95ffffff 15ffffff 57ffffff 97ffffff 17ffffff !!!!
0x13ffffff 0x53ffffff 0x93ffffff 0x15ffffff 0x95ffffff 0x55ffffff 0x97ffffff 0x17ffffff 0x57ffffff !!!!
Bad seed 0x99ac2b20
Testing collisions ( 32-bit) - Expected 0.0, actual 1 (715827882.67x) (1) !!!!
59ffffff 99ffffff 19ffffff
0x99ffffff 0x59ffffff 0x19ffffff
Broken seed 0x9a4f1376 => 0 with key[16] of all 0 bytes
5bffffff 9bffffff 1bffffff 5dffffff 9dffffff 1dffffff 5fffffff 9fffffff 1fffffff 61ffffff a1ffffff 21ffffff 63ffffff a3ffffff 23ffffff 65ffffff a5ffffff 25ffffff 67ffffff a7ffffff 27ffffff 69ffffff a9ffffff 29ffffff 6bffffff abffffff 2bffffff 6dffffff adffffff 2dffffff 6fffffff afffffff 2fffffff 71ffffff b1ffffff 31ffffff 73ffffff b3ffffff 33ffffff 75ffffff b5ffffff 35ffffff 77ffffff b7ffffff 37ffffff 79ffffff b9ffffff 39ffffff 7bffffff bbffffff 3bffffff 7dffffff bdffffff 3dffffff 7fffffff bfffffff 3fffffff All 4 threads ended
0x1bffffff 0x5bffffff 0x9bffffff 0x1dffffff 0x5dffffff 0x9dffffff 0x1fffffff 0x5fffffff 0x9fffffff 0x61ffffff 0x21ffffff 0xa1ffffff 0x63ffffff 0x23ffffff 0xa3ffffff 0x65ffffff 0x25ffffff 0xa5ffffff 0x67ffffff 0x27ffffff 0xa7ffffff 0x69ffffff 0x29ffffff 0xa9ffffff 0x6bffffff 0x2bffffff 0xabffffff 0x6dffffff 0x2dffffff 0xadffffff 0x6fffffff 0x2fffffff 0xafffffff 0x71ffffff 0x31ffffff 0xb1ffffff 0x73ffffff 0x33ffffff 0xb3ffffff 0x75ffffff 0x35ffffff 0xb5ffffff 0x77ffffff 0x37ffffff 0xb7ffffff 0x79ffffff 0x39ffffff 0xb9ffffff 0x7bffffff 0x3bffffff 0xbbffffff 0x7dffffff 0x3dffffff 0xbdffffff 0x7fffffff 0x3fffffff 0xbfffffff All 4 threads ended
FAIL
Ensure to add these bad seeds to the list of secrets in main.cpp

*********FAIL*********

Input vcode 0x00000001, Output vcode 0x00000001, Result vcode 0x00000001
Verification value is 0x00000001 - Testing took 908.112923 seconds
Loading

0 comments on commit 984ab6a

Please sign in to comment.