diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2022-06-01 20:30:16 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2022-06-01 20:30:16 +0200 |
| commit | 2feaa43610b63c190762ad4b233ad648e30636d6 (patch) | |
| tree | 795b481a73e55c5d742c45aca31888d79d171170 | |
| parent | 2b1b1970f774aa451f4fae197c0b1177118f3570 (diff) | |
| download | nissy-2feaa43610b63c190762ad4b233ad648e30636d6.tar.gz nissy-2feaa43610b63c190762ad4b233ad648e30636d6.zip | |
Version 2.0.2
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | INSTALL | 93 | ||||
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | TODO.md | 3 | ||||
| -rw-r--r-- | adhoc/README | 3 | ||||
| -rwxr-xr-x | adhoc/compile.sh | 15 | ||||
| -rw-r--r-- | adhoc/cornersdrhtr.c | 128 | ||||
| -rwxr-xr-x | adhoc/run | bin | 322392 -> 0 bytes | |||
| -rw-r--r-- | doc/nissy.html | 314 | ||||
| -rw-r--r-- | doc/nissy.pdf | bin | 33154 -> 0 bytes | |||
| -rwxr-xr-x | nissy | bin | 327768 -> 0 bytes | |||
| -rw-r--r-- | src/pruning.c | 4 | ||||
| -rw-r--r-- | www/download/index.html | 73 |
13 files changed, 95 insertions, 542 deletions
| @@ -1 +1,4 @@ | |||
| 1 | nissy | 1 | nissy |
| 2 | nissy-* | ||
| 3 | doc/*.html | ||
| 4 | doc/*.pdf | ||
| @@ -4,57 +4,78 @@ Nissy is available at https://nissy.tronto.net | |||
| 4 | 4 | ||
| 5 | # Requirements | 5 | # Requirements |
| 6 | 6 | ||
| 7 | A full installation of nissy requires about 3Gb of space, | 7 | A full installation of nissy requires about 3Gb of space, of which |
| 8 | of which 2.3Gb are occupied by the huge pruning table for fast optimal solving, | 8 | 2.3Gb are occupied by the huge pruning table for fast optimal solving, |
| 9 | and running it requires the same amount of RAM. | 9 | and running it requires the same amount of RAM. One can choose to never |
| 10 | One can choose to never use this function and not to install the relative | 10 | use this function and not to install the relative pruning table. There |
| 11 | pruning table. There is an alternative (slower) | 11 | is an alternative (slower) optimal solving function that uses about |
| 12 | optimal solving function that uses about 500Mb of RAM. | 12 | 500Mb of RAM. When generating the pruning tables automatically (see |
| 13 | the section Tables below), at least 5.3Gb or RAM are required. | ||
| 13 | 14 | ||
| 14 | # Installation | 15 | # Installation |
| 15 | 16 | ||
| 16 | ## On Windows | 17 | ## On Windows |
| 17 | 18 | ||
| 18 | Try downloading and executing in a terminal the file nissy.exe, then | 19 | Try downloading and executing in a terminal the file nissy.exe, then |
| 19 | follow the instructions in the Tables section below for | 20 | follow the instructions in the Tables section below for installing the |
| 20 | installing the pruning tables. | 21 | pruning tables. If nissy.exe does not work, you can try following the |
| 21 | If nissy.exe does not work, you can try following the UNIX instructions | 22 | UNIX instructions in WSL (Windows Subsystem for Linux) or in a similar |
| 22 | in WSL (Windows Subsystem for Linux) or in a similar environment. | 23 | environment. |
| 23 | |||
| 24 | Sorry for the inconvenience, I don't have a Windows machine to test this on. | ||
| 25 | 24 | ||
| 26 | ## On a UNIX system: | 25 | ## On a UNIX system: |
| 27 | 26 | ||
| 28 | Edit the Makefile to match your local configuration (usually not necessary, but you | 27 | Download the source archive (.tar.gz). Extract it with your favorite |
| 29 | may want to change the PREFIX variable) and run make, followed by make install. | 28 | archive program, for example with |
| 30 | Follow the instructions below to install the pruning tables. | 29 | |
| 30 | tar -xvzf nissy-VERSION.tar.gz | ||
| 31 | |||
| 32 | Open a terminal in the directory just extracted. If you wish, edit the | ||
| 33 | Makefile to match your local configuration (this is usually not necessary, | ||
| 34 | but you may want to change the PREFIX variable to change the installation | ||
| 35 | path) and run | ||
| 36 | |||
| 37 | make | ||
| 38 | |||
| 39 | followed by | ||
| 40 | |||
| 41 | make install | ||
| 42 | |||
| 43 | Then follow the instructions below to install the pruning tables. | ||
| 31 | 44 | ||
| 32 | ## Tables | 45 | ## Tables |
| 33 | Nissy needs to generate certain large tables to work. These tables are by default | ||
| 34 | generated the first time they are needed (e.g the first time you ask to solve a | ||
| 35 | certain step) and then saved to a file. Whenever these tables are needed again, | ||
| 36 | nissy simply loads the corresponding file from the hard disk. | ||
| 37 | 46 | ||
| 38 | The very large table for optimal solving can take some time to generate | 47 | Once you have installed nissy, run |
| 39 | (about 1.5 hours on my fairly old but decent laptop, using 8 CPU threads). | ||
| 40 | In order to generate it you need at least 5Gb of RAM. | ||
| 41 | All other tables are much faster. | ||
| 42 | 48 | ||
| 43 | You can ask nissy to generate all the tables it will ever need with the gen | 49 | nissy gen |
| 44 | command. It is recommended to use more than one thread, if your CPU has them. | ||
| 45 | For example, you can run: | ||
| 46 | 50 | ||
| 47 | nissy gen -t 8 | 51 | to generate all the tables that Nissy will ever need. Running this |
| 52 | command requires around 5.3Gb of RAM, and it can take some time (about | ||
| 53 | 40 minutes on my fairly old but decent laptop, with 8 CPU threads). | ||
| 48 | 54 | ||
| 49 | to generate all tables using 8 threads. | 55 | Some unnecessary technical detail: by default this command is going to |
| 56 | use at most 64 threads. If you want you can choose to use more threads | ||
| 57 | (if your CPU is very powerful) or fewer threads (if you for example | ||
| 58 | want to run this command in the background while you do other stuff) | ||
| 59 | with the -t option, for example nissy gen -t 1. | ||
| 50 | 60 | ||
| 51 | Alternatively, you can simply download all the tables and copy them into the | 61 | Alternatively, you can download all the tables (1.7Gb) and copy them |
| 52 | correct folder (see manual page, ENVIRONMENT section). On UNIX operating | 62 | into the correct folder (see manual page, ENVIRONMENT section). On UNIX |
| 53 | systems this folder is either .nissy/tables in the user's home directory or | 63 | operating systems this folder is either .nissy/tables in the user's |
| 54 | $XDG_DATA_HOME/nissy/tables if the XDG variable is configured. On Windows | 64 | home directory or $XDG_DATA_HOME/nissy/tables if the XDG variable |
| 55 | it is the same directory as the nissy.exe executable file. | 65 | is configured. On Windows it is the same directory as the nissy.exe |
| 66 | executable file. | ||
| 56 | 67 | ||
| 57 | You can downloads all the tables from the following link: | 68 | You can downloads all the tables from the following link: |
| 58 | https://nissy.tronto.net/nissy-tables-2.0.zip | 69 | |
| 59 | The version 2.0 at the end of the file name is only indicative. | 70 | https://nissy.tronto.net/nissy-tables-2.0.2.zip |
| 60 | Later versions will use the same tables, unless otherwise specified. | 71 | |
| 72 | # Upgrading | ||
| 73 | |||
| 74 | If you already have nissy installed and you want to upgrade to a more | ||
| 75 | recent version, you can simply repeat the installation process: | ||
| 76 | * On Windows: simply replace nissy.exe with the new file with the same name. | ||
| 77 | * On UNIX systems: download the new version of the source code, extract it | ||
| 78 | in a new folder and run make and make install again. | ||
| 79 | |||
| 80 | Between each version new table files might have been added, or old ones | ||
| 81 | may be not used anymore. Nissy will deal with this automatically. | ||
| @@ -27,6 +27,7 @@ debug: | |||
| 27 | 27 | ||
| 28 | clean: | 28 | clean: |
| 29 | rm -rf nissy nissy*.exe nissy*.tar.gz | 29 | rm -rf nissy nissy*.exe nissy*.tar.gz |
| 30 | rm doc/nissy.html doc/nissy.pdf | ||
| 30 | 31 | ||
| 31 | dist: clean nissy.exe | 32 | dist: clean nissy.exe |
| 32 | mkdir -p nissy-${VERSION} | 33 | mkdir -p nissy-${VERSION} |
| @@ -4,6 +4,8 @@ This is a list of things that I would like to add or change at some point. | |||
| 4 | It's more of a personal reminder than anything else. | 4 | It's more of a personal reminder than anything else. |
| 5 | 5 | ||
| 6 | ## Version 2.0.2 | 6 | ## Version 2.0.2 |
| 7 | ### Website | ||
| 8 | * now gen takes 40 minutes | ||
| 7 | ### Changelog | 9 | ### Changelog |
| 8 | * Only improved table generation speed, but this required huge changes in | 10 | * Only improved table generation speed, but this required huge changes in |
| 9 | coordinates.c and symcoord.c (+ some minor changes in other parts). | 11 | coordinates.c and symcoord.c (+ some minor changes in other parts). |
| @@ -44,6 +46,7 @@ It's more of a personal reminder than anything else. | |||
| 44 | ### Tables management | 46 | ### Tables management |
| 45 | * Check files in tables directory, add command to remove old / extraneous files | 47 | * Check files in tables directory, add command to remove old / extraneous files |
| 46 | * Add checksum to check that tables are generated / downloaded correctly | 48 | * Add checksum to check that tables are generated / downloaded correctly |
| 49 | * Edit download page update instructions to tell what to do when changing tables | ||
| 47 | 50 | ||
| 48 | ## Commands | 51 | ## Commands |
| 49 | 52 | ||
diff --git a/adhoc/README b/adhoc/README deleted file mode 100644 index 8f72c6e..0000000 --- a/adhoc/README +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | This folder contains some ad-hoc code that is not included in the main nissy | ||
| 2 | program. You probably don't need it, but it may be worth looking into if you | ||
| 3 | are trying to extend nissy by writing your own steps or other functions. | ||
diff --git a/adhoc/compile.sh b/adhoc/compile.sh deleted file mode 100755 index aa541c7..0000000 --- a/adhoc/compile.sh +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #/!bin/sh | ||
| 2 | |||
| 3 | mkdir build | ||
| 4 | cd build | ||
| 5 | cp -R ../../src ./ | ||
| 6 | rm src/shell.c | ||
| 7 | cp ../$1 src/ | ||
| 8 | cp ../../Makefile ./ | ||
| 9 | make | ||
| 10 | cp nissy ../run | ||
| 11 | rm src/* | ||
| 12 | rmdir src | ||
| 13 | rm * | ||
| 14 | cd .. | ||
| 15 | rmdir build | ||
diff --git a/adhoc/cornersdrhtr.c b/adhoc/cornersdrhtr.c deleted file mode 100644 index 2a5a6e6..0000000 --- a/adhoc/cornersdrhtr.c +++ /dev/null | |||
| @@ -1,128 +0,0 @@ | |||
| 1 | #include "commands.h" | ||
| 2 | |||
| 3 | /* Some of the following functions are new, some are copied from steps.c */ | ||
| 4 | bool | ||
| 5 | allowed(Move m) | ||
| 6 | { | ||
| 7 | return base_move(m) == U || m == R2 || m == F2; | ||
| 8 | } | ||
| 9 | |||
| 10 | bool | ||
| 11 | allowed_next(Move l2, Move l1, Move m) | ||
| 12 | { | ||
| 13 | return base_move(m) != base_move(l1); | ||
| 14 | } | ||
| 15 | |||
| 16 | bool | ||
| 17 | check_cornershtr(Cube c) | ||
| 18 | { | ||
| 19 | return coord_cornershtr.index(c) == 0; | ||
| 20 | } | ||
| 21 | |||
| 22 | bool | ||
| 23 | check_coud_and_dbl(Cube c) | ||
| 24 | { | ||
| 25 | return c.coud == 0 && what_corner_at(c, DBL) == DBL; | ||
| 26 | } | ||
| 27 | |||
| 28 | static int | ||
| 29 | estimate_cornershtr_HTM(DfsArg *arg) | ||
| 30 | { | ||
| 31 | return ptableval(&pd_cornershtr_HTM, arg->cube); | ||
| 32 | } | ||
| 33 | |||
| 34 | static bool | ||
| 35 | validate_singlecw_ending(Alg *alg) | ||
| 36 | { | ||
| 37 | int i; | ||
| 38 | bool nor, inv; | ||
| 39 | Move l2 = NULLMOVE, l1 = NULLMOVE, l2i = NULLMOVE, l1i = NULLMOVE; | ||
| 40 | |||
| 41 | for (i = 0; i < alg->len; i++) { | ||
| 42 | if (alg->inv[i]) { | ||
| 43 | l2i = l1i; | ||
| 44 | l1i = alg->move[i]; | ||
| 45 | } else { | ||
| 46 | l2 = l1; | ||
| 47 | l1 = alg->move[i]; | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 51 | nor = l1 ==base_move(l1) && (!commute(l1, l2) ||l2 ==base_move(l2)); | ||
| 52 | inv = l1i==base_move(l1i) && (!commute(l1i,l2i)||l2i==base_move(l2i)); | ||
| 53 | |||
| 54 | return nor && inv; | ||
| 55 | } | ||
| 56 | |||
| 57 | int | ||
| 58 | main() | ||
| 59 | { | ||
| 60 | Moveset moveset_UR2F2 = { | ||
| 61 | .allowed = allowed, | ||
| 62 | .allowed_next = allowed_next, | ||
| 63 | }; | ||
| 64 | |||
| 65 | init_moveset(&moveset_UR2F2); | ||
| 66 | |||
| 67 | /* | ||
| 68 | * This step is the same as cornershtr_HTM in steps.c, except for | ||
| 69 | * the ready() function (which is not relevant anyway, it is there | ||
| 70 | * more for testing than anything else) and the moveset. | ||
| 71 | */ | ||
| 72 | Step step = { | ||
| 73 | .final = false, | ||
| 74 | .is_done = check_cornershtr, | ||
| 75 | .estimate = estimate_cornershtr_HTM, | ||
| 76 | .ready = check_coud_and_dbl, | ||
| 77 | .is_valid = validate_singlecw_ending, | ||
| 78 | .moveset = &moveset_UR2F2, | ||
| 79 | |||
| 80 | .pre_trans = uf, | ||
| 81 | |||
| 82 | .tables = {&pd_cornershtr_HTM}, | ||
| 83 | .ntables = 1, | ||
| 84 | }; | ||
| 85 | |||
| 86 | SolveOptions opts = { | ||
| 87 | .min_moves = 0, | ||
| 88 | .max_moves = 20, | ||
| 89 | .max_solutions = 1, | ||
| 90 | .nthreads = 4, | ||
| 91 | .optimal = 0, | ||
| 92 | .can_niss = false, | ||
| 93 | .verbose = false, | ||
| 94 | .all = false, | ||
| 95 | .print_number = false, | ||
| 96 | .count_only = false | ||
| 97 | }; | ||
| 98 | |||
| 99 | init_symcoord(); | ||
| 100 | |||
| 101 | bool cphtr_state_done[BINOM8ON4*6]; | ||
| 102 | for (unsigned long int i = 0; i < BINOM8ON4*6; i++) | ||
| 103 | cphtr_state_done[i] = false; | ||
| 104 | |||
| 105 | for (unsigned long int i = 0; i < FACTORIAL8; i++) { | ||
| 106 | AlgList *sols; | ||
| 107 | Cube c = {0}; | ||
| 108 | c.cp = i; /* inconsistent state because of side CO */ | ||
| 109 | |||
| 110 | if (what_corner_at(c, DBL) != DBL || | ||
| 111 | cphtr_state_done[coord_cphtr.index(c)]) | ||
| 112 | continue; | ||
| 113 | |||
| 114 | fprintf(stderr, "Doing cp %ld (cphtr state %ld)\n", | ||
| 115 | i, coord_cphtr.index(c)); | ||
| 116 | |||
| 117 | cphtr_state_done[coord_cphtr.index(c)] = true; | ||
| 118 | /* Comment next two lines to get non-reduced list */ | ||
| 119 | Cube mirror = apply_trans(ur_mirror, c); | ||
| 120 | cphtr_state_done[coord_cphtr.index(mirror)] = true; | ||
| 121 | |||
| 122 | sols = solve(c, &step, &opts); | ||
| 123 | printf("%.2d\t", sols->first->alg->len); | ||
| 124 | print_alglist(sols, opts.print_number); | ||
| 125 | } | ||
| 126 | |||
| 127 | return 0; | ||
| 128 | } | ||
diff --git a/adhoc/run b/adhoc/run deleted file mode 100755 index 27541c2..0000000 --- a/adhoc/run +++ /dev/null | |||
| Binary files differ | |||
diff --git a/doc/nissy.html b/doc/nissy.html deleted file mode 100644 index f39100e..0000000 --- a/doc/nissy.html +++ /dev/null | |||
| @@ -1,314 +0,0 @@ | |||
| 1 | <!-- Creator : groff version 1.22.4 --> | ||
| 2 | <!-- CreationDate: Mon Feb 21 22:56:07 2022 --> | ||
| 3 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
| 4 | "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 5 | <html> | ||
| 6 | <head> | ||
| 7 | <meta name="generator" content="groff -Thtml, see www.gnu.org"> | ||
| 8 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | ||
| 9 | <meta name="Content-Style" content="text/css"> | ||
| 10 | <style type="text/css"> | ||
| 11 | p { margin-top: 0; margin-bottom: 0; vertical-align: top } | ||
| 12 | pre { margin-top: 0; margin-bottom: 0; vertical-align: top } | ||
| 13 | table { margin-top: 0; margin-bottom: 0; vertical-align: top } | ||
| 14 | h1 { text-align: center } | ||
| 15 | </style> | ||
| 16 | <title></title> | ||
| 17 | </head> | ||
| 18 | <body> | ||
| 19 | |||
| 20 | <hr> | ||
| 21 | |||
| 22 | |||
| 23 | <p>NISSY(1) BSD General Commands Manual NISSY(1)</p> | ||
| 24 | |||
| 25 | <p style="margin-top: 1em"><b>NAME</b></p> | ||
| 26 | |||
| 27 | <p style="margin-left:6%;"><b>nissy</b> — a | ||
| 28 | Rubik’s cube solver and FMC assistant</p> | ||
| 29 | |||
| 30 | <p style="margin-top: 1em"><b>SYNOPSIS</b></p> | ||
| 31 | |||
| 32 | <p style="margin-left:14%;"><b>nissy</b> [<b>−b</b>] | ||
| 33 | <b><br> | ||
| 34 | nissy</b> <i>command</i> [options...]</p> | ||
| 35 | |||
| 36 | <p style="margin-top: 1em"><b>DESCRIPTION</b></p> | ||
| 37 | |||
| 38 | <p style="margin-left:6%;"><b>nissy</b> is a Rubik’s | ||
| 39 | Cube solver. It uses techniques from Herbert | ||
| 40 | Kociemba’s Cube Explorer and Tomas Rokicki’s | ||
| 41 | nxopt. With 4 cores at 2.5GHz and using less than 3Gb of | ||
| 42 | RAM, Nissy can find the optimal solution for a random | ||
| 43 | Rubik’s cube position in about a minute on average. | ||
| 44 | Nissy can also solve different substeps of the | ||
| 45 | Thistlethwaite’s algorithm and more.</p> | ||
| 46 | |||
| 47 | <p style="margin-left:6%; margin-top: 1em">When run without | ||
| 48 | any argument an interactive shell is launched, otherwise the | ||
| 49 | provided <i>command</i> is executed and nissy terminates. If | ||
| 50 | the option <b>−b</b> is given, every argument after it | ||
| 51 | is ignored and the shell is launched without any prompt or | ||
| 52 | welcome message. This can be used to run nissy in batch | ||
| 53 | mode, for example writing a list of commands in a | ||
| 54 | <i>file</i> (one per line) and running <i>nissy -b < | ||
| 55 | file</i></p> | ||
| 56 | |||
| 57 | <p style="margin-left:6%; margin-top: 1em">The commands | ||
| 58 | that can be run in the interactive shell are the same that | ||
| 59 | can be run non-interactively and are provided below.</p> | ||
| 60 | |||
| 61 | <p style="margin-top: 1em"><b>COMMANDS</b></p> | ||
| 62 | |||
| 63 | <p style="margin-left:6%;">The available <i>commands</i> | ||
| 64 | are the following:</p> | ||
| 65 | |||
| 66 | <p style="margin-top: 1em"><b>commands</b></p> | ||
| 67 | |||
| 68 | <p style="margin-left:17%;">List all available | ||
| 69 | commands.</p> | ||
| 70 | |||
| 71 | <p style="margin-top: 1em"><b>gen</b> [<b>−t</b> | ||
| 72 | <i>N</i>]</p> | ||
| 73 | |||
| 74 | <p style="margin-left:17%;">Generate all tables used by | ||
| 75 | nissy. Run this to complete your installation. If <i>N</i> | ||
| 76 | is specified, <i>N</i> CPU threads will be used (defaults to | ||
| 77 | 1).</p> | ||
| 78 | |||
| 79 | <p style="margin-top: 1em"><b>help</b> [<i>command</i>]</p> | ||
| 80 | |||
| 81 | <p style="margin-left:17%;">Display help. If no | ||
| 82 | <i>command</i> is given, a generic help message is printed, | ||
| 83 | otherwise a specific help relative to <i>command</i> is | ||
| 84 | returned.</p> | ||
| 85 | |||
| 86 | <p style="margin-top: 1em"><b>invert</b> | ||
| 87 | <i>scramble</i></p> | ||
| 88 | |||
| 89 | <p style="margin-left:17%;">Invert the given scramble.</p> | ||
| 90 | |||
| 91 | <p style="margin-top: 1em"><b>print</b> <i>scramble</i></p> | ||
| 92 | |||
| 93 | <p style="margin-left:17%;">Display a text-only description | ||
| 94 | of the cube obtained after applying <i>scramble</i>.</p> | ||
| 95 | |||
| 96 | <p style="margin-top: 1em"><b>quit</b></p> | ||
| 97 | |||
| 98 | <p style="margin-left:17%; margin-top: 1em">Quit nissy.</p> | ||
| 99 | |||
| 100 | <p style="margin-top: 1em"><b>scramble</b> [ <b><br> | ||
| 101 | −n</b> <i>N</i>] [ <i><br> | ||
| 102 | type</i>]</p> | ||
| 103 | |||
| 104 | <p style="margin-left:17%;">Print a randomly-generated | ||
| 105 | (random position) scramble If <i>N</i> is given, it produces | ||
| 106 | <i>N</i> scrambles. <i>type</i> can be specified to be one | ||
| 107 | of the following:</p> | ||
| 108 | |||
| 109 | <p style="margin-top: 1em"><i>eo</i></p> | ||
| 110 | |||
| 111 | <p style="margin-left:27%; margin-top: 1em">Scramble with | ||
| 112 | solved EO on F/B axis.</p> | ||
| 113 | |||
| 114 | <p style="margin-top: 1em"><i>corners</i></p> | ||
| 115 | |||
| 116 | <p style="margin-left:27%;">Scramble with solved edges | ||
| 117 | (only cornes are scrambled).</p> | ||
| 118 | |||
| 119 | <p style="margin-top: 1em"><i>edges</i></p> | ||
| 120 | |||
| 121 | <p style="margin-left:27%; margin-top: 1em">Scramble with | ||
| 122 | solved corners (only edges are scrambled).</p> | ||
| 123 | |||
| 124 | <p style="margin-top: 1em"><b>solve</b> <i>step</i> [ | ||
| 125 | <i><br> | ||
| 126 | options</i>] <i>scramble.</i></p> | ||
| 127 | |||
| 128 | <p style="margin-left:17%;">Solve the given <i>step</i> on | ||
| 129 | the given <i>scramble.</i> By default it finds only one | ||
| 130 | (shortest) solution, without using niss, and it displays the | ||
| 131 | number of moves at the end of the line. The options for the | ||
| 132 | <i>solve</i> command are the following:</p> | ||
| 133 | |||
| 134 | <p style="margin-top: 1em"><b>−a</b></p> | ||
| 135 | |||
| 136 | <p style="margin-left:27%; margin-top: 1em">Print all | ||
| 137 | solutions: some solutions are filtered out by default for | ||
| 138 | some steps, for examples EOs that finish with F', with this | ||
| 139 | options they are not.</p> | ||
| 140 | |||
| 141 | <p style="margin-top: 1em"><b>−c</b></p> | ||
| 142 | |||
| 143 | <p style="margin-left:27%; margin-top: 1em">Display only | ||
| 144 | the number of solutions found, not the solutions | ||
| 145 | themselves.</p> | ||
| 146 | |||
| 147 | <p style="margin-top: 1em"><b>−m</b> <i>min</i></p> | ||
| 148 | |||
| 149 | <p style="margin-left:27%; margin-top: 1em">Only look for | ||
| 150 | solution that are at least <i>min</i> moves long.</p> | ||
| 151 | |||
| 152 | <p style="margin-top: 1em"><b>−M</b> <i>MAX</i></p> | ||
| 153 | |||
| 154 | <p style="margin-left:27%; margin-top: 1em">Only look for | ||
| 155 | solution that are at most <i>MAX</i> moves long.</p> | ||
| 156 | |||
| 157 | <p style="margin-top: 1em"><b>−n</b> <i>N</i></p> | ||
| 158 | |||
| 159 | <p style="margin-left:27%; margin-top: 1em">Try to find | ||
| 160 | <i>N</i> solutions. By default and unless the | ||
| 161 | <b>−M</b> or <b>−o</b> options are used, at most | ||
| 162 | one solution is returned. If at least one of <b>−M</b> | ||
| 163 | and <b>−o</b> is used, all the solutions found within | ||
| 164 | the given bounds are returned. The option <b>−s</b> | ||
| 165 | overwrites these default behaviors and at most <i>N</i> | ||
| 166 | solutions are returned, still satisfiyng the other | ||
| 167 | constraints.</p> | ||
| 168 | |||
| 169 | <p style="margin-top: 1em"><b>−N</b></p> | ||
| 170 | |||
| 171 | <p style="margin-left:27%; margin-top: 1em">Allow use of | ||
| 172 | NISS.</p> | ||
| 173 | |||
| 174 | <p style="margin-top: 1em"><b>−o</b></p> | ||
| 175 | |||
| 176 | <p style="margin-left:27%; margin-top: 1em">Only find | ||
| 177 | solutions that require the minimum number of moves.</p> | ||
| 178 | |||
| 179 | <p style="margin-top: 1em"><b>−O</b> <i>N</i></p> | ||
| 180 | |||
| 181 | <p style="margin-left:27%; margin-top: 1em">Only find | ||
| 182 | solutions that require at most <i>N</i> moves more than the | ||
| 183 | optimal solution. If <i>N</i> is 0, this is equivalent to | ||
| 184 | <b>−o</b></p> | ||
| 185 | |||
| 186 | <p style="margin-top: 1em"><b>−p</b></p> | ||
| 187 | |||
| 188 | <p style="margin-left:27%; margin-top: 1em">Plain style: do | ||
| 189 | not print the number of moves.</p> | ||
| 190 | |||
| 191 | <p style="margin-top: 1em"><b>−t</b> <i>N</i></p> | ||
| 192 | |||
| 193 | <p style="margin-left:27%; margin-top: 1em">Use <i>N</i> | ||
| 194 | CPU threads. By default nissy uses only 1 thread. Using more | ||
| 195 | than one thread will improve performance, but the optimal | ||
| 196 | number depends on your machine and operating system. | ||
| 197 | Generally, using one less than the number of threads of your | ||
| 198 | CPU works quite well.</p> | ||
| 199 | |||
| 200 | <p style="margin-top: 1em"><b>−v</b></p> | ||
| 201 | |||
| 202 | <p style="margin-left:27%; margin-top: 1em">Verbose mode: | ||
| 203 | print some information during the search and print each | ||
| 204 | solution as it is found instead of only printing them all | ||
| 205 | together at the end.</p> | ||
| 206 | |||
| 207 | <p style="margin-top: 1em"><b>steps</b></p> | ||
| 208 | |||
| 209 | <p style="margin-left:17%; margin-top: 1em">List all | ||
| 210 | available <i>steps</i> for the <i>solve</i> command.</p> | ||
| 211 | |||
| 212 | <p style="margin-top: 1em"><b>twophase</b> | ||
| 213 | <i>scramble</i></p> | ||
| 214 | |||
| 215 | <p style="margin-left:17%;">Find a solution using a | ||
| 216 | two-phase method. This does not guarantee to return an | ||
| 217 | optimal solution (and in fact most often it does not), but | ||
| 218 | it is very fast.</p> | ||
| 219 | |||
| 220 | <p style="margin-top: 1em"><b>unniss</b> | ||
| 221 | <i>scramble</i></p> | ||
| 222 | |||
| 223 | <p style="margin-left:17%;">Rewrite the scramble without | ||
| 224 | using NISS.</p> | ||
| 225 | |||
| 226 | <p style="margin-top: 1em"><b>version</b></p> | ||
| 227 | |||
| 228 | <p style="margin-left:17%;">Display version | ||
| 229 | information.</p> | ||
| 230 | |||
| 231 | <p style="margin-top: 1em"><b>SCRAMBLES</b></p> | ||
| 232 | |||
| 233 | <p style="margin-left:6%;">All the commands above that | ||
| 234 | accept a scramble also accept a <b>−i</b> option with | ||
| 235 | no arguments. If this option is given, multiple scrambles | ||
| 236 | are read from standard input (one per line) until and EOF is | ||
| 237 | found, at which point stdin is cleared.</p> | ||
| 238 | |||
| 239 | <p style="margin-top: 1em"><b>ENVIRONMENT</b></p> | ||
| 240 | |||
| 241 | <p style="margin-left:6%;">Data is stored in the folder | ||
| 242 | pointed to by <b>$NISSYDATA.</b> If that variable is unset | ||
| 243 | the folder <b>$XDG_DATA_HOME/nissy</b> or | ||
| 244 | <b>$HOME/.nissy</b> is used instead. If none of this | ||
| 245 | environment variables is defined (e.g. in a non-UNIX | ||
| 246 | system), the current folder is used.</p> | ||
| 247 | |||
| 248 | <p style="margin-top: 1em"><b>EXAMPLES</b></p> | ||
| 249 | |||
| 250 | <p style="margin-left:6%;">The command:</p> | ||
| 251 | |||
| 252 | <p style="margin-left:14%;">nissy solve -v -O 1 | ||
| 253 | "R'U'FD2L2FR2U2R2BD2LB2D'B2L'R'BD2BU2LU2R'U'F"</p> | ||
| 254 | |||
| 255 | <p style="margin-left:6%;">Returns:</p> | ||
| 256 | |||
| 257 | <p style="margin-left:14%;">Searching depth 0 <br> | ||
| 258 | Searching depth 1 <br> | ||
| 259 | (some more lines) <br> | ||
| 260 | Searching depth 16 <br> | ||
| 261 | D2 F' U2 D2 F' L2 D R2 D F B2 R' L2 F' U' D <br> | ||
| 262 | Searching depth 17 <br> | ||
| 263 | D2 F' U2 D2 F' L2 D R2 D F B2 R' L2 F' U' D (16)</p> | ||
| 264 | |||
| 265 | <p style="margin-left:6%;">Notice that the solution is | ||
| 266 | printed twice: the first time it is printed as soon as it is | ||
| 267 | found as requested by the -v option.</p> | ||
| 268 | |||
| 269 | <p style="margin-left:6%; margin-top: 1em">The command:</p> | ||
| 270 | |||
| 271 | <p style="margin-left:14%;">nissy solve eofb -m 4 -M 5 -N | ||
| 272 | -n 6 "R'U'FD2L2 FR2 U2R2BD2 L B2 D' B2 L' R'"</p> | ||
| 273 | |||
| 274 | <p style="margin-left:6%;">Returns:</p> | ||
| 275 | |||
| 276 | <p style="margin-left:14%;">U B U' B (4) <br> | ||
| 277 | U (B R' B) (4) <br> | ||
| 278 | (U B R' B) (4) <br> | ||
| 279 | U2 F R2 F (4) <br> | ||
| 280 | U2 B U2 B (4) <br> | ||
| 281 | (U2 B R' B) (4)</p> | ||
| 282 | |||
| 283 | <p style="margin-left:6%; margin-top: 1em">On a UNIX shell, | ||
| 284 | the composite command</p> | ||
| 285 | |||
| 286 | <p style="margin-left:14%;">nissy scramble -n 2 | nissy | ||
| 287 | solve -i > file.txt</p> | ||
| 288 | |||
| 289 | <p style="margin-left:6%;">Generates two random scrambles, | ||
| 290 | solves them and saves the result to file.txt. The file will | ||
| 291 | look something like this:</p> | ||
| 292 | |||
| 293 | <p style="margin-left:14%;">>>> Line: D U2 F D B' | ||
| 294 | F L2 D' F2 R2 L B2 L' U2 B2 R F2 L' D2 <br> | ||
| 295 | U2 R2 F2 L B2 D' R2 D' F U L2 B' U' R2 D2 R2 U (17) <br> | ||
| 296 | >>> Line: D B R U' B' L2 U L U D2 R L B2 U2 L2 U2 R | ||
| 297 | U2 B2 L F2 <br> | ||
| 298 | D' F R' D B L2 B R2 L U L U2 B D' U R U F2 (18)</p> | ||
| 299 | |||
| 300 | <p style="margin-top: 1em"><b>AUTHORS</b></p> | ||
| 301 | |||
| 302 | <p style="margin-left:6%;">Sebastiano Tronto | ||
| 303 | <<i>sebastiano.tronto@gmail.com</i>></p> | ||
| 304 | |||
| 305 | <p style="margin-top: 1em"><b>SOURCE CODE</b></p> | ||
| 306 | |||
| 307 | <p style="margin-left:6%;">Source code is available at | ||
| 308 | <b>https://github.com/sebastianotronto/nissy</b></p> | ||
| 309 | |||
| 310 | <p style="margin-left:6%; margin-top: 1em">BSD | ||
| 311 | February 21, 2022 BSD</p> | ||
| 312 | <hr> | ||
| 313 | </body> | ||
| 314 | </html> | ||
diff --git a/doc/nissy.pdf b/doc/nissy.pdf deleted file mode 100644 index 17f8bde..0000000 --- a/doc/nissy.pdf +++ /dev/null | |||
| Binary files differ | |||
| Binary files differ | |||
diff --git a/src/pruning.c b/src/pruning.c index a5e60ce..1dba949 100644 --- a/src/pruning.c +++ b/src/pruning.c | |||
| @@ -371,10 +371,6 @@ instance_fixnasty(void *arg) | |||
| 371 | if ((t = aux[j]) == uf) | 371 | if ((t = aux[j]) == uf) |
| 372 | continue; | 372 | continue; |
| 373 | ii = td->pd->coord->transform(t, i); | 373 | ii = td->pd->coord->transform(t, i); |
| 374 | if (ii < rmin || ii >= rmax) | ||
| 375 | fprintf(stderr, | ||
| 376 | "Error: transformed out of bound! " | ||
| 377 | "%lu %lu %lu\n", ii, rmin, rmax); | ||
| 378 | if (ptableval_index(td->pd, ii) > td->d) { | 374 | if (ptableval_index(td->pd, ii) > td->d) { |
| 379 | ptable_update_index(td->pd, ii, td->d); | 375 | ptable_update_index(td->pd, ii, td->d); |
| 380 | updated++; | 376 | updated++; |
diff --git a/www/download/index.html b/www/download/index.html index ff824f8..b115244 100644 --- a/www/download/index.html +++ b/www/download/index.html | |||
| @@ -34,8 +34,8 @@ | |||
| 34 | </tr> | 34 | </tr> |
| 35 | <tr> | 35 | <tr> |
| 36 | <td><strong>Latest version</strong></td> | 36 | <td><strong>Latest version</strong></td> |
| 37 | <td><a href="/nissy-2.0.1.tar.gz">nissy-2.0.1.tar.gz (63Kb)</a></td> | 37 | <td><a href="/nissy-2.0.2.tar.gz">nissy-2.0.2.tar.gz (67Kb)</a></td> |
| 38 | <td><a href="/nissy-2.0.1.exe">nissy-2.0.1.exe (770Kb)</a></td> | 38 | <td><a href="/nissy-2.0.2.exe">nissy-2.0.2.exe (780Kb)</a></td> |
| 39 | </tr> | 39 | </tr> |
| 40 | </table> | 40 | </table> |
| 41 | 41 | ||
| @@ -63,12 +63,15 @@ the git repository. | |||
| 63 | <h3>System requirements</h3> | 63 | <h3>System requirements</h3> |
| 64 | 64 | ||
| 65 | <p> | 65 | <p> |
| 66 | A full installation of nissy requires about 3Gb of space, | 66 | A full installation of nissy requires about 3.1Gb of space, |
| 67 | of which 2.3Gb are occupied by the huge pruning table for fast optimal solving, | 67 | of which 2.3Gb are occupied by the huge pruning table for fast optimal solving, |
| 68 | and running it requires the same amount of RAM. | 68 | and running it requires the same amount of RAM. |
| 69 | One can choose to never use this function and not to install the relative | 69 | One can choose to never use this function and not to install the relative |
| 70 | pruning table. There is an alternative (slower) | 70 | pruning table. There is an alternative (slower) |
| 71 | optimal solving function that uses about 500Mb of RAM. | 71 | optimal solving function that uses about 500Mb of RAM. |
| 72 | |||
| 73 | When generating the pruning tables automatically (see the section Tables below), | ||
| 74 | at least 5.3Gb or RAM are required. | ||
| 72 | </p> | 75 | </p> |
| 73 | 76 | ||
| 74 | <h3>Windows</h3> | 77 | <h3>Windows</h3> |
| @@ -103,55 +106,35 @@ Then follow the instructions below to install the pruning tables. | |||
| 103 | 106 | ||
| 104 | <h3>Tables</h3> | 107 | <h3>Tables</h3> |
| 105 | 108 | ||
| 106 | <table class="dltable"> | ||
| 107 | <tr> | ||
| 108 | <td></td> <td><strong>Zip file</strong></td> | ||
| 109 | </tr> | ||
| 110 | <tr> | ||
| 111 | <td><strong>Tables</strong></td> | ||
| 112 | <td><a href="/nissy-tables-2.0.zip">nissy-tables.2.0.zip (1.6Gb)</a></td> | ||
| 113 | </tr> | ||
| 114 | </table> | ||
| 115 | <p> | 109 | <p> |
| 116 | <strong>Note:</strong> the version 2.0 at the end of the file name is | 110 | Once you have installed nissy, run |
| 117 | only indicative. Later versions will use the same tables, unless | ||
| 118 | otherwise specified. | ||
| 119 | </p> | 111 | </p> |
| 120 | 112 | ||
| 121 | <p> | 113 | <pre><code>nissy gen</code></pre> |
| 122 | Nissy needs certain large tables to work. These tables are by default | ||
| 123 | generated the first time they are needed (e.g the first time you ask to solve a | ||
| 124 | certain step) and then saved to a file. Whenever these tables are needed again, | ||
| 125 | nissy simply loads the corresponding file from the hard disk. | ||
| 126 | </p> | ||
| 127 | 114 | ||
| 128 | <p> | 115 | <p> |
| 129 | The very large table for optimal solving can take some time to generate | 116 | to generate all the tables that Nissy will ever need. |
| 130 | (about 1.5 hours on my fairly old but decent laptop, using 8 CPU threads). | 117 | Running this command requires around 5.3Gb of RAM, and it can take some time |
| 131 | In order to generate it you need at least 5Gb of RAM. | 118 | (about 40 minutes on my fairly old but decent laptop, with 8 CPU threads). |
| 132 | All other tables are much faster. | ||
| 133 | </p> | 119 | </p> |
| 134 | 120 | ||
| 135 | <p> | 121 | <p> |
| 136 | You can ask nissy to generate all the tables it will ever need with the gen | 122 | Some unnecessary technical detail: by default this command is going to use |
| 137 | command. It is recommended to use more than one thread, if your CPU has them. | 123 | at most 64 threads. If you want you can choose to use more threads (if your CPU |
| 138 | For example, you can run: | 124 | is very powerful) or fewer threads (if you for example want to run this command |
| 125 | in the background while you do other stuff) with the <code>-t</code> option, for | ||
| 126 | example <code>nissy gen -t 1</code>. | ||
| 139 | </p> | 127 | </p> |
| 140 | 128 | ||
| 141 | <pre><code>nissy gen -t 8</code></pre> | ||
| 142 | |||
| 143 | <p> | 129 | <p> |
| 144 | to generate all tables using 8 threads. You can change 8 to any number | 130 | Alternatively, you can |
| 145 | your CPU supports, up to 64. | 131 | <a href="/nissy-tables-2.0.2.zip">download all the tables (1.7Gb)</a> and |
| 146 | </p> | 132 | copy them into the correct folder (see manual page, <code>ENVIRONMENT</code> |
| 147 | 133 | section). On UNIX operating systems this folder is either | |
| 148 | <p> | 134 | <code>.nissy/tables</code> in the user's home directory or |
| 149 | Alternatively, you can simply download all the tables and copy them into the | 135 | <code>$XDG_DATA_HOME/nissy/tables</code> if the XDG variable is configured. |
| 150 | correct folder (see manual page, <code>ENVIRONMENT</code> section). On UNIX | 136 | On Windows it is the same directory as the <code>nissy.exe</code> executable |
| 151 | operating systems this folder is either <code>.nissy/tables</code> in the | 137 | file. |
| 152 | user's home directory or <code>$XDG_DATA_HOME/nissy/tables</code> if the | ||
| 153 | XDG variable is configured. On Windows it is the same directory as the | ||
| 154 | <code>nissy.exe</code> executable file. | ||
| 155 | </p> | 138 | </p> |
| 156 | 139 | ||
| 157 | <h2 id="Upgrade">Upgrading</h2> | 140 | <h2 id="Upgrade">Upgrading</h2> |
| @@ -169,7 +152,8 @@ a new folder and run <code>make</code> and <code>make install</code> again. | |||
| 169 | </li> | 152 | </li> |
| 170 | </ul> | 153 | </ul> |
| 171 | <p> | 154 | <p> |
| 172 | In all cases the table files do not need to be upgraded. | 155 | Between each version new table files might have been added, or old ones |
| 156 | may be not used anymore. Nissy will deal with this automatically. | ||
| 173 | </p> | 157 | </p> |
| 174 | 158 | ||
| 175 | <h2>Version history</h2> | 159 | <h2>Version history</h2> |
| @@ -183,6 +167,11 @@ In all cases the table files do not need to be upgraded. | |||
| 183 | <td><strong>Comment</strong></td> | 167 | <td><strong>Comment</strong></td> |
| 184 | </tr> | 168 | </tr> |
| 185 | <tr> | 169 | <tr> |
| 170 | <td><a href="/nissy-2.0.2.tar.gz">2.0.2</a></td> | ||
| 171 | <td>2022-06-01</td> | ||
| 172 | <td>Improved table generation speed</td> | ||
| 173 | </tr> | ||
| 174 | <tr> | ||
| 186 | <td><a href="/nissy-2.0.1.tar.gz">2.0.1</a></td> | 175 | <td><a href="/nissy-2.0.1.tar.gz">2.0.1</a></td> |
| 187 | <td>2022-02-22</td> | 176 | <td>2022-02-22</td> |
| 188 | <td>Bugfix release</td> | 177 | <td>Bugfix release</td> |
