diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ba596bf..e2c51ca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -148,4 +148,4 @@ jobs: - uses: actions-rs/cargo@v1 with: command: check - args: --target wasm32-unknown-unknown + args: --target wasm32-unknown-unknown --no-default-features diff --git a/build.rs b/build.rs index 58d71a9..0c5b769 100644 --- a/build.rs +++ b/build.rs @@ -20,5 +20,4 @@ fn main() { { println!("cargo:rustc-cfg=feature=\"folded_multiply\""); } - } diff --git a/smhasher/fallbackNoFoldedOutput.txt b/smhasher/fallbackNoFoldedOutput.txt new file mode 100644 index 0000000..8b6040b --- /dev/null +++ b/smhasher/fallbackNoFoldedOutput.txt @@ -0,0 +1,1137 @@ +------------------------------------------------------------------------------- +--- Testing ahash64 "ahash 64bit" GOOD + +[[[ Sanity Tests ]]] + +Verification value 0x4F80BA96 ....... SKIP (self- or unseeded) +Running sanity check 1 .......... PASS +Running AppendedZeroesTest .......... PASS + +[[[ Speed Tests ]]] + +Bulk speed test - 262144-byte keys +Alignment 7 - 18.833 bytes/cycle - 53881.77 MiB/sec @ 3 ghz +Alignment 6 - 18.835 bytes/cycle - 53887.84 MiB/sec @ 3 ghz +Alignment 5 - 18.835 bytes/cycle - 53888.73 MiB/sec @ 3 ghz +Alignment 4 - 19.338 bytes/cycle - 55327.26 MiB/sec @ 3 ghz +Alignment 3 - 19.422 bytes/cycle - 55566.47 MiB/sec @ 3 ghz +Alignment 2 - 19.475 bytes/cycle - 55717.32 MiB/sec @ 3 ghz +Alignment 1 - 19.266 bytes/cycle - 55120.73 MiB/sec @ 3 ghz +Alignment 0 - 19.932 bytes/cycle - 57026.80 MiB/sec @ 3 ghz +Average - 19.242 bytes/cycle - 55052.12 MiB/sec @ 3 ghz + +Small key speed test - 1-byte keys - 33.00 cycles/hash +Small key speed test - 2-byte keys - 33.00 cycles/hash +Small key speed test - 3-byte keys - 32.02 cycles/hash +Small key speed test - 4-byte keys - 30.73 cycles/hash +Small key speed test - 5-byte keys - 30.81 cycles/hash +Small key speed test - 6-byte keys - 31.95 cycles/hash +Small key speed test - 7-byte keys - 33.00 cycles/hash +Small key speed test - 8-byte keys - 33.00 cycles/hash +Small key speed test - 9-byte keys - 30.83 cycles/hash +Small key speed test - 10-byte keys - 30.79 cycles/hash +Small key speed test - 11-byte keys - 30.86 cycles/hash +Small key speed test - 12-byte keys - 31.79 cycles/hash +Small key speed test - 13-byte keys - 32.00 cycles/hash +Small key speed test - 14-byte keys - 32.31 cycles/hash +Small key speed test - 15-byte keys - 30.51 cycles/hash +Small key speed test - 16-byte keys - 30.93 cycles/hash +Small key speed test - 17-byte keys - 33.07 cycles/hash +Small key speed test - 18-byte keys - 35.00 cycles/hash +Small key speed test - 19-byte keys - 35.00 cycles/hash +Small key speed test - 20-byte keys - 33.93 cycles/hash +Small key speed test - 21-byte keys - 32.86 cycles/hash +Small key speed test - 22-byte keys - 32.96 cycles/hash +Small key speed test - 23-byte keys - 34.30 cycles/hash +Small key speed test - 24-byte keys - 35.00 cycles/hash +Small key speed test - 25-byte keys - 35.00 cycles/hash +Small key speed test - 26-byte keys - 32.65 cycles/hash +Small key speed test - 27-byte keys - 33.00 cycles/hash +Small key speed test - 28-byte keys - 33.44 cycles/hash +Small key speed test - 29-byte keys - 35.00 cycles/hash +Small key speed test - 30-byte keys - 35.00 cycles/hash +Small key speed test - 31-byte keys - 34.00 cycles/hash +Average 32.830 cycles/hash + +[[[ 'Hashmap' Speed Tests ]]] + +std::unordered_map +Init std HashMapTest: 199.037 cycles/op (102774 inserts, 1% deletions) +Running std HashMapTest: 125.873 cycles/op (2.4 stdv) + +greg7mdp/parallel-hashmap +Init fast HashMapTest: 113.297 cycles/op (102774 inserts, 1% deletions) +Running fast HashMapTest: 85.337 cycles/op (2.7 stdv) ....... PASS + +[[[ Avalanche Tests ]]] + +Testing 24-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.653333% +Testing 32-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.654667% +Testing 40-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.725333% +Testing 48-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.680667% +Testing 56-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.686000% +Testing 64-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.676000% +Testing 72-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.676000% +Testing 80-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.620667% +Testing 96-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.699333% +Testing 112-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.684667% +Testing 128-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.734000% +Testing 160-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.673333% +Testing 512-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.748000% +Testing 1024-bit keys -> 64-bit hashes, 300000 reps.......... worst bias is 0.780000% + +[[[ Keyset 'Sparse' Tests ]]] + +Keyset 'Sparse' - 16-bit keys with up to 9 bits set - 50643 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 0.3, actual 0 (0.00x) +Testing collisions (high 19-25 bits) - Worst is 22 bits: 313/304 (1.03x) +Testing collisions (low 32-bit) - Expected 0.3, actual 0 (0.00x) +Testing collisions (low 19-25 bits) - Worst is 25 bits: 43/38 (1.13x) +Testing distribution - Worst bias is the 13-bit window at bit 9 - 0.766% + +Keyset 'Sparse' - 24-bit keys with up to 8 bits set - 1271626 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 188.2, actual 179 (0.95x) +Testing collisions (high 24-35 bits) - Worst is 30 bits: 772/752 (1.03x) +Testing collisions (low 32-bit) - Expected 188.2, actual 180 (0.96x) +Testing collisions (low 24-35 bits) - Worst is 24 bits: 46572/46996 (0.99x) +Testing distribution - Worst bias is the 17-bit window at bit 52 - 0.099% + +Keyset 'Sparse' - 32-bit keys with up to 7 bits set - 4514873 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 2372.2, actual 2386 (1.01x) (14) +Testing collisions (high 25-38 bits) - Worst is 33 bits: 1206/1186 (1.02x) +Testing collisions (low 32-bit) - Expected 2372.2, actual 2291 (0.97x) +Testing collisions (low 25-38 bits) - Worst is 35 bits: 299/296 (1.01x) +Testing distribution - Worst bias is the 19-bit window at bit 7 - 0.048% + +Keyset 'Sparse' - 40-bit keys with up to 6 bits set - 4598479 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 2460.8, actual 2467 (1.00x) (7) +Testing collisions (high 25-38 bits) - Worst is 38 bits: 42/38 (1.09x) +Testing collisions (low 32-bit) - Expected 2460.8, actual 2431 (0.99x) (-29) +Testing collisions (low 25-38 bits) - Worst is 37 bits: 80/76 (1.04x) +Testing distribution - Worst bias is the 18-bit window at bit 32 - 0.044% + +Keyset 'Sparse' - 48-bit keys with up to 6 bits set - 14196869 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 23437.8, actual 23394 (1.00x) (-43) +Testing collisions (high 27-42 bits) - Worst is 41 bits: 58/45 (1.27x) +Testing collisions (low 32-bit) - Expected 23437.8, actual 23042 (0.98x) (-395) +Testing collisions (low 27-42 bits) - Worst is 40 bits: 97/91 (1.06x) +Testing distribution - Worst bias is the 20-bit window at bit 27 - 0.026% + +Keyset 'Sparse' - 56-bit keys with up to 5 bits set - 4216423 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 2069.0, actual 2131 (1.03x) (63) +Testing collisions (high 25-38 bits) - Worst is 38 bits: 44/32 (1.36x) +Testing collisions (low 32-bit) - Expected 2069.0, actual 2134 (1.03x) (66) +Testing collisions (low 25-38 bits) - Worst is 38 bits: 40/32 (1.24x) +Testing distribution - Worst bias is the 19-bit window at bit 28 - 0.078% + +Keyset 'Sparse' - 64-bit keys with up to 5 bits set - 8303633 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8021.7, actual 8004 (1.00x) (-17) +Testing collisions (high 26-40 bits) - Worst is 35 bits: 1003/1003 (1.00x) +Testing collisions (low 32-bit) - Expected 8021.7, actual 8045 (1.00x) (24) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 39/31 (1.24x) +Testing distribution - Worst bias is the 20-bit window at bit 25 - 0.045% + +Keyset 'Sparse' - 72-bit keys with up to 5 bits set - 15082603 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 26451.8, actual 26592 (1.01x) (141) +Testing collisions (high 27-42 bits) - Worst is 33 bits: 13368/13233 (1.01x) +Testing collisions (low 32-bit) - Expected 26451.8, actual 26315 (0.99x) (-136) +Testing collisions (low 27-42 bits) - Worst is 40 bits: 113/103 (1.09x) +Testing distribution - Worst bias is the 20-bit window at bit 59 - 0.018% + +Keyset 'Sparse' - 96-bit keys with up to 4 bits set - 3469497 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 1401.0, actual 1354 (0.97x) +Testing collisions (high 25-38 bits) - Worst is 36 bits: 88/87 (1.00x) +Testing collisions (low 32-bit) - Expected 1401.0, actual 1422 (1.02x) (22) +Testing collisions (low 25-38 bits) - Worst is 36 bits: 96/87 (1.10x) +Testing distribution - Worst bias is the 18-bit window at bit 43 - 0.055% + +Keyset 'Sparse' - 160-bit keys with up to 4 bits set - 26977161 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 84546.1, actual 84656 (1.00x) (110) +Testing collisions (high 28-44 bits) - Worst is 42 bits: 84/82 (1.02x) +Testing collisions (low 32-bit) - Expected 84546.1, actual 84598 (1.00x) (52) +Testing collisions (low 28-44 bits) - Worst is 41 bits: 199/165 (1.20x) +Testing distribution - Worst bias is the 20-bit window at bit 3 - 0.014% + +Keyset 'Sparse' - 256-bit keys with up to 3 bits set - 2796417 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 910.2, actual 914 (1.00x) (4) +Testing collisions (high 25-37 bits) - Worst is 36 bits: 62/56 (1.09x) +Testing collisions (low 32-bit) - Expected 910.2, actual 887 (0.97x) +Testing collisions (low 25-37 bits) - Worst is 35 bits: 130/113 (1.14x) +Testing distribution - Worst bias is the 19-bit window at bit 47 - 0.068% + +Keyset 'Sparse' - 512-bit keys with up to 3 bits set - 22370049 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 58155.4, actual 58437 (1.00x) (282) +Testing collisions (high 28-43 bits) - Worst is 33 bits: 29437/29102 (1.01x) +Testing collisions (low 32-bit) - Expected 58155.4, actual 58276 (1.00x) (121) +Testing collisions (low 28-43 bits) - Worst is 35 bits: 7362/7280 (1.01x) +Testing distribution - Worst bias is the 19-bit window at bit 11 - 0.011% + +Keyset 'Sparse' - 1024-bit keys with up to 2 bits set - 524801 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 32.1, actual 39 (1.22x) (7) +Testing collisions (high 22-32 bits) - Worst is 32 bits: 39/32 (1.22x) +Testing collisions (low 32-bit) - Expected 32.1, actual 29 (0.90x) +Testing collisions (low 22-32 bits) - Worst is 30 bits: 136/128 (1.06x) +Testing distribution - Worst bias is the 16-bit window at bit 59 - 0.126% + +Keyset 'Sparse' - 2048-bit keys with up to 2 bits set - 2098177 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 512.4, actual 513 (1.00x) (1) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 38/32 (1.19x) +Testing collisions (low 32-bit) - Expected 512.4, actual 491 (0.96x) +Testing collisions (low 24-36 bits) - Worst is 34 bits: 134/128 (1.05x) +Testing distribution - Worst bias is the 18-bit window at bit 17 - 0.134% + + +[[[ Keyset 'Permutation' Tests ]]] + +Combination Lowbits Tests: +Keyset 'Combination' - up to 7 blocks from a set of 8 - 2396744 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 668.6, actual 705 (1.05x) (37) +Testing collisions (high 24-37 bits) - Worst is 32 bits: 705/668 (1.05x) +Testing collisions (low 32-bit) - Expected 668.6, actual 619 (0.93x) +Testing collisions (low 24-37 bits) - Worst is 24 bits: 163754/163326 (1.00x) +Testing distribution - Worst bias is the 18-bit window at bit 19 - 0.061% + + +Combination Highbits Tests +Keyset 'Combination' - up to 7 blocks from a set of 8 - 2396744 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 668.6, actual 662 (0.99x) (-6) +Testing collisions (high 24-37 bits) - Worst is 30 bits: 2701/2672 (1.01x) +Testing collisions (low 32-bit) - Expected 668.6, actual 689 (1.03x) (21) +Testing collisions (low 24-37 bits) - Worst is 36 bits: 48/41 (1.15x) +Testing distribution - Worst bias is the 18-bit window at bit 47 - 0.053% + + +Combination Hi-Lo Tests: +Keyset 'Combination' - up to 6 blocks from a set of 15 - 12204240 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 17322.9, actual 17227 (0.99x) (-95) +Testing collisions (high 27-41 bits) - Worst is 27 bits: 538234/538415 (1.00x) +Testing collisions (low 32-bit) - Expected 17322.9, actual 17271 (1.00x) (-51) +Testing collisions (low 27-41 bits) - Worst is 41 bits: 43/33 (1.27x) +Testing distribution - Worst bias is the 20-bit window at bit 5 - 0.027% + + +Combination 0x8000000 Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8305 (1.01x) (119) +Testing collisions (high 26-40 bits) - Worst is 32 bits: 8305/8186 (1.01x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8198 (1.00x) (12) +Testing collisions (low 26-40 bits) - Worst is 34 bits: 2097/2047 (1.02x) +Testing distribution - Worst bias is the 20-bit window at bit 57 - 0.044% + + +Combination 0x0000001 Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8255 (1.01x) (69) +Testing collisions (high 26-40 bits) - Worst is 38 bits: 142/127 (1.11x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8105 (0.99x) (-81) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 34/31 (1.06x) +Testing distribution - Worst bias is the 20-bit window at bit 48 - 0.036% + + +Combination 0x800000000000000 Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8071 (0.99x) (-115) +Testing collisions (high 26-40 bits) - Worst is 27 bits: 256884/256766 (1.00x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8209 (1.00x) (23) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 38/31 (1.19x) +Testing distribution - Worst bias is the 20-bit window at bit 25 - 0.032% + + +Combination 0x000000000000001 Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8052 (0.98x) (-134) +Testing collisions (high 26-40 bits) - Worst is 35 bits: 1029/1023 (1.00x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8128 (0.99x) (-58) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 40/31 (1.25x) +Testing distribution - Worst bias is the 20-bit window at bit 21 - 0.070% + + +Combination 16-bytes [0-1] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8235 (1.01x) (49) +Testing collisions (high 26-40 bits) - Worst is 38 bits: 134/127 (1.05x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8072 (0.99x) (-114) +Testing collisions (low 26-40 bits) - Worst is 26 bits: 503674/503108 (1.00x) +Testing distribution - Worst bias is the 20-bit window at bit 54 - 0.046% + + +Combination 16-bytes [0-last] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8207 (1.00x) (21) +Testing collisions (high 26-40 bits) - Worst is 34 bits: 2088/2047 (1.02x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8017 (0.98x) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 37/31 (1.16x) +Testing distribution - Worst bias is the 20-bit window at bit 10 - 0.037% + + +Combination 32-bytes [0-1] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8218 (1.00x) (32) +Testing collisions (high 26-40 bits) - Worst is 32 bits: 8218/8186 (1.00x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8233 (1.01x) (47) +Testing collisions (low 26-40 bits) - Worst is 38 bits: 152/127 (1.19x) +Testing distribution - Worst bias is the 20-bit window at bit 2 - 0.029% + + +Combination 32-bytes [0-last] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8324 (1.02x) (138) +Testing collisions (high 26-40 bits) - Worst is 37 bits: 268/255 (1.05x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8099 (0.99x) (-87) +Testing collisions (low 26-40 bits) - Worst is 36 bits: 525/511 (1.03x) +Testing distribution - Worst bias is the 20-bit window at bit 13 - 0.044% + + +Combination 64-bytes [0-1] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8033 (0.98x) (-153) +Testing collisions (high 26-40 bits) - Worst is 39 bits: 67/63 (1.05x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8293 (1.01x) (107) +Testing collisions (low 26-40 bits) - Worst is 37 bits: 274/255 (1.07x) +Testing distribution - Worst bias is the 20-bit window at bit 29 - 0.037% + + +Combination 64-bytes [0-last] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8335 (1.02x) (149) +Testing collisions (high 26-40 bits) - Worst is 32 bits: 8335/8186 (1.02x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8163 (1.00x) (-23) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 35/31 (1.09x) +Testing distribution - Worst bias is the 20-bit window at bit 20 - 0.033% + + +Combination 128-bytes [0-1] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8238 (1.01x) (52) +Testing collisions (high 26-40 bits) - Worst is 31 bits: 16565/16362 (1.01x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8062 (0.98x) (-124) +Testing collisions (low 26-40 bits) - Worst is 37 bits: 262/255 (1.02x) +Testing distribution - Worst bias is the 20-bit window at bit 16 - 0.042% + + +Combination 128-bytes [0-last] Tests: +Keyset 'Combination' - up to 22 blocks from a set of 2 - 8388606 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 8186.7, actual 8270 (1.01x) (84) +Testing collisions (high 26-40 bits) - Worst is 39 bits: 70/63 (1.09x) +Testing collisions (low 32-bit) - Expected 8186.7, actual 8144 (0.99x) (-42) +Testing collisions (low 26-40 bits) - Worst is 40 bits: 41/31 (1.28x) +Testing distribution - Worst bias is the 20-bit window at bit 29 - 0.042% + + +[[[ Keyset 'Window' Tests ]]] + +Keyset 'Window' - 32-bit key, 25-bit window - 32 tests, 33554432 keys per test +Window at 0 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 1 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 2 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 3 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 4 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 5 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 6 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 7 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 8 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 9 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 10 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 11 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 12 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 13 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 14 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 15 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 16 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 17 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 18 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 19 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 20 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 21 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 22 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 23 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 24 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 25 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 26 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 27 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 28 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 29 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 30 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 31 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Window at 32 - Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) + +[[[ Keyset 'Cyclic' Tests ]]] + +Keyset 'Cyclic' - 8 cycles of 8 bytes - 1000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 116.4, actual 129 (1.11x) (13) +Testing collisions (high 23-34 bits) - Worst is 34 bits: 35/29 (1.20x) +Testing collisions (low 32-bit) - Expected 116.4, actual 105 (0.90x) +Testing collisions (low 23-34 bits) - Worst is 26 bits: 7507/7413 (1.01x) +Testing distribution - Worst bias is the 17-bit window at bit 40 - 0.089% + +Keyset 'Cyclic' - 8 cycles of 9 bytes - 1000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 116.4, actual 112 (0.96x) +Testing collisions (high 23-34 bits) - Worst is 28 bits: 1915/1860 (1.03x) +Testing collisions (low 32-bit) - Expected 116.4, actual 109 (0.94x) +Testing collisions (low 23-34 bits) - Worst is 30 bits: 472/465 (1.01x) +Testing distribution - Worst bias is the 17-bit window at bit 28 - 0.111% + +Keyset 'Cyclic' - 8 cycles of 10 bytes - 1000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 116.4, actual 106 (0.91x) +Testing collisions (high 23-34 bits) - Worst is 25 bits: 14825/14754 (1.00x) +Testing collisions (low 32-bit) - Expected 116.4, actual 130 (1.12x) (14) +Testing collisions (low 23-34 bits) - Worst is 34 bits: 39/29 (1.34x) +Testing distribution - Worst bias is the 17-bit window at bit 51 - 0.114% + +Keyset 'Cyclic' - 8 cycles of 11 bytes - 1000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 116.4, actual 110 (0.94x) +Testing collisions (high 23-34 bits) - Worst is 27 bits: 3703/3716 (1.00x) +Testing collisions (low 32-bit) - Expected 116.4, actual 105 (0.90x) +Testing collisions (low 23-34 bits) - Worst is 29 bits: 977/930 (1.05x) +Testing distribution - Worst bias is the 17-bit window at bit 32 - 0.120% + +Keyset 'Cyclic' - 8 cycles of 12 bytes - 1000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 116.4, actual 107 (0.92x) +Testing collisions (high 23-34 bits) - Worst is 23 bits: 57386/57305 (1.00x) +Testing collisions (low 32-bit) - Expected 116.4, actual 132 (1.13x) (16) +Testing collisions (low 23-34 bits) - Worst is 34 bits: 40/29 (1.37x) +Testing distribution - Worst bias is the 17-bit window at bit 57 - 0.073% + +Keyset 'Cyclic' - 8 cycles of 16 bytes - 1000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 116.4, actual 132 (1.13x) (16) +Testing collisions (high 23-34 bits) - Worst is 32 bits: 132/116 (1.13x) +Testing collisions (low 32-bit) - Expected 116.4, actual 118 (1.01x) (2) +Testing collisions (low 23-34 bits) - Worst is 32 bits: 118/116 (1.01x) +Testing distribution - Worst bias is the 17-bit window at bit 46 - 0.095% + + +[[[ Keyset 'TwoBytes' Tests ]]] + +Keyset 'TwoBytes' - up-to-4-byte keys, 652545 total keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 49.6, actual 53 (1.07x) (4) +Testing collisions (high 23-33 bits) - Worst is 32 bits: 53/49 (1.07x) +Testing collisions (low 32-bit) - Expected 49.6, actual 60 (1.21x) (11) +Testing collisions (low 23-33 bits) - Worst is 33 bits: 35/24 (1.41x) +Testing distribution - Worst bias is the 16-bit window at bit 21 - 0.145% + +Keyset 'TwoBytes' - up-to-8-byte keys, 5471025 total keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 3483.1, actual 3402 (0.98x) +Testing collisions (high 26-39 bits) - Worst is 29 bits: 27946/27781 (1.01x) +Testing collisions (low 32-bit) - Expected 3483.1, actual 3541 (1.02x) (58) +Testing collisions (low 26-39 bits) - Worst is 38 bits: 56/54 (1.03x) +Testing distribution - Worst bias is the 19-bit window at bit 30 - 0.034% + +Keyset 'TwoBytes' - up-to-12-byte keys, 18616785 total keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 40289.5, actual 39891 (0.99x) (-398) +Testing collisions (high 27-42 bits) - Worst is 27 bits: 1232174/1233446 (1.00x) +Testing collisions (low 32-bit) - Expected 40289.5, actual 40423 (1.00x) (134) +Testing collisions (low 27-42 bits) - Worst is 42 bits: 42/39 (1.07x) +Testing distribution - Worst bias is the 20-bit window at bit 6 - 0.016% + +Keyset 'TwoBytes' - up-to-16-byte keys, 44251425 total keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 227182.3, actual 227113 (1.00x) (-69) +Testing collisions (high 29-45 bits) - Worst is 45 bits: 32/27 (1.15x) +Testing collisions (low 32-bit) - Expected 227182.3, actual 227820 (1.00x) (638) +Testing collisions (low 29-45 bits) - Worst is 45 bits: 30/27 (1.08x) +Testing distribution - Worst bias is the 20-bit window at bit 11 - 0.006% + +Keyset 'TwoBytes' - up-to-20-byte keys, 86536545 total keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 865959.1, actual 866474 (1.00x) (515) +Testing collisions (high 30-47 bits) - Worst is 45 bits: 108/106 (1.01x) +Testing collisions (low 32-bit) - Expected 865959.1, actual 865864 (1.00x) (-95) +Testing collisions (low 30-47 bits) - Worst is 37 bits: 27468/27237 (1.01x) +Testing distribution - Worst bias is the 20-bit window at bit 18 - 0.005% + + +[[[ Keyset 'Text' Tests ]]] + +Keyset 'Text' - keys of form "FooXXXXBar" - 14776336 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 25389.0, actual 25545 (1.01x) (156) +Testing collisions (high 27-42 bits) - Worst is 40 bits: 106/99 (1.07x) +Testing collisions (low 32-bit) - Expected 25389.0, actual 25253 (0.99x) (-136) +Testing collisions (low 27-42 bits) - Worst is 42 bits: 25/24 (1.01x) +Testing distribution - Worst bias is the 20-bit window at bit 51 - 0.027% + +Keyset 'Text' - keys of form "FooBarXXXX" - 14776336 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 25389.0, actual 25219 (0.99x) (-170) +Testing collisions (high 27-42 bits) - Worst is 31 bits: 50616/50719 (1.00x) +Testing collisions (low 32-bit) - Expected 25389.0, actual 25549 (1.01x) (160) +Testing collisions (low 27-42 bits) - Worst is 40 bits: 106/99 (1.07x) +Testing distribution - Worst bias is the 20-bit window at bit 60 - 0.022% + +Keyset 'Text' - keys of form "XXXXFooBar" - 14776336 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 25389.0, actual 25373 (1.00x) (-16) +Testing collisions (high 27-42 bits) - Worst is 42 bits: 29/24 (1.17x) +Testing collisions (low 32-bit) - Expected 25389.0, actual 25204 (0.99x) (-185) +Testing collisions (low 27-42 bits) - Worst is 39 bits: 221/198 (1.11x) +Testing distribution - Worst bias is the 20-bit window at bit 28 - 0.020% + +Keyset 'Words' - 4000000 random keys of len 6-16 from alnum charset +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 1862.1, actual 1800 (0.97x) +Testing collisions (high 25-38 bits) - Worst is 37 bits: 65/58 (1.12x) +Testing collisions (low 32-bit) - Expected 1862.1, actual 1819 (0.98x) +Testing collisions (low 25-38 bits) - Worst is 34 bits: 484/465 (1.04x) +Testing distribution - Worst bias is the 19-bit window at bit 63 - 0.041% + +Keyset 'Words' - 4000000 random keys of len 6-16 from password charset +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 1862.1, actual 1827 (0.98x) (-35) +Testing collisions (high 25-38 bits) - Worst is 35 bits: 237/232 (1.02x) +Testing collisions (low 32-bit) - Expected 1862.1, actual 1885 (1.01x) (23) +Testing collisions (low 25-38 bits) - Worst is 35 bits: 237/232 (1.02x) +Testing distribution - Worst bias is the 19-bit window at bit 60 - 0.059% + +Keyset 'Words' - 102774 dict words +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 1.2, actual 0 (0.00x) +Testing collisions (high 20-27 bits) - Worst is 27 bits: 46/39 (1.17x) +Testing collisions (low 32-bit) - Expected 1.2, actual 1 (0.81x) +Testing collisions (low 20-27 bits) - Worst is 25 bits: 173/157 (1.10x) +Testing distribution - Worst bias is the 14-bit window at bit 35 - 0.340% + + +[[[ Keyset 'Zeroes' Tests ]]] + +Keyset 'Zeroes' - 204800 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 4.9, actual 6 (1.23x) (2) +Testing collisions (high 21-29 bits) - Worst is 25 bits: 651/623 (1.04x) +Testing collisions (low 32-bit) - Expected 4.9, actual 5 (1.02x) (1) +Testing collisions (low 21-29 bits) - Worst is 27 bits: 166/156 (1.06x) +Testing distribution - Worst bias is the 15-bit window at bit 55 - 0.298% + + +[[[ Keyset 'Seed' Tests ]]] + +Keyset 'Seed' - 5000000 keys +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 2909.3, actual 2790 (0.96x) +Testing collisions (high 26-39 bits) - Worst is 26 bits: 181311/181723 (1.00x) +Testing collisions (low 32-bit) - Expected 2909.3, actual 2885 (0.99x) (-24) +Testing collisions (low 26-39 bits) - Worst is 39 bits: 33/22 (1.45x) +Testing distribution - Worst bias is the 19-bit window at bit 55 - 0.051% + + +[[[ Keyset 'PerlinNoise' Tests ]]] + +Testing 16777216 coordinates (L2) : +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 32725.4, actual 32807 (1.00x) (82) +Testing collisions (high 27-42 bits) - Worst is 39 bits: 266/255 (1.04x) +Testing collisions (low 32-bit) - Expected 32725.4, actual 33071 (1.01x) (346) +Testing collisions (low 27-42 bits) - Worst is 42 bits: 44/31 (1.38x) + +Testing AV variant, 128 count with 4 spacing, 4-12: +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 1116.2, actual 1124 (1.01x) (8) +Testing collisions (high 25-37 bits) - Worst is 36 bits: 83/69 (1.19x) +Testing collisions (low 32-bit) - Expected 1116.2, actual 1026 (0.92x) +Testing collisions (low 25-37 bits) - Worst is 27 bits: 35507/35452 (1.00x) + + +[[[ Diff 'Differential' Tests ]]] + +Testing 8303632 up-to-5-bit differentials in 64-bit keys -> 64 bit hashes. +1000 reps, 8303632000 total tests, expecting 0.00 random collisions.......... +0 total collisions, of which 0 single collisions were ignored + +Testing 11017632 up-to-4-bit differentials in 128-bit keys -> 64 bit hashes. +1000 reps, 11017632000 total tests, expecting 0.00 random collisions.......... +0 total collisions, of which 0 single collisions were ignored + +Testing 2796416 up-to-3-bit differentials in 256-bit keys -> 64 bit hashes. +1000 reps, 2796416000 total tests, expecting 0.00 random collisions.......... +0 total collisions, of which 0 single collisions were ignored + + +[[[ DiffDist 'Differential Distribution' Tests ]]] + +Testing bit 0 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 530 (1.04x) (19) +Testing collisions (high 24-36 bits) - Worst is 33 bits: 273/255 (1.07x) +Testing collisions (low 32-bit) - Expected 511.9, actual 537 (1.05x) (26) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 42/31 (1.31x) +Testing distribution - Worst bias is the 18-bit window at bit 10 - 0.083% + +Testing bit 1 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 518 (1.01x) (7) +Testing collisions (high 24-36 bits) - Worst is 32 bits: 518/511 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 526 (1.03x) (15) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 36/31 (1.13x) +Testing distribution - Worst bias is the 18-bit window at bit 63 - 0.070% + +Testing bit 2 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 524 (1.02x) (13) +Testing collisions (high 24-36 bits) - Worst is 31 bits: 1063/1023 (1.04x) +Testing collisions (low 32-bit) - Expected 511.9, actual 528 (1.03x) (17) +Testing collisions (low 24-36 bits) - Worst is 31 bits: 1062/1023 (1.04x) +Testing distribution - Worst bias is the 18-bit window at bit 10 - 0.078% + +Testing bit 3 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 531 (1.04x) (20) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 68/63 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 494 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 38/31 (1.19x) +Testing distribution - Worst bias is the 18-bit window at bit 14 - 0.059% + +Testing bit 4 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 519 (1.01x) (8) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 72/63 (1.13x) +Testing collisions (low 32-bit) - Expected 511.9, actual 492 (0.96x) +Testing collisions (low 24-36 bits) - Worst is 24 bits: 125969/125777 (1.00x) +Testing distribution - Worst bias is the 18-bit window at bit 6 - 0.068% + +Testing bit 5 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 498 (0.97x) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing collisions (low 32-bit) - Expected 511.9, actual 504 (0.98x) (-7) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 75/63 (1.17x) +Testing distribution - Worst bias is the 18-bit window at bit 39 - 0.077% + +Testing bit 6 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 477 (0.93x) +Testing collisions (high 24-36 bits) - Worst is 34 bits: 134/127 (1.05x) +Testing collisions (low 32-bit) - Expected 511.9, actual 465 (0.91x) +Testing collisions (low 24-36 bits) - Worst is 26 bits: 32805/32429 (1.01x) +Testing distribution - Worst bias is the 18-bit window at bit 34 - 0.086% + +Testing bit 7 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 514 (1.00x) (3) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 34/31 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 498 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 48/31 (1.50x) +Testing distribution - Worst bias is the 18-bit window at bit 33 - 0.090% + +Testing bit 8 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 474 (0.93x) +Testing collisions (high 24-36 bits) - Worst is 29 bits: 4132/4090 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 483 (0.94x) +Testing collisions (low 24-36 bits) - Worst is 28 bits: 8305/8170 (1.02x) +Testing distribution - Worst bias is the 16-bit window at bit 37 - 0.063% + +Testing bit 9 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 481 (0.94x) +Testing collisions (high 24-36 bits) - Worst is 31 bits: 1048/1023 (1.02x) +Testing collisions (low 32-bit) - Expected 511.9, actual 501 (0.98x) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 68/63 (1.06x) +Testing distribution - Worst bias is the 18-bit window at bit 24 - 0.065% + +Testing bit 10 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 504 (0.98x) (-7) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 37/31 (1.16x) +Testing collisions (low 32-bit) - Expected 511.9, actual 494 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 36/31 (1.13x) +Testing distribution - Worst bias is the 18-bit window at bit 43 - 0.068% + +Testing bit 11 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 509 (0.99x) (-2) +Testing collisions (high 24-36 bits) - Worst is 34 bits: 140/127 (1.09x) +Testing collisions (low 32-bit) - Expected 511.9, actual 572 (1.12x) (61) +Testing collisions (low 24-36 bits) - Worst is 32 bits: 572/511 (1.12x) +Testing distribution - Worst bias is the 18-bit window at bit 51 - 0.091% + +Testing bit 12 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 486 (0.95x) +Testing collisions (high 24-36 bits) - Worst is 24 bits: 125213/125777 (1.00x) +Testing collisions (low 32-bit) - Expected 511.9, actual 520 (1.02x) (9) +Testing collisions (low 24-36 bits) - Worst is 31 bits: 1043/1023 (1.02x) +Testing distribution - Worst bias is the 18-bit window at bit 6 - 0.083% + +Testing bit 13 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 547 (1.07x) (36) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 78/63 (1.22x) +Testing collisions (low 32-bit) - Expected 511.9, actual 515 (1.01x) (4) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 32 - 0.074% + +Testing bit 14 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 457 (0.89x) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 72/63 (1.13x) +Testing collisions (low 32-bit) - Expected 511.9, actual 509 (0.99x) (-2) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 24 - 0.084% + +Testing bit 15 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 510 (1.00x) (-1) +Testing collisions (high 24-36 bits) - Worst is 30 bits: 2133/2046 (1.04x) +Testing collisions (low 32-bit) - Expected 511.9, actual 476 (0.93x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 37/31 (1.16x) +Testing distribution - Worst bias is the 18-bit window at bit 52 - 0.071% + +Testing bit 16 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 503 (0.98x) (-8) +Testing collisions (high 24-36 bits) - Worst is 28 bits: 8161/8170 (1.00x) +Testing collisions (low 32-bit) - Expected 511.9, actual 508 (0.99x) (-3) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 38/31 (1.19x) +Testing distribution - Worst bias is the 18-bit window at bit 49 - 0.062% + +Testing bit 17 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 513 (1.00x) (2) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 41/31 (1.28x) +Testing collisions (low 32-bit) - Expected 511.9, actual 520 (1.02x) (9) +Testing collisions (low 24-36 bits) - Worst is 33 bits: 279/255 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 50 - 0.070% + +Testing bit 18 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 546 (1.07x) (35) +Testing collisions (high 24-36 bits) - Worst is 33 bits: 283/255 (1.11x) +Testing collisions (low 32-bit) - Expected 511.9, actual 487 (0.95x) +Testing collisions (low 24-36 bits) - Worst is 28 bits: 8185/8170 (1.00x) +Testing distribution - Worst bias is the 18-bit window at bit 22 - 0.058% + +Testing bit 19 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 514 (1.00x) (3) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 37/31 (1.16x) +Testing collisions (low 32-bit) - Expected 511.9, actual 498 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 24 bits: 125639/125777 (1.00x) +Testing distribution - Worst bias is the 18-bit window at bit 54 - 0.082% + +Testing bit 20 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 525 (1.03x) (14) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 74/63 (1.16x) +Testing collisions (low 32-bit) - Expected 511.9, actual 541 (1.06x) (30) +Testing collisions (low 24-36 bits) - Worst is 30 bits: 2173/2046 (1.06x) +Testing distribution - Worst bias is the 18-bit window at bit 10 - 0.062% + +Testing bit 21 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 510 (1.00x) (-1) +Testing collisions (high 24-36 bits) - Worst is 33 bits: 275/255 (1.07x) +Testing collisions (low 32-bit) - Expected 511.9, actual 517 (1.01x) (6) +Testing collisions (low 24-36 bits) - Worst is 34 bits: 135/127 (1.05x) +Testing distribution - Worst bias is the 17-bit window at bit 29 - 0.059% + +Testing bit 22 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 505 (0.99x) (-6) +Testing collisions (high 24-36 bits) - Worst is 27 bits: 16472/16298 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 529 (1.03x) (18) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 39/31 (1.22x) +Testing distribution - Worst bias is the 18-bit window at bit 45 - 0.071% + +Testing bit 23 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 526 (1.03x) (15) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 38/31 (1.19x) +Testing collisions (low 32-bit) - Expected 511.9, actual 542 (1.06x) (31) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 43/31 (1.34x) +Testing distribution - Worst bias is the 18-bit window at bit 57 - 0.070% + +Testing bit 24 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 515 (1.01x) (4) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 38/31 (1.19x) +Testing collisions (low 32-bit) - Expected 511.9, actual 532 (1.04x) (21) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 38/31 (1.19x) +Testing distribution - Worst bias is the 18-bit window at bit 50 - 0.060% + +Testing bit 25 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 511 (1.00x) +Testing collisions (high 24-36 bits) - Worst is 28 bits: 8353/8170 (1.02x) +Testing collisions (low 32-bit) - Expected 511.9, actual 497 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 42/31 (1.31x) +Testing distribution - Worst bias is the 18-bit window at bit 4 - 0.067% + +Testing bit 26 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 499 (0.97x) +Testing collisions (high 24-36 bits) - Worst is 34 bits: 132/127 (1.03x) +Testing collisions (low 32-bit) - Expected 511.9, actual 538 (1.05x) (27) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 40/31 (1.25x) +Testing distribution - Worst bias is the 18-bit window at bit 24 - 0.073% + +Testing bit 27 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 533 (1.04x) (22) +Testing collisions (high 24-36 bits) - Worst is 32 bits: 533/511 (1.04x) +Testing collisions (low 32-bit) - Expected 511.9, actual 485 (0.95x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 36/31 (1.13x) +Testing distribution - Worst bias is the 18-bit window at bit 10 - 0.105% + +Testing bit 28 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 532 (1.04x) (21) +Testing collisions (high 24-36 bits) - Worst is 34 bits: 136/127 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 506 (0.99x) (-5) +Testing collisions (low 24-36 bits) - Worst is 33 bits: 265/255 (1.04x) +Testing distribution - Worst bias is the 18-bit window at bit 63 - 0.073% + +Testing bit 29 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 494 (0.97x) +Testing collisions (high 24-36 bits) - Worst is 29 bits: 4145/4090 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 492 (0.96x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 51 - 0.081% + +Testing bit 30 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 505 (0.99x) (-6) +Testing collisions (high 24-36 bits) - Worst is 26 bits: 32853/32429 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 500 (0.98x) +Testing collisions (low 24-36 bits) - Worst is 30 bits: 2081/2046 (1.02x) +Testing distribution - Worst bias is the 18-bit window at bit 4 - 0.073% + +Testing bit 31 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 503 (0.98x) (-8) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 37/31 (1.16x) +Testing collisions (low 32-bit) - Expected 511.9, actual 503 (0.98x) (-8) +Testing collisions (low 24-36 bits) - Worst is 26 bits: 32504/32429 (1.00x) +Testing distribution - Worst bias is the 18-bit window at bit 48 - 0.068% + +Testing bit 32 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 536 (1.05x) (25) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 69/63 (1.08x) +Testing collisions (low 32-bit) - Expected 511.9, actual 526 (1.03x) (15) +Testing collisions (low 24-36 bits) - Worst is 33 bits: 274/255 (1.07x) +Testing distribution - Worst bias is the 18-bit window at bit 29 - 0.072% + +Testing bit 33 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 500 (0.98x) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 39/31 (1.22x) +Testing collisions (low 32-bit) - Expected 511.9, actual 562 (1.10x) (51) +Testing collisions (low 24-36 bits) - Worst is 33 bits: 292/255 (1.14x) +Testing distribution - Worst bias is the 18-bit window at bit 19 - 0.116% + +Testing bit 34 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 569 (1.11x) (58) +Testing collisions (high 24-36 bits) - Worst is 34 bits: 151/127 (1.18x) +Testing collisions (low 32-bit) - Expected 511.9, actual 529 (1.03x) (18) +Testing collisions (low 24-36 bits) - Worst is 31 bits: 1087/1023 (1.06x) +Testing distribution - Worst bias is the 18-bit window at bit 42 - 0.070% + +Testing bit 35 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 518 (1.01x) (7) +Testing collisions (high 24-36 bits) - Worst is 29 bits: 4155/4090 (1.02x) +Testing collisions (low 32-bit) - Expected 511.9, actual 546 (1.07x) (35) +Testing collisions (low 24-36 bits) - Worst is 34 bits: 149/127 (1.16x) +Testing distribution - Worst bias is the 18-bit window at bit 9 - 0.097% + +Testing bit 36 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 519 (1.01x) (8) +Testing collisions (high 24-36 bits) - Worst is 31 bits: 1084/1023 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 502 (0.98x) (-9) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 59 - 0.069% + +Testing bit 37 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 542 (1.06x) (31) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 81/63 (1.27x) +Testing collisions (low 32-bit) - Expected 511.9, actual 544 (1.06x) (33) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 37/31 (1.16x) +Testing distribution - Worst bias is the 17-bit window at bit 36 - 0.069% + +Testing bit 38 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 516 (1.01x) (5) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 67/63 (1.05x) +Testing collisions (low 32-bit) - Expected 511.9, actual 486 (0.95x) +Testing collisions (low 24-36 bits) - Worst is 27 bits: 16424/16298 (1.01x) +Testing distribution - Worst bias is the 18-bit window at bit 16 - 0.116% + +Testing bit 39 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 516 (1.01x) (5) +Testing collisions (high 24-36 bits) - Worst is 34 bits: 139/127 (1.09x) +Testing collisions (low 32-bit) - Expected 511.9, actual 536 (1.05x) (25) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 70/63 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 43 - 0.066% + +Testing bit 40 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 533 (1.04x) (22) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing collisions (low 32-bit) - Expected 511.9, actual 540 (1.05x) (29) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 40/31 (1.25x) +Testing distribution - Worst bias is the 18-bit window at bit 25 - 0.065% + +Testing bit 41 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 501 (0.98x) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 33/31 (1.03x) +Testing collisions (low 32-bit) - Expected 511.9, actual 548 (1.07x) (37) +Testing collisions (low 24-36 bits) - Worst is 33 bits: 277/255 (1.08x) +Testing distribution - Worst bias is the 18-bit window at bit 60 - 0.091% + +Testing bit 42 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 516 (1.01x) (5) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 39/31 (1.22x) +Testing collisions (low 32-bit) - Expected 511.9, actual 553 (1.08x) (42) +Testing collisions (low 24-36 bits) - Worst is 32 bits: 553/511 (1.08x) +Testing distribution - Worst bias is the 18-bit window at bit 23 - 0.057% + +Testing bit 43 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 545 (1.06x) (34) +Testing collisions (high 24-36 bits) - Worst is 32 bits: 545/511 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 497 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 28 bits: 8234/8170 (1.01x) +Testing distribution - Worst bias is the 18-bit window at bit 61 - 0.090% + +Testing bit 44 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 461 (0.90x) +Testing collisions (high 24-36 bits) - Worst is 24 bits: 125866/125777 (1.00x) +Testing collisions (low 32-bit) - Expected 511.9, actual 526 (1.03x) (15) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 38/31 (1.19x) +Testing distribution - Worst bias is the 18-bit window at bit 10 - 0.043% + +Testing bit 45 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 551 (1.08x) (40) +Testing collisions (high 24-36 bits) - Worst is 32 bits: 551/511 (1.08x) +Testing collisions (low 32-bit) - Expected 511.9, actual 512 (1.00x) (1) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 65/63 (1.02x) +Testing distribution - Worst bias is the 17-bit window at bit 52 - 0.060% + +Testing bit 46 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 506 (0.99x) (-5) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 67/63 (1.05x) +Testing collisions (low 32-bit) - Expected 511.9, actual 490 (0.96x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 36/31 (1.13x) +Testing distribution - Worst bias is the 18-bit window at bit 21 - 0.079% + +Testing bit 47 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 536 (1.05x) (25) +Testing collisions (high 24-36 bits) - Worst is 33 bits: 282/255 (1.10x) +Testing collisions (low 32-bit) - Expected 511.9, actual 483 (0.94x) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 70/63 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 9 - 0.079% + +Testing bit 48 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 527 (1.03x) (16) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 72/63 (1.13x) +Testing collisions (low 32-bit) - Expected 511.9, actual 503 (0.98x) (-8) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 70/63 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 56 - 0.081% + +Testing bit 49 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 560 (1.09x) (49) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 74/63 (1.16x) +Testing collisions (low 32-bit) - Expected 511.9, actual 523 (1.02x) (12) +Testing collisions (low 24-36 bits) - Worst is 33 bits: 263/255 (1.03x) +Testing distribution - Worst bias is the 17-bit window at bit 41 - 0.058% + +Testing bit 50 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 522 (1.02x) (11) +Testing collisions (high 24-36 bits) - Worst is 33 bits: 271/255 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 519 (1.01x) (8) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 40/31 (1.25x) +Testing distribution - Worst bias is the 18-bit window at bit 39 - 0.079% + +Testing bit 51 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 531 (1.04x) (20) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 76/63 (1.19x) +Testing collisions (low 32-bit) - Expected 511.9, actual 489 (0.96x) +Testing collisions (low 24-36 bits) - Worst is 29 bits: 4122/4090 (1.01x) +Testing distribution - Worst bias is the 18-bit window at bit 6 - 0.071% + +Testing bit 52 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 512 (1.00x) (1) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 67/63 (1.05x) +Testing collisions (low 32-bit) - Expected 511.9, actual 562 (1.10x) (51) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 46/31 (1.44x) +Testing distribution - Worst bias is the 18-bit window at bit 15 - 0.055% + +Testing bit 53 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 501 (0.98x) +Testing collisions (high 24-36 bits) - Worst is 29 bits: 4137/4090 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 535 (1.05x) (24) +Testing collisions (low 24-36 bits) - Worst is 32 bits: 535/511 (1.05x) +Testing distribution - Worst bias is the 18-bit window at bit 62 - 0.093% + +Testing bit 54 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 465 (0.91x) +Testing collisions (high 24-36 bits) - Worst is 27 bits: 16437/16298 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 515 (1.01x) (4) +Testing collisions (low 24-36 bits) - Worst is 34 bits: 139/127 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 46 - 0.076% + +Testing bit 55 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 555 (1.08x) (44) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 39/31 (1.22x) +Testing collisions (low 32-bit) - Expected 511.9, actual 491 (0.96x) +Testing collisions (low 24-36 bits) - Worst is 34 bits: 138/127 (1.08x) +Testing distribution - Worst bias is the 18-bit window at bit 52 - 0.074% + +Testing bit 56 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 539 (1.05x) (28) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 36/31 (1.13x) +Testing collisions (low 32-bit) - Expected 511.9, actual 533 (1.04x) (22) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 39/31 (1.22x) +Testing distribution - Worst bias is the 18-bit window at bit 31 - 0.108% + +Testing bit 57 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 513 (1.00x) (2) +Testing collisions (high 24-36 bits) - Worst is 33 bits: 272/255 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 522 (1.02x) (11) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 68/63 (1.06x) +Testing distribution - Worst bias is the 18-bit window at bit 8 - 0.114% + +Testing bit 58 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 514 (1.00x) (3) +Testing collisions (high 24-36 bits) - Worst is 28 bits: 8230/8170 (1.01x) +Testing collisions (low 32-bit) - Expected 511.9, actual 545 (1.06x) (34) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 43/31 (1.34x) +Testing distribution - Worst bias is the 18-bit window at bit 7 - 0.092% + +Testing bit 59 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 500 (0.98x) +Testing collisions (high 24-36 bits) - Worst is 30 bits: 2120/2046 (1.04x) +Testing collisions (low 32-bit) - Expected 511.9, actual 503 (0.98x) (-8) +Testing collisions (low 24-36 bits) - Worst is 35 bits: 69/63 (1.08x) +Testing distribution - Worst bias is the 18-bit window at bit 31 - 0.065% + +Testing bit 60 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 496 (0.97x) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 65/63 (1.02x) +Testing collisions (low 32-bit) - Expected 511.9, actual 486 (0.95x) +Testing collisions (low 24-36 bits) - Worst is 29 bits: 4218/4090 (1.03x) +Testing distribution - Worst bias is the 18-bit window at bit 22 - 0.081% + +Testing bit 61 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 520 (1.02x) (9) +Testing collisions (high 24-36 bits) - Worst is 35 bits: 67/63 (1.05x) +Testing collisions (low 32-bit) - Expected 511.9, actual 486 (0.95x) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 39/31 (1.22x) +Testing distribution - Worst bias is the 18-bit window at bit 6 - 0.064% + +Testing bit 62 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 522 (1.02x) (11) +Testing collisions (high 24-36 bits) - Worst is 32 bits: 522/511 (1.02x) +Testing collisions (low 32-bit) - Expected 511.9, actual 533 (1.04x) (22) +Testing collisions (low 24-36 bits) - Worst is 36 bits: 35/31 (1.09x) +Testing distribution - Worst bias is the 18-bit window at bit 52 - 0.084% + +Testing bit 63 +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 511.9, actual 498 (0.97x) +Testing collisions (high 24-36 bits) - Worst is 36 bits: 34/31 (1.06x) +Testing collisions (low 32-bit) - Expected 511.9, actual 496 (0.97x) +Testing collisions (low 24-36 bits) - Worst is 30 bits: 2053/2046 (1.00x) +Testing distribution - Worst bias is the 18-bit window at bit 53 - 0.104% + + +[[[ MomentChi2 Tests ]]] + +Analyze hashes produced from a serie of linearly increasing numbers of 32-bit, using a step of 2 ... +Target values to approximate : 38918200.000000 - 273633.333333 +4 threads starting... done +Popcount 1 stats : 38918835.315783 - 273623.606930 +Popcount 0 stats : 38918226.200577 - 273605.413971 +MomentChi2 for bits 1 : 0.737544 +MomentChi2 for bits 0 : 0.00125443 + +Derivative stats (transition from 2 consecutive values) : +Popcount 1 stats : 38919083.803108 - 273655.817065 +Popcount 0 stats : 38919331.387736 - 273661.792772 +MomentChi2 for deriv b1 : 1.42723 +MomentChi2 for deriv b0 : 2.33884 + + Great + + +[[[ Prng Tests ]]] + +Generating 33554432 random numbers : +Testing collisions ( 64-bit) - Expected 0.0, actual 0 (0.00x) +Testing collisions (high 32-bit) - Expected 130731.3, actual 131908 (1.01x) (1177) +Testing collisions (high 28-44 bits) - Worst is 37 bits: 4198/4095 (1.02x) +Testing collisions (low 32-bit) - Expected 130731.3, actual 131430 (1.01x) (699) +Testing collisions (low 28-44 bits) - Worst is 42 bits: 144/127 (1.13x) + +[[[ BadSeeds Tests ]]] + +Testing 0 internal secrets: +0x0 PASS + + +Input vcode 0x00000001, Output vcode 0x00000001, Result vcode 0x00000001 +Verification value is 0x00000001 - Testing took 631.594488 seconds +------------------------------------------------------------------------------- diff --git a/src/aes_hash.rs b/src/aes_hash.rs index df67bfd..702044e 100644 --- a/src/aes_hash.rs +++ b/src/aes_hash.rs @@ -1,8 +1,8 @@ use crate::convert::*; use crate::operations::*; +use crate::random_state::PI; use crate::RandomState; use core::hash::Hasher; -use crate::random_state::PI; /// A `Hasher` for hashing an arbitrary stream of bytes. /// @@ -68,7 +68,6 @@ impl AHasher { } } - #[inline] pub(crate) fn from_random_state(rand_state: &RandomState) -> Self { let key1 = [rand_state.k0, rand_state.k1].convert(); @@ -128,7 +127,11 @@ impl Hasher for AHasher { } #[inline] - #[cfg(any(target_pointer_width = "64", target_pointer_width = "32", target_pointer_width = "16"))] + #[cfg(any( + target_pointer_width = "64", + target_pointer_width = "32", + target_pointer_width = "16" + ))] fn write_usize(&mut self, i: usize) { self.write_u64(i as u64); } @@ -317,7 +320,7 @@ pub(crate) struct AHasherStr(pub AHasher); impl Hasher for AHasherStr { #[inline] fn finish(&self) -> u64 { - let result : [u64; 2] = self.0.enc.convert(); + let result: [u64; 2] = self.0.enc.convert(); result[0] } @@ -428,4 +431,3 @@ mod tests { assert_eq!(bytes, 0x6464646464646464); } } - diff --git a/src/convert.rs b/src/convert.rs index 4c0a00e..fc47baa 100644 --- a/src/convert.rs +++ b/src/convert.rs @@ -7,17 +7,13 @@ macro_rules! convert { impl Convert<$b> for $a { #[inline(always)] fn convert(self) -> $b { - unsafe { - core::mem::transmute::<$a, $b>(self) - } + unsafe { core::mem::transmute::<$a, $b>(self) } } } impl Convert<$a> for $b { #[inline(always)] fn convert(self) -> $a { - unsafe { - core::mem::transmute::<$b, $a>(self) - } + unsafe { core::mem::transmute::<$b, $a>(self) } } } }; diff --git a/src/fallback_hash.rs b/src/fallback_hash.rs index efad74c..f78074d 100644 --- a/src/fallback_hash.rs +++ b/src/fallback_hash.rs @@ -6,8 +6,6 @@ use crate::random_state::PI; use crate::RandomState; use core::hash::Hasher; - - const ROT: u32 = 23; //17 /// A `Hasher` for hashing an arbitrary stream of bytes. @@ -94,19 +92,10 @@ impl AHasher { /// attacker somehow knew part of (but not all) the contents of the buffer before hand, /// they would not be able to predict any of the bits in the buffer at the end. #[inline(always)] - #[cfg(feature = "folded_multiply")] fn update(&mut self, new_data: u64) { self.buffer = folded_multiply(new_data ^ self.buffer, MULTIPLE); } - #[inline(always)] - #[cfg(not(feature = "folded_multiply"))] - fn update(&mut self, new_data: u64) { - let d1 = (new_data ^ self.buffer).wrapping_mul(MULTIPLE); - self.pad = (self.pad ^ d1).rotate_left(8).wrapping_mul(MULTIPLE); - self.buffer = (self.buffer ^ self.pad).rotate_left(24); - } - /// Similar to the above this function performs an update using a "folded multiply". /// However it takes in 128 bits of data instead of 64. Both halves must be masked. /// @@ -119,21 +108,12 @@ impl AHasher { /// can't be changed by the same set of input bits. To cancel this sequence with subsequent input would require /// knowing the keys. #[inline(always)] - #[cfg(feature = "folded_multiply")] fn large_update(&mut self, new_data: u128) { let block: [u64; 2] = new_data.convert(); let combined = folded_multiply(block[0] ^ self.extra_keys[0], block[1] ^ self.extra_keys[1]); self.buffer = (self.buffer.wrapping_add(self.pad) ^ combined).rotate_left(ROT); } - #[inline(always)] - #[cfg(not(feature = "folded_multiply"))] - fn large_update(&mut self, new_data: u128) { - let block: [u64; 2] = new_data.convert(); - self.update(block[0] ^ self.extra_keys[0]); - self.update(block[1] ^ self.extra_keys[1]); - } - #[inline] #[cfg(feature = "specialize")] fn short_finish(&self) -> u64 { @@ -171,7 +151,11 @@ impl Hasher for AHasher { } #[inline] - #[cfg(any(target_pointer_width = "64", target_pointer_width = "32", target_pointer_width = "16"))] + #[cfg(any( + target_pointer_width = "64", + target_pointer_width = "32", + target_pointer_width = "16" + ))] fn write_usize(&mut self, i: usize) { self.write_u64(i as u64); } @@ -209,18 +193,10 @@ impl Hasher for AHasher { } #[inline] - #[cfg(feature = "folded_multiply")] fn finish(&self) -> u64 { let rot = (self.buffer & 63) as u32; folded_multiply(self.buffer, self.pad).rotate_left(rot) } - - #[inline] - #[cfg(not(feature = "folded_multiply"))] - fn finish(&self) -> u64 { - let rot = (self.buffer & 63) as u32; - (self.buffer.wrapping_mul(MULTIPLE) ^ self.pad).rotate_left(rot) - } } #[cfg(feature = "specialize")] @@ -339,8 +315,7 @@ impl Hasher for AHasherStr { self.0.write(bytes) } else { let value = read_small(bytes); - self.0.buffer = folded_multiply(value[0] ^ self.0.buffer, - value[1] ^ self.0.extra_keys[1]); + self.0.buffer = folded_multiply(value[0] ^ self.0.buffer, value[1] ^ self.0.extra_keys[1]); self.0.pad = self.0.pad.wrapping_add(bytes.len() as u64); } } diff --git a/src/hash_quality_test.rs b/src/hash_quality_test.rs index 125c522..bd85edd 100644 --- a/src/hash_quality_test.rs +++ b/src/hash_quality_test.rs @@ -147,7 +147,13 @@ fn assert_each_byte_differs(num: u64, base: u64, alternitives: Vec) { for alternitive in alternitives { changed_bits |= base ^ alternitive } - assert_eq!(core::u64::MAX, changed_bits, "Bits changed: {:x} on num: {:?}", changed_bits, num); + assert_eq!( + core::u64::MAX, + changed_bits, + "Bits changed: {:x} on num: {:?}", + changed_bits, + num + ); } fn test_finish_is_consistent(constructor: impl Fn(u128, u128) -> T) { @@ -273,11 +279,19 @@ fn test_padding_doesnot_collide(hasher: impl Fn() -> T) { let (same_bytes, same_nibbles) = count_same_bytes_and_nibbles(value, long.finish()); assert!( same_bytes <= 3, - "{} bytes of {} -> {:x} vs {:x}", num, c, value, long.finish() + "{} bytes of {} -> {:x} vs {:x}", + num, + c, + value, + long.finish() ); assert!( same_nibbles <= 8, - "{} bytes of {} -> {:x} vs {:x}", num, c, value, long.finish() + "{} bytes of {} -> {:x} vs {:x}", + num, + c, + value, + long.finish() ); let flipped_bits = (value ^ long.finish()).count_ones(); assert!(flipped_bits > 10); @@ -370,7 +384,7 @@ mod fallback_tests { fn fallback_keys_affect_every_byte() { //For fallback second key is not used in every hash. #[cfg(all(not(feature = "specialize"), feature = "folded_multiply"))] - test_keys_affect_every_byte(0, |a, b| AHasher::new_with_keys(a ^ b, a)); + test_keys_affect_every_byte(0, |a, b| AHasher::new_with_keys(a ^ b, a)); test_keys_affect_every_byte("", |a, b| AHasher::new_with_keys(a ^ b, a)); test_keys_affect_every_byte((0, 0), |a, b| AHasher::new_with_keys(a ^ b, a)); } @@ -397,7 +411,12 @@ mod fallback_tests { ///Basic sanity tests of the cypto properties of aHash. #[cfg(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) ))] #[cfg(test)] mod aes_tests { @@ -460,7 +479,7 @@ mod aes_tests { #[test] fn aes_keys_affect_every_byte() { #[cfg(not(feature = "specialize"))] - test_keys_affect_every_byte(0, AHasher::test_with_keys); + test_keys_affect_every_byte(0, AHasher::test_with_keys); test_keys_affect_every_byte("", AHasher::test_with_keys); test_keys_affect_every_byte((0, 0), AHasher::test_with_keys); } diff --git a/src/lib.rs b/src/lib.rs index 8c146bf..4566af0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,8 +8,10 @@ //! //! aHash uses the hardware AES instruction on x86 processors to provide a keyed hash function. //! aHash is not a cryptographically secure hash. -//! -#![cfg_attr(any(feature = "compile-time-rng", feature = "runtime-rng"), doc = r##" +//! +#![cfg_attr( + any(feature = "compile-time-rng", feature = "runtime-rng"), + doc = r##" # Example ``` use ahash::{AHasher, RandomState}; @@ -18,8 +20,11 @@ use std::collections::HashMap; let mut map: HashMap = HashMap::default(); map.insert(12, 34); ``` -"##)] -#![cfg_attr(feature = "std", doc = r##" +"## +)] +#![cfg_attr( + feature = "std", + doc = r##" For convenience, both new-type wrappers and type aliases are provided. The new type wrappers are called called `AHashMap` and `AHashSet`. These do the same thing with slightly less typing. The type aliases are called `ahash::HashMap`, `ahash::HashSet` are also provided and alias the std::[HashMap] and std::[HashSet]. Why are there two options? The wrappers are convenient but @@ -39,7 +44,8 @@ map.insert(12, 34); let mut set = ahash::HashSet::with_capacity(10); set.insert(10); ``` -"##)] +"## +)] #![deny(clippy::correctness, clippy::complexity, clippy::perf)] #![allow(clippy::pedantic, clippy::cast_lossless, clippy::unreadable_literal)] #![cfg_attr(all(not(test), not(feature = "std")), no_std)] @@ -265,10 +271,10 @@ impl BuildHasherExt for B { #[cfg(test)] mod test { use crate::convert::Convert; + use crate::specialize::CallHasher; use crate::*; use std::collections::HashMap; use std::hash::Hash; - use crate::specialize::CallHasher; #[test] fn test_ahash_alias_map_construction() { diff --git a/src/operations.rs b/src/operations.rs index 0ee98b9..ffd3b1a 100644 --- a/src/operations.rs +++ b/src/operations.rs @@ -1,6 +1,6 @@ use crate::convert::*; -///This constant come from Kunth's prng (Empirically it works better than those from splitmix32). +///This constant comes from Kunth's prng (Empirically it works better than those from splitmix32). pub(crate) const MULTIPLE: u64 = 6364136223846793005; /// This is a constant with a lot of special properties found by automated search. @@ -11,11 +11,19 @@ const SHUFFLE_MASK: u128 = 0x020a0700_0c01030e_050f0d08_06090b04_u128; //const SHUFFLE_MASK: u128 = 0x040A0700_030E0106_0D050F08_020B0C09_u128; #[inline(always)] +#[cfg(feature = "folded_multiply")] pub(crate) const fn folded_multiply(s: u64, by: u64) -> u64 { let result = (s as u128).wrapping_mul(by as u128); ((result & 0xffff_ffff_ffff_ffff) as u64) ^ ((result >> 64) as u64) } +#[inline(always)] +#[cfg(not(feature = "folded_multiply"))] +pub(crate) const fn folded_multiply(s: u64, by: u64) -> u64 { + let b1 = s.wrapping_mul(by.swap_bytes()); + let b2 = s.swap_bytes().wrapping_mul(!by); + b1 ^ b2.swap_bytes() +} /// Given a small (less than 8 byte slice) returns the same data stored in two u32s. /// (order of and non-duplication of bytes is NOT guaranteed) @@ -104,14 +112,19 @@ pub(crate) fn aesenc(value: u128, xor: u128) -> u128 { } } -#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd"))] +#[cfg(all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" +))] #[allow(unused)] #[inline(always)] pub(crate) fn aesenc(value: u128, xor: u128) -> u128 { - #[cfg(target_arch = "arm")] - use core::arch::arm::*; #[cfg(target_arch = "aarch64")] use core::arch::aarch64::*; + #[cfg(target_arch = "arm")] + use core::arch::arm::*; use core::mem::transmute; unsafe { let value = transmute(value); @@ -134,14 +147,19 @@ pub(crate) fn aesdec(value: u128, xor: u128) -> u128 { } } -#[cfg(all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd"))] +#[cfg(all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" +))] #[allow(unused)] #[inline(always)] pub(crate) fn aesdec(value: u128, xor: u128) -> u128 { - #[cfg(target_arch = "arm")] - use core::arch::arm::*; #[cfg(target_arch = "aarch64")] use core::arch::aarch64::*; + #[cfg(target_arch = "arm")] + use core::arch::arm::*; use core::mem::transmute; unsafe { let value = transmute(value); diff --git a/src/random_state.rs b/src/random_state.rs index d7c5c70..60ba51f 100644 --- a/src/random_state.rs +++ b/src/random_state.rs @@ -1,4 +1,3 @@ - use core::hash::Hash; cfg_if::cfg_if! { if #[cfg(any( @@ -54,7 +53,7 @@ cfg_if::cfg_if! { #[inline] fn get_fixed_seeds() -> &'static [[u64; 4]; 2] { use const_random::const_random; - + const RAND: [[u64; 4]; 2] = [ [ const_random!(u64), @@ -74,9 +73,9 @@ cfg_if::cfg_if! { #[inline] fn get_fixed_seeds() -> &'static [[u64; 4]; 2] { use crate::convert::Convert; - + static SEEDS: OnceBox<[[u64; 4]; 2]> = OnceBox::new(); - + SEEDS.get_or_init(|| { let mut result: [u8; 64] = [0; 64]; getrandom::getrandom(&mut result).expect("getrandom::getrandom() failed."); @@ -87,7 +86,7 @@ cfg_if::cfg_if! { #[inline] fn get_fixed_seeds() -> &'static [[u64; 4]; 2] { use const_random::const_random; - + const RAND: [[u64; 4]; 2] = [ [ const_random!(u64), @@ -106,7 +105,7 @@ cfg_if::cfg_if! { } else { fn get_fixed_seeds() -> &'static [[u64; 4]; 2] { &[PI, PI2] - } + } } } @@ -120,9 +119,7 @@ cfg_if::cfg_if! { /// A supplier of Randomness used for different hashers. /// See [set_random_source]. pub trait RandomSource { - fn gen_hasher_seed(&self) -> usize; - } struct DefaultRandomSource { @@ -271,7 +268,12 @@ impl RandomState { /// or the same value being passed for more than one parameter. #[inline] pub const fn with_seeds(k0: u64, k1: u64, k2: u64, k3: u64) -> RandomState { - RandomState { k0: k0 ^ PI2[0], k1: k1 ^ PI2[1], k2: k2 ^ PI2[2], k3: k3 ^ PI2[3] } + RandomState { + k0: k0 ^ PI2[0], + k1: k1 ^ PI2[1], + k2: k2 ^ PI2[2], + k3: k3 ^ PI2[3], + } } /// Calculates the hash of a single value. @@ -286,7 +288,9 @@ impl RandomState { /// [`Hasher`], not to call this method repeatedly and combine the results. #[inline] pub fn hash_one(&self, x: T) -> u64 - where Self: Sized { + where + Self: Sized, + { use crate::specialize::CallHasher; T::get_hash(&x, self) } @@ -308,7 +312,9 @@ impl BuildHasher for RandomState { /// [AHasher]s that will return different hashcodes, but [Hasher]s created from the same [BuildHasher] /// will generate the same hashes for the same input data. /// - #[cfg_attr(any(feature = "compile-time-rng", feature = "runtime-rng"), doc = r##" # Examples + #[cfg_attr( + any(feature = "compile-time-rng", feature = "runtime-rng"), + doc = r##" # Examples ``` use ahash::{AHasher, RandomState}; use std::hash::{Hasher, BuildHasher}; @@ -327,7 +333,8 @@ impl BuildHasher for RandomState { different_hasher.write_u32(1234); assert_ne!(different_hasher.finish(), hasher_1.finish()); ``` - "##)] + "## + )] /// [Hasher]: std::hash::Hasher /// [BuildHasher]: std::hash::BuildHasher /// [HashMap]: std::collections::HashMap diff --git a/tests/bench.rs b/tests/bench.rs index 251e134..84a3739 100644 --- a/tests/bench.rs +++ b/tests/bench.rs @@ -8,7 +8,12 @@ use std::hash::{BuildHasherDefault, Hash, Hasher}; #[cfg(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) ))] fn aeshash(b: &H) -> u64 { let build_hasher = RandomState::with_seeds(1, 2, 3, 4); @@ -16,7 +21,12 @@ fn aeshash(b: &H) -> u64 { } #[cfg(not(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) )))] fn aeshash(_b: &H) -> u64 { panic!("aes must be enabled") @@ -24,7 +34,12 @@ fn aeshash(_b: &H) -> u64 { #[cfg(not(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) )))] fn fallbackhash(b: &H) -> u64 { let build_hasher = RandomState::with_seeds(1, 2, 3, 4); @@ -32,7 +47,12 @@ fn fallbackhash(b: &H) -> u64 { } #[cfg(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) ))] fn fallbackhash(_b: &H) -> u64 { panic!("aes must be disabled") @@ -148,9 +168,10 @@ fn bench_sip(c: &mut Criterion) { fn bench_map(c: &mut Criterion) { #[cfg(feature = "std")] - { - let mut group = c.benchmark_group("map"); - group.bench_function("aHash-alias", |b| b.iter(|| { + { + let mut group = c.benchmark_group("map"); + group.bench_function("aHash-alias", |b| { + b.iter(|| { let hm: ahash::HashMap = (0..1_000_000).map(|i| (i, i)).collect(); let mut sum = 0; for i in 0..1_000_000 { @@ -158,8 +179,10 @@ fn bench_map(c: &mut Criterion) { sum += x; } } - })); - group.bench_function("aHash-hashBrown", |b| b.iter(|| { + }) + }); + group.bench_function("aHash-hashBrown", |b| { + b.iter(|| { let hm: hashbrown::HashMap = (0..1_000_000).map(|i| (i, i)).collect(); let mut sum = 0; for i in 0..1_000_000 { @@ -167,8 +190,10 @@ fn bench_map(c: &mut Criterion) { sum += x; } } - })); - group.bench_function("aHash-hashBrown-explicit", |b| b.iter(|| { + }) + }); + group.bench_function("aHash-hashBrown-explicit", |b| { + b.iter(|| { let hm: hashbrown::HashMap = (0..1_000_000).map(|i| (i, i)).collect(); let mut sum = 0; for i in 0..1_000_000 { @@ -176,8 +201,10 @@ fn bench_map(c: &mut Criterion) { sum += x; } } - })); - group.bench_function("aHash-wrapper", |b| b.iter(|| { + }) + }); + group.bench_function("aHash-wrapper", |b| { + b.iter(|| { let hm: ahash::AHashMap = (0..1_000_000).map(|i| (i, i)).collect(); let mut sum = 0; for i in 0..1_000_000 { @@ -185,8 +212,10 @@ fn bench_map(c: &mut Criterion) { sum += x; } } - })); - group.bench_function("aHash-rand", |b| b.iter(|| { + }) + }); + group.bench_function("aHash-rand", |b| { + b.iter(|| { let hm: std::collections::HashMap = (0..1_000_000).map(|i| (i, i)).collect(); let mut sum = 0; for i in 0..1_000_000 { @@ -194,37 +223,44 @@ fn bench_map(c: &mut Criterion) { sum += x; } } - })); - group.bench_function("aHash-default", |b| b.iter(|| { - let hm: std::collections::HashMap> = (0..1_000_000).map(|i| (i, i)).collect(); + }) + }); + group.bench_function("aHash-default", |b| { + b.iter(|| { + let hm: std::collections::HashMap> = + (0..1_000_000).map(|i| (i, i)).collect(); let mut sum = 0; for i in 0..1_000_000 { if let Some(x) = hm.get(&i) { sum += x; } } - })); - } + }) + }); + } } criterion_main!(benches); #[cfg(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) ))] -criterion_group!( - benches, - bench_ahash, - bench_fx, - bench_fnv, - bench_sea, - bench_sip -); +criterion_group!(benches, bench_ahash, bench_fx, bench_fnv, bench_sea, bench_sip); #[cfg(not(any( all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "aes", not(miri)), - all(any(target_arch = "arm", target_arch = "aarch64"), any(target_feature = "aes", target_feature = "crypto"), not(miri), feature = "stdsimd") + all( + any(target_arch = "arm", target_arch = "aarch64"), + any(target_feature = "aes", target_feature = "crypto"), + not(miri), + feature = "stdsimd" + ) )))] criterion_group!( benches, diff --git a/tests/map_tests.rs b/tests/map_tests.rs index 3f4a06a..8d798a0 100644 --- a/tests/map_tests.rs +++ b/tests/map_tests.rs @@ -2,9 +2,9 @@ use std::hash::{BuildHasher, Hash, Hasher}; +use ahash::RandomState; use criterion::*; use fxhash::FxHasher; -use ahash::RandomState; fn gen_word_pairs() -> Vec { let words: Vec<_> = r#" diff --git a/tests/nopanic.rs b/tests/nopanic.rs index 4ad13bd..56f754c 100644 --- a/tests/nopanic.rs +++ b/tests/nopanic.rs @@ -25,7 +25,10 @@ struct SimpleBuildHasher { } impl SimpleBuildHasher { - fn hash_one(&self, x: T) -> u64 where Self: Sized { + fn hash_one(&self, x: T) -> u64 + where + Self: Sized, + { let mut hasher = self.build_hasher(); x.hash(&mut hasher); hasher.finish() @@ -61,10 +64,7 @@ fn hash_test_random_wrapper(num: i32, string: &str) { fn hash_test_random(num: i32, string: &str) -> (u64, u64) { let build_hasher1 = RandomState::with_seeds(1, 2, 3, 4); let build_hasher2 = RandomState::with_seeds(1, 2, 3, 4); - ( - build_hasher1.hash_one(&num), - build_hasher2.hash_one(string.as_bytes()) - ) + (build_hasher1.hash_one(&num), build_hasher2.hash_one(string.as_bytes())) } #[inline(never)]