diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-07 16:38:40 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-12-07 16:38:40 +0100 |
| commit | 9ac266c76f39620d8343e46ca41cb09d1534384c (patch) | |
| tree | 823bd419d99fe0f00e6b5b713237a73b4ec7ffca /src/utils | |
| parent | ea25a7ccad625c4e664dfd114147971b8a2677f3 (diff) | |
| download | nissy-core-9ac266c76f39620d8343e46ca41cb09d1534384c.tar.gz nissy-core-9ac266c76f39620d8343e46ca41cb09d1534384c.zip | |
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 <sebastiano@tronto.net>
Date: Sat Dec 7 16:06:48 2024 +0100
Fix indentation
commit cc5d489a251812b6188c0ba264ac6cb2236f1afe
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Sat Dec 7 15:56:19 2024 +0100
Updated documentation
commit a3f605dd628546e52564f82b139feb473b0725f3
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Sat Dec 7 14:01:11 2024 +0100
use eoesep table as second fallback
commit c75e43c9116c64f97e92b0fe038be8a032925a72
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri Dec 6 16:13:23 2024 +0100
First commit for gendata_eoesep
commit fea7688ab8bdc5ae0c3480622e2510a3bcd39248
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Dec 3 17:31:00 2024 +0100
Add scramble to tool
commit 66866cb71dea4ca8278ecb9e90ff4295771feb42
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Dec 3 17:22:59 2024 +0100
Added tool to check multiple solutions
commit ef65611c772c3996bddca8d181da3538e0af1674
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Dec 3 17:16:20 2024 +0100
Write all solutions for symmetric positions
commit e3ded26db7d7d4ae7c0e2488151ed14f581f7b8e
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Nov 26 09:14:54 2024 +0100
Added symmetry filter (TODO: print excluded solutions)
commit 864c437a9751c58d58562650ca9eba4a9e6ad3eb
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Mon Nov 25 14:51:13 2024 +0100
Improved task split
commit b88926d36d7ab0c64c5fe3bb954fd15d41267fba
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri Nov 22 19:06:41 2024 +0100
Reworked tasks for multi-threading in view of symmetry filter
commit 26fa653f97df8cd601aecb80eaf89f0a00e9ba9f
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Thu Oct 31 15:37:43 2024 +0100
Added transform move
commit 19f655ef94d658eaa2fefb5cea3c167a3ec58db6
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Thu Oct 31 09:29:15 2024 +0100
Clarified doc
commit 3b0fe1e5ef8b628854e30f0f0067300e2763c954
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Thu Oct 31 08:36:58 2024 +0100
Handle solved cube correctly
commit 57705cbc4982e3abe97a36ed64871738d4f721c0
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Thu Oct 31 08:24:30 2024 +0100
Close file
commit fc7d462b58bcf3d3a3fbf26c1f3bd04c640a4898
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Oct 29 15:05:48 2024 +0100
Removed stats tool
commit 359bf7cb49ef405ee76ed662207d47cb2abcc5a9
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Oct 29 15:01:51 2024 +0100
Updated theory doc
commit 39c315af562bc4ce896f41004388a4c34d475d37
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Oct 29 14:51:40 2024 +0100
Remove unused constants
commit 57a5d24538aa59a4df9221dad2f99e9f0286bd9d
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Tue Oct 29 10:20:38 2024 +0100
Add tool to solve scrambles from file
commit 07e2918c216636891b1fa6adecc9756086a901e9
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Mon Oct 28 17:00:00 2024 +0100
Add make table to tool
commit f5e5266c654eb027a5a35c57cc618555246f5e5e
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Mon Oct 28 09:35:49 2024 +0100
Remove old solver, other small things
commit a1ec78025b7959dbb845213f7f4e6851ecebc204
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Sun Oct 27 02:00:29 2024 +0200
Improvements
commit 8eea23dbe888d923e662e24ae969130e2c67b999
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Sat Oct 26 12:24:19 2024 +0200
Makefile fix
commit 3fc3927beacc78971cefeb42da8d71fe6c015fc1
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri Oct 25 18:25:09 2024 +0200
More performance gains
commit 7b4efa1f9af9722de1ab9ccfc27899825a0d12c4
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri Oct 25 15:53:20 2024 +0200
Alternative solver implementation, small performance gain
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/constants.h | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/src/utils/constants.h b/src/utils/constants.h index ab1b9d8..dd2b92a 100644 --- a/src/utils/constants.h +++ b/src/utils/constants.h | |||
| @@ -93,12 +93,11 @@ STATIC int64_t binomial[12][12] = { | |||
| 93 | #define TRANS_BDm UINT8_C(46) | 93 | #define TRANS_BDm UINT8_C(46) |
| 94 | #define TRANS_BLm UINT8_C(47) | 94 | #define TRANS_BLm UINT8_C(47) |
| 95 | 95 | ||
| 96 | #define MM_NORMAL UINT8_C(0x00) | 96 | #define NMOVES (1+MOVE_B3) |
| 97 | #define MM_INVERSE UINT8_C(0x01) | 97 | #define NTRANS (1+TRANS_BLr) |
| 98 | #define MM_INVERSEBRANCH UINT8_C(0x03) | 98 | |
| 99 | #define MM_NORMALBRANCH UINT8_C(0x02) | 99 | #define MM_ALLMOVES UINT32_C(0x3FFFF) |
| 100 | #define MM_ALLMOVES UINT32_C(0x3FFFF) | 100 | #define MM_NOHALFTURNS UINT32_C(0x2DB6D) |
| 101 | #define MM_NOHALFTURNS UINT32_C(0x2DB6D) | ||
| 102 | 101 | ||
| 103 | #define CORNER_UFR UINT8_C(0) | 102 | #define CORNER_UFR UINT8_C(0) |
| 104 | #define CORNER_UBL UINT8_C(1) | 103 | #define CORNER_UBL UINT8_C(1) |
| @@ -296,3 +295,54 @@ static uint8_t inverse_trans_table[48] = { | |||
| 296 | [TRANS_BLr] = TRANS_RDr, | 295 | [TRANS_BLr] = TRANS_RDr, |
| 297 | [TRANS_BLm] = TRANS_LDm, | 296 | [TRANS_BLm] = TRANS_LDm, |
| 298 | }; | 297 | }; |
| 298 | |||
| 299 | static uint8_t trans_move_table[48][3] = { | ||
| 300 | [TRANS_UFr] = { MOVE_U, MOVE_R, MOVE_F }, | ||
| 301 | [TRANS_UFm] = { MOVE_U, MOVE_L, MOVE_F }, | ||
| 302 | [TRANS_ULr] = { MOVE_U, MOVE_F, MOVE_L }, | ||
| 303 | [TRANS_ULm] = { MOVE_U, MOVE_F, MOVE_R }, | ||
| 304 | [TRANS_UBr] = { MOVE_U, MOVE_L, MOVE_B }, | ||
| 305 | [TRANS_UBm] = { MOVE_U, MOVE_R, MOVE_B }, | ||
| 306 | [TRANS_URr] = { MOVE_U, MOVE_B, MOVE_R }, | ||
| 307 | [TRANS_URm] = { MOVE_U, MOVE_B, MOVE_L }, | ||
| 308 | [TRANS_DFr] = { MOVE_D, MOVE_L, MOVE_F }, | ||
| 309 | [TRANS_DFm] = { MOVE_D, MOVE_R, MOVE_F }, | ||
| 310 | [TRANS_DLr] = { MOVE_D, MOVE_B, MOVE_L }, | ||
| 311 | [TRANS_DLm] = { MOVE_D, MOVE_B, MOVE_R }, | ||
| 312 | [TRANS_DBr] = { MOVE_D, MOVE_R, MOVE_B }, | ||
| 313 | [TRANS_DBm] = { MOVE_D, MOVE_L, MOVE_B }, | ||
| 314 | [TRANS_DRr] = { MOVE_D, MOVE_F, MOVE_R }, | ||
| 315 | [TRANS_DRm] = { MOVE_D, MOVE_F, MOVE_L }, | ||
| 316 | [TRANS_RUr] = { MOVE_R, MOVE_F, MOVE_U }, | ||
| 317 | [TRANS_RUm] = { MOVE_L, MOVE_F, MOVE_U }, | ||
| 318 | [TRANS_RFr] = { MOVE_R, MOVE_D, MOVE_F }, | ||
| 319 | [TRANS_RFm] = { MOVE_L, MOVE_D, MOVE_F }, | ||
| 320 | [TRANS_RDr] = { MOVE_R, MOVE_B, MOVE_D }, | ||
| 321 | [TRANS_RDm] = { MOVE_L, MOVE_B, MOVE_D }, | ||
| 322 | [TRANS_RBr] = { MOVE_R, MOVE_U, MOVE_B }, | ||
| 323 | [TRANS_RBm] = { MOVE_L, MOVE_U, MOVE_B }, | ||
| 324 | [TRANS_LUr] = { MOVE_L, MOVE_B, MOVE_U }, | ||
| 325 | [TRANS_LUm] = { MOVE_R, MOVE_B, MOVE_U }, | ||
| 326 | [TRANS_LFr] = { MOVE_L, MOVE_U, MOVE_F }, | ||
| 327 | [TRANS_LFm] = { MOVE_R, MOVE_U, MOVE_F }, | ||
| 328 | [TRANS_LDr] = { MOVE_L, MOVE_F, MOVE_D }, | ||
| 329 | [TRANS_LDm] = { MOVE_R, MOVE_F, MOVE_D }, | ||
| 330 | [TRANS_LBr] = { MOVE_L, MOVE_D, MOVE_B }, | ||
| 331 | [TRANS_LBm] = { MOVE_R, MOVE_D, MOVE_B }, | ||
| 332 | [TRANS_FUr] = { MOVE_F, MOVE_L, MOVE_U }, | ||
| 333 | [TRANS_FUm] = { MOVE_F, MOVE_R, MOVE_U }, | ||
| 334 | [TRANS_FRr] = { MOVE_F, MOVE_U, MOVE_R }, | ||
| 335 | [TRANS_FRm] = { MOVE_F, MOVE_U, MOVE_L }, | ||
| 336 | [TRANS_FDr] = { MOVE_F, MOVE_R, MOVE_D }, | ||
| 337 | [TRANS_FDm] = { MOVE_F, MOVE_L, MOVE_D }, | ||
| 338 | [TRANS_FLr] = { MOVE_F, MOVE_D, MOVE_L }, | ||
| 339 | [TRANS_FLm] = { MOVE_F, MOVE_D, MOVE_R }, | ||
| 340 | [TRANS_BUr] = { MOVE_B, MOVE_R, MOVE_U }, | ||
| 341 | [TRANS_BUm] = { MOVE_B, MOVE_L, MOVE_U }, | ||
| 342 | [TRANS_BRr] = { MOVE_B, MOVE_D, MOVE_R }, | ||
| 343 | [TRANS_BRm] = { MOVE_B, MOVE_D, MOVE_L }, | ||
| 344 | [TRANS_BDr] = { MOVE_B, MOVE_L, MOVE_D }, | ||
| 345 | [TRANS_BDm] = { MOVE_B, MOVE_R, MOVE_D }, | ||
| 346 | [TRANS_BLr] = { MOVE_B, MOVE_U, MOVE_L }, | ||
| 347 | [TRANS_BLm] = { MOVE_B, MOVE_U, MOVE_R }, | ||
| 348 | }; | ||
