diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-17 09:26:53 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-12-17 09:26:53 +0100 |
| commit | 36f37564cd566e91771cd1f92ac3886917c769d1 (patch) | |
| tree | 037b21f46dafb4edce8aeef25fc3d6e1d607df12 /benchmarks | |
| parent | c6ab40b1602443938e431b996b28fb3d888365bb (diff) | |
| download | nissy-core-36f37564cd566e91771cd1f92ac3886917c769d1.tar.gz nissy-core-36f37564cd566e91771cd1f92ac3886917c769d1.zip | |
Update benchmarks
Diffstat (limited to 'benchmarks')
20 files changed, 449 insertions, 196 deletions
diff --git a/benchmarks/benchmarks.md b/benchmarks/benchmarks.md index 33e8288..6c035e3 100644 --- a/benchmarks/benchmarks.md +++ b/benchmarks/benchmarks.md | |||
| @@ -58,163 +58,164 @@ All benchmark tests were done on the following configuration: | |||
| 58 | * CPU: AMD Ryzen 7 7700 (8 cores, 16 virtual threads) | 58 | * CPU: AMD Ryzen 7 7700 (8 cores, 16 virtual threads) |
| 59 | * Memory: 2x Corsair Vengeance 32GB 5600MHz | 59 | * Memory: 2x Corsair Vengeance 32GB 5600MHz |
| 60 | * Motherboard: Gigabyte B650M K | 60 | * Motherboard: Gigabyte B650M K |
| 61 | * Operating system: Debian 12 (Linux kernel 6.1.0) | 61 | * Operating system: Debian 13 (Linux kernel 6.12.57) |
| 62 | * Compiler: GCC 12.2.0 for H48 and Clang 14.0.6 for vcube | 62 | * Compiler: GCC 14.2.0 for H48 and Clang 19.1.7 for vcube |
| 63 | 63 | ||
| 64 | ## Single solution | 64 | ## Results |
| 65 | 65 | ||
| 66 | Average time for finding a single optimal solution. | 66 | <details><summary>Single solution, single thread</summary> |
| 67 | |||
| 68 | ### Single thread | ||
| 69 | 67 | ||
| 70 | Time per cube (in seconds, lower is better). | 68 | Time per cube (in seconds, lower is better). |
| 71 | 69 | ||
| 72 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 70 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 73 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 71 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 74 | |H48 h11 k2|56.1GiB | 0.23 | 1.15 | 5.08 | 31.30 | 53.67 | | 72 | |vcube 212 |58.2 Gib| 0.11| 0.75| 3.43| 27.28| 19.30| |
| 75 | |vcube 404 |31.8GiB | 0.30 | 1.25 | 6.87 | 57.49 | 291.31 | | 73 | |H48 h11 |56.5 Gib| 0.15| 0.91| 4.08| 26.81| 26.90| |
| 76 | |H48 h10 k2|28.1GiB | 0.34 | 1.80 | 7.77 | | 81.89 | | 74 | |vcube 404 |31.8 Gib| 0.23| 1.24| 6.10| 59.33| 268.26| |
| 77 | |vcube 308 |21.2GiB | 0.20 | 1.11 | 6.92 | | | | 75 | |H48 h10 |28.3 Gib| 0.27| 1.47| 6.75| 46.65| 60.55| |
| 78 | |H48 h9 k2 |14.1GiB | 0.42 | 2.84 | 12.86 | | | | 76 | |vcube 308 |21.2 Gib| 0.17| 1.02| 6.20| 58.70| 604.35| |
| 79 | |vcube 208 | 7.3GiB | 0.57 | 4.41 | 20.75 | | | | 77 | |H48 h9 |14.1 Gib| 0.38| 2.66| 12.21| | | |
| 80 | |H48 h8 k2 | 7.1GiB | 0.86 | 6.66 | 27.40 | | | | 78 | |vcube 208 | 7.3 Gib| 0.56| 4.36| 20.58| | | |
| 81 | |H48 h7 k2 | 3.6GiB | 1.47 | 8.90 | 42.46 | | | | 79 | |H48 h8 | 7.1 Gib| 0.87| 6.61| 26.57| | | |
| 82 | |vcube 112 | 2.4GiB | 1.01 | 9.39 | | | | | 80 | |H48 h7 | 3.5 Gib| 1.02| 8.21| 41.25| | | |
| 83 | |H48 h6 k2 | 1.8GiB | 2.28 | 16.89 | | | | | 81 | |vcube 112 | 2.4 Gib| 0.96| 9.29| 40.52| | | |
| 82 | |H48 h6 | 1.8 Gib| 2.11| 15.95| 82.00| | | | ||
| 84 | 83 | ||
| 85 | Time per cube adjusted for tables size (in seconds \* GiB, lower is better). | 84 | Time per cube adjusted for table size (in seconds \* GiB, lower is better). |
| 86 | 85 | ||
| 87 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 86 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 88 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 87 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 89 | |H48 h11 k2|56.1GiB | 12.90 | 64.51 | 284.99 |1755.93 | 3010.89 | | 88 | |vcube 212 |58.2 Gib| 6.43| 43.80| 199.38| 1587.43| 1122.73| |
| 90 | |vcube 404 |31.8GiB | 9.54 | 39.75 | 218.47 |1828.18 | 9263.66 | | 89 | |H48 h11 |56.5 Gib| 8.73| 51.58| 230.38| 1514.85| 1520.10| |
| 91 | |H48 h10 k2|28.1GiB | 9.55 | 50.58 | 218.34 | | 2301.11 | | 90 | |vcube 404 |31.8 Gib| 7.40| 39.47| 194.01| 1887.94| 8535.87| |
| 92 | |vcube 308 |21.2GiB | 4.24 | 23.53 | 146.70 | | | | 91 | |H48 h10 |28.3 Gib| 7.70| 41.43| 190.75| 1317.96| 1710.78| |
| 93 | |H48 h9 k2 |14.1GiB | 5.92 | 40.04 | 181.33 | | | | 92 | |vcube 308 |21.2 Gib| 3.51| 21.71| 131.50| 1245.26| 12819.94| |
| 94 | |vcube 208 | 7.3GiB | 4.16 | 32.19 | 151.48 | | | | 93 | |H48 h9 |14.1 Gib| 5.31| 37.64| 172.53| | | |
| 95 | |H48 h8 k2 | 7.1GiB | 6.11 | 47.29 | 194.54 | | | | 94 | |vcube 208 | 7.3 Gib| 4.08| 31.74| 149.68| | | |
| 96 | |H48 h7 k2 | 3.6GiB | 5.29 | 32.04 | 152.86 | | | | 95 | |H48 h8 | 7.1 Gib| 6.17| 46.72| 187.70| | | |
| 97 | |vcube 112 | 2.4GiB | 2.42 | 22.53 | | | | | 96 | |H48 h7 | 3.5 Gib| 3.62| 29.01| 145.74| | | |
| 98 | |H48 h6 k2 | 1.8GiB | 4.10 | 30.40 | | | | | 97 | |vcube 112 | 2.4 Gib| 2.33| 22.53| 98.23| | | |
| 98 | |H48 h6 | 1.8 Gib| 3.72| 28.19| 144.94| | | | ||
| 99 | 99 | ||
| 100 | <details><summary>Plots</summary> | ||
| 101 | <img src="img/17moves1thread.png"> | 100 | <img src="img/17moves1thread.png"> |
| 102 | <img src="img/18moves1thread.png"> | 101 | <img src="img/18moves1thread.png"> |
| 103 | <img src="img/19moves1thread.png"> | 102 | <img src="img/19moves1thread.png"> |
| 104 | <img src="img/20moves1thread.png"> | 103 | <img src="img/20moves1thread.png"> |
| 105 | </details> | ||
| 106 | 104 | ||
| 107 | ### Multithread (4 threads) | 105 | </details> |
| 106 | <details><summary>Single solution, 4 threads</summary> | ||
| 108 | 107 | ||
| 109 | Time per cube (in seconds, lower is better). | 108 | Time per cube (in seconds, lower is better). |
| 110 | 109 | ||
| 111 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 110 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 112 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 111 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 113 | |H48 h11 k2|56.1GiB | 0.06 | 0.31 | 1.31 | 7.96 | 14.01 | | 112 | |vcube 212 |58.2 Gib| 0.03| 0.27| 1.04| 7.70| (a) | |
| 114 | |vcube 404 |31.8GiB | 0.10 | 0.38 | 1.88 | 16.98 | (a) | | 113 | |H48 h11 |56.5 Gib| 0.05| 0.26| 1.13| 7.60| 8.44| |
| 115 | |H48 h10 k2|28.1GiB | 0.10 | 0.47 | 2.00 | 13.54 | 21.96 | | 114 | |vcube 404 |31.8 Gib| 0.07| 0.30| 1.65| 16.17| (a) | |
| 116 | |vcube 308 |21.2GiB | 0.06 | 0.42 | 1.95 | 17.73 | (a) | | 115 | |H48 h10 |28.3 Gib| 0.08| 0.39| 1.89| 13.07| 16.63| |
| 117 | |H48 h9 k2 |14.1GiB | 0.14 | 0.83 | 3.82 | 25.98 | 31.68 | | 116 | |vcube 308 |21.2 Gib| 0.05| 0.35| 1.78| 16.61| (a) | |
| 118 | |vcube 208 | 7.3GiB | 0.17 | 1.49 | 5.88 | | (a) | | 117 | |H48 h9 |14.1 Gib| 0.12| 0.77| 3.42| 24.72| 29.31| |
| 119 | |H48 h8 k2 | 7.1GiB | 0.27 | 2.02 | 7.94 | | | | 118 | |vcube 208 | 7.3 Gib| 0.16| 1.47| 5.86| | (a) | |
| 120 | |H48 h7 k2 | 3.6GiB | 0.35 | 2.59 | 12.41 | | | | 119 | |H48 h8 | 7.1 Gib| 0.26| 1.87| 7.84| | | |
| 121 | |vcube 112 | 2.4GiB | 0.29 | 3.15 | 12.06 | | (a) | | 120 | |H48 h7 | 3.5 Gib| 0.30| 2.32| 11.74| | | |
| 122 | |H48 h6 k2 | 1.8GiB | 0.65 | 4.79 | 23.91 | | | | 121 | |vcube 112 | 2.4 Gib| 0.29| 3.13| 11.95| | (a) | |
| 122 | |H48 h6 | 1.8 Gib| 0.63| 4.67| 24.67| | | | ||
| 123 | 123 | ||
| 124 | Time per cube adjusted for tables size (in seconds \* GiB, lower is better). | 124 | Time per cube adjusted for table size (in seconds \* GiB, lower is better). |
| 125 | 125 | ||
| 126 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 126 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 127 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 127 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 128 | |H48 h11 k2|56.1GiB | 3.37 | 17.39 | 73.49 | 446.56 | 785.96 | | 128 | |vcube 212 |58.2 Gib| 2.03| 15.69| 60.25| 447.97| (a) | |
| 129 | |vcube 404 |31.8GiB | 3.80 | 12.08 | 59.78 | 539.96 | (a) | | 129 | |H48 h11 |56.5 Gib| 2.85| 14.76| 63.96| 429.69| 476.80| |
| 130 | |H48 h10 k2|28.1GiB | 2.81 | 13.21 | 56.20 | 380.47 | 617.08 | | 130 | |vcube 404 |31.8 Gib| 2.32| 9.50| 52.46| 514.50| (a) | |
| 131 | |vcube 308 |21.2GiB | 1.27 | 8.90 | 41.34 | 375.88 | (a) | | 131 | |H48 h10 |28.3 Gib| 2.22| 11.01| 53.47| 369.40| 469.92| |
| 132 | |H48 h9 k2 |14.1GiB | 1.97 | 11.70 | 53.86 | 366.32 | 446.69 | | 132 | |vcube 308 |21.2 Gib| 1.02| 7.52| 37.82| 352.36| (a) | |
| 133 | |vcube 208 | 7.3GiB | 1.24 | 10.88 | 42.92 | | (a) | | 133 | |H48 h9 |14.1 Gib| 1.64| 10.83| 48.37| 349.20| 414.10| |
| 134 | |H48 h8 k2 | 7.1GiB | 1.92 | 14.34 | 56.37 | | | | 134 | |vcube 208 | 7.3 Gib| 1.18| 10.69| 42.63| | (a) | |
| 135 | |H48 h7 k2 | 3.6GiB | 1.26 | 9.32 | 44.68 | | | | 135 | |H48 h8 | 7.1 Gib| 1.81| 13.20| 55.35| | | |
| 136 | |vcube 112 | 2.4GiB | 0.70 | 7.56 | 28.94 | | (a) | | 136 | |H48 h7 | 3.5 Gib| 1.07| 8.19| 41.47| | | |
| 137 | |H48 h6 k2 | 1.8GiB | 1.17 | 8.62 | 43.04 | | | | 137 | |vcube 112 | 2.4 Gib| 0.69| 7.59| 28.97| | (a) | |
| 138 | |H48 h6 | 1.8 Gib| 1.11| 8.25| 43.60| | | | ||
| 138 | 139 | ||
| 139 | <details><summary>Plots</summary> | ||
| 140 | <img src="img/17moves4threads.png"> | 140 | <img src="img/17moves4threads.png"> |
| 141 | <img src="img/18moves4threads.png"> | 141 | <img src="img/18moves4threads.png"> |
| 142 | <img src="img/19moves4threads.png"> | 142 | <img src="img/19moves4threads.png"> |
| 143 | <img src="img/20moves4threads.png"> | 143 | <img src="img/20moves4threads.png"> |
| 144 | </details> | ||
| 145 | 144 | ||
| 146 | (a) vcube cannot parallelize on a single scramble, the results for the | ||
| 147 | Superflip are going to be the same as in the single thread case. | ||
| 148 | 145 | ||
| 149 | ### Multithread (16 threads) | 146 | (a) vcube cannot parallelize on a single scramble, the results for the |
| 147 | superflip are going to be the same as in the single thread case. | ||
| 148 | </details> | ||
| 149 | <details><summary>Single solution, 16 threads</summary> | ||
| 150 | 150 | ||
| 151 | Time per cube (in seconds, lower is better). | 151 | Time per cube (in seconds, lower is better). |
| 152 | 152 | ||
| 153 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 153 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 154 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 154 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 155 | |H48 h11 k2|56.1GiB | 0.02 | 0.10 | 0.43 | 2.48 | 5.67 | | 155 | |vcube 212 |58.2 Gib| 0.02| 0.13| 0.45| 2.84| (a) | |
| 156 | |vcube 404 |31.8GiB | 0.03 | 0.16 | 0.67 | 6.36 | (a) | | 156 | |H48 h11 |56.5 Gib| 0.02| 0.10| 0.37| 2.31| 3.47| |
| 157 | |H48 h10 k2|28.1GiB | 0.03 | 0.16 | 0.74 | 4.43 | 8.81 | | 157 | |vcube 404 |31.8 Gib| 0.04| 0.14| 0.65| 6.08| (a) | |
| 158 | |vcube 308 |21.2GiB | 0.04 | 0.22 | 0.89 | 9.53 | (a) | | 158 | |H48 h10 |28.3 Gib| 0.03| 0.14| 0.62| 4.24| 7.07| |
| 159 | |H48 h9 k2 |14.1GiB | 0.04 | 0.26 | 1.18 | 8.31 | 13.20 | | 159 | |vcube 308 |21.2 Gib| 0.03| 0.19| 0.78| 6.67| (a) | |
| 160 | |vcube 208 | 7.3GiB | 0.08 | 0.80 | 2.38 | | (a) | | 160 | |H48 h9 |14.1 Gib| 0.04| 0.26| 1.15| 8.15| 12.18| |
| 161 | |H48 h8 k2 | 7.1GiB | 0.08 | 0.60 | 2.48 | | | | 161 | |vcube 208 | 7.3 Gib| 0.08| 0.79| 2.43| | (a) | |
| 162 | |H48 h7 k2 | 3.6GiB | 0.11 | 0.81 | 3.91 | | | | 162 | |H48 h8 | 7.1 Gib| 0.09| 0.64| 2.50| | | |
| 163 | |vcube 112 | 2.4GiB | 0.15 | 1.66 | 5.18 | | (a) | | 163 | |H48 h7 | 3.5 Gib| 0.11| 0.79| 3.88| | | |
| 164 | |H48 h6 k2 | 1.8GiB | 0.21 | 1.53 | 7.82 | | | | 164 | |vcube 112 | 2.4 Gib| 0.15| 1.63| 5.10| | (a) | |
| 165 | |H48 h6 | 1.8 Gib| 0.21| 1.48| 7.70| | | | ||
| 165 | 166 | ||
| 166 | Time per cube adjusted for tables size (in seconds \* GiB, lower is better). | 167 | Time per cube adjusted for table size (in seconds \* GiB, lower is better). |
| 167 | 168 | ||
| 168 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 169 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 169 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 170 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 170 | |H48 h11 k2|56.1GiB | 1.12 | 5.61 | 24.12 | 139.13 | 318.09 | | 171 | |vcube 212 |58.2 Gib| 0.95| 7.83| 26.04| 165.03| (a) | |
| 171 | |vcube 404 |31.8GiB | 1.08 | 5.09 | 21.31 | 202.25 | (a) | | 172 | |H48 h11 |56.5 Gib| 1.20| 5.39| 21.09| 130.46| 195.92| |
| 172 | |H48 h10 k2|28.1GiB | 0.84 | 4.50 | 20.79 | 124.48 | 247.56 | | 173 | |vcube 404 |31.8 Gib| 1.21| 4.60| 20.76| 193.43| (a) | |
| 173 | |vcube 308 |21.2GiB | 0.85 | 4.66 | 18.87 | 202.04 | (a) | | 174 | |H48 h10 |28.3 Gib| 0.87| 3.99| 17.52| 119.70| 199.79| |
| 174 | |H48 h9 k2 |14.1GiB | 0.56 | 3.67 | 16.64 | 117.17 | 186.12 | | 175 | |vcube 308 |21.2 Gib| 0.67| 4.01| 16.48| 141.49| (a) | |
| 175 | |vcube 208 | 7.3GiB | 0.58 | 5.84 | 17.37 | | (a) | | 176 | |H48 h9 |14.1 Gib| 0.61| 3.71| 16.23| 115.18| 172.04| |
| 176 | |H48 h8 k2 | 7.1GiB | 0.57 | 4.26 | 17.60 | | | | 177 | |vcube 208 | 7.3 Gib| 0.56| 5.78| 17.68| | (a) | |
| 177 | |H48 h7 k2 | 3.6GiB | 0.40 | 2.92 | 14.07 | | | | 178 | |H48 h8 | 7.1 Gib| 0.65| 4.50| 17.69| | | |
| 178 | |vcube 112 | 2.4GiB | 0.36 | 3.98 | 12.43 | | (a) | | 179 | |H48 h7 | 3.5 Gib| 0.39| 2.81| 13.73| | | |
| 179 | |H48 h6 k2 | 1.8GiB | 0.38 | 2.75 | 14.08 | | | | 180 | |vcube 112 | 2.4 Gib| 0.35| 3.95| 12.37| | (a) | |
| 181 | |H48 h6 | 1.8 Gib| 0.37| 2.62| 13.61| | | | ||
| 180 | 182 | ||
| 181 | <details><summary>Plots</summary> | ||
| 182 | <img src="img/17moves16threads.png"> | 183 | <img src="img/17moves16threads.png"> |
| 183 | <img src="img/18moves16threads.png"> | 184 | <img src="img/18moves16threads.png"> |
| 184 | <img src="img/19moves16threads.png"> | 185 | <img src="img/19moves16threads.png"> |
| 185 | <img src="img/20moves16threads.png"> | 186 | <img src="img/20moves16threads.png"> |
| 186 | </details> | ||
| 187 | 187 | ||
| 188 | (a) vcube cannot parallelize on a single scramble, the results for the | ||
| 189 | Superflip are going to be the same as in the single thread case. | ||
| 190 | |||
| 191 | ## All optimal solutions | ||
| 192 | 188 | ||
| 193 | Average time for finding all optimal solutions. | 189 | (a) vcube cannot parallelize on a single scramble, the results for the |
| 190 | superflip are going to be the same as in the single thread case. | ||
| 191 | </details> | ||
| 192 | <details><summary>All solutions, 16 threads</summary> | ||
| 194 | 193 | ||
| 195 | ### Multithread (16 threads) | 194 | *Note: vcube does not have an option for finding multiple solutions.* |
| 196 | 195 | ||
| 197 | Time per cube (in seconds, lower is better). | 196 | Time per cube (in seconds, lower is better). |
| 198 | 197 | ||
| 199 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 198 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 200 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 199 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 201 | |H48 h11 k2|56.1GiB | 0.05 | 0.50 | 4.24 | 19.75 | 52.99 | | 200 | |H48 h11 |56.5 Gib| 0.05| 0.46| 3.98| 33.27| 31.83| |
| 202 | |H48 h10 k2|28.1GiB | 0.08 | 0.88 | 6.94 | | | | 201 | |H48 h10 |28.3 Gib| 0.08| 0.78| 7.00| 59.77| 62.45| |
| 203 | |H48 h9 k2 |14.1GiB | 0.13 | 1.39 | 13.50 | | | | 202 | |H48 h9 |14.1 Gib| 0.13| 1.39| 13.35| | | |
| 204 | |H48 h8 k2 | 7.1GiB | 0.25 | 2.85 | | | | | 203 | |H48 h8 | 7.1 Gib| 0.27| 3.00| 29.13| | | |
| 205 | |H48 h7 k2 | 3.6GiB | 0.36 | 4.24 | | | | | 204 | |H48 h7 | 3.5 Gib| 0.36| 4.19| 46.77| | | |
| 206 | |H48 h6 k2 | 1.8GiB | 0.69 | 8.20 | | | | | 205 | |H48 h6 | 1.8 Gib| 0.69| 8.32| 91.89| | | |
| 207 | 206 | ||
| 208 | Time per cube adjusted for tables size (in seconds \* GiB, lower is better). | 207 | Time per cube adjusted for table size (in seconds \* GiB, lower is better). |
| 209 | 208 | ||
| 210 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| | 209 | | Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| |
| 211 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| | 210 | |:---------|:-------|-------:|-------:|-------:|-------:|--------:| |
| 212 | |H48 h11 k2|56.1GiB | 2.81 | 28.05 | 237.86 |1107.98 | 2972.74 | | 211 | |H48 h11 |56.5 Gib| 2.84| 26.16| 224.81| 1879.97| 1798.27| |
| 213 | |H48 h10 k2|28.1GiB | 2.25 | 24.73 | 195.01 | | | | 212 | |H48 h10 |28.3 Gib| 2.19| 22.11| 197.79| 1688.62| 1764.41| |
| 214 | |H48 h9 k2 |14.1GiB | 1.83 | 19.60 | 190.35 | | | | 213 | |H48 h9 |14.1 Gib| 1.80| 19.59| 188.61| | | |
| 215 | |H48 h8 k2 | 7.1GiB | 1.77 | 20.24 | | | | | 214 | |H48 h8 | 7.1 Gib| 1.89| 21.16| 205.79| | | |
| 216 | |H48 h7 k2 | 3.6GiB | 1.30 | 15.26 | | | | | 215 | |H48 h7 | 3.5 Gib| 1.28| 14.79| 165.25| | | |
| 217 | |H48 h6 k2 | 1.8GiB | 1.24 | 14.76 | | | | | 216 | |H48 h6 | 1.8 Gib| 1.23| 14.70| 162.42| | | |
| 217 | |||
| 218 | </details> | ||
| 218 | 219 | ||
| 219 | ## Comments on the results | 220 | ## Comments on the results |
| 220 | 221 | ||
| @@ -226,20 +227,9 @@ Time per cube adjusted for tables size (in seconds \* GiB, lower is better). | |||
| 226 | 227 | ||
| 227 | ## Other notes | 228 | ## Other notes |
| 228 | 229 | ||
| 229 | * Missing values in the table mean that the test is very slow and I did | 230 | * To repeat the benchmarks, use `./benchmarks/run-h48-benchmarks.sh`. |
| 230 | not want to wait for it to finish. I may add these values in the future. | ||
| 231 | * All the measurements above exclude the time needed to load the pruning | 231 | * All the measurements above exclude the time needed to load the pruning |
| 232 | tables into memory, which can be quite significant for large tables. To | 232 | tables into memory, which can be quite significant for large tables. |
| 233 | repeat these measurements, one can use the tool `301_solve_file`. For | ||
| 234 | example: | ||
| 235 | |||
| 236 | ``` | ||
| 237 | ./build.sh tool solve_file h48h7k2 ./benchmarks/scrambles/scrambles-16.txt | ||
| 238 | ``` | ||
| 239 | |||
| 240 | To find all solutions, add something like `99999 0` at the end of the | ||
| 241 | command. This will tell the tool to find up to `99999` solutions that | ||
| 242 | are at most `0` moves longer than optimal. | ||
| 243 | * The measurements also excluded the one-off computation of the pruning | 233 | * The measurements also excluded the one-off computation of the pruning |
| 244 | tables which, for reasons related to the cube coordinates used, is | 234 | tables which, for reasons related to the cube coordinates used, is |
| 245 | significantly slower for H48 compared to vcube. | 235 | significantly slower for H48 compared to vcube. |
| @@ -254,3 +244,6 @@ Time per cube adjusted for tables size (in seconds \* GiB, lower is better). | |||
| 254 | * vcube only supports x86 processors (Intel, AMD), while H48 runs on any | 244 | * vcube only supports x86 processors (Intel, AMD), while H48 runs on any |
| 255 | architecture, including e.g. ARM (Macbook M series, android phones) | 245 | architecture, including e.g. ARM (Macbook M series, android phones) |
| 256 | and can be compiled to WebAssembly as well. | 246 | and can be compiled to WebAssembly as well. |
| 247 | * For H48, both GCC and Clang have been tried, with the same options; | ||
| 248 | the resulting executable was about 10% faster with GCC compared to Clang. | ||
| 249 | vcube only supports compiling with Clang. | ||
diff --git a/benchmarks/img/17moves16threads.png b/benchmarks/img/17moves16threads.png index 84a7cfb..59ca195 100644 --- a/benchmarks/img/17moves16threads.png +++ b/benchmarks/img/17moves16threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/17moves1thread.png b/benchmarks/img/17moves1thread.png index 09a13e5..fe91ca8 100644 --- a/benchmarks/img/17moves1thread.png +++ b/benchmarks/img/17moves1thread.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/17moves4threads.png b/benchmarks/img/17moves4threads.png index 8507d67..d6bcd16 100644 --- a/benchmarks/img/17moves4threads.png +++ b/benchmarks/img/17moves4threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/18moves16threads.png b/benchmarks/img/18moves16threads.png index f16627d..aa1bc3c 100644 --- a/benchmarks/img/18moves16threads.png +++ b/benchmarks/img/18moves16threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/18moves1thread.png b/benchmarks/img/18moves1thread.png index ffde1f6..5f9d7fd 100644 --- a/benchmarks/img/18moves1thread.png +++ b/benchmarks/img/18moves1thread.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/18moves4threads.png b/benchmarks/img/18moves4threads.png index 62b82ed..ce28518 100644 --- a/benchmarks/img/18moves4threads.png +++ b/benchmarks/img/18moves4threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/19moves16threads.png b/benchmarks/img/19moves16threads.png index 3d4bb43..51a6368 100644 --- a/benchmarks/img/19moves16threads.png +++ b/benchmarks/img/19moves16threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/19moves1thread.png b/benchmarks/img/19moves1thread.png index 5e668ad..a843fef 100644 --- a/benchmarks/img/19moves1thread.png +++ b/benchmarks/img/19moves1thread.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/19moves4threads.png b/benchmarks/img/19moves4threads.png index 7014c24..e1c79e4 100644 --- a/benchmarks/img/19moves4threads.png +++ b/benchmarks/img/19moves4threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/20moves16threads.png b/benchmarks/img/20moves16threads.png index cf197a6..7c83689 100644 --- a/benchmarks/img/20moves16threads.png +++ b/benchmarks/img/20moves16threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/20moves1thread.png b/benchmarks/img/20moves1thread.png index 7084134..4b8b613 100644 --- a/benchmarks/img/20moves1thread.png +++ b/benchmarks/img/20moves1thread.png | |||
| Binary files differ | |||
diff --git a/benchmarks/img/20moves4threads.png b/benchmarks/img/20moves4threads.png index 7fb45cd..f61e1ab 100644 --- a/benchmarks/img/20moves4threads.png +++ b/benchmarks/img/20moves4threads.png | |||
| Binary files differ | |||
diff --git a/benchmarks/plot-benchmarks.py b/benchmarks/plot-benchmarks.py new file mode 100644 index 0000000..b42c4ba --- /dev/null +++ b/benchmarks/plot-benchmarks.py | |||
| @@ -0,0 +1,161 @@ | |||
| 1 | import matplotlib.pyplot as plt | ||
| 2 | import results_h48 | ||
| 3 | import results_vcube | ||
| 4 | |||
| 5 | # Table sizes in bytes | ||
| 6 | |||
| 7 | sizes_h48 = { | ||
| 8 | 6: 1897951528, | ||
| 9 | 7: 3793842344, | ||
| 10 | 8: 7585624040, | ||
| 11 | 9: 15169187432, | ||
| 12 | 10: 30336314216, | ||
| 13 | 11: 60670567784, | ||
| 14 | } | ||
| 15 | |||
| 16 | sizes_vcube = { | ||
| 17 | 112: 2603089920, | ||
| 18 | 208: 7809269760, | ||
| 19 | 308: 22777036800, | ||
| 20 | 404: 34165555200, | ||
| 21 | 212: 62474158080, | ||
| 22 | } | ||
| 23 | |||
| 24 | # Printing tables in markdown format | ||
| 25 | |||
| 26 | def print_row(solver_name, solver_size, dict, mul_by_size, superflip_star): | ||
| 27 | if dict is None: | ||
| 28 | return | ||
| 29 | solver_gib = solver_size / (2**30) | ||
| 30 | m = solver_gib if mul_by_size else 1 | ||
| 31 | s = " (a) " if superflip_star else " " | ||
| 32 | cols = [f"{solver_name: <10}", f"{solver_gib:>4.1f} Gib"] + [ | ||
| 33 | f"{dict[key]*m/25:>8.2f}" if key in dict else " " | ||
| 34 | for key in [17, 18, 19, 20] | ||
| 35 | ] + [ | ||
| 36 | f"{dict["superflip"]*m:>9.2f}" if "superflip" in dict else s | ||
| 37 | ] | ||
| 38 | sep = "|" | ||
| 39 | print(sep + sep.join(cols) + sep) | ||
| 40 | |||
| 41 | def print_table(h48, vcube, ms, st): | ||
| 42 | vcube = vcube or {} | ||
| 43 | print("| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip|") | ||
| 44 | print("|:---------|:-------|-------:|-------:|-------:|-------:|--------:|") | ||
| 45 | print_row("vcube 212", sizes_vcube[212], vcube.get(212), ms, not st) | ||
| 46 | print_row("H48 h11", sizes_h48[11], h48[11], ms, False) | ||
| 47 | print_row("vcube 404", sizes_vcube[404], vcube.get(404), ms, not st) | ||
| 48 | print_row("H48 h10", sizes_h48[10], h48[10], ms, False) | ||
| 49 | print_row("vcube 308", sizes_vcube[308], vcube.get(308), ms, not st) | ||
| 50 | print_row("H48 h9", sizes_h48[9], h48[9], ms, False) | ||
| 51 | print_row("vcube 208", sizes_vcube[208], vcube.get(208), ms, not st) | ||
| 52 | print_row("H48 h8", sizes_h48[8], h48[8], ms, False) | ||
| 53 | print_row("H48 h7", sizes_h48[7], h48[7], ms, False) | ||
| 54 | print_row("vcube 112", sizes_vcube[112], vcube.get(112), ms, not st) | ||
| 55 | print_row("H48 h6", sizes_h48[6], h48[6], ms, False) | ||
| 56 | |||
| 57 | print("<details><summary>Single solution, single thread</summary>") | ||
| 58 | print() | ||
| 59 | print("Time per cube (in seconds, lower is better).") | ||
| 60 | print() | ||
| 61 | print_table(results_h48.h48_single_thread, results_vcube.vcube_single_thread, False, True) | ||
| 62 | print() | ||
| 63 | print("Time per cube adjusted for table size (in seconds \\* GiB, lower is better).") | ||
| 64 | print() | ||
| 65 | print_table(results_h48.h48_single_thread, results_vcube.vcube_single_thread, True, True) | ||
| 66 | print() | ||
| 67 | print( | ||
| 68 | '<img src="img/17moves1thread.png">\n' | ||
| 69 | '<img src="img/18moves1thread.png">\n' | ||
| 70 | '<img src="img/19moves1thread.png">\n' | ||
| 71 | '<img src="img/20moves1thread.png">\n' | ||
| 72 | ) | ||
| 73 | print("</details>") | ||
| 74 | |||
| 75 | print("<details><summary>Single solution, 4 threads</summary>") | ||
| 76 | print() | ||
| 77 | print("Time per cube (in seconds, lower is better).") | ||
| 78 | print() | ||
| 79 | print_table(results_h48.h48_4_threads, results_vcube.vcube_4_threads, False, False) | ||
| 80 | print() | ||
| 81 | print("Time per cube adjusted for table size (in seconds \\* GiB, lower is better).") | ||
| 82 | print() | ||
| 83 | print_table(results_h48.h48_4_threads, results_vcube.vcube_4_threads, True, False) | ||
| 84 | print() | ||
| 85 | print( | ||
| 86 | '<img src="img/17moves4threads.png">\n' | ||
| 87 | '<img src="img/18moves4threads.png">\n' | ||
| 88 | '<img src="img/19moves4threads.png">\n' | ||
| 89 | '<img src="img/20moves4threads.png">\n' | ||
| 90 | ) | ||
| 91 | print() | ||
| 92 | print("(a) vcube cannot parallelize on a single scramble, the results for the") | ||
| 93 | print("superflip are going to be the same as in the single thread case.") | ||
| 94 | print("</details>") | ||
| 95 | |||
| 96 | print("<details><summary>Single solution, 16 threads</summary>") | ||
| 97 | print() | ||
| 98 | print("Time per cube (in seconds, lower is better).") | ||
| 99 | print() | ||
| 100 | print_table(results_h48.h48_16_threads, results_vcube.vcube_16_threads, False, False) | ||
| 101 | print() | ||
| 102 | print("Time per cube adjusted for table size (in seconds \\* GiB, lower is better).") | ||
| 103 | print() | ||
| 104 | print_table(results_h48.h48_16_threads, results_vcube.vcube_16_threads, True, False) | ||
| 105 | print() | ||
| 106 | print( | ||
| 107 | '<img src="img/17moves16threads.png">\n' | ||
| 108 | '<img src="img/18moves16threads.png">\n' | ||
| 109 | '<img src="img/19moves16threads.png">\n' | ||
| 110 | '<img src="img/20moves16threads.png">\n' | ||
| 111 | ) | ||
| 112 | print() | ||
| 113 | print("(a) vcube cannot parallelize on a single scramble, the results for the") | ||
| 114 | print("superflip are going to be the same as in the single thread case.") | ||
| 115 | print("</details>") | ||
| 116 | |||
| 117 | print("<details><summary>All solutions, 16 threads</summary>") | ||
| 118 | print() | ||
| 119 | print("*Note: vcube does not have an option for finding multiple solutions.*") | ||
| 120 | print() | ||
| 121 | print("Time per cube (in seconds, lower is better).") | ||
| 122 | print() | ||
| 123 | print_table(results_h48.h48_all_solutions, None, False, False) | ||
| 124 | print() | ||
| 125 | print("Time per cube adjusted for table size (in seconds \\* GiB, lower is better).") | ||
| 126 | print() | ||
| 127 | print_table(results_h48.h48_all_solutions, None, True, False) | ||
| 128 | print() | ||
| 129 | print("</details>") | ||
| 130 | |||
| 131 | # Plotting | ||
| 132 | |||
| 133 | def plot(title, hd, vd, key): | ||
| 134 | d = 1 if key == "superflip" else 25 | ||
| 135 | h48x = [sizes_h48[m]/(2**30) for m in hd.keys() if key in hd[m]] | ||
| 136 | vcubex = [sizes_vcube[m]/(2**30) for m in vd.keys() if key in vd[m]] | ||
| 137 | h48y = [d[key] for _, d in hd.items() if key in d] | ||
| 138 | vcubey = [d[key] for _, d in vd.items() if key in d] | ||
| 139 | |||
| 140 | plt.clf() | ||
| 141 | plt.title(title) | ||
| 142 | plt.xlabel("Table size (GiB)") | ||
| 143 | plt.ylabel("Time to solve (s / cube)") | ||
| 144 | plt.plot(h48x, h48y, "o--", label = "H48") | ||
| 145 | plt.plot(vcubex, vcubey, "o--", label = "vcube") | ||
| 146 | plt.legend(loc = "right") | ||
| 147 | filename = title.replace(" ", "").replace(",", "") + ".png" | ||
| 148 | plt.savefig("benchmarks/img/" + filename, dpi=300) | ||
| 149 | #plt.show() | ||
| 150 | |||
| 151 | rh, rv = results_h48.h48_single_thread, results_vcube.vcube_single_thread | ||
| 152 | for m in [17, 18, 19, 20]: | ||
| 153 | plot(f"{m} moves 1 thread", rh, rv, m) | ||
| 154 | |||
| 155 | rh, rv = results_h48.h48_4_threads, results_vcube.vcube_4_threads | ||
| 156 | for m in [17, 18, 19, 20]: | ||
| 157 | plot(f"{m} moves 4 threads", rh, rv, m) | ||
| 158 | |||
| 159 | rh, rv = results_h48.h48_16_threads, results_vcube.vcube_16_threads | ||
| 160 | for m in [17, 18, 19, 20]: | ||
| 161 | plot(f"{m} moves 16 threads", rh, rv, m) | ||
diff --git a/benchmarks/plot.py b/benchmarks/plot.py deleted file mode 100644 index d07d11d..0000000 --- a/benchmarks/plot.py +++ /dev/null | |||
| @@ -1,85 +0,0 @@ | |||
| 1 | import matplotlib.pyplot as plt | ||
| 2 | |||
| 3 | h48 = [ | ||
| 4 | ("H48 h11 k2", 56.1, | ||
| 5 | [0.23, 1.15, 5.08, 31.30], | ||
| 6 | [0.06, 0.31, 1.31, 7.96], | ||
| 7 | [0.02, 0.1, 0.43, 2.48] | ||
| 8 | ), | ||
| 9 | ("H48 h10 k2", 28.1, | ||
| 10 | [0.34, 1.80, 7.77], | ||
| 11 | [0.1, 0.47, 2.00, 13.54], | ||
| 12 | [0.03, 0.16, 0.74, 4.43] | ||
| 13 | ), | ||
| 14 | ("H48 h9 k2", 14.1, | ||
| 15 | [0.42, 2.84, 12.86], | ||
| 16 | [0.14, 0.83, 3.82, 25.98], | ||
| 17 | [0.04, 0.26, 1.18, 8.31] | ||
| 18 | ), | ||
| 19 | ("H48 h8 k2", 7.1, | ||
| 20 | [0.86, 6.66, 27.4], | ||
| 21 | [0.27, 2.02, 7.94], | ||
| 22 | [0.08, 0.6, 2.48] | ||
| 23 | ), | ||
| 24 | ("H48 h7 k2", 3.6, | ||
| 25 | [1.47, 8.9, 42.46], | ||
| 26 | [0.35, 2.59, 12.41], | ||
| 27 | [0.11, 0.81, 3.91] | ||
| 28 | ), | ||
| 29 | ("H48 h6 k2", 1.8, | ||
| 30 | [2.28, 16.89], | ||
| 31 | [0.65, 4.79, 23.91], | ||
| 32 | [0.21, 1.53, 7.82] | ||
| 33 | ) | ||
| 34 | ] | ||
| 35 | |||
| 36 | vcube = [ | ||
| 37 | ("vcube 404", 31.8, | ||
| 38 | [0.3, 1.25, 6.87, 57.49], | ||
| 39 | [0.1, 0.38, 1.88, 16.98], | ||
| 40 | [0.03, 0.16, 0.67, 6.36] | ||
| 41 | ), | ||
| 42 | ("vcube 308", 21.2, | ||
| 43 | [0.2, 1.11, 6.92], | ||
| 44 | [0.06, 0.42, 1.95, 17.73], | ||
| 45 | [0.04, 0.26, 1.18, 9.53] | ||
| 46 | ), | ||
| 47 | ("vcube 208", 7.3, | ||
| 48 | [0.57, 4.41, 20.75], | ||
| 49 | [0.17, 1.49, 5.88], | ||
| 50 | [0.08, 0.8, 2.38] | ||
| 51 | ), | ||
| 52 | ("vcube 112", 2.4, | ||
| 53 | [1.01, 9.39], | ||
| 54 | [0.29, 3.15, 12.06], | ||
| 55 | [0.15, 1.66, 5.18] | ||
| 56 | ) | ||
| 57 | ] | ||
| 58 | |||
| 59 | h48_x = [i[1] for i in h48] | ||
| 60 | vcube_x = [i[1] for i in vcube] | ||
| 61 | |||
| 62 | def getarr(m, t, a): | ||
| 63 | return [i[2+t][m-17] for i in a if len(i[2+t]) > m-17] | ||
| 64 | |||
| 65 | def gethv(m, t): | ||
| 66 | return getarr(m, t, h48), getarr(m, t, vcube) | ||
| 67 | |||
| 68 | def showplt(plt, title, h48y, vcubey): | ||
| 69 | plt.clf() | ||
| 70 | plt.title(title) | ||
| 71 | plt.xlabel("Table size (GiB)") | ||
| 72 | plt.ylabel("Time to solve (s / cube)") | ||
| 73 | plt.plot(h48_x[:len(h48y)], h48y, "o--", label = "H48") | ||
| 74 | plt.plot(vcube_x[:len(vcubey)], vcubey, "o--", label = "vcube") | ||
| 75 | plt.legend(loc = "right") | ||
| 76 | filename = title.replace(" ", "").replace(",", "") + ".png" | ||
| 77 | plt.savefig("benchmarks/img/" + filename, dpi=300) | ||
| 78 | #plt.show() | ||
| 79 | |||
| 80 | for i in range(17, 21): | ||
| 81 | for j in range(0, 3): | ||
| 82 | title = "{} moves, {} thread{}".format( | ||
| 83 | i, 4**j, "s" if j > 0 else "") | ||
| 84 | h, v = gethv(i, j) | ||
| 85 | showplt(plt, title, h, v) | ||
diff --git a/benchmarks/results_h48.py b/benchmarks/results_h48.py new file mode 100644 index 0000000..db8a3a5 --- /dev/null +++ b/benchmarks/results_h48.py | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | h48_single_thread = { | ||
| 2 | 6: {17: 52.6781, 18: 398.7213, 19: 2049.9640}, | ||
| 3 | 7: {17: 25.6133, 18: 205.2683, 19: 1031.1970}, | ||
| 4 | 8: {17: 21.8331, 18: 165.3185, 19: 664.2050}, | ||
| 5 | 9: {17: 9.4036, 18: 66.6141, 19: 305.3164}, | ||
| 6 | 10: {17: 6.8148, 18: 36.6565, 19: 168.7843, 20: 1166.2200, "superflip": 60.5523}, | ||
| 7 | 11: {17: 3.8640, 18: 22.8206, 19: 101.9301, 20: 670.2421, "superflip": 26.9025}, | ||
| 8 | } | ||
| 9 | |||
| 10 | h48_4_threads = { | ||
| 11 | 6: {17: 15.6631, 18: 116.6983, 19: 616.6293}, | ||
| 12 | 7: {17: 7.5627, 18: 57.9755, 19: 293.4441}, | ||
| 13 | 8: {17: 6.3879, 18: 46.6986, 19: 195.8814}, | ||
| 14 | 9: {17: 2.9011, 18: 19.1689, 19: 85.5939, 20: 617.9417, "superflip": 29.3115}, | ||
| 15 | 10: {17: 1.9637, 18: 9.7415, 19: 47.3158, 20: 326.8692, "superflip": 16.6325}, | ||
| 16 | 11: {17: 1.2589, 18: 6.5298, 19: 28.2996, 20: 190.1169, "superflip": 8.4383}, | ||
| 17 | } | ||
| 18 | |||
| 19 | h48_16_threads = { | ||
| 20 | 6: {17: 5.2001, 18: 37.0525, 19: 192.4323}, | ||
| 21 | 7: {17: 2.7835, 18: 19.8514, 19: 97.1157}, | ||
| 22 | 8: {17: 2.3060, 18: 15.9383, 19: 62.6004}, | ||
| 23 | 9: {17: 1.0799, 18: 6.5733, 19: 28.7205, 20: 203.8189, "superflip": 12.1779}, | ||
| 24 | 10: {17: 0.7715, 18: 3.5307, 19: 15.4995, 20: 105.9181, "superflip": 7.0716}, | ||
| 25 | 11: {17: 0.5313, 18: 2.3848, 19: 9.3324, 20: 57.7204, "superflip": 3.4673}, | ||
| 26 | } | ||
| 27 | |||
| 28 | h48_all_solutions = { | ||
| 29 | 6: {17: 17.3451, 18: 207.8877, 19: 2297.1491}, | ||
| 30 | 7: {17: 9.0715, 18: 104.6421, 19: 1169.2355}, | ||
| 31 | 8: {17: 6.6934, 18: 74.8913, 19: 728.2341}, | ||
| 32 | 9: {17: 3.1790, 18: 34.6734, 19: 333.7746}, | ||
| 33 | 10: {17: 1.9342, 18: 19.5612, 19: 175.0206, 20: 1494.2053, "superflip": 62.4507}, | ||
| 34 | 11: {17: 1.2574, 18: 11.5760, 19: 99.4671, 20: 831.7873, "superflip": 31.8256}, | ||
| 35 | } | ||
| 36 | |||
diff --git a/benchmarks/results_h48_clang.py b/benchmarks/results_h48_clang.py new file mode 100644 index 0000000..3fbc553 --- /dev/null +++ b/benchmarks/results_h48_clang.py | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | h48_single_thread = { | ||
| 2 | 6: {17: 57.7296, 18: 436.0622, 19: 2240.5087}, | ||
| 3 | 7: {17: 27.8748, 18: 222.3812, 19: 1114.8537}, | ||
| 4 | 8: {17: 23.6884, 18: 181.7169, 19: 722.1819}, | ||
| 5 | 9: {17: 10.1115, 18: 72.6935, 19: 328.5458}, | ||
| 6 | 10: {17: 7.0337, 18: 37.5239, 19: 179.3647, 20: 1267.3059, "superflip": 71.8359}, | ||
| 7 | 11: {17: 3.9693, 18: 24.2573, 19: 106.8995, 20: 688.5594, "superflip": 32.0008}, | ||
| 8 | } | ||
| 9 | |||
| 10 | h48_4_threads = { | ||
| 11 | 6: {17: 16.7353, 18: 129.9696, 19: 663.2930}, | ||
| 12 | 7: {17: 8.4315, 18: 65.4883, 19: 348.3440}, | ||
| 13 | 8: {17: 6.9127, 18: 51.8117, 19: 208.8438}, | ||
| 14 | 9: {17: 3.0985, 18: 21.2920, 19: 95.3467, 20: 711.2927, "superflip": 35.3772}, | ||
| 15 | 10: {17: 2.0592, 18: 10.6636, 19: 49.9811, 20: 388.0203, "superflip": 18.6665}, | ||
| 16 | 11: {17: 1.3065, 18: 6.9261, 19: 29.7725, 20: 197.9893, "superflip": 9.1158}, | ||
| 17 | } | ||
| 18 | |||
| 19 | h48_16_threads = { | ||
| 20 | 6: {17: 5.6335, 18: 39.2955, 19: 207.5730}, | ||
| 21 | 7: {17: 2.9328, 18: 21.0462, 19: 104.7917}, | ||
| 22 | 8: {17: 2.4790, 18: 17.0854, 19: 67.6617}, | ||
| 23 | 9: {17: 1.1561, 18: 7.0899, 19: 30.5952, 20: 220.9804, "superflip": 13.5599}, | ||
| 24 | 10: {17: 0.8002, 18: 3.6835, 19: 16.4910, 20: 114.4733, "superflip": 7.6359}, | ||
| 25 | 11: {17: 0.5475, 18: 2.4681, 19: 9.8224, 20: 60.7893, "superflip": 3.8795}, | ||
| 26 | } | ||
| 27 | |||
| 28 | h48_all_solutions = { | ||
| 29 | 6: {17: 18.3998, 18: 223.3861, 19: 2459.7513}, | ||
| 30 | 7: {17: 9.6264, 18: 114.2752, 19: 1242.9741}, | ||
| 31 | 8: {17: 7.1793, 18: 81.2145, 19: 783.8113}, | ||
| 32 | 9: {17: 3.3487, 18: 36.9225, 19: 363.1912}, | ||
| 33 | 10: {17: 2.0002, 18: 20.4565, 19: 187.5199, 20: 1570.6074, "superflip": 68.2016}, | ||
| 34 | 11: {17: 1.2833, 18: 12.3616, 19: 105.6184, 20: 872.5879, "superflip": 34.1071}, | ||
| 35 | } | ||
| 36 | |||
diff --git a/benchmarks/results_vcube.py b/benchmarks/results_vcube.py new file mode 100644 index 0000000..7b561aa --- /dev/null +++ b/benchmarks/results_vcube.py | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | vcube_single_thread = { | ||
| 2 | 112: {17: 24.021138887, 18: 232.290148751, 19: 1012.971335021}, | ||
| 3 | 208: {17: 14.015260764, 18: 109.093653866, 19: 514.498894356}, | ||
| 4 | 308: {17: 4.140126887, 18: 25.580857443, 19: 154.973883402, 20: 1467.580449672, "superflip": 604.350116961}, | ||
| 5 | 404: {17: 5.817552240, 18: 31.011977639, 19: 152.427892670, 20: 1483.336504130, "superflip": 268.261983286}, | ||
| 6 | 212: {17: 2.762842065, 18: 18.817855233, 19: 85.668495927, 20: 682.075876988, "superflip": 19.296406826}, | ||
| 7 | } | ||
| 8 | |||
| 9 | vcube_4_threads = { | ||
| 10 | 112: {17: 7.127616290, 18: 78.318152570, 19: 298.717794059}, | ||
| 11 | 208: {17: 4.064627893, 18: 36.750120494, 19: 146.530835915}, | ||
| 12 | 308: {17: 1.203668154, 18: 8.861778047, 19: 44.574642874, 20: 415.264434322}, | ||
| 13 | 404: {17: 1.824527079, 18: 7.464447783, 19: 41.220812956, 20: 404.238440653}, | ||
| 14 | 212: {17: 0.873352248, 18: 6.742663807, 19: 25.886399367, 20: 192.481134988}, | ||
| 15 | } | ||
| 16 | |||
| 17 | vcube_16_threads = { | ||
| 18 | 112: {17: 3.634119823, 18: 40.734799597, 19: 127.553167079}, | ||
| 19 | 208: {17: 1.914579912, 18: 19.860062709, 19: 60.773634937}, | ||
| 20 | 308: {17: 0.787410653, 18: 4.727771575, 19: 19.423988316, 20: 166.749710026}, | ||
| 21 | 404: {17: 0.948257897, 18: 3.616245643, 19: 16.311276268, 20: 151.974609036}, | ||
| 22 | 212: {17: 0.409647385, 18: 3.365509654, 19: 11.187815758, 20: 70.908266374}, | ||
| 23 | } | ||
| 24 | |||
diff --git a/benchmarks/run-h48-benchmarks.sh b/benchmarks/run-h48-benchmarks.sh new file mode 100755 index 0000000..4b4d174 --- /dev/null +++ b/benchmarks/run-h48-benchmarks.sh | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # This script must be run from the main repository folder. | ||
| 4 | |||
| 5 | scr="./benchmarks/scrambles" | ||
| 6 | out="./benchmarks/results_h48.py" | ||
| 7 | |||
| 8 | get_solve_time() { | ||
| 9 | THREADS="$1" ./build.sh tool solve_file "$2" "$3" "$4" 0 | \ | ||
| 10 | tail -n 1 | sed 's/Total time: //; s/s$//' | ||
| 11 | } | ||
| 12 | |||
| 13 | do_all() { | ||
| 14 | low=$1 | ||
| 15 | cutoff=$2 | ||
| 16 | high=$3 | ||
| 17 | t=$4 | ||
| 18 | n=$5 | ||
| 19 | name=$6 | ||
| 20 | |||
| 21 | printf '%s = {\n' "$name" >> "$out" | ||
| 22 | for i in $(seq "$low" "$high"); do | ||
| 23 | t17="$(get_solve_time $t h48h$i "$scr/scrambles-17.txt" $n)" | ||
| 24 | t18="$(get_solve_time $t h48h$i "$scr/scrambles-18.txt" $n)" | ||
| 25 | t19="$(get_solve_time $t h48h$i "$scr/scrambles-19.txt" $n)" | ||
| 26 | printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" | ||
| 27 | if [ "$i" -ge "$cutoff" ]; then | ||
| 28 | t20="$(get_solve_time $t h48h$i "$scr/scrambles-20.txt" $n)" | ||
| 29 | tsf="$(get_solve_time $t h48h$i "$scr/superflip.txt" $n)" | ||
| 30 | printf ', 20: %s, "superflip": %s},\n' $t20 $tsf >> "$out" | ||
| 31 | else | ||
| 32 | printf '},\n' >> "$out" | ||
| 33 | fi | ||
| 34 | done | ||
| 35 | printf '}\n\n' >> "$out" | ||
| 36 | } | ||
| 37 | |||
| 38 | ./build.sh clean && ./build.sh | ||
| 39 | printf '' > "$out" | ||
| 40 | |||
| 41 | do_all 6 10 11 1 1 "h48_single_thread" | ||
| 42 | do_all 6 9 11 4 1 "h48_4_threads" | ||
| 43 | do_all 6 9 11 16 1 "h48_16_threads" | ||
| 44 | do_all 6 10 11 16 999999 "h48_all_solutions" | ||
diff --git a/benchmarks/run-vcube-benchmarks.sh b/benchmarks/run-vcube-benchmarks.sh new file mode 100755 index 0000000..801bad0 --- /dev/null +++ b/benchmarks/run-vcube-benchmarks.sh | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # This script can be used to run benchmarks for vcube, similar to the | ||
| 4 | # benchmarks for H48 run by run-h48-benchmarks.sh. Before running this script, | ||
| 5 | # move it to the vcube folder and and adjust the paths below if necessary. | ||
| 6 | |||
| 7 | scr="../nissy-core/benchmarks/scrambles" | ||
| 8 | out="../nissy-core/benchmarks/results_vcube.py" | ||
| 9 | |||
| 10 | get_solve_time() { | ||
| 11 | ./vc-optimal -w "$1" -c "$2" <"$3" \ | ||
| 12 | 2>&1 >/dev/null | sed 's/Total time: //; s/ real.*//' | ||
| 13 | } | ||
| 14 | |||
| 15 | do_all() { | ||
| 16 | t=$1 | ||
| 17 | name=$2 | ||
| 18 | printf '%s = {\n' "$name" >> "$out" | ||
| 19 | for i in 112 208 308 404 212 ; do | ||
| 20 | t17="$(get_solve_time $t $i "$scr/scrambles-17.txt")" | ||
| 21 | t18="$(get_solve_time $t $i "$scr/scrambles-18.txt")" | ||
| 22 | t19="$(get_solve_time $t $i "$scr/scrambles-19.txt")" | ||
| 23 | printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" | ||
| 24 | if [ "$i" -ge 212 ]; then | ||
| 25 | t20="$(get_solve_time $t $i "$scr/scrambles-20.txt")" | ||
| 26 | printf ', 20: %s' $t20 >> "$out" | ||
| 27 | if [ "$t" = 1 ]; then | ||
| 28 | tsf="$(get_solve_time $t $i "$scr/superflip.txt")" | ||
| 29 | printf ', "superflip": %s},\n' $tsf >> "$out" | ||
| 30 | else | ||
| 31 | printf '},\n' >> "$out" | ||
| 32 | fi | ||
| 33 | else | ||
| 34 | printf '},\n' >> "$out" | ||
| 35 | fi | ||
| 36 | done | ||
| 37 | printf '}\n\n' >> "$out" | ||
| 38 | } | ||
| 39 | |||
| 40 | printf '' > "$out" | ||
| 41 | |||
| 42 | do_all 1 "vcube_single_thread" | ||
| 43 | do_all 4 "vcube_4_threads" | ||
| 44 | do_all 16 "vcube_16_threads" | ||
