From 9ac266c76f39620d8343e46ca41cb09d1534384c Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Sat, 7 Dec 2024 16:38:40 +0100 Subject: Merge the "solver-experiments" branch that I have been working on for a few weeks. This include mainly three things: 1. Various tweaks for a total performance gain of around 30%. 2. Take into account symmetries and avoid repeated work. This required a re-work of the splitting into tasks before the solve. 3. Add a second fallback table (eoesep). This gives huge performance gains for particular scrambles (e.g. superflip). After merging this commit, remove and re-generate all pruning tables. Squashed commit of the following: commit 60f0705d2d69050e6a30581a2810f686d6f69b80 Author: Sebastiano Tronto Date: Sat Dec 7 16:06:48 2024 +0100 Fix indentation commit cc5d489a251812b6188c0ba264ac6cb2236f1afe Author: Sebastiano Tronto Date: Sat Dec 7 15:56:19 2024 +0100 Updated documentation commit a3f605dd628546e52564f82b139feb473b0725f3 Author: Sebastiano Tronto Date: Sat Dec 7 14:01:11 2024 +0100 use eoesep table as second fallback commit c75e43c9116c64f97e92b0fe038be8a032925a72 Author: Sebastiano Tronto Date: Fri Dec 6 16:13:23 2024 +0100 First commit for gendata_eoesep commit fea7688ab8bdc5ae0c3480622e2510a3bcd39248 Author: Sebastiano Tronto Date: Tue Dec 3 17:31:00 2024 +0100 Add scramble to tool commit 66866cb71dea4ca8278ecb9e90ff4295771feb42 Author: Sebastiano Tronto Date: Tue Dec 3 17:22:59 2024 +0100 Added tool to check multiple solutions commit ef65611c772c3996bddca8d181da3538e0af1674 Author: Sebastiano Tronto Date: Tue Dec 3 17:16:20 2024 +0100 Write all solutions for symmetric positions commit e3ded26db7d7d4ae7c0e2488151ed14f581f7b8e Author: Sebastiano Tronto Date: Tue Nov 26 09:14:54 2024 +0100 Added symmetry filter (TODO: print excluded solutions) commit 864c437a9751c58d58562650ca9eba4a9e6ad3eb Author: Sebastiano Tronto Date: Mon Nov 25 14:51:13 2024 +0100 Improved task split commit b88926d36d7ab0c64c5fe3bb954fd15d41267fba Author: Sebastiano Tronto Date: Fri Nov 22 19:06:41 2024 +0100 Reworked tasks for multi-threading in view of symmetry filter commit 26fa653f97df8cd601aecb80eaf89f0a00e9ba9f Author: Sebastiano Tronto Date: Thu Oct 31 15:37:43 2024 +0100 Added transform move commit 19f655ef94d658eaa2fefb5cea3c167a3ec58db6 Author: Sebastiano Tronto Date: Thu Oct 31 09:29:15 2024 +0100 Clarified doc commit 3b0fe1e5ef8b628854e30f0f0067300e2763c954 Author: Sebastiano Tronto Date: Thu Oct 31 08:36:58 2024 +0100 Handle solved cube correctly commit 57705cbc4982e3abe97a36ed64871738d4f721c0 Author: Sebastiano Tronto Date: Thu Oct 31 08:24:30 2024 +0100 Close file commit fc7d462b58bcf3d3a3fbf26c1f3bd04c640a4898 Author: Sebastiano Tronto Date: Tue Oct 29 15:05:48 2024 +0100 Removed stats tool commit 359bf7cb49ef405ee76ed662207d47cb2abcc5a9 Author: Sebastiano Tronto Date: Tue Oct 29 15:01:51 2024 +0100 Updated theory doc commit 39c315af562bc4ce896f41004388a4c34d475d37 Author: Sebastiano Tronto Date: Tue Oct 29 14:51:40 2024 +0100 Remove unused constants commit 57a5d24538aa59a4df9221dad2f99e9f0286bd9d Author: Sebastiano Tronto Date: Tue Oct 29 10:20:38 2024 +0100 Add tool to solve scrambles from file commit 07e2918c216636891b1fa6adecc9756086a901e9 Author: Sebastiano Tronto Date: Mon Oct 28 17:00:00 2024 +0100 Add make table to tool commit f5e5266c654eb027a5a35c57cc618555246f5e5e Author: Sebastiano Tronto Date: Mon Oct 28 09:35:49 2024 +0100 Remove old solver, other small things commit a1ec78025b7959dbb845213f7f4e6851ecebc204 Author: Sebastiano Tronto Date: Sun Oct 27 02:00:29 2024 +0200 Improvements commit 8eea23dbe888d923e662e24ae969130e2c67b999 Author: Sebastiano Tronto Date: Sat Oct 26 12:24:19 2024 +0200 Makefile fix commit 3fc3927beacc78971cefeb42da8d71fe6c015fc1 Author: Sebastiano Tronto Date: Fri Oct 25 18:25:09 2024 +0200 More performance gains commit 7b4efa1f9af9722de1ab9ccfc27899825a0d12c4 Author: Sebastiano Tronto Date: Fri Oct 25 15:53:20 2024 +0200 Alternative solver implementation, small performance gain --- test/063_symmetry_mask/00_solved.in | 1 + test/063_symmetry_mask/00_solved.out | 1 + test/063_symmetry_mask/01_U.in | 1 + test/063_symmetry_mask/01_U.out | 1 + test/063_symmetry_mask/02_B2.in | 1 + test/063_symmetry_mask/02_B2.out | 1 + test/063_symmetry_mask/03_superflip.in | 1 + test/063_symmetry_mask/03_superflip.out | 1 + test/063_symmetry_mask/04_scrambled.in | 1 + test/063_symmetry_mask/04_scrambled.out | 1 + test/063_symmetry_mask/symmetry_mask_tests.c | 17 +++++++++++++++++ 11 files changed, 27 insertions(+) create mode 100644 test/063_symmetry_mask/00_solved.in create mode 100644 test/063_symmetry_mask/00_solved.out create mode 100644 test/063_symmetry_mask/01_U.in create mode 100644 test/063_symmetry_mask/01_U.out create mode 100644 test/063_symmetry_mask/02_B2.in create mode 100644 test/063_symmetry_mask/02_B2.out create mode 100644 test/063_symmetry_mask/03_superflip.in create mode 100644 test/063_symmetry_mask/03_superflip.out create mode 100644 test/063_symmetry_mask/04_scrambled.in create mode 100644 test/063_symmetry_mask/04_scrambled.out create mode 100644 test/063_symmetry_mask/symmetry_mask_tests.c (limited to 'test/063_symmetry_mask') diff --git a/test/063_symmetry_mask/00_solved.in b/test/063_symmetry_mask/00_solved.in new file mode 100644 index 0000000..dff224d --- /dev/null +++ b/test/063_symmetry_mask/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/test/063_symmetry_mask/00_solved.out b/test/063_symmetry_mask/00_solved.out new file mode 100644 index 0000000..05fdc4c --- /dev/null +++ b/test/063_symmetry_mask/00_solved.out @@ -0,0 +1 @@ +111111111111111111111111111111111111111111111111 diff --git a/test/063_symmetry_mask/01_U.in b/test/063_symmetry_mask/01_U.in new file mode 100644 index 0000000..b5b36ad --- /dev/null +++ b/test/063_symmetry_mask/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/test/063_symmetry_mask/01_U.out b/test/063_symmetry_mask/01_U.out new file mode 100644 index 0000000..a71f9f4 --- /dev/null +++ b/test/063_symmetry_mask/01_U.out @@ -0,0 +1 @@ +111100000000000000000000000000000000000000000000 diff --git a/test/063_symmetry_mask/02_B2.in b/test/063_symmetry_mask/02_B2.in new file mode 100644 index 0000000..9b33e35 --- /dev/null +++ b/test/063_symmetry_mask/02_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/test/063_symmetry_mask/02_B2.out b/test/063_symmetry_mask/02_B2.out new file mode 100644 index 0000000..9a040fc --- /dev/null +++ b/test/063_symmetry_mask/02_B2.out @@ -0,0 +1 @@ +100010000100010000000000100010000100010000000000 diff --git a/test/063_symmetry_mask/03_superflip.in b/test/063_symmetry_mask/03_superflip.in new file mode 100644 index 0000000..ec7594a --- /dev/null +++ b/test/063_symmetry_mask/03_superflip.in @@ -0,0 +1 @@ +UF1 UB1 DB1 DF1 UR1 UL1 DL1 DR1 FR1 FL1 BL1 BR1 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 diff --git a/test/063_symmetry_mask/03_superflip.out b/test/063_symmetry_mask/03_superflip.out new file mode 100644 index 0000000..05fdc4c --- /dev/null +++ b/test/063_symmetry_mask/03_superflip.out @@ -0,0 +1 @@ +111111111111111111111111111111111111111111111111 diff --git a/test/063_symmetry_mask/04_scrambled.in b/test/063_symmetry_mask/04_scrambled.in new file mode 100644 index 0000000..6c52430 --- /dev/null +++ b/test/063_symmetry_mask/04_scrambled.in @@ -0,0 +1 @@ +UB1 UL0 UF1 DL0 FL0 DB0 BR0 BL0 DF0 FR0 DR0 UR0 UBR1 DFR1 UBL0 DFL2 DBR1 DBL2 UFR1 UFL1 diff --git a/test/063_symmetry_mask/04_scrambled.out b/test/063_symmetry_mask/04_scrambled.out new file mode 100644 index 0000000..4b9bb89 --- /dev/null +++ b/test/063_symmetry_mask/04_scrambled.out @@ -0,0 +1 @@ +100000000000000000000000000000000000000000000000 diff --git a/test/063_symmetry_mask/symmetry_mask_tests.c b/test/063_symmetry_mask/symmetry_mask_tests.c new file mode 100644 index 0000000..ccc2623 --- /dev/null +++ b/test/063_symmetry_mask/symmetry_mask_tests.c @@ -0,0 +1,17 @@ +#include "../test.h" + +uint64_t symmetry_mask(cube_t); + +void run(void) { + char str[STRLENMAX]; + uint64_t i, result; + cube_t cube; + + fgets(str, STRLENMAX, stdin); + cube = readcube("H48", str); + result = symmetry_mask(cube); + + for (i = 0; i < 48; result >>= 1, i++) + printf("%" PRIu64, result % UINT64_C(2)); + printf("\n"); +} -- cgit v1.3