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 /doc | |
| 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 '')
| -rw-r--r-- | doc/h48.md | 31 | ||||
| -rw-r--r-- | doc/transformations.md | 3 |
2 files changed, 29 insertions, 5 deletions
| @@ -230,9 +230,8 @@ can be one of three kinds: | |||
| 230 | If the base value is `b`, a pruning value of 1, 2 or 3 can be used directly | 230 | If the base value is `b`, a pruning value of 1, 2 or 3 can be used directly |
| 231 | as a lower bound of b+1, b+2 and b+3 respectively. However, a value of 0 | 231 | as a lower bound of b+1, b+2 and b+3 respectively. However, a value of 0 |
| 232 | could mean that the actual lower bound is anything between 0 and b, so we | 232 | could mean that the actual lower bound is anything between 0 and b, so we |
| 233 | cannot take b as a lower bount. Instead we have to use a pruning value from | 233 | cannot take b as a lower bound. Instead we have to use a pruning value from |
| 234 | another table, for example the corner-only table mentioned in the previous | 234 | another table - see the section "Fallback tables" below. |
| 235 | section, or a completely new one. | ||
| 236 | * 1 bit per entry, or `k1`: With one bit per entry, the only information we | 235 | * 1 bit per entry, or `k1`: With one bit per entry, the only information we |
| 237 | can get from the pruning table is wether or not the current position | 236 | can get from the pruning table is wether or not the current position |
| 238 | requires more or fewer moves than a fixed base value b. This can still be | 237 | requires more or fewer moves than a fixed base value b. This can still be |
| @@ -240,6 +239,24 @@ can be one of three kinds: | |||
| 240 | pruning values. | 239 | pruning values. |
| 241 | (Work in progress - `k1` tables not available in the code yet) | 240 | (Work in progress - `k1` tables not available in the code yet) |
| 242 | 241 | ||
| 242 | ### Fallback tables | ||
| 243 | |||
| 244 | When a pruning table does not store the exact lower bound value, for | ||
| 245 | example in the case of `k2` table as described above, we need to refine | ||
| 246 | our estimate using another table, which we call *fallback table*. | ||
| 247 | In the current implementation, we actually use two different tables: | ||
| 248 | |||
| 249 | * **h0** table: for larger `k2` tables we get a fallback value from the full | ||
| 250 | table for the **h0** coordinate. | ||
| 251 | * edges-only table: to improve the pruning value for certain specific | ||
| 252 | scrambles, namely whose with solved corners such as the superflip, | ||
| 253 | we employ a second table that takes into account the edges of a full | ||
| 254 | **h11** coordinate. This table is small (around 1MB). | ||
| 255 | |||
| 256 | More tables could be used to refine the fallback estimate, but each | ||
| 257 | additional table leads to longer lookup times, especially if it is | ||
| 258 | too large to fit in cache. | ||
| 259 | |||
| 243 | ### Estimation refinements | 260 | ### Estimation refinements |
| 244 | 261 | ||
| 245 | After computing the pruning value, there are a number of different tricks | 262 | After computing the pruning value, there are a number of different tricks |
| @@ -285,6 +302,12 @@ as described above. For doing this, we need to replace the cube with its | |||
| 285 | inverse, and keep track of the moves done from now on so that we can | 302 | inverse, and keep track of the moves done from now on so that we can |
| 286 | invert them at the end to construct the final solution. | 303 | invert them at the end to construct the final solution. |
| 287 | 304 | ||
| 305 | When this technique is used, it is also possible to avoid some table | ||
| 306 | lookups: if the last move applied to the cube is a 180° move *on the | ||
| 307 | inverse position*, then the coordinate on the normal position has not | ||
| 308 | changed. Thus if we keep track of the last computed pruning value, | ||
| 309 | we can reuse it and avoid an expensive table lookup. | ||
| 310 | |||
| 288 | ### Other optimizations | 311 | ### Other optimizations |
| 289 | 312 | ||
| 290 | Other possible (low-level) optimizations include: | 313 | Other possible (low-level) optimizations include: |
| @@ -344,7 +367,7 @@ don't have this much memory. | |||
| 344 | 367 | ||
| 345 | ### 2 bits tables with for h0 and h11 | 368 | ### 2 bits tables with for h0 and h11 |
| 346 | 369 | ||
| 347 | (Work in progress - currently I there is no specialized routine for | 370 | (Work in progress - currently there is no specialized routine for |
| 348 | computing 2 bits table for "real" coordinates; instead, an optimized | 371 | computing 2 bits table for "real" coordinates; instead, an optimized |
| 349 | version of the generic method explained below is used) | 372 | version of the generic method explained below is used) |
| 350 | 373 | ||
diff --git a/doc/transformations.md b/doc/transformations.md index a180ce6..65212ea 100644 --- a/doc/transformations.md +++ b/doc/transformations.md | |||
| @@ -6,4 +6,5 @@ For example, to apply the transformation RBm (mirrored RB) to a cube C: | |||
| 6 | 1. Apply a mirror along the M plane to the solved cube | 6 | 1. Apply a mirror along the M plane to the solved cube |
| 7 | 2. Rotate the mirrored cube with z' y2 | 7 | 2. Rotate the mirrored cube with z' y2 |
| 8 | 3. Apply the cube C to the transformed solved cube | 8 | 3. Apply the cube C to the transformed solved cube |
| 9 | 4. Apply the transformations of step 1a and 1b in reverse | 9 | 4. Apply the transformations of step 2 in reverse |
| 10 | 5. Apply the transformations of step 1 in reverse | ||
