From 067ba55add258ab03db328234168af66c4ad87c3 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 10 Nov 2023 17:07:42 +0100 Subject: Towards a definitve API --- old/061_coord_eo/00_solved.in | 1 + old/061_coord_eo/00_solved.out | 1 + old/061_coord_eo/01_U.in | 1 + old/061_coord_eo/01_U.out | 1 + old/061_coord_eo/02_U2.in | 1 + old/061_coord_eo/02_U2.out | 1 + old/061_coord_eo/03_U3.in | 1 + old/061_coord_eo/03_U3.out | 1 + old/061_coord_eo/04_D.in | 1 + old/061_coord_eo/04_D.out | 1 + old/061_coord_eo/07_R.in | 1 + old/061_coord_eo/07_R.out | 1 + old/061_coord_eo/08_R2.in | 1 + old/061_coord_eo/08_R2.out | 1 + old/061_coord_eo/10_L.in | 1 + old/061_coord_eo/10_L.out | 1 + old/061_coord_eo/13_F.in | 1 + old/061_coord_eo/13_F.out | 1 + old/061_coord_eo/14_F2.in | 1 + old/061_coord_eo/14_F2.out | 1 + old/061_coord_eo/15_F3.in | 1 + old/061_coord_eo/15_F3.out | 1 + old/061_coord_eo/16_B.in | 1 + old/061_coord_eo/16_B.out | 1 + old/061_coord_eo/17_B2.in | 1 + old/061_coord_eo/17_B2.out | 1 + old/061_coord_eo/18_B3.in | 1 + old/061_coord_eo/18_B3.out | 1 + old/061_coord_eo/20_scrambled.in | 3 + old/061_coord_eo/20_scrambled.out | 1 + old/061_coord_eo/coord_eo_tests.c | 26 ++++ old/benchmark/bench.c | 83 ++++++++++++ old/benchmark/bench.sh | 21 +++ old/benchmark/cube-bench.c | 147 +++++++++++++++++++++ .../results/results-2023-10-31-18-54-37.txt | 32 +++++ .../results/results-2023-10-31-19-13-49.txt | 32 +++++ .../results/results-2023-11-01-20-55-21.txt | 32 +++++ .../results/results-2023-11-03-23-08-50.txt | 18 +++ .../results/results-2023-11-03-23-10-40.txt | 32 +++++ .../results/results-2023-11-04-10-22-43.txt | 32 +++++ .../results/results-2023-11-04-10-23-11.txt | 32 +++++ .../results/results-2023-11-04-10-23-43.txt | 32 +++++ .../results/results-2023-11-04-10-24-08.txt | 32 +++++ .../results/results-2023-11-04-10-52-05.txt | 32 +++++ .../results/results-2023-11-04-10-53-06.txt | 32 +++++ .../results/results-2023-11-04-10-57-46.txt | 32 +++++ .../results/results-2023-11-10-15-49-45.txt | 28 ++++ old/benchmark/results/results.txt | 28 ++++ 48 files changed, 735 insertions(+) create mode 100644 old/061_coord_eo/00_solved.in create mode 100644 old/061_coord_eo/00_solved.out create mode 100644 old/061_coord_eo/01_U.in create mode 100644 old/061_coord_eo/01_U.out create mode 100644 old/061_coord_eo/02_U2.in create mode 100644 old/061_coord_eo/02_U2.out create mode 100644 old/061_coord_eo/03_U3.in create mode 100644 old/061_coord_eo/03_U3.out create mode 100644 old/061_coord_eo/04_D.in create mode 100644 old/061_coord_eo/04_D.out create mode 100644 old/061_coord_eo/07_R.in create mode 100644 old/061_coord_eo/07_R.out create mode 100644 old/061_coord_eo/08_R2.in create mode 100644 old/061_coord_eo/08_R2.out create mode 100644 old/061_coord_eo/10_L.in create mode 100644 old/061_coord_eo/10_L.out create mode 100644 old/061_coord_eo/13_F.in create mode 100644 old/061_coord_eo/13_F.out create mode 100644 old/061_coord_eo/14_F2.in create mode 100644 old/061_coord_eo/14_F2.out create mode 100644 old/061_coord_eo/15_F3.in create mode 100644 old/061_coord_eo/15_F3.out create mode 100644 old/061_coord_eo/16_B.in create mode 100644 old/061_coord_eo/16_B.out create mode 100644 old/061_coord_eo/17_B2.in create mode 100644 old/061_coord_eo/17_B2.out create mode 100644 old/061_coord_eo/18_B3.in create mode 100644 old/061_coord_eo/18_B3.out create mode 100644 old/061_coord_eo/20_scrambled.in create mode 100644 old/061_coord_eo/20_scrambled.out create mode 100644 old/061_coord_eo/coord_eo_tests.c create mode 100644 old/benchmark/bench.c create mode 100755 old/benchmark/bench.sh create mode 100644 old/benchmark/cube-bench.c create mode 100644 old/benchmark/results/results-2023-10-31-18-54-37.txt create mode 100644 old/benchmark/results/results-2023-10-31-19-13-49.txt create mode 100644 old/benchmark/results/results-2023-11-01-20-55-21.txt create mode 100644 old/benchmark/results/results-2023-11-03-23-08-50.txt create mode 100644 old/benchmark/results/results-2023-11-03-23-10-40.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-22-43.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-23-11.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-23-43.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-24-08.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-52-05.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-53-06.txt create mode 100644 old/benchmark/results/results-2023-11-04-10-57-46.txt create mode 100644 old/benchmark/results/results-2023-11-10-15-49-45.txt create mode 100644 old/benchmark/results/results.txt (limited to 'old') diff --git a/old/061_coord_eo/00_solved.in b/old/061_coord_eo/00_solved.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/old/061_coord_eo/00_solved.in @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/old/061_coord_eo/00_solved.out b/old/061_coord_eo/00_solved.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/00_solved.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/01_U.in b/old/061_coord_eo/01_U.in new file mode 100644 index 0000000..b5b36ad --- /dev/null +++ b/old/061_coord_eo/01_U.in @@ -0,0 +1 @@ +UR0 UL0 DB0 DF0 UB0 UF0 DL0 DR0 FR0 FL0 BL0 BR0 UBR0 UFL0 DFL0 DBR0 UFR0 UBL0 DFR0 DBL0 diff --git a/old/061_coord_eo/01_U.out b/old/061_coord_eo/01_U.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/01_U.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/02_U2.in b/old/061_coord_eo/02_U2.in new file mode 100644 index 0000000..316ad57 --- /dev/null +++ b/old/061_coord_eo/02_U2.in @@ -0,0 +1 @@ +UB0 UF0 DB0 DF0 UL0 UR0 DL0 DR0 FR0 FL0 BL0 BR0 UBL0 UFR0 DFL0 DBR0 UBR0 UFL0 DFR0 DBL0 diff --git a/old/061_coord_eo/02_U2.out b/old/061_coord_eo/02_U2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/02_U2.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/03_U3.in b/old/061_coord_eo/03_U3.in new file mode 100644 index 0000000..7721ab5 --- /dev/null +++ b/old/061_coord_eo/03_U3.in @@ -0,0 +1 @@ +UL0 UR0 DB0 DF0 UF0 UB0 DL0 DR0 FR0 FL0 BL0 BR0 UFL0 UBR0 DFL0 DBR0 UBL0 UFR0 DFR0 DBL0 diff --git a/old/061_coord_eo/03_U3.out b/old/061_coord_eo/03_U3.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/03_U3.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/04_D.in b/old/061_coord_eo/04_D.in new file mode 100644 index 0000000..cf4f816 --- /dev/null +++ b/old/061_coord_eo/04_D.in @@ -0,0 +1 @@ +UF0 UB0 DR0 DL0 UR0 UL0 DB0 DF0 FR0 FL0 BL0 BR0 UFR0 UBL0 DBL0 DFR0 UFL0 UBR0 DFL0 DBR0 diff --git a/old/061_coord_eo/04_D.out b/old/061_coord_eo/04_D.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/04_D.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/07_R.in b/old/061_coord_eo/07_R.in new file mode 100644 index 0000000..8c8fcb3 --- /dev/null +++ b/old/061_coord_eo/07_R.in @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 FR0 UL0 DL0 BR0 DR0 FL0 BL0 UR0 DFR2 UBL0 DFL0 UBR2 UFL0 UFR1 DBR1 DBL0 diff --git a/old/061_coord_eo/07_R.out b/old/061_coord_eo/07_R.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/07_R.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/08_R2.in b/old/061_coord_eo/08_R2.in new file mode 100644 index 0000000..90765e2 --- /dev/null +++ b/old/061_coord_eo/08_R2.in @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 DR0 UL0 DL0 UR0 BR0 FL0 BL0 FR0 DBR0 UBL0 DFL0 UFR0 UFL0 DFR0 UBR0 DBL0 diff --git a/old/061_coord_eo/08_R2.out b/old/061_coord_eo/08_R2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/08_R2.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/10_L.in b/old/061_coord_eo/10_L.in new file mode 100644 index 0000000..0b0565c --- /dev/null +++ b/old/061_coord_eo/10_L.in @@ -0,0 +1 @@ +UF0 UB0 DB0 DF0 UR0 BL0 FL0 DR0 FR0 UL0 DL0 BR0 UFR0 DBL2 UFL2 DBR0 UBL1 UBR0 DFR0 DFL1 diff --git a/old/061_coord_eo/10_L.out b/old/061_coord_eo/10_L.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/10_L.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/13_F.in b/old/061_coord_eo/13_F.in new file mode 100644 index 0000000..e805af8 --- /dev/null +++ b/old/061_coord_eo/13_F.in @@ -0,0 +1 @@ +FL1 UB0 DB0 FR1 UR0 UL0 DL0 DR0 UF1 DF1 BL0 BR0 UFL1 UBL0 DFR1 DBR0 DFL2 UBR0 UFR2 DBL0 diff --git a/old/061_coord_eo/13_F.out b/old/061_coord_eo/13_F.out new file mode 100644 index 0000000..2c60641 --- /dev/null +++ b/old/061_coord_eo/13_F.out @@ -0,0 +1 @@ +388 diff --git a/old/061_coord_eo/14_F2.in b/old/061_coord_eo/14_F2.in new file mode 100644 index 0000000..8aa701f --- /dev/null +++ b/old/061_coord_eo/14_F2.in @@ -0,0 +1 @@ +DF0 UB0 DB0 UF0 UR0 UL0 DL0 DR0 FL0 FR0 BL0 BR0 DFL0 UBL0 UFR0 DBR0 DFR0 UBR0 UFL0 DBL0 diff --git a/old/061_coord_eo/14_F2.out b/old/061_coord_eo/14_F2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/14_F2.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/15_F3.in b/old/061_coord_eo/15_F3.in new file mode 100644 index 0000000..40f1260 --- /dev/null +++ b/old/061_coord_eo/15_F3.in @@ -0,0 +1 @@ +FR1 UB0 DB0 FL1 UR0 UL0 DL0 DR0 DF1 UF1 BL0 BR0 DFR1 UBL0 UFL1 DBR0 UFR2 UBR0 DFL2 DBL0 diff --git a/old/061_coord_eo/15_F3.out b/old/061_coord_eo/15_F3.out new file mode 100644 index 0000000..2c60641 --- /dev/null +++ b/old/061_coord_eo/15_F3.out @@ -0,0 +1 @@ +388 diff --git a/old/061_coord_eo/16_B.in b/old/061_coord_eo/16_B.in new file mode 100644 index 0000000..f7fb13c --- /dev/null +++ b/old/061_coord_eo/16_B.in @@ -0,0 +1 @@ +UF0 BR1 BL1 DF0 UR0 UL0 DL0 DR0 FR0 FL0 UB1 DB1 UFR0 UBR1 DFL0 DBL1 UFL0 DBR2 DFR0 UBL2 diff --git a/old/061_coord_eo/16_B.out b/old/061_coord_eo/16_B.out new file mode 100644 index 0000000..1fd9918 --- /dev/null +++ b/old/061_coord_eo/16_B.out @@ -0,0 +1 @@ +1539 diff --git a/old/061_coord_eo/17_B2.in b/old/061_coord_eo/17_B2.in new file mode 100644 index 0000000..9b33e35 --- /dev/null +++ b/old/061_coord_eo/17_B2.in @@ -0,0 +1 @@ +UF0 DB0 UB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BR0 BL0 UFR0 DBR0 DFL0 UBL0 UFL0 DBL0 DFR0 UBR0 diff --git a/old/061_coord_eo/17_B2.out b/old/061_coord_eo/17_B2.out new file mode 100644 index 0000000..573541a --- /dev/null +++ b/old/061_coord_eo/17_B2.out @@ -0,0 +1 @@ +0 diff --git a/old/061_coord_eo/18_B3.in b/old/061_coord_eo/18_B3.in new file mode 100644 index 0000000..1367517 --- /dev/null +++ b/old/061_coord_eo/18_B3.in @@ -0,0 +1 @@ +UF0 BL1 BR1 DF0 UR0 UL0 DL0 DR0 FR0 FL0 DB1 UB1 UFR0 DBL1 DFL0 UBR1 UFL0 UBL2 DFR0 DBR2 diff --git a/old/061_coord_eo/18_B3.out b/old/061_coord_eo/18_B3.out new file mode 100644 index 0000000..1fd9918 --- /dev/null +++ b/old/061_coord_eo/18_B3.out @@ -0,0 +1 @@ +1539 diff --git a/old/061_coord_eo/20_scrambled.in b/old/061_coord_eo/20_scrambled.in new file mode 100644 index 0000000..274d30b --- /dev/null +++ b/old/061_coord_eo/20_scrambled.in @@ -0,0 +1,3 @@ +UL0 BL0 BR1 DL0 FR0 DF0 DB1 DR1 UB0 FL0 UF0 UR1 DFL0 UFR1 DBR1 UBR2 DBL2 DFR0 UFL1 UBL2 + +// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B' diff --git a/old/061_coord_eo/20_scrambled.out b/old/061_coord_eo/20_scrambled.out new file mode 100644 index 0000000..aa309cc --- /dev/null +++ b/old/061_coord_eo/20_scrambled.out @@ -0,0 +1 @@ +1122 diff --git a/old/061_coord_eo/coord_eo_tests.c b/old/061_coord_eo/coord_eo_tests.c new file mode 100644 index 0000000..30989e8 --- /dev/null +++ b/old/061_coord_eo/coord_eo_tests.c @@ -0,0 +1,26 @@ +#include +#include +#include + +#ifdef CUBE_AVX2 +#include +#endif + +#include "../../cube.h" + +#define STRLENMAX 10000 + +int main() { + char str[STRLENMAX]; + cube_t cube; + int16_t result; + + fgets(str, STRLENMAX, stdin); + cube = readcube("H48", str); + + result = coord_eo(cube); + + printf("%" PRId16 "\n", result); + + return 0; +} diff --git a/old/benchmark/bench.c b/old/benchmark/bench.c new file mode 100644 index 0000000..2c3358f --- /dev/null +++ b/old/benchmark/bench.c @@ -0,0 +1,83 @@ +#include +#include +#include +#include +#include + +#include "../cube.h" + +#define MOVES 100000000 +#define TRANS 100000000 +#define COMPOSE 100000000 +#define INVERSE 100000000 + +double +bench(cube_t (*run)(int64_t), int64_t n, char *name) +{ + char str[1000]; + cube_t cube; + struct timespec start, end; + double tdiff, tdsec, tdnano; + + printf("\n"); + fflush(stdout); + + if (run == NULL) { + printf("> %s: nothing to run!\n", name); + fflush(stdout); + return -1.0; + } + + printf("> %s: running benchmark...\n", name); + fflush(stdout); + clock_gettime(CLOCK_MONOTONIC, &start); + + cube = run(n); + writecube("H48", cube, str); + str[3] = 0; + printf("> %s: resulting cube, first piece: %s\n", name, str); + fflush(stdout); + + clock_gettime(CLOCK_MONOTONIC, &end); + tdsec = end.tv_sec - start.tv_sec; + tdnano = end.tv_nsec - start.tv_nsec; + tdiff = tdsec + 1e-9 * tdnano; + printf("> %s: %.4fs\n", name, tdiff); + fflush(stdout); + + return tdiff; +} + +int main() { + double tmoves, ttrans, tcompose, tinverse; + + printf( + "Benchmarks settings:\n" + "MOVES:\t%d\nTRANS:\t%d\nCOMPOSE:\t%d\nINVERSE:\t%d\n", + MOVES, TRANS, COMPOSE, INVERSE + ); + fflush(stdout); + + srand(time(NULL)); + + tmoves = bench(run_moves, MOVES, "moves"); + ttrans = bench(run_trans, TRANS, "trans"); + tcompose = bench(run_compose, COMPOSE, "compose"); + tinverse = bench(run_inverse, INVERSE, "inverse"); + + printf( + "\nBenchmark summary:\n" + "moves: %d moves in %.4fs (%.4f MTPS)\n" + "trans: %d transformations in %.4fs (%.4f MTPS)\n" + "compose: %d compositions in %.4fs (%.4f MCPS)\n" + "inverse: %d inverses in %.4fs (%.4f MIPS)\n" + "Total time: %.4f\n", + MOVES, tmoves, MOVES / (1e6 * tmoves), + TRANS, ttrans, TRANS / (1e6 * ttrans), + COMPOSE, tcompose, COMPOSE / (1e6 * tcompose), + INVERSE, tinverse, INVERSE / (1e6 * tinverse), + tmoves + ttrans + tcompose + tinverse + ); + + return 0; +} diff --git a/old/benchmark/bench.sh b/old/benchmark/bench.sh new file mode 100755 index 0000000..cc31c1e --- /dev/null +++ b/old/benchmark/bench.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +CC="cc -std=c99 -O3 -D$CUBETYPE" +if [ "$CUBETYPE" = "CUBE_AVX2" ]; then + CC="$CC -mavx2" +fi + +BENCHBIN="benchmark/run" +BENCHDIR="benchmark/results" +CUBEOBJ="cube.o" + +$CC -D_POSIX_C_SOURCE=199309L -o $BENCHBIN benchmark/bench.c $CUBEOBJ || exit 1 + +d="$(date +'%Y-%m-%d-%H-%M-%S')" +mkdir -p "$BENCHDIR" +$BENCHBIN | tee "$BENCHDIR/results-$d.txt" "$BENCHDIR/results.txt" + +echo "" +echo "Results saved to $BENCHDIR/results.txt" + +rm -rf $BENCHBIN $CUBEOBJ diff --git a/old/benchmark/cube-bench.c b/old/benchmark/cube-bench.c new file mode 100644 index 0000000..26d12a4 --- /dev/null +++ b/old/benchmark/cube-bench.c @@ -0,0 +1,147 @@ +/****************************************************************************** +Section: benchmarks + +Here you can find some simple functions that can be used to benchmark the +rest of the code. +******************************************************************************/ + +#define RANDOMCUBES 157 + +static void +setup_randomcubes(cube_fast_t *cubes) +{ + int i; + + for (i = 0; i < RANDOMCUBES; i++) + cubes[i] = run_moves(i*4); +} + +cube_t +run_moves(int64_t n) +{ + cube_fast_t fast; + int64_t m, i; + + fast = solvedcube(); + m = n / 18; + + for (i = 0; i < m; i++) { + fast = _move_U(fast); + fast = _move_U2(fast); + fast = _move_U3(fast); + fast = _move_D(fast); + fast = _move_D2(fast); + fast = _move_D3(fast); + fast = _move_R(fast); + fast = _move_R2(fast); + fast = _move_R3(fast); + fast = _move_L(fast); + fast = _move_L2(fast); + fast = _move_L3(fast); + fast = _move_F(fast); + fast = _move_F2(fast); + fast = _move_F3(fast); + fast = _move_B(fast); + fast = _move_B2(fast); + fast = _move_B3(fast); + } + + for (i = m * 18; i < n; i++) + fast = _move_F(fast); + + return fast; +} + +cube_t +run_trans(int64_t n) +{ + cube_fast_t fast; + int64_t m, i; + + fast = run_moves(33); + m = n / 18; + + for (i = 0; i < m; i++) { + fast = _trans_UFr(fast); + fast = _trans_ULr(fast); + fast = _trans_UBr(fast); + fast = _trans_URr(fast); + fast = _trans_DFr(fast); + fast = _trans_DLr(fast); + fast = _trans_DBr(fast); + fast = _trans_DRr(fast); + fast = _trans_RUr(fast); + fast = _trans_RFr(fast); + fast = _trans_RDr(fast); + fast = _trans_RBr(fast); + fast = _trans_LUr(fast); + fast = _trans_LFr(fast); + fast = _trans_LDr(fast); + fast = _trans_LBr(fast); + fast = _trans_FUr(fast); + fast = _trans_FRr(fast); + fast = _trans_FDr(fast); + fast = _trans_FLr(fast); + fast = _trans_BUr(fast); + fast = _trans_BRr(fast); + fast = _trans_BDr(fast); + fast = _trans_BLr(fast); + fast = _trans_UFm(fast); + fast = _trans_ULm(fast); + fast = _trans_UBm(fast); + fast = _trans_URm(fast); + fast = _trans_DFm(fast); + fast = _trans_DLm(fast); + fast = _trans_DBm(fast); + fast = _trans_DRm(fast); + fast = _trans_RUm(fast); + fast = _trans_RFm(fast); + fast = _trans_RDm(fast); + fast = _trans_RBm(fast); + fast = _trans_LUm(fast); + fast = _trans_LFm(fast); + fast = _trans_LDm(fast); + fast = _trans_LBm(fast); + fast = _trans_FUm(fast); + fast = _trans_FRm(fast); + fast = _trans_FDm(fast); + fast = _trans_FLm(fast); + fast = _trans_BUm(fast); + fast = _trans_BRm(fast); + fast = _trans_BDm(fast); + fast = _trans_BLm(fast); + } + + for (i = m * 18; i < n; i++) + fast = _trans_FRm(fast); + + return fast; +} + +cube_t +run_compose(int64_t n) +{ + cube_fast_t fast, cubes[RANDOMCUBES]; + int64_t i; + + setup_randomcubes(cubes); + + for (i = 0; i < n; i++) + fast = compose_fast(fast, cubes[i % RANDOMCUBES]); + + return fast; +} + +cube_t +run_inverse(int64_t n) +{ + cube_fast_t fast, cubes[RANDOMCUBES]; + int64_t i; + + setup_randomcubes(cubes); + + for (i = 0; i < n; i++) + fast = inverse_fast(cubes[i % RANDOMCUBES]); + + return fast; +} diff --git a/old/benchmark/results/results-2023-10-31-18-54-37.txt b/old/benchmark/results/results-2023-10-31-18-54-37.txt new file mode 100644 index 0000000..c0f84e5 --- /dev/null +++ b/old/benchmark/results/results-2023-10-31-18-54-37.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UR0 +> moves: 3.5626s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 9.9028s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 2.9944s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: DB0 +> inv: 2.6475s + +Benchmark summary: +moves: 100000000 moves in 3.5626s (28.0697 MTPS) +trans: 100000000 trans in 9.9028s (10.0981 MTPS) +comp: 100000000 comps in 2.9944s (33.3956 MCPS) +inv: 100000000 invs in 2.6475s (37.7714 MIPS) +Total time: 19.1073 diff --git a/old/benchmark/results/results-2023-10-31-19-13-49.txt b/old/benchmark/results/results-2023-10-31-19-13-49.txt new file mode 100644 index 0000000..b0716f1 --- /dev/null +++ b/old/benchmark/results/results-2023-10-31-19-13-49.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UF0 +> moves: 3.5096s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 9.8367s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 2.9693s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: FL0 +> inv: 2.6227s + +Benchmark summary: +moves: 100000000 moves in 3.5096s (28.4930 MTPS) +trans: 100000000 trans in 9.8367s (10.1660 MTPS) +comp: 100000000 comps in 2.9693s (33.6784 MCPS) +inv: 100000000 invs in 2.6227s (38.1283 MIPS) +Total time: 18.9383 diff --git a/old/benchmark/results/results-2023-11-01-20-55-21.txt b/old/benchmark/results/results-2023-11-01-20-55-21.txt new file mode 100644 index 0000000..adf1fd8 --- /dev/null +++ b/old/benchmark/results/results-2023-11-01-20-55-21.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: BL1 +> moves: 3.6556s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 7.5844s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 3.0103s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: DL0 +> inv: 2.6601s + +Benchmark summary: +moves: 100000000 moves in 3.6556s (27.3556 MTPS) +trans: 100000000 trans in 7.5844s (13.1850 MTPS) +comp: 100000000 comps in 3.0103s (33.2191 MCPS) +inv: 100000000 invs in 2.6601s (37.5929 MIPS) +Total time: 16.9103 diff --git a/old/benchmark/results/results-2023-11-03-23-08-50.txt b/old/benchmark/results/results-2023-11-03-23-08-50.txt new file mode 100644 index 0000000..12e2aa6 --- /dev/null +++ b/old/benchmark/results/results-2023-11-03-23-08-50.txt @@ -0,0 +1,18 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: ERR +> moves: 6.6791s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: ERR +> trans: 6.6844s + +> comp: setting up benchmark... +> comp: running benchmark... diff --git a/old/benchmark/results/results-2023-11-03-23-10-40.txt b/old/benchmark/results/results-2023-11-03-23-10-40.txt new file mode 100644 index 0000000..5be1c1f --- /dev/null +++ b/old/benchmark/results/results-2023-11-03-23-10-40.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: BL1 +> moves: 1.6354s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: ERR +> trans: 1.9863s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 0.3505s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: DL1 +> inv: 0.7249s + +Benchmark summary: +moves: 100000000 moves in 1.6354s (61.1463 MTPS) +trans: 100000000 trans in 1.9863s (50.3458 MTPS) +comp: 100000000 comps in 0.3505s (285.3105 MCPS) +inv: 100000000 invs in 0.7249s (137.9488 MIPS) +Total time: 4.6971 diff --git a/old/benchmark/results/results-2023-11-04-10-22-43.txt b/old/benchmark/results/results-2023-11-04-10-22-43.txt new file mode 100644 index 0000000..7a2c483 --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-22-43.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UF0 +> moves: 1.3535s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 1.6526s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UR0 +> comp: 0.2848s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: DF0 +> inv: 0.6598s + +Benchmark summary: +moves: 100000000 moves in 1.3535s (73.8828 MTPS) +trans: 100000000 trans in 1.6526s (60.5112 MTPS) +comp: 100000000 comps in 0.2848s (351.1409 MCPS) +inv: 100000000 invs in 0.6598s (151.5679 MIPS) +Total time: 3.9506 diff --git a/old/benchmark/results/results-2023-11-04-10-23-11.txt b/old/benchmark/results/results-2023-11-04-10-23-11.txt new file mode 100644 index 0000000..f3a60de --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-23-11.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UL1 +> moves: 1.3463s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 1.6303s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 0.2881s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: UF0 +> inv: 0.6853s + +Benchmark summary: +moves: 100000000 moves in 1.3463s (74.2803 MTPS) +trans: 100000000 trans in 1.6303s (61.3400 MTPS) +comp: 100000000 comps in 0.2881s (347.0564 MCPS) +inv: 100000000 invs in 0.6853s (145.9211 MIPS) +Total time: 3.9499 diff --git a/old/benchmark/results/results-2023-11-04-10-23-43.txt b/old/benchmark/results/results-2023-11-04-10-23-43.txt new file mode 100644 index 0000000..e1f557c --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-23-43.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UF0 +> moves: 1.3434s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 1.6439s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UR1 +> comp: 0.2872s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: DF0 +> inv: 0.6646s + +Benchmark summary: +moves: 100000000 moves in 1.3434s (74.4399 MTPS) +trans: 100000000 trans in 1.6439s (60.8320 MTPS) +comp: 100000000 comps in 0.2872s (348.1848 MCPS) +inv: 100000000 invs in 0.6646s (150.4726 MIPS) +Total time: 3.9390 diff --git a/old/benchmark/results/results-2023-11-04-10-24-08.txt b/old/benchmark/results/results-2023-11-04-10-24-08.txt new file mode 100644 index 0000000..46eb403 --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-24-08.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UF0 +> moves: 1.3330s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 1.6094s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 0.2827s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: BL0 +> inv: 0.6527s + +Benchmark summary: +moves: 100000000 moves in 1.3330s (75.0200 MTPS) +trans: 100000000 trans in 1.6094s (62.1335 MTPS) +comp: 100000000 comps in 0.2827s (353.7582 MCPS) +inv: 100000000 invs in 0.6527s (153.2026 MIPS) +Total time: 3.8778 diff --git a/old/benchmark/results/results-2023-11-04-10-52-05.txt b/old/benchmark/results/results-2023-11-04-10-52-05.txt new file mode 100644 index 0000000..597eddf --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-52-05.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UL0 +> moves: 3.6559s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 7.9072s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: BL1 +> comp: 3.3698s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: FL1 +> inv: 2.6933s + +Benchmark summary: +moves: 100000000 moves in 3.6559s (27.3528 MTPS) +trans: 100000000 trans in 7.9072s (12.6467 MTPS) +comp: 100000000 comps in 3.3698s (29.6755 MCPS) +inv: 100000000 invs in 2.6933s (37.1296 MIPS) +Total time: 17.6262 diff --git a/old/benchmark/results/results-2023-11-04-10-53-06.txt b/old/benchmark/results/results-2023-11-04-10-53-06.txt new file mode 100644 index 0000000..8543d81 --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-53-06.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UR1 +> moves: 1.3554s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 1.6302s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 0.2880s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: DR1 +> inv: 0.6567s + +Benchmark summary: +moves: 100000000 moves in 1.3554s (73.7816 MTPS) +trans: 100000000 trans in 1.6302s (61.3423 MTPS) +comp: 100000000 comps in 0.2880s (347.2758 MCPS) +inv: 100000000 invs in 0.6567s (152.2870 MIPS) +Total time: 3.9302 diff --git a/old/benchmark/results/results-2023-11-04-10-57-46.txt b/old/benchmark/results/results-2023-11-04-10-57-46.txt new file mode 100644 index 0000000..1ad4579 --- /dev/null +++ b/old/benchmark/results/results-2023-11-04-10-57-46.txt @@ -0,0 +1,32 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMP: 100000000 +INV: 100000000 + +> moves: setting up benchmark... +> moves: running benchmark... +> moves: resulting cube, first piece: UL0 +> moves: 1.3518s + +> trans: setting up benchmark... +> trans: running benchmark... +> trans: resulting cube, first piece: UF0 +> trans: 1.6350s + +> comp: setting up benchmark... +> comp: running benchmark... +> comp: resulting cube, first piece: UF0 +> comp: 0.3039s + +> inv: setting up benchmark... +> inv: running benchmark... +> comp: resulting cube, first piece: UR1 +> inv: 0.6681s + +Benchmark summary: +moves: 100000000 moves in 1.3518s (73.9734 MTPS) +trans: 100000000 trans in 1.6350s (61.1621 MTPS) +comp: 100000000 comps in 0.3039s (329.0593 MCPS) +inv: 100000000 invs in 0.6681s (149.6737 MIPS) +Total time: 3.9589 diff --git a/old/benchmark/results/results-2023-11-10-15-49-45.txt b/old/benchmark/results/results-2023-11-10-15-49-45.txt new file mode 100644 index 0000000..6c64bc8 --- /dev/null +++ b/old/benchmark/results/results-2023-11-10-15-49-45.txt @@ -0,0 +1,28 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMPOSE: 100000000 +INVERSE: 100000000 + +> moves: running benchmark... +> moves: resulting cube, first piece: UB0 +> moves: 0.0097s + +> trans: running benchmark... +> trans: resulting cube, first piece: DB0 +> trans: 20.1464s + +> compose: running benchmark... +> compose: resulting cube, first piece: ERR +> compose: 3.7322s + +> inverse: running benchmark... +> inverse: resulting cube, first piece: DB0 +> inverse: 2.1003s + +Benchmark summary: +moves: 100000000 moves in 0.0097s (10259.5134 MTPS) +trans: 100000000 transformations in 20.1464s (4.9637 MTPS) +compose: 100000000 compositions in 3.7322s (26.7940 MCPS) +inverse: 100000000 inverses in 2.1003s (47.6116 MIPS) +Total time: 25.9886 diff --git a/old/benchmark/results/results.txt b/old/benchmark/results/results.txt new file mode 100644 index 0000000..6c64bc8 --- /dev/null +++ b/old/benchmark/results/results.txt @@ -0,0 +1,28 @@ +Benchmarks settings: +MOVES: 100000000 +TRANS: 100000000 +COMPOSE: 100000000 +INVERSE: 100000000 + +> moves: running benchmark... +> moves: resulting cube, first piece: UB0 +> moves: 0.0097s + +> trans: running benchmark... +> trans: resulting cube, first piece: DB0 +> trans: 20.1464s + +> compose: running benchmark... +> compose: resulting cube, first piece: ERR +> compose: 3.7322s + +> inverse: running benchmark... +> inverse: resulting cube, first piece: DB0 +> inverse: 2.1003s + +Benchmark summary: +moves: 100000000 moves in 0.0097s (10259.5134 MTPS) +trans: 100000000 transformations in 20.1464s (4.9637 MTPS) +compose: 100000000 compositions in 3.7322s (26.7940 MCPS) +inverse: 100000000 inverses in 2.1003s (47.6116 MIPS) +Total time: 25.9886 -- cgit v1.3