A new spaceship search approach

For scripts to aid with computation or simulation in cellular automata.
mscibing
Posts: 105
Joined: May 18th, 2010, 8:30 pm

Re: A new spaceship search approach

Post by mscibing » March 20th, 2020, 7:25 pm

globins wrote:
March 14th, 2020, 8:34 pm
Could someone give an example of how you might format the input to exclude known spaceships? I’m kinda confused on how to do that.
The first step, unfortunately, is to wait for the know spaceship to show up in a partial. That way we know we're using the phase the program expects.

The terminology is a bit wonky because the partials are "tipped over" in the files so that rows in the file are actually the "columns" of the search.

So say you have a partial that looks like this:

Code: Select all

                                                           *
                           ***      **                     *
                    ***      *     * *       *            * 
  ***             **    **         *** **  *   *  **   ** * 
  ***           *** * *** ****     ** * *  *   *  *** *   * 
 *             *****         *     **        ***    **      
** * *** *    *                    **        ***    ***     
         ** * **            **     ** * *  *   *  *** *     
   *     ****    ** *       *      *** **  *   *  **        
    *               **             * *       *              
     * *   *      *                 **                      
      *     **     *                                        
That's a pushalong followed by a repeating component; there is no point continuing this search as it won't find anything that couldn't just start with the repeating component.

The first step is to trim off that bit by the tail. We'll want to exclude everything that starts with the pushalong followed by the repeating component, not just the very specific partial above:

Code: Select all

                           ***      **          
                    ***      *     * *       *  
  ***             **    **         *** **  *   *
  ***           *** * *** ****     ** * *  *   *
 *             *****         *     **        ***
** * *** *    *                    **        ***
         ** * **            **     ** * *  *   *
   *     ****    ** *       *      *** **  *   *
    *               **             * *       *              
     * *   *      *                 **                      
      *     **     *                                        
Then pick two rows near the center:

Code: Select all

 *             *****         *     **        ***
** * *** *    *                    **        ***
Then, because this partial happens to be an odd-numbered partial, the rows have to be swapped:

Code: Select all

** * *** *    *                    **        ***
 *             *****         *     **        ***
Combine the two rows separated by a forward slash:

Code: Select all

** * *** *    *                    **        ***/ *             *****         *     **        ***
Uncomment the exclude variable and stick the resulting pattern into it:

Code: Select all

exclude+=(--exclude)
exclude+=("** * *** *    *                    **        ***/ *             *****         *     **        ***")
After a pass the partial will no longer be part of the search.

The risk here is we are specifying relatively few cells in only one phase of the partial, so there is a slight possibility that other components have the same pattern and will be excluded as well.
-- Andrew Wade

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: A new spaceship search approach

Post by Saka » April 4th, 2020, 9:17 am

I was running a wide search (margin 15 if anyone's curious), and I underestimated the space it would take on my disk, so it stopped on "0041/06" before giving the error

Code: Select all

error: Os { code: 28, kind: Other, message: "No space left on device" } 
Turns out that it made 38 Gigabytes of slice files :lol: . I knew they were big but I didn't them to be that large!

Anyway, getting to the point;
I've moved all the files in the "data" folder to another drive on my computer. If I copy the other LSSS files there and put the data files in there, can I continue the search from where it left off?

mscibing
Posts: 105
Joined: May 18th, 2010, 8:30 pm

Re: A new spaceship search approach

Post by mscibing » April 4th, 2020, 7:27 pm

Yup. You'll get an error message that a directory already exists, but that's benign. It'll simply overwrite the files it was creating when it got the disk full.
-- Andrew Wade

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: A new spaceship search approach

Post by Saka » April 5th, 2020, 6:03 am

Is there a way I can get a rough estimate of how much space will be needed at maximum for a given LSSS search?

EDIT (Unrelated to the above question): I tried starting back up the search that was stopped because of not enough space, but then I got this error

Code: Select all

0041/06                                                                                                                                                                                                            mkdir: cannot create directory ‘data/0041/07’: File exists                                                                                                                                                         thread 'thread '<unnamed><unnamed>' panicked at '' panicked at 'thread 'index out of bounds: the len is 44 but the index is 44thread 'index out of bounds: the len is 23 but the index is 23thread 'thread '<unnamed>thread '', thread '<unnamed>thread 'thread '', <unnamed><unnamed>' panicked at '<unnamed>thread 'src/compress.rs<unnamed>thread '' panicked at '<unnamed><unnamed>src/compress.rs' panicked at '' panicked at 'index out of bounds: the len is 911 but the index is 911' panicked at '<unnamed>:' panicked at '<unnamed>index out of bounds: the len is 21228 but the index is 21228' panicked at '' panicked at ':index out of bounds: the len is 48 but the index is 48index out of bounds: the len is 859 but the index is 859', index out of bounds: the len is 109 but the index is 109' panicked at '62index out of bounds: the len is 73 but the index is 73' panicked at '', index out of bounds: the len is 39 but the index is 39index out of bounds: the len is 92 but the index is 9262', ', src/compress.rs', index out of bounds: the len is 49 but the index is 49:', index out of bounds: the len is 26 but the index is 26src/compress.rs', ', :src/compress.rssrc/compress.rs:src/compress.rs', 13src/compress.rs', :src/compress.rssrc/compress.rs13::62:src/compress.rs  :src/compress.rs62::                                                                                                                                                                                               6262:62:note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                                                                                                              62::6262::13:62:6213::1313                                                                                                                                                                                         13:13:                                                                                                                                                                                                             1313                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     13                                                                                                                                                                                                                 13                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', src/main.rs:1224:17 
I tried deleting 0041/07, but now I get this error

Code: Select all

0041/06                                                                                                                                                                                                            thread 'thread '<unnamed><unnamed>' panicked at '' panicked at 'index out of bounds: the len is 44 but the index is 44thread 'index out of bounds: the len is 23 but the index is 23thread '', thread 'thread '<unnamed>thread '', thread '<unnamed>thread 'thread 'src/compress.rs<unnamed><unnamed>' panicked at 'thread 'thread '<unnamed>src/compress.rs<unnamed>' panicked at '<unnamed><unnamed>:' panicked at '' panicked at 'index out of bounds: the len is 911 but the index is 911<unnamed><unnamed>' panicked at ':' panicked at 'index out of bounds: the len is 21228 but the index is 21228' panicked at '' panicked at '62index out of bounds: the len is 48 but the index is 48index out of bounds: the len is 859 but the index is 859', ' panicked at '' panicked at 'index out of bounds: the len is 109 but the index is 10962index out of bounds: the len is 73 but the index is 73', index out of bounds: the len is 39 but the index is 39index out of bounds: the len is 92 but the index is 92:', ', src/compress.rsindex out of bounds: the len is 49 but the index is 49index out of bounds: the len is 26 but the index is 26', :', src/compress.rs', ', 13src/compress.rssrc/compress.rs:', ', src/compress.rs13src/compress.rs:src/compress.rssrc/compress.rs                      ::62src/compress.rssrc/compress.rs:                                                                                                                                                                                :62::note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                                                                                                                 6262:::6262:6262::136262::13::1313                                                                                                                                                                                 ::1313                                                                                                                                                                                                             1313                                                                                                                                                                                                                                                                                                                                                                                                                                  1313                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', src/main.rs:1224:17
EDIT2: Nevermind... turns out I mistyped the speed as c/16... :oops:

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » April 6th, 2020, 7:06 am

I'll ask this question again, since last time it happened to be at the bottom of a page.

How can I run this software on macOS?

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

mscibing
Posts: 105
Joined: May 18th, 2010, 8:30 pm

Re: A new spaceship search approach

Post by mscibing » April 8th, 2020, 7:05 pm

LaundryPizza03 wrote:
April 6th, 2020, 7:06 am
I'll ask this question again, since last time it happened to be at the bottom of a page.

How can I run this software on macOS?
Unfortunately I don't know enough about macOS to help. As far as I know it should be possible to open a terminal window and download, compile and run it the same way it would be on linux. You'll need to install rust, and probably a git client to download the software. The bash shell I think will already be installed.
-- Andrew Wade

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » April 30th, 2020, 11:13 am

What is "target/release/life_slice_ship_search" supposed to be in the shell files? I'm getting a "No such file or directory" error when attempting to run files, even after installing Rust.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

wildmyron
Posts: 1542
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: A new spaceship search approach

Post by wildmyron » April 30th, 2020, 11:44 pm

LaundryPizza03 wrote:
April 30th, 2020, 11:13 am
What is "target/release/life_slice_ship_search" supposed to be in the shell files? I'm getting a "No such file or directory" error when attempting to run files, even after installing Rust.
Great that you managed to get rust installed. The next step is to compile the main search program. From the README
Run "RUSTFLAGS='-C target-cpu=native' cargo build --release". The RUSTFLAGS variable is optional.
This should generate the binary in the folder quoted above.
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 1st, 2020, 3:26 am

wildmyron wrote:
April 30th, 2020, 11:44 pm
LaundryPizza03 wrote:
April 30th, 2020, 11:13 am
What is "target/release/life_slice_ship_search" supposed to be in the shell files? I'm getting a "No such file or directory" error when attempting to run files, even after installing Rust.
Great that you managed to get rust installed. The next step is to compile the main search program. From the README
Run "RUSTFLAGS='-C target-cpu=native' cargo build --release". The RUSTFLAGS variable is optional.
This should generate the binary in the folder quoted above.
Where, exactly, do I run this command? The command "cargo" was not found.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

User avatar
dexter1
Posts: 71
Joined: February 26th, 2020, 8:46 am

Re: A new spaceship search approach

Post by dexter1 » May 1st, 2020, 5:36 am

LaundryPizza03 wrote:
May 1st, 2020, 3:26 am
Where, exactly, do I run this command? The command "cargo" was not found.
After installing Rust, the cargo binary should be in your executable search path. If your system is linux with a standard bash shell, try:

Code: Select all

which cargo
If it comes up empty, do:

Code: Select all

export PATH="$HOME/.cargo/bin:$PATH"
which is the default path if you install Rust locally. Try again to run the build command in the life-slice-ship-search folder.
Frank Everdij

wildmyron
Posts: 1542
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: A new spaceship search approach

Post by wildmyron » May 1st, 2020, 6:43 am

LaundryPizza03 wrote:
May 1st, 2020, 3:26 am
Where, exactly, do I run this command? The command "cargo" was not found.
You need to run it in Terminal (on MacOS X). [edit]Sorry misunderstood you - run this command while in the life_slice_ship_search directory after makeing the required changes to $PATH. You only need to run this once, so changing the path isn't essential, but it would be convenient if you want to compile other rust programs or update lsss after Andrew makes any changes to the code.[/edit]

Which method did you use to install rust? I believe there are two possible methods - either using the rust installer "rustup" from rust-lang.org (or more specifically, sh.rustup.rs), or using the packages provided by Homebrew.

If you used rustup, then instructions to use cargo are on the installation page https://www.rust-lang.org/tools/install - I.e. the cargo binary is in ~/.cargo/bin and this directory should be added to the PATH variable. However, how to make this change depends on which shell you are using, and Apple changed the default shell in MacOS X in the not too distant past. So first find out which shell you are using (in the terminal)

Code: Select all

echo $SHELL
Almost certainly the output will be one of "/bin/bash" or "/bin/zsh" - these are known as the bash shell and the zsh shell, respectively.
If you are using the bash shell then run the following:

Code: Select all

echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.bash_profile
Otherwise, if you are using the zsh shell:

Code: Select all

echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.zshrc
Then restart the terminal for this change to take effect and you should be able to run "rustc --version" to test the rust install. This has the same effect as what dexter1 instructed, but makes the change permanent rather than only for the current terminal session.

If you installed rust via Homebrew then the situation is a bit different and I'm not sure of the details.

Once you have successfully added the rust binary directory to your PATH, you can run the search.sh script. Remember to set the data variable to a directory where you want the working files and the partial results to be output to.
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: A new spaceship search approach

Post by Saka » May 1st, 2020, 8:05 am

Some strange stuff happened when I searched for a 4c/5o in B27/S137.
It first started on width 15 seedcolumn 02 I believe.
I got this error message in the console

Code: Select all

0021/28
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0021/03p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0021/02p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0021/01p/*.slice': No such file or directory
rm: cannot remove 'data/0021/00p/*.slice': No such file or directory
0021/done
And "0023.partial.txt" contained the following:

Code: Select all

 ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††† ††‪ †⨪⨠ ⨪⨠⨠ਊ
Not sure what to make of this, I put it aside and just thought it was a random "cosmic ray" incident.

I increased the width to 16, and I didn't get it in 0023.partial.txt but now 0075.partial.txt:

Code: Select all

 ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††† ††††††‪ †††††‪†ਊ
The error was similar:

Code: Select all

0075/28
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/11p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" } 
rm: cannot remove 'data/0075/10p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/09p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/08p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/07p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/06p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/05p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/04p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/03p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/02p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0075/01p/*.slice': No such file or directory
rm: cannot remove 'data/0075/00p/*.slice': No such file or directory
0075/done
0076/29
It did the same thing on width 17, and on width 18, 0097.partial.txt (The final one!) was corrupted as well:

Code: Select all

 ††††††††† ††††††††† ††††††††† ††††††††† ††††††††† ††††††††† ††††††††† ††††††††† ††††††††† ††††††††† †††††††⨠† ††††††††† ††††††††† ††††††⨪⨪⨪ ††‪‪†⨪†⨠†ਊ
Again, the error message was similar

Code: Select all

0097/28
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/13p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/12p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/11p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/10p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/09p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/08p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/07p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/06p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/05p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/04p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/03p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/02p/*.slice': No such file or directory
error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
rm: cannot remove 'data/0097/01p/*.slice': No such file or directory
rm: cannot remove 'data/0097/00p/*.slice': No such file or directory
0097/done
0098/29
What's going on? Attached is my search.sh file as a .txt file (I can't attach a .sh file it seems)

EDIT: It seems that I am not currently using the most recent version. I used whatever version was available on March 25th, and I haven't updated. Is this a known and addressed bug? If so, apologies.
Attachments
search.txt
(14.8 KiB) Downloaded 192 times

Hunting
Posts: 4395
Joined: September 11th, 2017, 2:54 am

Re: A new spaceship search approach

Post by Hunting » May 1st, 2020, 9:41 am

Does LSSS support non-totalistic rules?

User avatar
Saka
Posts: 3627
Joined: June 19th, 2015, 8:50 pm
Location: Indonesia
Contact:

Re: A new spaceship search approach

Post by Saka » May 1st, 2020, 9:45 am

Hunting wrote:
May 1st, 2020, 9:41 am
Does LSSS support non-totalistic rules?
Currently, no.

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 2nd, 2020, 1:21 am

wildmyron wrote:
May 1st, 2020, 6:43 am
LaundryPizza03 wrote:
May 1st, 2020, 3:26 am
Where, exactly, do I run this command? The command "cargo" was not found.
You need to run it in Terminal (on MacOS X). [edit]Sorry misunderstood you - run this command while in the life_slice_ship_search directory after makeing the required changes to $PATH. You only need to run this once, so changing the path isn't essential, but it would be convenient if you want to compile other rust programs or update lsss after Andrew makes any changes to the code.[/edit]

Which method did you use to install rust? I believe there are two possible methods - either using the rust installer "rustup" from rust-lang.org (or more specifically, sh.rustup.rs), or using the packages provided by Homebrew.

If you used rustup, then instructions to use cargo are on the installation page https://www.rust-lang.org/tools/install - I.e. the cargo binary is in ~/.cargo/bin and this directory should be added to the PATH variable. However, how to make this change depends on which shell you are using, and Apple changed the default shell in MacOS X in the not too distant past. So first find out which shell you are using (in the terminal)

Code: Select all

echo $SHELL
Almost certainly the output will be one of "/bin/bash" or "/bin/zsh" - these are known as the bash shell and the zsh shell, respectively.
If you are using the bash shell then run the following:

Code: Select all

echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.bash_profile
Otherwise, if you are using the zsh shell:

Code: Select all

echo 'export PATH=$PATH:~/.cargo/bin' >> ~/.zshrc
Then restart the terminal for this change to take effect and you should be able to run "rustc --version" to test the rust install. This has the same effect as what dexter1 instructed, but makes the change permanent rather than only for the current terminal session.

If you installed rust via Homebrew then the situation is a bit different and I'm not sure of the details.

Once you have successfully added the rust binary directory to your PATH, you can run the search.sh script. Remember to set the data variable to a directory where you want the working files and the partial results to be output to.
It's still not working.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

hkoenig
Posts: 258
Joined: June 20th, 2009, 11:40 am

Re: A new spaceship search approach

Post by hkoenig » May 2nd, 2020, 2:05 am

You can also use XCode to build C/C++ based tools on the Mac. In the past, I've created a "command line tool" project as a wrapper for the rest of the source code. You can then run the tool inside the IDE, or build a binary that can be run in Terminal.

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 2nd, 2020, 2:14 am

hkoenig wrote:
May 2nd, 2020, 2:05 am
You can also use XCode to build C/C++ based tools on the Mac. In the past, I've created a "command line tool" project as a wrapper for the rest of the source code. You can then run the tool inside the IDE, or build a binary that can be run in Terminal.
No, the problem is that I am able to use the command and access the version, but I am still unable to create to create target/release/life_slice_ship_search. Am I supposed to replace it with something else?

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

wildmyron
Posts: 1542
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: A new spaceship search approach

Post by wildmyron » May 2nd, 2020, 1:07 pm

LaundryPizza03 wrote:
May 2nd, 2020, 1:21 am
It's still not working.
What exactly is it that's not working?

1) Have you got a functioning rust dev environment installed? If yes that means you can run "rustc --version" without error and "which cargo" should return the path to the cargo binary.
2) Which shell are you using? If bash and you installed from sh.rustup.rs then your PATH should have been adjusted, but that evidently hasn't happened.
3) What have you done to add the rust binary path to your PATH variable? Has it worked?
4) If you've got a working rust dev environment then you should be able to compile the life_slice_ship_search binary. Change directory to the life_slice_ship_search directory and run "RUSTFLAGS='-C target-cpu=native' cargo build --release". What output do you get? If it worked then this will create the file "target/release/life_slice_ship_search". Check that it exists. If it does then you should be able to run LSSS
5) If everything is good up till here but you're still not able to run a search, then please give as much information as possible about what happens when you run "./search.sh" - including any changes you've made to search.sh and a copy of the output when you attempt to run it.

Please note that unless you are resuming a search after interrupting it you need to have a clean data directory, otherwise the existing temporary files may interfere with the search.

I have just carried out the above steps on a MacBook Air with MacOS 10.15.4 and was able to run a search with LSSS. Hopefully you can get your installation running too.
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 2nd, 2020, 5:00 pm

wildmyron wrote:
May 2nd, 2020, 1:07 pm
LaundryPizza03 wrote:
May 2nd, 2020, 1:21 am
It's still not working.
What exactly is it that's not working?

1) Have you got a functioning rust dev environment installed? If yes that means you can run "rustc --version" without error and "which cargo" should return the path to the cargo binary.
2) Which shell are you using? If bash and you installed from sh.rustup.rs then your PATH should have been adjusted, but that evidently hasn't happened.
3) What have you done to add the rust binary path to your PATH variable? Has it worked?
4) If you've got a working rust dev environment then you should be able to compile the life_slice_ship_search binary. Change directory to the life_slice_ship_search directory and run "RUSTFLAGS='-C target-cpu=native' cargo build --release". What output do you get? If it worked then this will create the file "target/release/life_slice_ship_search". Check that it exists. If it does then you should be able to run LSSS
5) If everything is good up till here but you're still not able to run a search, then please give as much information as possible about what happens when you run "./search.sh" - including any changes you've made to search.sh and a copy of the output when you attempt to run it.

Please note that unless you are resuming a search after interrupting it you need to have a clean data directory, otherwise the existing temporary files may interfere with the search.

I have just carried out the above steps on a MacBook Air with MacOS 10.15.4 and was able to run a search with LSSS. Hopefully you can get your installation running too.
1) rustc --version returns rustc 1.43.0 (4fb7144ed 2020-04-20), and which cargo returns ~/.cargo/bin/cargo.
2) I'm using zsh.
3) Nothing. I dont' know what this means.
4)

Code: Select all

> RUSTFLAGS='-C target-cpu=native' cargo build --release
    Updating crates.io index
  Downloaded num_cpus v1.13.0
  Downloaded regex v1.3.7
  Downloaded std-semaphore v0.1.0
  Downloaded getopts v0.2.21
  Downloaded libc v0.2.69
  Downloaded thread_local v1.0.1
  Downloaded memchr v2.3.3
  Downloaded aho-corasick v0.7.10
  Downloaded regex-syntax v0.6.17
  Downloaded lazy_static v1.4.0
  Downloaded unicode-width v0.1.7
   Compiling memchr v2.3.3
   Compiling libc v0.2.69
   Compiling lazy_static v1.4.0
   Compiling unicode-width v0.1.7
   Compiling regex-syntax v0.6.17
   Compiling std-semaphore v0.1.0
   Compiling getopts v0.2.21
   Compiling thread_local v1.0.1
   Compiling aho-corasick v0.7.10
   Compiling num_cpus v1.13.0
   Compiling regex v1.3.7
   Compiling life_slice_ship_search v3.5.6 (/Users/gb/life_slice_ship_search)
    Finished release [optimized + debuginfo] target(s) in 1m 29s
5) Everything's good now, except that I don't know how to format the searches.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 4th, 2020, 11:16 am

What's wrong now?

Code: Select all

> zsh search_P7H2V0EVEN24.sh  
0010/done
mkdir: P7H2V0EVEN24/0011: File exists
mkdir: P7H2V0EVEN24/0011/00: File exists
error: UnrecognizedOption("period 7 --starts 0,1,4,0,1,1,5,0,2,1 --rule B3/S23")

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

mscibing
Posts: 105
Joined: May 18th, 2010, 8:30 pm

Re: A new spaceship search approach

Post by mscibing » May 6th, 2020, 7:32 am

Hi LaundryPizza03,

I was able to reproduce the error.

Please delete all the files from the P7H2V0EVEN24 directory, and then try running the following command:

> bash search_P7H2V0EVEN24.sh

You don't have to make bash your default shell, but it will need to be installed.
-- Andrew Wade

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 6th, 2020, 3:57 pm

So how do I format the search parameters? For example, which paramters would I use to find a c/5o in B35/S46?

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

User avatar
dexter1
Posts: 71
Joined: February 26th, 2020, 8:46 am

Re: A new spaceship search approach

Post by dexter1 » May 10th, 2020, 7:54 am

LaundryPizza03 wrote:
May 6th, 2020, 3:57 pm
So how do I format the search parameters? For example, which paramters would I use to find a c/5o in B35/S46?
In the recent versions of lsss you don't need to use the --search option anymore. Open the default search.sh script in an editor, find the following lines and change the following options:

Code: Select all

margin=11

#midline=--even_midline
midline=--odd_midline
#midline=--gutter
#midline=--zero # use for Asymmetric, add 1 to margin.

parms="--velocity (1,0)c/5 --rule B35/S46"
The 'margin' options determines the width of the spaceship search space. A larger width increases the computation time and the use of disk space, but has the chance of finding big ships which do not fit in smaller columns, so try out a few widths until you find a workable situation which doesn't run out of disk space.

An extra option you should take care of is 'seedcolumn' . This determines the column in which the cell should be alive at the front of the spaceship search. A value of 0 means that the program makes the cell alive on the central column:

Code: Select all

0?????...
0?????...
1?????...
0?????...
0?????...
A value of 1 makes the cell alive on the column above:

Code: Select all

0?????...
1?????...
0?????...
1?????...
0?????...
(since the search is odd symmetric). And so on. You should run the program at different seedcolumns, preferably all of them from 0 to the set width.

The 'mem' parameter is the maximum amount the program will use. You can set it to the total amount of memory (in bytes), but i found that aiming at a lower value helps to avoid going out of disk buffer memory and enter swap space, which is really slow.
Frank Everdij

User avatar
dexter1
Posts: 71
Joined: February 26th, 2020, 8:46 am

Re: A new spaceship search approach

Post by dexter1 » May 10th, 2020, 8:14 am

mscibing wrote:
January 19th, 2020, 1:54 pm
Hooloovoo wrote:
January 16th, 2020, 1:47 am
The shell scripts have a $threads variable which is passed to the rust program. Often, however, one thread will take longer than the others.
By default it spawns worker threads equal to the number of hardware threads, but it's not always good at keeping them busy with work.
Because i tried to benchmark different amounts of values for the thread option, i found a small problem in the supplied scripts when reaching the lines in which the lsss program is started:

Code: Select all

$lsss join $parms $threads \
This ignores the 'threads' parameter, because it is supposed to be entered as:

Code: Select all

lsss join $parms --threads $threads \
This can be fixed by running a command pipe through sed :

Code: Select all

cat search.sh | sed 's/$threads/--threads\ $threads/g' > search_fixed.sh
Frank Everdij

User avatar
LaundryPizza03
Posts: 2295
Joined: December 15th, 2017, 12:05 am
Location: Unidentified location "https://en.wikipedia.org/wiki/Texas"

Re: A new spaceship search approach

Post by LaundryPizza03 » May 10th, 2020, 10:31 pm

I'm not sure why the seedcolumn option is not working for me. It's always defaulting to 0, no matter how I set it. For example, the option

Code: Select all

margin=10

midline=--even_midline
#midline=--odd_midline
#midline=--gutter
#midline=--zero # use for Asymmetric, add 1 to margin.

seedcolumn=01
parms="--velocity (1,0)c/5 --rule B3/S2"
flush=4000000000
max_width=100
performs the same search as with seedcolumn 00.
EDIT: It doesn't seem to affect any particular seed. The sample scripts work properly, though.

Code: Select all

x = 4, y = 3, rule = B3-q4z5y/S234k5j
2b2o$b2o$2o!
LaundryPizza03 at Wikipedia

Post Reply