Tutorials/Catagolue stdin symmetry

From LifeWiki
Jump to navigation Jump to search

The program used for random soup searching and uploading census results to Catagolue, apgluxe, can also be used to census other patterns besides the standard 16x16 soups (and the various symmetric versions).

This can be done using a special-case "symmetry" -- which, as with some other custom input type settings (especially "C1") doesn't mean that anything about the input is actually symmetrical. It's just that the ability to choose different types of symmetry was the original reason why this input-type symmetry was added to apgsearch, so it got called --symmetry.

Example use of stdin "symmetry"

Here's a walkthrough of what I did to make the "stdin" setting work correctly for the current octohash database. The octohash database is a text file containing RLE and hash "fingerprints" for 455,380 constellations of two well-separated small objects, with gliders hitting those constellations in all possible ways. The original format of the database looks like this:

2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo! 4VR.}_d9V 2Ix+b%WBR 3yxH8RZE. #0;<x`Uw5 ...
2o$2o5$6b2o$7bo$7bobo$8b2o2$10bo$9b2o$9bobo! %;PIz*v-2 4^3)fGg4d $ELjpBC|L +na$+!R;z ...
2o$2o5$6b2o$7bo$7bobo$8b2o$11b3o$11bo$12bo! +v_ZNH#oe -}^X[oicJ -R-?MafAS /_5rv;~OS ...
2o$2o5$6b2o$6bobo$8bo$8b2o2$9bo$8b2o$8bobo! *)96g6@`< )$19%$P-v 0;fHjqa6H 1kt!Xw0*B ...
2o$2o5$6b2o$6bobo$8bo$8b2o2$10b3o$10bo$11bo! )nqxL570R -[6bmsrmA /^gHjOSFo 1n3pM&bmw ...
...

For this project, we're not going to use the hash values that show up after the exclamation point on every line. We just need the RLE -- but we need it to be actual standard-format RLE, not headerless RLE. However, apgluxe doesn't care whether the x and y values are right or not, so we can just add the same standard header to each line.

We could do this by writing a Python or Lua script to read the original octohash database, split each string at the space, and write out a new text file with x = 0, y = 0, rule = B3/S23 added before every line. But it's actually just as easy to do this kind of thing with a good text editor -- Notepad++ or TextPad, or any similar editor that support regular-expression search and replaces.

Tangential note about the usefulness of regexp search-and-replace

First replace " .*" without the quotes -- space period asterisk -- with the empty string. That gets rid of the long strings of hashes. If you're trying this with the full database, this might take a little while since there are almost half a million lines of text in the database.

Then replace "^" without the quotes -- just a single carat character -- with "x = 0, y = 0, rule = B3/S23\n". "^" is a regexp shortcut for "the beginning of the line of text", just as "$" is a reference meaning "the end of the line of text". "\n" is just the standard syntax for a newline character.

You should end up with a new text file, which you can save with a new name. Let's call it octohashes.txt. Save it in the same folder with apgluxe.exe, to make things simpler (otherwise you have to specify the full path to it in your command-line invocation, below.) octohashes.txt should look like this now:

x = 0, y = 0, rule = B3/S23
2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
x = 0, y = 0, rule = B3/S23
2o$2o5$6b2o$7bo$7bobo$8b2o2$10bo$9b2o$9bobo!
x = 0, y = 0, rule = B3/S23
2o$2o5$6b2o$7bo$7bobo$8b2o$11b3o$11bo$12bo!
x = 0, y = 0, rule = B3/S23
2o$2o5$6b2o$6bobo$8bo$8b2o2$9bo$8b2o$8bobo!
x = 0, y = 0, rule = B3/S23
2o$2o5$6b2o$6bobo$8bo$8b2o2$10b3o$10bo$11bo!
...

Different options for piping patterns into apgluxe

The above is a format -- chunks of RLE one right after another -- that we can feed directly into apgluxe, as long as we tell it that the symmetry is some arbitrary name containing the string "stdin". You pick the rest of the name, but make it unique and descriptive, and make sure it includes this string -- just "_stdin" at the end of the name for example. ("Stdin" is short for "standard input", and that's good terminology to know when you're working with command-line utilities like apgluxe.)

Really apgluxe can accept any stream of data that consists of chunks of RLE like this, one right after another. If you're familiar with the concept of piping the output of one shell command into the input of another, then you can write a program that generates RLE directly and prints it to the console -- a stream called "stdout", "standard output". A pipe character | then tells the shell interpreter to redirect the output of that program to be the input of another program, apgluxe.exe in this case.

Several people have written this kind of program to produce various types of enumerated patterns: partial spaceships, all possible NxN patterns for small N, etc. It's often useful to pipe these enumerated patterns through apgluxe, because that way you find out very quickly if any interesting still lifes, oscillators, spaceships, or growing patterns are produced.

In the case of the octohash database that we modified above, we can just use a shell command called "cat", short for "concatenate" but what it does is simply print whatever files you mention to the console (standard output), one after another. We'll only mention one file, octohashes.txt, so it will just print the contents of the file, which is exactly what we want to pipe into apgluxe.

How to use the pipe command with apgluxe

If you don't already have apgluxe installed, follow the standard instructions from the apgmera README.

Once you've done that, recompile apgluxe with your chosen "stdin" symmetry name:

./apgluxe --symmetry octohash2obj12x12_stdin

Then you'll be all ready to run the actual command to census your list of RLEs:

./apgluxe -k MyPayoshaKey -t 1 -n 455380 < octohashes.txt

Translation:

< octohashes.txt

– Use octohashes.txt as input to…

 ./apgluxe 

– …apgluxe.exe (in Unix-like operating systems, you have to put the ./ in front of the name, because if you don't, it thinks that it's a shell command that it can't find, instead of an executable file name.)

 -k MyPayoshaKey 

– you won't need this unless you change the next line, to upload your census results to Catagolue.

 -t 1 

– specifies 'testing' mode. Remove this option from the command to upload your stdin census to Catagolue.

 -n 455380

– specifies the number of patterns to process before uploading, or before completing the task that you're telling apgluxe to do here.

Results from apgluxe

For my particular octohash database census, the result that came back from apgluxe after a few minutes (in the form of a log file named something long and unpronounceable) is shown below. You can check by running the sample soups in Golly, that those collisions do indeed produce explosions whose ash contains the referenced objects. For example,

2o$obo$2bo$2b2o3$6b2o$7bo$7bobo$8b2o2$8bo$7b2o$7bobo! #C [[ THUMBSIZE 2 THEME 6 GRID GRIDMAJOR 0 SUPPRESS THUMBLAUNCH ]] #C [[ THUMBSIZE 4 ]]
(click above to open LifeViewer)
xp3_co9nas0san9oczgoldlo0oldlogz1047210127401 -2o$obo$2bo$2b2o3$6b2o$7bo$7bobo$8b2o2$8bo$7b2o$7bobo!

means that a glider hitting two 180-degree rotationally symmetric eaters will produce a pulsar (at T=1878, along with many other things).

Click on "Expand" to the right to view full content of the log file.

testing
@VERSION v5.2-ll2.4.3
@MD5 678291a2bf974c9aeaf313e7171a9acb
@ROOT k_NCzsAkKecFzp
@RULE b3s23
@SYMMETRY octohash2obj12x12_stdin
@NUM_SOUPS 455380
@NUM_OBJECTS 6874903

@CENSUS TABLE
xs4_33 2138665
xp2_7 1930705
xs6_696 1125108
xq4_153 630131
xs7_2596 313936
xs5_253 307969
xs6_356 223659
xs8_6996 75167
xs4_252 63316
xs7_25ac 20223
xp2_7e 14256
xs12_g8o653z11 12841
xp2_318c 4204
xs6_25a4 3772
xs14_g88m952z121 3075
xs7_178c 1629
xs8_69ic 1578
xs8_25ak8 817
xq4_6frc 733
xp3_co9nas0san9oczgoldlo0oldlogz1047210127401 553
xs6_39c 450
xs14_69bqic 257
xs9_31ego 251
xs8_35ac 217
xq4_27dee6 167
xs6_bd 161
xs8_3pm 130
xs16_g88m996z1221 122
xs14_g88b96z123 113
xs10_g8o652z01 96
xs18_rhe0ehr 64
xs9_4aar 59
xs9_178ko 49
xs9_25ako 38
xs8_178k8 37
xp15_4r4z4r4 35
xs10_35ako 34
xq4_27deee6 26
xs11_g8o652z11 23
xs16_j1u0696z11 21
xs11_2530f9 17
xs15_354cgc453 14
xs14_j1u066z11 13
xs14_6970796 13
xs12_raar 13
xs11_g0s453z11 13
xs8_312ko 8
xs14_39e0e93 8
xs10_g0s252z11 8
xs10_178kk8 7
xs12_330fho 6
xs11_178kic 6
xs9_178kc 5
xs10_358gkc 5
xs7_3lo 4
xs17_2ege1ege2 4
xs12_o4q552z01 4
xs10_3542ac 4
xs10_32qr 4
xs16_69egmiczx1 3
xs14_69bo8a6 3
xs12_330f96 3
xs10_3215ac 3
xs9_312453 2
xs16_69bob96 2
xs15_j1u06a4z11 2
xs15_259e0eic 2
xs15_259e0e96 2
xs14_j1u413z11 2
xs14_6is079c 2
xs14_69e0eic 2
xs14_6960uic 2
xs13_g88m96z121 2
xs12_69iczx113 2
xs11_ggm952z1 2
xs10_g8ka52z01 2
xs10_1784ko 2
xs8_31248c 1
xs20_3lkkl3z32w23 1
xs19_0c88b96z6953 1
xs15_g88m596z121 1
xs15_4a9raic 1
xs15_3lkm96z01 1
xs15_3lk453z121 1
xs14_i5q453z11 1
xs14_g8o0e96z121 1
xs14_39e0eic 1
xs14_31egm96 1
xs13_3hu06a4 1
xs12_3hu066 1
xs12_0ggs252z32 1
xs12_0g8o652z121 1
xs12_08o653z32 1
xs11_ggka53z1 1
xs11_31461ac 1
xs10_69ar 1
xs10_0j96z32 1

@SAMPLE_SOUPIDS
xs4_33 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xp2_7 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs6_696 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xq4_153 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs7_2596 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs5_253 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs6_356 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs8_6996 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs4_252 -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs7_25ac -2o$2o5$7b2o$6bo2bo$6bo2bo$7b2o2$9b3o$9bo$10bo!
xp2_7e -2o$2o6$8b2o$7bobo$8bo2$8b2o$8bobo$8bo!
xs12_g8o653z11 -2o$obo$bo4$8b2o$7bobo$7bo$6b2o2$8b2o$8bobo$8bo!
xp2_318c -2o$2o6$8b2o$7bobo$8bo2$8b2o$8bobo$8bo!
xs6_25a4 -2o$obo$2bo$2b2o4$8bo$7bobo$8bo2b2o$11bobo$11bo!
xs14_g88m952z121 -2o$obo$bo4$7b2o$6bo2bo$6bobo$7bo2$8b3o$8bo$9bo!
xs7_178c -2o$obo$bo5$7b2o$7bobo$8b2o2$8bo$7b2o$7bobo!
xs8_69ic -2o$2o5$6b2o$7bo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs8_25ak8 -2o$obo$bo4$6b2o$7bo4b2o$7bobob2o$8b2o3bo!
xq4_6frc -b2o$o2bo$o2bo$b2o4$7b2o$7bobo$8b2o2$9bo$8b2o$8bobo!
xp3_co9nas0san9oczgoldlo0oldlogz1047210127401 -2o$obo$2bo$2b2o3$6b2o$7bo$7bobo$8b2o2$8bo$7b2o$7bobo!
xs6_39c -6bo$6b3o$9bo$8b2o2$9bo$8b2o$bo6bobo$obo$b2o!
xs14_69bqic -b2o$o2bo$bobo$2bo3$7b2o$6bo2bo$6bo2bo$7b2o2b2o$11bobo$11bo!
xs9_31ego -8b2o$7bobo$7b2o4$3bo$b3o$o$2o$3b2o$3bobo$3bo!
xs8_35ac -bo$obo$bobo$2b2o4$8bo$7bobo$7bobo$8bo2$6b2o$6bobo$6bo!
xq4_27dee6 -2b2o$3bo$3o$o3$7bo$6bobo$7bobo$8b2o2$9bo$8b2o$8bobo!
xs6_bd -b2o$o2bo$b2o4$8b2o$7bobo$6bobo$7bo2b2o$10bobo$10bo!
xs8_3pm -2b2o$3bo$3o$o3$7b2o$6bo2bo$6bo2bo$7b2o2$9b2o$9bobo$9bo!
xs16_g88m996z1221 -2b2o$3bo$3o$o3$7bo$6bobo$6bo2bo$7b2o2$8bo$7b2o$7bobo!
xs14_g88b96z123 -bo$obo$bo4$8bo$7bobo$7bobo$8bo2b3o$11bo$12bo!
xs10_g8o652z01 -7b2o$7bobo$8b2o2$8bo$7b2o$7bobo$b2o$o2bo$b2o!
xs18_rhe0ehr -b2o$obo$bo4$6bo$6b3o$9bo2b2o$8b2ob2o$13bo!
xs9_4aar -7b2o$6bo2bo$6bobo2b3o$7bo3bo$12bo4$2o$2o!
xs9_178ko -8b2o2b2o$7bobob2o$6bobo4bo$7bo5$bo$obo$b2o!
xs9_25ako -7b2o$7bobo$8bo6$2bo3b2o$bobob2o$o2bo3bo$b2o!
xs8_178k8 -2o$o$b3o$3bo4$6b2o$7bo$7bobo$8b2o2$10bo$9b2o$9bobo!
xp15_4r4z4r4 -b2o3b2o$o2bob2o$o2bo3bo$b2o4$6b2o$6bo$7b3o$9bo!
xs10_35ako -6b2o$7bo$7bobo$8b2o3$b2o$o2bo$bobo$2bo2$3b2o$3bobo$3bo!
xq4_27deee6 -2o$obo$b2o6$7b2o$6bo2bo$6bo2bo$7b2o2$9b3o$9bo$10bo!
xs11_g8o652z11 -bo$obo4b2o$obo4bobo$bo6bo2$9b3o$9bo$10bo!
xs16_j1u0696z11 -4b3o$bo2bo$obo2bo$2o6$8bo$7bobo$6bo2bo$7b2o!
xs11_2530f9 -2o$2o2$bo4b2o$2o4bobo$obo4bobo$8bo!
xs15_354cgc453 -8b2o$2b2o4b2o$bobo$obo7bo$bo7b2o$9bobo!
xs14_j1u066z11 -2o$o$b3o$3bo2$8bo$7bobob3o$7b2o2bo$12bo!
xs14_6970796 -bo$obo$obo4bo$bo4bobo$7bobo$8b2o2$7bo$6b2o$6bobo!
xs12_raar -7b2o$8bo$8bobo$2b2o5b2o$bobo$bo7bo$2o6b2o$8bobo!
xs11_g0s453z11 -b2o$bobo$2b2o2$bo5b2o$2o6bo$obo5bobo$9b2o!
xs8_312ko -2o$o8bo2b2o$b3o3b3ob2o$3bo2bo6bo$6b2o!
xs14_39e0e93 -8b2o2b2o$7bobob2o$6bobo4bo$7bo4$2b2o$2bo$obo$2o!
xs10_g0s252z11 -7b2o$2bo4bobo$bobo4bo$o2bo$b2o6b2o$9bobo$9bo!
xs10_178kk8 -2o$bo$bobo$2b2o4b2o$8bo2b2o$6bobo2bobo$6b2o3bo!
xs12_330fho -2o$obo$bo$8b2o$7bo2bo$7bobo2b3o$8bo3bo$13bo!
xs11_178kic -b2o$bobo$2b2o2$bo5b2o$2o5bobo$obo6bo$9b2o!
xs9_178kc -9b2o$8bobo$8bo$7b2o2$9b2o$9bobo$9bo$2b2o$3bo$3o$o!
xs10_358gkc -8b2o$7bo2bo$7bo2bo$8b2o$2bo$bobo3bo$obo3b2o$2o4bobo!
xs7_3lo -6b2o$3bo2bo$b3o3b3o$o8bo$2o4bo$5b2o$5bobo!
xs17_2ege1ege2 -7b2o$6bo2bo$b2o4b2o$o2bo$obo6b3o$bo7bo$10bo!
xs12_o4q552z01 -bo$obo$2o6bo$7bobo$8bobo$9b2o2$10bo$9b2o$9bobo!
xs10_3542ac -2o$obo$bo5bo$6bobo$2o4bo2bo$obo4b2o$o!
xs10_32qr -2o$o$b3o$3bo5$8b2o$7bo2bo$7bo2bo$8b2o2b2o$12bobo$12bo!
xs16_69egmiczx1 -2o$obo$b2o7bo$8b3o$bo5bo$2o5b2o$obo!
xs14_69bo8a6 -7bo$6bobo$7bobo$8b2o$b2o$o2bo$o2bo$b2o2b2o$5bobo$5bo!
xs12_330f96 -8b2o$7bobo$7b2o6$b2o$o2bo$o2bo$b2o2b2o$5bobo$5bo!
xs10_3215ac -bo$obo5bo$obo4bobo$bo4bobo$6b2o2$8b2o$8bobo$8bo!
xs9_312453 -o$o$o6bo3b2o$6bobob2o$5bo2bo3bo$6b2o!
xs16_69bob96 -6b2o$5bo2bo$5bo2bo$o5b2o$o$o$2b3o$2bo$3bo!
xs15_j1u06a4z11 -2bo$bobo$obo5bo$2o5bobo$8b2o$bo$2o$obo!
xs15_259e0eic -8bo$7bobo$6bobo$6b2o6$2o$obo2b2o$b2ob2o$6bo!
xs15_259e0e96 -b2o$obo$bo$10b2o$9bobo$9bo3b2o$8b2o3bobo$13bo!
xs14_j1u413z11 -2b2o$bobo$bo6b2o$2o6bobo$9b2o2$10bo$9b2o$9bobo!
xs14_6is079c -4b2o$4bobo2b2o$5b2ob2o$10bo2$b2o$o2bo$obo$bo!
xs14_69e0eic -b2o$obo$2o2$3b2o$2bo2bob3o$2bobo2bo$3bo4bo!
xs14_6960uic -o5b2o$o4bo2bo$o4bo2bo$6b2o2$6bo$5b2o$5bobo!
xs13_g88m96z121 -10bo$10bo$10bo$b2o$o2bo$b2o2b2o$5bobo$5bo!
xs12_69iczx113 -8bo$7bobo$7b2o$2b2o$bobo5b3o$bo7bo$2o8bo!
xs11_ggm952z1 -2b2o$2bobo$3bo2$5b3o$2bo2bo$bobo2bo$obo$2o!
xs10_g8ka52z01 -8b2o$8b2o$2bo$bobo$obo$2o2$bo$2o$obo!
xs10_1784ko -2o$bo$bobo$2b2o4bo$7bobo$7bobo$8bo2$9b2o$9bobo$9bo!
xs8_31248c -b2o5b2o$o2bo3bobo$obo5bo$bo$3b3o$3bo$4bo!
xs20_3lkkl3z32w23 -2bo$bobo$o2bo$b2o2$10bo$8b3o$7bo$7b2o2$7bo$6b2o$6bobo!
xs19_0c88b96z6953 -7b2o$7bobo$8bo6$2o$obo$b2o2$3bo$2b2o$2bobo!
xs15_g88m596z121 -6b2o$6bobo$b2o5bo$o2bo4b2o$obo$bo5bo$6b2o$6bobo!
xs15_4a9raic -4b2o$5bo$5bobo$6b2o3$2o$obo$b2o2$3bo$2b2o$2bobo!
xs15_3lkm96z01 -6b2o$6b2o3$3bo$b3o$o$2o2$2b3o$2bo$3bo!
xs15_3lk453z121 -2bo$bobo$2b2o3$2o$obo$b2o2$bo$2o$obo!
xs14_i5q453z11 -6b2o$6bo$7b3o$9bo4$2o$obo$b2o2b2o$4b2o$6bo!
xs14_g8o0e96z121 -b2o7bo$o2bo5bobo$o2bo6bo$b2o2$bo$2o$obo!
xs14_39e0eic -8b2o$2o5bobo$bo6bo$bobo$2b2o5b3o$9bo$10bo!
xs14_31egm96 -6b2o$5bo2bo$5bobo2b2o$6bo3bobo$10bo$2b2o$3bo$3o$o!
xs13_3hu06a4 -2o$2o7$10bo$8b3o$7bo$7b2o2$7bo$6b2o$6bobo!
xs12_3hu066 -7b2o$7bobo$8bo2$9b2o$9bobo$9bo$o$3o$3bo$2b2o!
xs12_0ggs252z32 -8b2o$2o5bobo$obo4bo$2bo3b2o$2b2o$6bo$5b2o$5bobo!
xs12_0g8o652z121 -7b2o$bo5bobo$obo5b2o$bobo$2b2o6bo$9b2o$9bobo!
xs12_08o653z32 -bo$obo$bobo5bo$2b2o3b3o$6bo$6b2o$9b2o$9bobo$9bo!
xs11_ggka53z1 -3bo$b3o$o$2o2$11b3o$7b2o2bo$6bo2bo2bo$7b2o!
xs11_31461ac -bo$obo$b2o3$5bo$4bobo$5bobo$6b2o2$8bo$7b2o$7bobo!
xs10_69ar -7b2o$7bobo$8b2o6$b2o$o2bo$b2o2b2o$5bobo$5bo!
xs10_0j96z32 -9b3o7$2b2o$bobo$bo3b2o$2o3bobo$5bo!

See also