From 8e3088997f43fb02d9b657f7e9d32ddd44d7d940 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 14 Nov 2026 19:16:45 +0100 Subject: Re-run benchmarks for H48 and add comparison with egg-solver --- benchmarks/benchmarks.md | 248 ++++++++++++++--------- benchmarks/img/16threadsspeedupfactor.png | Bin 87877 -> 0 bytes benchmarks/img/17moves1thread.png | Bin 110266 -> 125200 bytes benchmarks/img/18moves1thread.png | Bin 110481 -> 125893 bytes benchmarks/img/19moves1thread.png | Bin 116134 -> 131787 bytes benchmarks/img/20moves1thread.png | Bin 108798 -> 121054 bytes benchmarks/img/4threadsspeedupfactor.png | Bin 95085 -> 0 bytes benchmarks/img/H48_16_threads_speedup_factor.png | Bin 0 -> 79032 bytes benchmarks/img/H48_4_threads_speedup_factor.png | Bin 0 -> 86172 bytes benchmarks/img/egg_16_threads_speedup_factor.png | Bin 0 -> 82970 bytes benchmarks/img/egg_4_threads_speedup_factor.png | Bin 0 -> 84399 bytes benchmarks/plot-benchmarks.py | 218 ++++++++++++++++---- benchmarks/results_egg.py | 27 +++ benchmarks/results_h48.py | 48 ++--- benchmarks/run-egg-benchmarks.sh | 40 ++++ benchmarks/tables_16_threads.md | 47 +++-- benchmarks/tables_1_thread.md | 44 ++-- benchmarks/tables_4_threads.md | 47 +++-- benchmarks/tables_all_solutions.md | 32 +-- 19 files changed, 522 insertions(+), 229 deletions(-) delete mode 100644 benchmarks/img/16threadsspeedupfactor.png delete mode 100644 benchmarks/img/4threadsspeedupfactor.png create mode 100644 benchmarks/img/H48_16_threads_speedup_factor.png create mode 100644 benchmarks/img/H48_4_threads_speedup_factor.png create mode 100644 benchmarks/img/egg_16_threads_speedup_factor.png create mode 100644 benchmarks/img/egg_4_threads_speedup_factor.png create mode 100644 benchmarks/results_egg.py create mode 100755 benchmarks/run-egg-benchmarks.sh (limited to 'benchmarks') diff --git a/benchmarks/benchmarks.md b/benchmarks/benchmarks.md index baba515..4f36cac 100644 --- a/benchmarks/benchmarks.md +++ b/benchmarks/benchmarks.md @@ -2,11 +2,18 @@ This page contains some benchmarks for some of the possible configurations of the H48 optimal solver. For comparison we also -include similar measurements for Andrew Skalski's impressive optimal -solver [vcube](https://github.com/Voltara/vcube), which has been taken -as a benchmark reference throughout the development of H48. The two -solvers differ both in method (although they both use an A* search) -and implementation. +include similar measurements for two other optimal solvers: + +* Andrew Skalski's [vcube](https://github.com/Voltara/vcube), which + is a truly impressive implementation of Tomas Rokicki's + [nxopt](https://github.com/rokicki/cube20src/blob/master/nxopt.md) + that has been taken as a reference throughout the development of H48. + This solver also uses an A* search, but the search is supported + by different pruning tables. +* Arhan Chaudhary's + [egg-solver](https://github.com/ArhanChaudhary/egg-solver), which + is an AI-generated implementation of the H48 method with + highly-optimized microthreading. Similar benchmarks can be found: @@ -18,6 +25,8 @@ Similar benchmarks can be found: * In Enrico Tenuti's [thesis](https://github.com/enricotenuti/h48thesis), also using an old implementation of H48, but including more data and nice plots. +* In [the documentation page](https://egg-solver/arhan.sh/docs/index.html) + for egg-solver. ## Setting @@ -43,8 +52,9 @@ All benchmark tests were done on the following configuration: * CPU: AMD Ryzen 7 7700 (8 cores, 16 virtual threads) * Memory: 2x Corsair Vengeance 32GB 5600MHz * Motherboard: Gigabyte B650M K -* Operating system: Debian 13 (Linux kernel 6.12.57) -* Compiler: GCC 14.2.0 for H48 and Clang 19.1.7 for vcube +* Operating system: Debian 13 (Linux kernel 6.12) +* Compilers: GCC 14.2.0 for H48, Chhang 19.1.7 for vcube and + cargo 1.99.1 for egg-solver ## Benchmark results @@ -53,11 +63,11 @@ All benchmark tests were done on the following configuration: The first test we performed was finding a single optimal solution, and we compared the results with vcube. -This test was run in a single-thread configuration, because the two +This test was run in a single-thread configuration, because the three solvers use very different strategies for multithreading: vcube can only -parallelize by solving one cube per thread, while H48 is able to take -advantage of multiple threads even when solving a single cube. Therefore -we prefer to compare their single-threaded performance only. +parallelize by solving one cube per thread, while H48 and egg-solver can +take advantage of multiple threads even when solving a single cube. +Therefore we prefer to compare their single-threaded performance only. Since the size of the pruning table used by the solver is of utmost importance, we include two statistics: time per cube and time per cube @@ -67,40 +77,52 @@ leads to more even results across the board, although the speed of the solvers of the same family does not scale exactly linearly with the size of the pruning table. - +
Results: Single solution, single thread Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| |vcube 212 |58.2 GiB| 0.11| 0.75| 3.43| 27.28| 19.30| -|H48 h11 |56.5 GiB| 0.09| 0.50| 2.24| 15.73| 15.55| +|egg h11 |58.0 GiB| 0.01| 0.06| 0.24| 2.16| 0.14| +|H48 h11 |56.5 GiB| 0.08| 0.43| 1.86| 12.20| 15.39| |vcube 404 |31.8 GiB| 0.23| 1.24| 6.10| 59.33| 268.26| -|H48 h10 |28.3 GiB| 0.15| 0.76| 3.36| 23.51| 38.05| +|egg h10 |29.0 GiB| 0.02| 0.10| 0.47| 4.00| 0.23| +|H48 h10 |28.3 GiB| 0.13| 0.69| 3.37| 23.15| 38.00| |vcube 308 |21.2 GiB| 0.17| 1.02| 6.20| 58.70| 604.35| -|H48 h9 |14.1 GiB| 0.24| 1.48| 6.69| | | +|egg h9 |14.5 GiB| 0.03| 0.19| 0.91| | | +|H48 h9 |14.1 GiB| 0.22| 1.43| 6.56| | | |vcube 208 | 7.3 GiB| 0.56| 4.36| 20.58| | | -|H48 h8 | 7.1 GiB| 0.46| 3.36| 14.13| | | -|H48 h7 | 3.5 GiB| 0.63| 4.85| 23.25| | | +|egg h8 | 7.2 GiB| 0.07| 0.39| 1.82| | | +|H48 h8 | 7.1 GiB| 0.46| 3.43| 14.18| | | +|egg h7 | 3.6 GiB| 0.11| 0.81| 4.35| | | +|H48 h7 | 3.5 GiB| 0.63| 4.84| 23.31| | | |vcube 112 | 2.4 GiB| 0.96| 9.29| 40.52| | | -|H48 h6 | 1.8 GiB| 1.25| 9.45| 46.31| | | +|egg h6 | 1.8 GiB| 0.20| 1.53| 8.19| | | +|H48 h6 | 1.8 GiB| 1.26| 9.51| 47.14| | | Time per cube adjusted for table size (in seconds \* GiB, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| |vcube 212 |58.2 GiB| 6.43| 43.80| 199.38| 1587.43| 1122.73| -|H48 h11 |56.5 GiB| 5.21| 28.28| 126.68| 889.01| 878.77| +|egg h11 |58.0 GiB| 0.55| 3.31| 13.99| 125.17| 8.04| +|H48 h11 |56.5 GiB| 4.56| 24.55| 104.96| 689.22| 869.37| |vcube 404 |31.8 GiB| 7.40| 39.47| 194.01| 1887.94| 8535.87| -|H48 h10 |28.3 GiB| 4.22| 21.37| 94.86| 664.22| 1075.08| +|egg h10 |29.0 GiB| 0.50| 2.90| 13.69| 115.88| 6.80| +|H48 h10 |28.3 GiB| 3.62| 19.45| 95.15| 654.05| 1073.69| |vcube 308 |21.2 GiB| 3.51| 21.71| 131.50| 1245.26| 12819.94| -|H48 h9 |14.1 GiB| 3.34| 20.97| 94.57| | | +|egg h9 |14.5 GiB| 0.47| 2.74| 13.19| | | +|H48 h9 |14.1 GiB| 3.11| 20.18| 92.68| | | |vcube 208 | 7.3 GiB| 4.08| 31.74| 149.68| | | -|H48 h8 | 7.1 GiB| 3.25| 23.75| 99.82| | | -|H48 h7 | 3.5 GiB| 2.22| 17.12| 82.14| | | +|egg h8 | 7.2 GiB| 0.48| 2.82| 13.16| | | +|H48 h8 | 7.1 GiB| 3.23| 24.26| 100.15| | | +|egg h7 | 3.6 GiB| 0.39| 2.94| 15.77| | | +|H48 h7 | 3.5 GiB| 2.22| 17.12| 82.35| | | |vcube 112 | 2.4 GiB| 2.33| 22.53| 98.23| | | -|H48 h6 | 1.8 GiB| 2.21| 16.70| 81.86| | | +|egg h6 | 1.8 GiB| 0.36| 2.76| 14.83| | | +|H48 h6 | 1.8 GiB| 2.24| 16.80| 83.33| | | @@ -108,9 +130,13 @@ Time per cube adjusted for table size (in seconds \* GiB, lower is better).
-As we can see, adjusting for table size, H48 is generally faster than -vcube. The gap between the two solvers is larger for scrambles with -longer optimal solutions. +As we can see, egg-solver is the clear winner, consistently beating H48 by +factors of 5.3x-8.8x for 17-19 moves scrambles, comparing tables of similar +size. Moreover, egg-solver is more than 100 times faster when solving the +superflip configuration. + +Adjusting for table size, H48 is generally faster than vcube. The gap between +the two solvers is larger for scrambles with longer optimal solutions. ### Single solution, multiple threads @@ -118,36 +144,48 @@ The same benchmark as before is repeated using 4 and 16 threads (recall that the CPU used for these tests has 8 physical cores and 16 virtual threads). -As mentioned above, we don't compare these results to vcube. Instead, -we compare them with the single-threaded results for H48 and we show -how far the speedup factor is from a theoretically optimal 4x and 16x. +For the reasons mentioned above, we will only compare H48 and egg-solver +in this section.
Results: Single solution, 4 threads Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 0.04| 0.14| 0.60| 3.97| 4.19| -|H48 h10 |28.3 GiB| 0.05| 0.20| 0.91| 6.65| 9.81| -|H48 h9 |14.1 GiB| 0.07| 0.39| 1.74| 12.54| 18.96| -|H48 h8 | 7.1 GiB| 0.13| 0.90| 3.71| | | -|H48 h7 | 3.5 GiB| 0.17| 1.28| 6.12| | | -|H48 h6 | 1.8 GiB| 0.33| 2.47| 12.22| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 0.00| 0.01| 0.06| 0.55| 0.03| +|H48 h11 |56.5 GiB| 0.03| 0.13| 0.50| 3.24| 4.17| +|egg h10 |29.0 GiB| 0.00| 0.03| 0.12| 1.05| 0.09| +|H48 h10 |28.3 GiB| 0.05| 0.18| 0.90| 6.21| 9.85| +|egg h9 |14.5 GiB| 0.01| 0.05| 0.23| | | +|H48 h9 |14.1 GiB| 0.07| 0.39| 1.73| 12.50| 18.97| +|egg h8 | 7.2 GiB| 0.02| 0.10| 0.48| | | +|H48 h8 | 7.1 GiB| 0.13| 0.91| 3.71| | | +|egg h7 | 3.6 GiB| 0.03| 0.21| 1.11| | | +|H48 h7 | 3.5 GiB| 0.18| 1.29| 6.19| | | +|egg h6 | 1.8 GiB| 0.05| 0.39| 2.11| | | +|H48 h6 | 1.8 GiB| 0.34| 2.48| 12.33| | | Speed-up factor (higher is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 2.55| 3.46| 3.75| 3.96| 3.71| -|H48 h10 |28.3 GiB| 3.09| 3.71| 3.67| 3.54| 3.88| -|H48 h9 |14.1 GiB| 3.25| 3.84| 3.85| | | -|H48 h8 | 7.1 GiB| 3.53| 3.72| 3.81| | | -|H48 h7 | 3.5 GiB| 3.60| 3.78| 3.80| | | -|H48 h6 | 1.8 GiB| 3.77| 3.82| 3.79| | | - - +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 3.77| 3.90| 3.89| 3.93| 5.42| +|H48 h11 |56.5 GiB| 2.51| 3.44| 3.75| 3.77| 3.69| +|egg h10 |29.0 GiB| 3.88| 3.77| 3.98| 3.81| 2.72| +|H48 h10 |28.3 GiB| 2.79| 3.91| 3.75| 3.73| 3.86| +|egg h9 |14.5 GiB| 3.90| 3.87| 3.88| | | +|H48 h9 |14.1 GiB| 3.18| 3.66| 3.79| | | +|egg h8 | 7.2 GiB| 3.87| 3.91| 3.81| | | +|H48 h8 | 7.1 GiB| 3.48| 3.78| 3.82| | | +|egg h7 | 3.6 GiB| 3.87| 3.87| 3.93| | | +|H48 h7 | 3.5 GiB| 3.43| 3.75| 3.77| | | +|egg h6 | 1.8 GiB| 3.98| 3.90| 3.87| | | +|H48 h6 | 1.8 GiB| 3.73| 3.84| 3.82| | | + + +
@@ -156,74 +194,92 @@ Speed-up factor (higher is better). Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 0.02| 0.06| 0.22| 1.33| 1.84| -|H48 h10 |28.3 GiB| 0.03| 0.08| 0.33| 2.34| 4.18| -|H48 h9 |14.1 GiB| 0.04| 0.15| 0.64| 4.45| 8.09| -|H48 h8 | 7.1 GiB| 0.06| 0.34| 1.36| | | -|H48 h7 | 3.5 GiB| 0.07| 0.47| 2.20| | | -|H48 h6 | 1.8 GiB| 0.13| 0.91| 4.39| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 0.00| 0.01| 0.03| 0.27| 0.02| +|H48 h11 |56.5 GiB| 0.02| 0.06| 0.21| 1.16| 1.84| +|egg h10 |29.0 GiB| 0.00| 0.02| 0.09| 0.77| 0.04| +|H48 h10 |28.3 GiB| 0.03| 0.08| 0.34| 2.24| 4.21| +|egg h9 |14.5 GiB| 0.01| 0.04| 0.17| | | +|H48 h9 |14.1 GiB| 0.03| 0.14| 0.64| 4.43| 8.04| +|egg h8 | 7.2 GiB| 0.01| 0.07| 0.33| | | +|H48 h8 | 7.1 GiB| 0.06| 0.30| 1.36| | | +|egg h7 | 3.6 GiB| 0.02| 0.15| 0.79| | | +|H48 h7 | 3.5 GiB| 0.08| 0.41| 2.20| | | +|egg h6 | 1.8 GiB| 0.04| 0.28| 1.53| | | +|H48 h6 | 1.8 GiB| 0.13| 0.77| 4.37| | | Speed-up factor (higher is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 3.90| 8.14| 10.39| 11.86| 8.45| -|H48 h10 |28.3 GiB| 5.72| 9.00| 10.03| 10.04| 9.09| -|H48 h9 |14.1 GiB| 6.56| 9.75| 10.53| | | -|H48 h8 | 7.1 GiB| 8.08| 9.91| 10.40| | | -|H48 h7 | 3.5 GiB| 8.59| 10.30| 10.57| | | -|H48 h6 | 1.8 GiB| 9.60| 10.39| 10.54| | | - - +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 5.56| 8.03| 8.00| 8.05| 8.45| +|H48 h11 |56.5 GiB| 3.73| 7.32| 8.87| 10.54| 8.35| +|egg h10 |29.0 GiB| 5.63| 5.58| 5.53| 5.18| 6.05| +|H48 h10 |28.3 GiB| 4.76| 8.60| 9.84| 10.34| 9.03| +|egg h9 |14.5 GiB| 5.46| 5.32| 5.35| | | +|H48 h9 |14.1 GiB| 6.34| 10.07| 10.19| | | +|egg h8 | 7.2 GiB| 5.49| 5.50| 5.53| | | +|H48 h8 | 7.1 GiB| 7.51| 11.36| 10.43| | | +|egg h7 | 3.6 GiB| 5.33| 5.38| 5.48| | | +|H48 h7 | 3.5 GiB| 8.21| 11.75| 10.61| | | +|egg h6 | 1.8 GiB| 5.51| 5.42| 5.35| | | +|H48 h6 | 1.8 GiB| 9.38| 12.31| 10.80| | | + + + -We can see that H48 scales pretty well with 4 threads, getting close -to the 4x theoretical maximum speedup in slower cases (small table or -long solutions). +We can see that both egg-solver and H48 scale pretty well with 4 threads, +getting close to the 4x theoretical maximum speedup in slower cases +(small table or long solutions). egg-solver managed to beat the 4x +speedup for the superflip, likely due to single-scramble variance, i.e. +the thread that found the solution stopped earlier. In the 16 threads benchmark shows that, although the virtual threads -help push us beyond the 8x theoretical speedup that would be provided -by the 8 cores, we are nowhere near a 16x speedup. +help push H48 beyond the 8x theoretical speedup that would be provided +by the 8 cores, it is nowhere near a 16x speedup. egg-solver seems +stuck around 5.5x speedup. ### All solutions Finally, we ran a test on finding *all* optimal solutions which, as -far as I know, is a use case not supported by vcube. For convenience, -this test is only run on 16 threads. +far as I know, is a use case not supported by vcube or egg-solver. +For convenience, this test is only run on 16 threads. - -
Results: All solutions (16 threads) + +
Results: All solutions, 16 threads Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 0.04| 0.26| 2.22| 18.96| 16.95| -|H48 h10 |28.3 GiB| 0.05| 0.42| 3.82| 34.42| 36.80| -|H48 h9 |14.1 GiB| 0.08| 0.73| 7.28| | | -|H48 h8 | 7.1 GiB| 0.15| 1.56| 15.41| | | -|H48 h7 | 3.5 GiB| 0.21| 2.38| 26.52| | | -|H48 h6 | 1.8 GiB| 0.39| 4.67| 53.00| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|H48 h11 |56.5 GiB| 0.04| 0.24| 1.88| 3.88| 1.86| +|H48 h10 |28.3 GiB| 0.05| 0.39| 3.51| 7.54| 4.29| +|H48 h9 |14.1 GiB| 0.08| 0.73| 6.92| | | +|H48 h8 | 7.1 GiB| 0.16| 1.54| 14.78| | | +|H48 h7 | 3.5 GiB| 0.22| 2.37| 25.35| | | +|H48 h6 | 1.8 GiB| 0.40| 4.58| 50.17| | | Time per cube adjusted for table size (in seconds \* GiB, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 2.11| 14.55| 125.21| 1071.23| 957.47| -|H48 h10 |28.3 GiB| 1.48| 11.96| 107.83| 972.35| 1039.73| -|H48 h9 |14.1 GiB| 1.08| 10.29| 102.88| | | -|H48 h8 | 7.1 GiB| 1.03| 10.99| 108.87| | | -|H48 h7 | 3.5 GiB| 0.74| 8.41| 93.69| | | -|H48 h6 | 1.8 GiB| 0.70| 8.25| 93.68| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|H48 h11 |56.5 GiB| 2.00| 13.40| 106.21| 219.43| 105.10| +|H48 h10 |28.3 GiB| 1.45| 11.13| 99.17| 212.94| 121.20| +|H48 h9 |14.1 GiB| 1.13| 10.25| 97.80| | | +|H48 h8 | 7.1 GiB| 1.10| 10.85| 104.41| | | +|H48 h7 | 3.5 GiB| 0.79| 8.38| 89.57| | | +|H48 h6 | 1.8 GiB| 0.71| 8.10| 88.68| | |
## Other notes -* To repeat the benchmarks, use `./benchmarks/run-h48-benchmarks.sh`. +* To repeat the benchmarks for H48, use `./benchmarks/run-h48-benchmarks.sh`. + Similar scripts for vcube and egg-solver can be found in the `benchmarks` + folder. * All the measurements above exclude the time needed to load the pruning tables into memory, which can be quite significant for large tables. * The measurements also excluded the one-off computation of the pruning diff --git a/benchmarks/img/16threadsspeedupfactor.png b/benchmarks/img/16threadsspeedupfactor.png deleted file mode 100644 index 5dcaaef..0000000 Binary files a/benchmarks/img/16threadsspeedupfactor.png and /dev/null differ diff --git a/benchmarks/img/17moves1thread.png b/benchmarks/img/17moves1thread.png index da78107..1ade3f3 100644 Binary files a/benchmarks/img/17moves1thread.png and b/benchmarks/img/17moves1thread.png differ diff --git a/benchmarks/img/18moves1thread.png b/benchmarks/img/18moves1thread.png index c9406fa..0281d4f 100644 Binary files a/benchmarks/img/18moves1thread.png and b/benchmarks/img/18moves1thread.png differ diff --git a/benchmarks/img/19moves1thread.png b/benchmarks/img/19moves1thread.png index 8400584..17c0d46 100644 Binary files a/benchmarks/img/19moves1thread.png and b/benchmarks/img/19moves1thread.png differ diff --git a/benchmarks/img/20moves1thread.png b/benchmarks/img/20moves1thread.png index 879448d..7ed910f 100644 Binary files a/benchmarks/img/20moves1thread.png and b/benchmarks/img/20moves1thread.png differ diff --git a/benchmarks/img/4threadsspeedupfactor.png b/benchmarks/img/4threadsspeedupfactor.png deleted file mode 100644 index 49badc4..0000000 Binary files a/benchmarks/img/4threadsspeedupfactor.png and /dev/null differ diff --git a/benchmarks/img/H48_16_threads_speedup_factor.png b/benchmarks/img/H48_16_threads_speedup_factor.png new file mode 100644 index 0000000..1bbd2f8 Binary files /dev/null and b/benchmarks/img/H48_16_threads_speedup_factor.png differ diff --git a/benchmarks/img/H48_4_threads_speedup_factor.png b/benchmarks/img/H48_4_threads_speedup_factor.png new file mode 100644 index 0000000..40cf8ec Binary files /dev/null and b/benchmarks/img/H48_4_threads_speedup_factor.png differ diff --git a/benchmarks/img/egg_16_threads_speedup_factor.png b/benchmarks/img/egg_16_threads_speedup_factor.png new file mode 100644 index 0000000..3c4a81b Binary files /dev/null and b/benchmarks/img/egg_16_threads_speedup_factor.png differ diff --git a/benchmarks/img/egg_4_threads_speedup_factor.png b/benchmarks/img/egg_4_threads_speedup_factor.png new file mode 100644 index 0000000..a00746a Binary files /dev/null and b/benchmarks/img/egg_4_threads_speedup_factor.png differ diff --git a/benchmarks/plot-benchmarks.py b/benchmarks/plot-benchmarks.py index 1a6fc39..dfd1f90 100644 --- a/benchmarks/plot-benchmarks.py +++ b/benchmarks/plot-benchmarks.py @@ -1,6 +1,7 @@ import matplotlib.pyplot as plt import results_h48 import results_vcube +import results_egg from pathlib import Path benchmarks_dir = Path("benchmarks") @@ -29,6 +30,15 @@ sizes_vcube = { 212: 62474158080, } +sizes_egg = { + 6: 1945686016, + 7: 3891367936, + 8: 7782731776, + 9: 15565459456, + 10: 31130914816, + 11: 62261825536, +} + # Printing tables in markdown format def print_row(f, solver_name, solver_size, dict, mul_by_size, superflip_star): @@ -46,48 +56,94 @@ def print_row(f, solver_name, solver_size, dict, mul_by_size, superflip_star): sep = "|" f.write(sep + sep.join(cols) + sep + "\n") -def print_table(f, h48, vcube, ms, st): +def print_table(f, h48, vcube, egg, ms, st): vcube = vcube or {} - f.write("| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip|\n") - f.write("|:---------|:-------|-------:|-------:|-------:|-------:|--------:|\n") + egg = egg or {} + f.write("|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip|\n") + f.write("|:-----|:---|-------:|-------:|-------:|-------:|--------:|\n") print_row(f, "vcube 212", sizes_vcube[212], vcube.get(212), ms, not st) + print_row(f, "egg h11", sizes_egg[11], egg.get(11), ms, False) print_row(f, "H48 h11", sizes_h48[11], h48[11], ms, False) print_row(f, "vcube 404", sizes_vcube[404], vcube.get(404), ms, not st) + print_row(f, "egg h10", sizes_egg[10], egg.get(10), ms, False) print_row(f, "H48 h10", sizes_h48[10], h48[10], ms, False) print_row(f, "vcube 308", sizes_vcube[308], vcube.get(308), ms, not st) + print_row(f, "egg h9", sizes_egg[9], egg.get(9), ms, False) print_row(f, "H48 h9", sizes_h48[9], h48[9], ms, False) print_row(f, "vcube 208", sizes_vcube[208], vcube.get(208), ms, not st) + print_row(f, "egg h8", sizes_egg[8], egg.get(8), ms, False) print_row(f, "H48 h8", sizes_h48[8], h48[8], ms, False) + print_row(f, "egg h7", sizes_egg[7], egg.get(7), ms, False) print_row(f, "H48 h7", sizes_h48[7], h48[7], ms, False) print_row(f, "vcube 112", sizes_vcube[112], vcube.get(112), ms, not st) + print_row(f, "egg h6", sizes_egg[6], egg.get(6), ms, False) print_row(f, "H48 h6", sizes_h48[6], h48[6], ms, False) -def print_factor_table(f, slow, fast): - ratio = {} +def print_factor_table(f, slow_h48, fast_h48, slow_egg, fast_egg): + ratio_h48 = {} + ratio_egg = {} for m in [6, 7, 8, 9, 10, 11]: - ratio[m] = {} - for k in slow[m]: - ratio[m][k] = (slow[m][k] / fast[m][k]) * (25 if k != "superflip" else 1) - f.write("| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip|\n") - f.write("|:---------|:-------|-------:|-------:|-------:|-------:|--------:|\n") - print_row(f, "H48 h11", sizes_h48[11], ratio[11], False, False) - print_row(f, "H48 h10", sizes_h48[10], ratio[10], False, False) - print_row(f, "H48 h9", sizes_h48[9], ratio[9], False, False) - print_row(f, "H48 h8", sizes_h48[8], ratio[8], False, False) - print_row(f, "H48 h7", sizes_h48[7], ratio[7], False, False) - print_row(f, "H48 h6", sizes_h48[6], ratio[6], False, False) + ratio_h48[m] = {} + ratio_egg[m] = {} + for k in slow_h48[m]: + ratio_h48[m][k] = ( + (slow_h48[m][k] / fast_h48[m][k]) * + (25 if k != "superflip" else 1) + ) + for k in slow_egg[m]: + ratio_egg[m][k] = ( + (slow_egg[m][k] / fast_egg[m][k]) * + (25 if k != "superflip" else 1) + ) + f.write("|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip|\n") + f.write("|:-----|:---|-------:|-------:|-------:|-------:|--------:|\n") + print_row(f, "egg h11", sizes_egg[11], ratio_egg[11], False, False) + print_row(f, "H48 h11", sizes_h48[11], ratio_h48[11], False, False) + print_row(f, "egg h10", sizes_egg[10], ratio_egg[10], False, False) + print_row(f, "H48 h10", sizes_h48[10], ratio_h48[10], False, False) + print_row(f, "egg h9", sizes_egg[9], ratio_egg[9], False, False) + print_row(f, "H48 h9", sizes_h48[9], ratio_h48[9], False, False) + print_row(f, "egg h8", sizes_egg[8], ratio_egg[8], False, False) + print_row(f, "H48 h8", sizes_h48[8], ratio_h48[8], False, False) + print_row(f, "egg h7", sizes_egg[7], ratio_egg[7], False, False) + print_row(f, "H48 h7", sizes_h48[7], ratio_h48[7], False, False) + print_row(f, "egg h6", sizes_egg[6], ratio_egg[6], False, False) + print_row(f, "H48 h6", sizes_h48[6], ratio_h48[6], False, False) with open(benchmarks_single_thread, "w") as f: - f.write(f"\n") - f.write("
Results: Single solution, single thread\n") + f.write( + "\n" + ) + f.write( + "
Results: Single solution, " + "single thread\n" + ) f.write("\n") f.write("Time per cube (in seconds, lower is better).\n") f.write("\n") - print_table(f, results_h48.h48_single_thread, results_vcube.vcube_single_thread, False, True) + print_table( + f, + results_h48.h48_single_thread, + results_vcube.vcube_single_thread, + results_egg.egg_single_thread, + False, + True, + ) f.write("\n") - f.write("Time per cube adjusted for table size (in seconds \\* GiB, lower is better).\n") + f.write( + "Time per cube adjusted for table size " + "(in seconds \\* GiB, lower is better).\n" + ) f.write("\n") - print_table(f, results_h48.h48_single_thread, results_vcube.vcube_single_thread, True, True) + print_table( + f, + results_h48.h48_single_thread, + results_vcube.vcube_single_thread, + results_egg.egg_single_thread, + True, + True, + ) f.write("\n") f.write( '\n' @@ -98,59 +154,114 @@ with open(benchmarks_single_thread, "w") as f: f.write("
\n") with open(benchmarks_4_threads, "w") as f: - f.write(f"\n") - f.write("
Results: Single solution, 4 threads\n") + f.write( + "\n" + ) + f.write( + "
Results: Single solution, " + "4 threads\n" + ) f.write("\n") f.write("Time per cube (in seconds, lower is better).\n") f.write("\n") - print_table(f, results_h48.h48_4_threads, None, False, False) + print_table( + f, + results_h48.h48_4_threads, + None, + results_egg.egg_4_threads, + False, + False, + ) f.write("\n") f.write("Speed-up factor (higher is better).\n") f.write("\n") - print_factor_table(f, results_h48.h48_single_thread, results_h48.h48_4_threads) + print_factor_table( + f, + results_h48.h48_single_thread, + results_h48.h48_4_threads, + results_egg.egg_single_thread, + results_egg.egg_4_threads, + ) f.write("\n") - f.write('\n') + f.write( + '\n' + '\n' + ) f.write("\n") f.write("
\n") with open(benchmarks_16_threads, "w") as f: - f.write(f"\n") - f.write("
Results: Single solution, 16 threads\n") + f.write( + "\n" + ) + f.write( + "
Results: Single solution, " + "16 threads\n" + ) f.write("\n") f.write("Time per cube (in seconds, lower is better).\n") f.write("\n") - print_table(f, results_h48.h48_16_threads, None, False, False) + print_table( + f, + results_h48.h48_16_threads, + None, + results_egg.egg_16_threads, + False, + False, + ) f.write("\n") f.write("Speed-up factor (higher is better).\n") f.write("\n") - print_factor_table(f, results_h48.h48_single_thread, results_h48.h48_16_threads) + print_factor_table( + f, + results_h48.h48_single_thread, + results_h48.h48_16_threads, + results_egg.egg_single_thread, + results_egg.egg_16_threads, + ) f.write("\n") - f.write('\n') + f.write( + '\n' + '\n' + ) f.write("\n") f.write("
\n") with open(benchmarks_all_solutions, "w") as f: - f.write(f"\n") - f.write("
Results: All solutions, 16 threads\n") + f.write( + "\n" + ) + f.write( + "
Results: All solutions, " + "16 threads\n" + ) f.write("\n") f.write("Time per cube (in seconds, lower is better).\n") f.write("\n") - print_table(f, results_h48.h48_all_solutions, None, False, False) + print_table(f, results_h48.h48_all_solutions, None, None, False, False) f.write("\n") - f.write("Time per cube adjusted for table size (in seconds \\* GiB, lower is better).\n") + f.write( + "Time per cube adjusted for table size " + "(in seconds \\* GiB, lower is better).\n" + ) f.write("\n") - print_table(f, results_h48.h48_all_solutions, None, True, False) + print_table(f, results_h48.h48_all_solutions, None, None, True, False) f.write("\n") f.write("
\n") # Plotting -def plot_comparison(title, hd, vd, key): +def plot_comparison(title, hd, vd, ed, key): d = 1 if key == "superflip" else 25 h48x = [sizes_h48[m]/(2**30) for m in hd.keys() if key in hd[m]] vcubex = [sizes_vcube[m]/(2**30) for m in vd.keys() if key in vd[m]] + eggx = [sizes_egg[m]/(2**30) for m in ed.keys() if key in ed[m]] h48y = [d[key] for _, d in hd.items() if key in d] vcubey = [d[key] for _, d in vd.items() if key in d] + eggy = [d[key] for _, d in ed.items() if key in d] plt.clf() plt.title(title) @@ -158,14 +269,17 @@ def plot_comparison(title, hd, vd, key): plt.ylabel("Time to solve (s / cube)") plt.plot(h48x, h48y, "o--", label = "H48") plt.plot(vcubex, vcubey, "o--", label = "vcube") + plt.plot(eggx, eggy, "o--", label = "egg") plt.legend(loc = "right") filename = title.replace(" ", "").replace(",", "") + ".png" plt.savefig(benchmarks_img_dir / filename, dpi=300) #plt.show() -rh, rv = results_h48.h48_single_thread, results_vcube.vcube_single_thread +rh = results_h48.h48_single_thread +rv = results_vcube.vcube_single_thread +re = results_egg.egg_single_thread for m in [17, 18, 19, 20]: - plot_comparison(f"{m} moves 1 thread", rh, rv, m) + plot_comparison(f"{m} moves 1 thread", rh, rv, re, m) def plot_multithread_scatter(title, slow, fast): plt.clf() @@ -176,11 +290,29 @@ def plot_multithread_scatter(title, slow, fast): plt.xticks(x) for h in [11, 10, 9, 8, 7, 6]: y = [slow[h][i] / fast[h][i] for i in x] - plt.scatter(x, y, label=f"H48 h{h}") + plt.scatter(x, y, label=f"h{h}") plt.legend(loc = "right") - filename = title.replace(" ", "").replace(",", "") + ".png" + filename = title.replace(" ", "_") + ".png" plt.savefig(benchmarks_img_dir / filename, dpi=300) #plt.show() -plot_multithread_scatter("4 threads speedup factor", results_h48.h48_single_thread, results_h48.h48_4_threads) -plot_multithread_scatter("16 threads speedup factor", results_h48.h48_single_thread, results_h48.h48_16_threads) +plot_multithread_scatter( + "H48 4 threads speedup factor", + results_h48.h48_single_thread, + results_h48.h48_4_threads, +) +plot_multithread_scatter( + "H48 16 threads speedup factor", + results_h48.h48_single_thread, + results_h48.h48_16_threads, +) +plot_multithread_scatter( + "egg 4 threads speedup factor", + results_egg.egg_single_thread, + results_egg.egg_4_threads, +) +plot_multithread_scatter( + "egg 16 threads speedup factor", + results_egg.egg_single_thread, + results_egg.egg_16_threads, +) diff --git a/benchmarks/results_egg.py b/benchmarks/results_egg.py new file mode 100644 index 0000000..3018cf4 --- /dev/null +++ b/benchmarks/results_egg.py @@ -0,0 +1,27 @@ +egg_single_thread = { + 6: {17: 5.032832, 18: 38.135722, 19: 204.652846}, + 7: {17: 2.669533, 18: 20.281338, 19: 108.782419}, + 8: {17: 1.651355, 18: 9.714498, 19: 45.383547}, + 9: {17: 0.803654, 18: 4.725768, 19: 22.741144}, + 10: {17: 0.429919, 18: 2.498317, 19: 11.803061, 20: 99.918920, "superflip": 0.234443}, + 11: {17: 0.237963, 18: 1.428538, 19: 6.031292, 20: 53.963847, "superflip": 0.138605}, +} + +egg_4_threads = { + 6: {17: 1.265374, 18: 9.782992, 19: 52.818767}, + 7: {17: 0.688996, 18: 5.239901, 19: 27.651903}, + 8: {17: 0.426688, 18: 2.487043, 19: 11.904544}, + 9: {17: 0.206107, 18: 1.220541, 19: 5.867951}, + 10: {17: 0.110690, 18: 0.662000, 19: 2.965403, 20: 26.244233, "superflip": 0.086182}, + 11: {17: 0.063179, 18: 0.366318, 19: 1.552111, 20: 13.738317, "superflip": 0.025594}, +} + +egg_16_threads = { + 6: {17: 0.913331, 18: 7.036477, 19: 38.217758}, + 7: {17: 0.501139, 18: 3.771112, 19: 19.841116}, + 8: {17: 0.301029, 18: 1.764851, 19: 8.205679}, + 9: {17: 0.147238, 18: 0.887650, 19: 4.249228}, + 10: {17: 0.076401, 18: 0.447673, 19: 2.135498, 20: 19.303369, "superflip": 0.038754}, + 11: {17: 0.042768, 18: 0.177966, 19: 0.754095, 20: 6.700410, "superflip": 0.016397}, +} + diff --git a/benchmarks/results_h48.py b/benchmarks/results_h48.py index 625b2c5..db3f61d 100644 --- a/benchmarks/results_h48.py +++ b/benchmarks/results_h48.py @@ -1,36 +1,36 @@ h48_single_thread = { - 6: {17: 31.2308, 18: 236.1986, 19: 1157.7502}, - 7: {17: 15.7227, 18: 121.1488, 19: 581.2004}, - 8: {17: 11.5065, 18: 84.0366, 19: 353.2224}, - 9: {17: 5.9123, 18: 37.1034, 19: 167.3496}, - 10: {17: 3.7338, 18: 18.9061, 19: 83.9382, 20: 587.7489, "superflip": 38.0522}, - 11: {17: 2.3070, 18: 12.5145, 19: 56.0479, 20: 393.3391, "superflip": 15.5523}, + 6: {17: 31.6146, 18: 237.6538, 19: 1178.5629}, + 7: {17: 15.7297, 18: 121.1100, 19: 582.6646}, + 8: {17: 11.4289, 18: 85.8390, 19: 354.3900}, + 9: {17: 5.4948, 18: 35.7112, 19: 164.0113}, + 10: {17: 3.2011, 18: 17.2078, 19: 84.1986, 20: 578.7479, "superflip": 38.0028}, + 11: {17: 2.0178, 18: 10.8605, 19: 46.4395, 20: 304.9428, "superflip": 15.3861}, } h48_4_threads = { - 6: {17: 8.2859, 18: 61.8403, 19: 305.5934}, - 7: {17: 4.3713, 18: 32.0550, 19: 152.9403}, - 8: {17: 3.2607, 18: 22.6002, 19: 92.7235}, - 9: {17: 1.8164, 18: 9.6520, 19: 43.5002, 20: 313.5156, "superflip": 18.9551}, - 10: {17: 1.2098, 18: 5.1007, 19: 22.8530, 20: 166.2468, "superflip": 9.8108}, - 11: {17: 0.9047, 18: 3.6152, 19: 14.9408, 20: 99.3673, "superflip": 4.1930}, + 6: {17: 8.4831, 18: 61.8787, 19: 308.3152}, + 7: {17: 4.5843, 18: 32.2699, 19: 154.6502}, + 8: {17: 3.2842, 18: 22.7150, 19: 92.6903}, + 9: {17: 1.7301, 18: 9.7587, 19: 43.2178, 20: 312.5222, "superflip": 18.9704}, + 10: {17: 1.1491, 18: 4.4016, 19: 22.4448, 20: 155.2350, "superflip": 9.8506}, + 11: {17: 0.8027, 18: 3.1583, 19: 12.3942, 20: 80.9024, "superflip": 4.1653}, } h48_16_threads = { - 6: {17: 3.2536, 18: 22.7283, 19: 109.8073}, - 7: {17: 1.8312, 18: 11.7609, 19: 54.9974}, - 8: {17: 1.4242, 18: 8.4798, 19: 33.9483}, - 9: {17: 0.9010, 18: 3.8064, 19: 15.8985, 20: 111.3421, "superflip": 8.0916}, - 10: {17: 0.6528, 18: 2.1009, 19: 8.3680, 20: 58.5190, "superflip": 4.1848}, - 11: {17: 0.5918, 18: 1.5379, 19: 5.3942, 20: 33.1522, "superflip": 1.8402}, + 6: {17: 3.3695, 18: 19.3030, 19: 109.1256}, + 7: {17: 1.9154, 18: 10.3030, 19: 54.8909}, + 8: {17: 1.5225, 18: 7.5543, 19: 33.9840}, + 9: {17: 0.8672, 18: 3.5479, 19: 16.0906, 20: 110.7977, "superflip": 8.0406}, + 10: {17: 0.6723, 18: 1.9998, 19: 8.5537, 20: 55.9818, "superflip": 4.2065}, + 11: {17: 0.5403, 18: 1.4842, 19: 5.2328, 20: 28.9226, "superflip": 1.8435}, } h48_all_solutions = { - 6: {17: 9.8554, 18: 116.6374, 19: 1324.9303}, - 7: {17: 5.2495, 18: 59.4768, 19: 662.9106}, - 8: {17: 3.6359, 18: 38.8943, 19: 385.2452}, - 9: {17: 1.9026, 18: 18.2076, 19: 182.0522}, - 10: {17: 1.3117, 18: 10.5836, 19: 95.4136, 20: 860.4004, "superflip": 36.8007}, - 11: {17: 0.9357, 18: 6.4383, 19: 55.3969, 20: 473.9622, "superflip": 16.9452}, + 6: {17: 10.1111, 18: 114.6104, 19: 1254.2822}, + 7: {17: 5.5958, 18: 59.2615, 19: 633.7330}, + 8: {17: 3.9038, 18: 38.3942, 19: 369.4771}, + 9: {17: 1.9935, 18: 18.1457, 19: 173.0701}, + 10: {17: 1.2822, 18: 9.8484, 19: 87.7510, 20: 188.4217, "superflip": 4.2900}, + 11: {17: 0.8868, 18: 5.9268, 19: 46.9945, 20: 97.0853, "superflip": 1.8600}, } diff --git a/benchmarks/run-egg-benchmarks.sh b/benchmarks/run-egg-benchmarks.sh new file mode 100755 index 0000000..d29db27 --- /dev/null +++ b/benchmarks/run-egg-benchmarks.sh @@ -0,0 +1,40 @@ +scr="../nissy-core/benchmarks/scrambles" +out="../nissy-core/benchmarks/results_egg.py" + +get_solve_time() { + ./target/release/solve -t "$1" --table "tables/h$2" <"$3" \ + | tail -1 | sed 's/.*cubes wall //; s/ wall.*//' +} + +do_all() { + echo "doing all $1 $2" + t=$1 + name=$2 + printf '%s = {\n' "$name" >> "$out" + for i in 6 7 8 9 10 11 ; do + echo "Doing 17 moves for h$i with $t threads..." + t17="$(get_solve_time $t $i "$scr/scrambles-17.txt")" + echo "Doing 18 moves for h$i with $t threads..." + t18="$(get_solve_time $t $i "$scr/scrambles-18.txt")" + echo "Doing 19 moves for h$i with $t threads..." + t19="$(get_solve_time $t $i "$scr/scrambles-19.txt")" + printf '\t%s: {17: %s, 18: %s, 19: %s' $i $t17 $t18 $t19 >> "$out" + if [ "$i" -ge 10 ]; then + echo "Doing 20 moves for h$i with $t threads..." + t20="$(get_solve_time $t $i "$scr/scrambles-20.txt")" + printf ', 20: %s' $t20 >> "$out" + echo "Doing superflip moves for h$i with $t threads..." + tsf="$(get_solve_time $t $i "$scr/superflip.txt")" + printf ', "superflip": %s},\n' $tsf >> "$out" + else + printf '},\n' >> "$out" + fi + done + printf '}\n\n' >> "$out" +} + +printf '' > "$out" + +do_all 1 "egg_single_thread" +do_all 4 "egg_4_threads" +do_all 16 "egg_16_threads" diff --git a/benchmarks/tables_16_threads.md b/benchmarks/tables_16_threads.md index 49d391a..ab5f03a 100644 --- a/benchmarks/tables_16_threads.md +++ b/benchmarks/tables_16_threads.md @@ -3,26 +3,39 @@ Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 0.02| 0.06| 0.22| 1.33| 1.84| -|H48 h10 |28.3 GiB| 0.03| 0.08| 0.33| 2.34| 4.18| -|H48 h9 |14.1 GiB| 0.04| 0.15| 0.64| 4.45| 8.09| -|H48 h8 | 7.1 GiB| 0.06| 0.34| 1.36| | | -|H48 h7 | 3.5 GiB| 0.07| 0.47| 2.20| | | -|H48 h6 | 1.8 GiB| 0.13| 0.91| 4.39| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 0.00| 0.01| 0.03| 0.27| 0.02| +|H48 h11 |56.5 GiB| 0.02| 0.06| 0.21| 1.16| 1.84| +|egg h10 |29.0 GiB| 0.00| 0.02| 0.09| 0.77| 0.04| +|H48 h10 |28.3 GiB| 0.03| 0.08| 0.34| 2.24| 4.21| +|egg h9 |14.5 GiB| 0.01| 0.04| 0.17| | | +|H48 h9 |14.1 GiB| 0.03| 0.14| 0.64| 4.43| 8.04| +|egg h8 | 7.2 GiB| 0.01| 0.07| 0.33| | | +|H48 h8 | 7.1 GiB| 0.06| 0.30| 1.36| | | +|egg h7 | 3.6 GiB| 0.02| 0.15| 0.79| | | +|H48 h7 | 3.5 GiB| 0.08| 0.41| 2.20| | | +|egg h6 | 1.8 GiB| 0.04| 0.28| 1.53| | | +|H48 h6 | 1.8 GiB| 0.13| 0.77| 4.37| | | Speed-up factor (higher is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 3.90| 8.14| 10.39| 11.86| 8.45| -|H48 h10 |28.3 GiB| 5.72| 9.00| 10.03| 10.04| 9.09| -|H48 h9 |14.1 GiB| 6.56| 9.75| 10.53| | | -|H48 h8 | 7.1 GiB| 8.08| 9.91| 10.40| | | -|H48 h7 | 3.5 GiB| 8.59| 10.30| 10.57| | | -|H48 h6 | 1.8 GiB| 9.60| 10.39| 10.54| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 5.56| 8.03| 8.00| 8.05| 8.45| +|H48 h11 |56.5 GiB| 3.73| 7.32| 8.87| 10.54| 8.35| +|egg h10 |29.0 GiB| 5.63| 5.58| 5.53| 5.18| 6.05| +|H48 h10 |28.3 GiB| 4.76| 8.60| 9.84| 10.34| 9.03| +|egg h9 |14.5 GiB| 5.46| 5.32| 5.35| | | +|H48 h9 |14.1 GiB| 6.34| 10.07| 10.19| | | +|egg h8 | 7.2 GiB| 5.49| 5.50| 5.53| | | +|H48 h8 | 7.1 GiB| 7.51| 11.36| 10.43| | | +|egg h7 | 3.6 GiB| 5.33| 5.38| 5.48| | | +|H48 h7 | 3.5 GiB| 8.21| 11.75| 10.61| | | +|egg h6 | 1.8 GiB| 5.51| 5.42| 5.35| | | +|H48 h6 | 1.8 GiB| 9.38| 12.31| 10.80| | | - + +
diff --git a/benchmarks/tables_1_thread.md b/benchmarks/tables_1_thread.md index c0abb50..bf2e0ab 100644 --- a/benchmarks/tables_1_thread.md +++ b/benchmarks/tables_1_thread.md @@ -3,35 +3,47 @@ Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| |vcube 212 |58.2 GiB| 0.11| 0.75| 3.43| 27.28| 19.30| -|H48 h11 |56.5 GiB| 0.09| 0.50| 2.24| 15.73| 15.55| +|egg h11 |58.0 GiB| 0.01| 0.06| 0.24| 2.16| 0.14| +|H48 h11 |56.5 GiB| 0.08| 0.43| 1.86| 12.20| 15.39| |vcube 404 |31.8 GiB| 0.23| 1.24| 6.10| 59.33| 268.26| -|H48 h10 |28.3 GiB| 0.15| 0.76| 3.36| 23.51| 38.05| +|egg h10 |29.0 GiB| 0.02| 0.10| 0.47| 4.00| 0.23| +|H48 h10 |28.3 GiB| 0.13| 0.69| 3.37| 23.15| 38.00| |vcube 308 |21.2 GiB| 0.17| 1.02| 6.20| 58.70| 604.35| -|H48 h9 |14.1 GiB| 0.24| 1.48| 6.69| | | +|egg h9 |14.5 GiB| 0.03| 0.19| 0.91| | | +|H48 h9 |14.1 GiB| 0.22| 1.43| 6.56| | | |vcube 208 | 7.3 GiB| 0.56| 4.36| 20.58| | | -|H48 h8 | 7.1 GiB| 0.46| 3.36| 14.13| | | -|H48 h7 | 3.5 GiB| 0.63| 4.85| 23.25| | | +|egg h8 | 7.2 GiB| 0.07| 0.39| 1.82| | | +|H48 h8 | 7.1 GiB| 0.46| 3.43| 14.18| | | +|egg h7 | 3.6 GiB| 0.11| 0.81| 4.35| | | +|H48 h7 | 3.5 GiB| 0.63| 4.84| 23.31| | | |vcube 112 | 2.4 GiB| 0.96| 9.29| 40.52| | | -|H48 h6 | 1.8 GiB| 1.25| 9.45| 46.31| | | +|egg h6 | 1.8 GiB| 0.20| 1.53| 8.19| | | +|H48 h6 | 1.8 GiB| 1.26| 9.51| 47.14| | | Time per cube adjusted for table size (in seconds \* GiB, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| |vcube 212 |58.2 GiB| 6.43| 43.80| 199.38| 1587.43| 1122.73| -|H48 h11 |56.5 GiB| 5.21| 28.28| 126.68| 889.01| 878.77| +|egg h11 |58.0 GiB| 0.55| 3.31| 13.99| 125.17| 8.04| +|H48 h11 |56.5 GiB| 4.56| 24.55| 104.96| 689.22| 869.37| |vcube 404 |31.8 GiB| 7.40| 39.47| 194.01| 1887.94| 8535.87| -|H48 h10 |28.3 GiB| 4.22| 21.37| 94.86| 664.22| 1075.08| +|egg h10 |29.0 GiB| 0.50| 2.90| 13.69| 115.88| 6.80| +|H48 h10 |28.3 GiB| 3.62| 19.45| 95.15| 654.05| 1073.69| |vcube 308 |21.2 GiB| 3.51| 21.71| 131.50| 1245.26| 12819.94| -|H48 h9 |14.1 GiB| 3.34| 20.97| 94.57| | | +|egg h9 |14.5 GiB| 0.47| 2.74| 13.19| | | +|H48 h9 |14.1 GiB| 3.11| 20.18| 92.68| | | |vcube 208 | 7.3 GiB| 4.08| 31.74| 149.68| | | -|H48 h8 | 7.1 GiB| 3.25| 23.75| 99.82| | | -|H48 h7 | 3.5 GiB| 2.22| 17.12| 82.14| | | +|egg h8 | 7.2 GiB| 0.48| 2.82| 13.16| | | +|H48 h8 | 7.1 GiB| 3.23| 24.26| 100.15| | | +|egg h7 | 3.6 GiB| 0.39| 2.94| 15.77| | | +|H48 h7 | 3.5 GiB| 2.22| 17.12| 82.35| | | |vcube 112 | 2.4 GiB| 2.33| 22.53| 98.23| | | -|H48 h6 | 1.8 GiB| 2.21| 16.70| 81.86| | | +|egg h6 | 1.8 GiB| 0.36| 2.76| 14.83| | | +|H48 h6 | 1.8 GiB| 2.24| 16.80| 83.33| | | diff --git a/benchmarks/tables_4_threads.md b/benchmarks/tables_4_threads.md index 95ec22c..b1bf9c5 100644 --- a/benchmarks/tables_4_threads.md +++ b/benchmarks/tables_4_threads.md @@ -3,26 +3,39 @@ Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 0.04| 0.14| 0.60| 3.97| 4.19| -|H48 h10 |28.3 GiB| 0.05| 0.20| 0.91| 6.65| 9.81| -|H48 h9 |14.1 GiB| 0.07| 0.39| 1.74| 12.54| 18.96| -|H48 h8 | 7.1 GiB| 0.13| 0.90| 3.71| | | -|H48 h7 | 3.5 GiB| 0.17| 1.28| 6.12| | | -|H48 h6 | 1.8 GiB| 0.33| 2.47| 12.22| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 0.00| 0.01| 0.06| 0.55| 0.03| +|H48 h11 |56.5 GiB| 0.03| 0.13| 0.50| 3.24| 4.17| +|egg h10 |29.0 GiB| 0.00| 0.03| 0.12| 1.05| 0.09| +|H48 h10 |28.3 GiB| 0.05| 0.18| 0.90| 6.21| 9.85| +|egg h9 |14.5 GiB| 0.01| 0.05| 0.23| | | +|H48 h9 |14.1 GiB| 0.07| 0.39| 1.73| 12.50| 18.97| +|egg h8 | 7.2 GiB| 0.02| 0.10| 0.48| | | +|H48 h8 | 7.1 GiB| 0.13| 0.91| 3.71| | | +|egg h7 | 3.6 GiB| 0.03| 0.21| 1.11| | | +|H48 h7 | 3.5 GiB| 0.18| 1.29| 6.19| | | +|egg h6 | 1.8 GiB| 0.05| 0.39| 2.11| | | +|H48 h6 | 1.8 GiB| 0.34| 2.48| 12.33| | | Speed-up factor (higher is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 2.55| 3.46| 3.75| 3.96| 3.71| -|H48 h10 |28.3 GiB| 3.09| 3.71| 3.67| 3.54| 3.88| -|H48 h9 |14.1 GiB| 3.25| 3.84| 3.85| | | -|H48 h8 | 7.1 GiB| 3.53| 3.72| 3.81| | | -|H48 h7 | 3.5 GiB| 3.60| 3.78| 3.80| | | -|H48 h6 | 1.8 GiB| 3.77| 3.82| 3.79| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|egg h11 |58.0 GiB| 3.77| 3.90| 3.89| 3.93| 5.42| +|H48 h11 |56.5 GiB| 2.51| 3.44| 3.75| 3.77| 3.69| +|egg h10 |29.0 GiB| 3.88| 3.77| 3.98| 3.81| 2.72| +|H48 h10 |28.3 GiB| 2.79| 3.91| 3.75| 3.73| 3.86| +|egg h9 |14.5 GiB| 3.90| 3.87| 3.88| | | +|H48 h9 |14.1 GiB| 3.18| 3.66| 3.79| | | +|egg h8 | 7.2 GiB| 3.87| 3.91| 3.81| | | +|H48 h8 | 7.1 GiB| 3.48| 3.78| 3.82| | | +|egg h7 | 3.6 GiB| 3.87| 3.87| 3.93| | | +|H48 h7 | 3.5 GiB| 3.43| 3.75| 3.77| | | +|egg h6 | 1.8 GiB| 3.98| 3.90| 3.87| | | +|H48 h6 | 1.8 GiB| 3.73| 3.84| 3.82| | | - + +
diff --git a/benchmarks/tables_all_solutions.md b/benchmarks/tables_all_solutions.md index 2959e0b..6535b60 100644 --- a/benchmarks/tables_all_solutions.md +++ b/benchmarks/tables_all_solutions.md @@ -3,24 +3,24 @@ Time per cube (in seconds, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 0.04| 0.26| 2.22| 18.96| 16.95| -|H48 h10 |28.3 GiB| 0.05| 0.42| 3.82| 34.42| 36.80| -|H48 h9 |14.1 GiB| 0.08| 0.73| 7.28| | | -|H48 h8 | 7.1 GiB| 0.15| 1.56| 15.41| | | -|H48 h7 | 3.5 GiB| 0.21| 2.38| 26.52| | | -|H48 h6 | 1.8 GiB| 0.39| 4.67| 53.00| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|H48 h11 |56.5 GiB| 0.04| 0.24| 1.88| 3.88| 1.86| +|H48 h10 |28.3 GiB| 0.05| 0.39| 3.51| 7.54| 4.29| +|H48 h9 |14.1 GiB| 0.08| 0.73| 6.92| | | +|H48 h8 | 7.1 GiB| 0.16| 1.54| 14.78| | | +|H48 h7 | 3.5 GiB| 0.22| 2.37| 25.35| | | +|H48 h6 | 1.8 GiB| 0.40| 4.58| 50.17| | | Time per cube adjusted for table size (in seconds \* GiB, lower is better). -| Solver | Size |17 moves|18 moves|19 moves|20 moves|Superflip| -|:---------|:-------|-------:|-------:|-------:|-------:|--------:| -|H48 h11 |56.5 GiB| 2.11| 14.55| 125.21| 1071.23| 957.47| -|H48 h10 |28.3 GiB| 1.48| 11.96| 107.83| 972.35| 1039.73| -|H48 h9 |14.1 GiB| 1.08| 10.29| 102.88| | | -|H48 h8 | 7.1 GiB| 1.03| 10.99| 108.87| | | -|H48 h7 | 3.5 GiB| 0.74| 8.41| 93.69| | | -|H48 h6 | 1.8 GiB| 0.70| 8.25| 93.68| | | +|Solver|Size|17 moves|18 moves|19 moves|20 moves|Superflip| +|:-----|:---|-------:|-------:|-------:|-------:|--------:| +|H48 h11 |56.5 GiB| 2.00| 13.40| 106.21| 219.43| 105.10| +|H48 h10 |28.3 GiB| 1.45| 11.13| 99.17| 212.94| 121.20| +|H48 h9 |14.1 GiB| 1.13| 10.25| 97.80| | | +|H48 h8 | 7.1 GiB| 1.10| 10.85| 104.41| | | +|H48 h7 | 3.5 GiB| 0.79| 8.38| 89.57| | | +|H48 h6 | 1.8 GiB| 0.71| 8.10| 88.68| | |
-- cgit v1.3