gloc.py - for glider guns we may have missed

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
Kazyan
Posts: 1247
Joined: February 6th, 2014, 11:02 pm

gloc.py - for glider guns we may have missed

Post by Kazyan » April 29th, 2022, 9:29 pm

Many glider guns look like this:

Code: Select all

#C [[ GRID MAXGRIDSIZE 14 THEME Catagolue ]]
#CSYNTH gun_363 costs 3600 cells.
#C period 363 fullperiod 363 bbox 60 by 60
#CLL state-numbering golly
x = 60, y = 60, rule = LifeHistory
30.2A$30.A.A$32.A4.2A$28.4A.2A2.A2.A10.A$28.A2.A.A.A.A.2A9.ABA$30.
BABABA.A13.2B$31.B2ABA.A12.A2BAB$32.2B.BA14.A.ABA.2A$31.3B7.A10.A
3B2A.A$22.2A6.4B7.3A9.BA4.A$23.A6.B2A3B8.A10.4A$23.A.AB3.B2A3B7.A.
A8.2B.A$24.2AB.10B5.A.AB7.AB.AB$26.13B5.A3B7.3AB$26.14B6.4B7.2A$
26.15B5.6B6.AB$28.8B2.4B4.7B3.BA.A$28.6B5.4B2.8B3.B2A$27.9B4.17B$
26.4B4.2A5.16B$25.4B5.A6.16B$24.4B7.3A3.16B$23.4B10.A3.15B$22.4B
11.A.2AB.12B$21.4B10.2A.A.AB2.11B$20.4B11.A2.A5.10B3.2A$19.4B14.2A
5.2B2A6B3.A$18.4B21.3B2A6B4.A$17.4B23.10B3.2A$16.4B24.8B.B2A$3.2A
10.4B24.7B3.B2AB2A$4.A9.4B25.6B6.B.A$2.A10.4B27.6B4.2A3.A$2.5A5.4B
5.2A21.8B.A2.4A$7.A4.4B5.A21.9BA.A.A$4.3AB2.7B.BA.A12.A8.7B.2BAB.A
.2A$3.A.2B3.7B.B2A13.3A6.6B3.2B2.A.A$3.4A12B18.A4.7B4.B.2A2.A$.2A
2.BA3B2A7B17.2A4.7B3.A.A2.A.A$A2.3AB.2B2A7B17.4B.8B3.2A2.A.A$2A.A.
B3.10B19.11B8.A$3.A8.8B17.12B$3.2A7.9B16.12B$13.3B2.4B15.11B$11.5B
3.4B13.9B12.2A$11.2A7.B3A9.2B.10B11.A$12.A8.A3B7.2A14B.B4.BA.A$9.
3A10.A3B3.3BABA17B2.B2A$9.A13.7B2AB2A8B3A9B$24.5B2A11BA13B$25.7BA
3BA5BA3BA9B$26.5B5ABA18B$28.2BA7BA6BA10B$29.9BA5BAB5.B.4B$29.A2B5A
6B11.4B$29.ABA6BA2BAB12.4B$33.3B4.2B14.3BA$34.B6.2B14.ABA$40.B2AB
14.2A$41.2A16.B! 
They're a loop in which a syringe feeds into an H-to-2G with a NW output glider, and then two reflectors feed it back into the syringe. Maybe the syringe is fancily p3, or maybe it's periodic in order to extract a glider from a loop that wouldn't otherwise have a spare glider. There are a lot of H-to-Gs and a lot of different small reflectors.

gloc.py tries all of the combinations and tells you any are better than its current list of gun sizes. It considers snarks, bumpers, the hotcrystal0 mechanism, p4 cenarks of both color parities, bouncers, and duoplet sparkers. It knows about the p3 bumper and p3 syringe to save rows, and has a vague idea that it's hard to put cenarks close to things or weld bouncers to syringes.

The code is a bodge job from a non-programmer, and there's at least a few bugs that I haven't tracked down, which is likely because I've mismeasured some period-something reflector or another. While I've attempted to cut down on false positives, there will still be a bunch of reports of possible guns that can't actually be built in practice.

gloc.py doesn't take any arguments. You run it and it gives you the list. The output consists of a lot of headers that look something like this:

Code: Select all

Reflector Sequence: p4 CC cenark, Bouncer, syringe
	NW19T102, period 344, 3584 area (-1066 cells), snark trombone slide pulled out by 0.5 diagonals; use periodic syringe
	[...]
This means that, for example, you construct the gun by feeding the syringe into NW19T102, which feeds into a p4 CC cenark, which feeds into a bouncer, which feeds back into the syringe input. You stretch out the trombone slide so that the circulating glider's U-turn is as far away from the syringe as a minimal weld of a snark loop, plus 0.5 diagonals (there's a .5 in there because the circulating glider is a different color than it would be in the equivalent snark loop.)

This script is very much a work in progress. I hope to eventually make it work with G-to-Xs that aren't syringes.
Attachments
gloc.zip
(18.77 KiB) Downloaded 28 times
Tanner Jacobi
Coldlander, a novel, available in paperback and as an ebook. Now on Amazon.

User avatar
Kazyan
Posts: 1247
Joined: February 6th, 2014, 11:02 pm

Re: gloc.py - for glider guns we may have missed

Post by Kazyan » May 2nd, 2022, 5:04 pm

v0.7: Fixed a bunch of bugs that made the program not work.
Attachments
gloc.zip
(19.28 KiB) Downloaded 34 times
Tanner Jacobi
Coldlander, a novel, available in paperback and as an ebook. Now on Amazon.

hotdogPi
Posts: 1615
Joined: August 12th, 2020, 8:22 pm

Re: gloc.py - for glider guns we may have missed

Post by hotdogPi » May 3rd, 2022, 9:46 am

I think there's still a bug — the improved periods only go up to 679. I changed MaxSlideout from 40 to 200, and this didn't change, even though a whole bunch of the 4-digit guns are unoptimized.
User:HotdogPi/My discoveries

Periods discovered: 5-16,⑱,⑳G,㉑G,㉒㉔㉕,㉗-㉛,㉜SG,㉞㉟㊱㊳㊵㊷㊹㊺㊽㊿,54G,55G,56,57G,60,62-66,68,70,73,74S,75,76S,80,84,88,90,96
100,02S,06,08,10,12,14G,16,17G,20,26G,28,38,47,48,54,56,72,74,80,92,96S
217,486,576

S: SKOP
G: gun

User avatar
Kazyan
Posts: 1247
Joined: February 6th, 2014, 11:02 pm

Re: gloc.py - for glider guns we may have missed

Post by Kazyan » May 3rd, 2022, 5:01 pm

hotdogPi wrote:
May 3rd, 2022, 9:46 am
I think there's still a bug — the improved periods only go up to 679. I changed MaxSlideout from 40 to 200, and this didn't change, even though a whole bunch of the 4-digit guns are unoptimized.
After taking a look into this, I think the explanation is that the simple glider loop model isn't competitive for large sizes. For example, of the kinds of guns that gloc tries, the smallest p1003 gun it tries among snark-snark-syringe loops is 141*151, which is about three times the size of the current 'folded' p1003 design. There doesn't seem to be a specific breakpoint or anything where gloc starts inflating areas for high slideout values.

I'll add in some functionality to automate some of the work of putting a gun together.
Tanner Jacobi
Coldlander, a novel, available in paperback and as an ebook. Now on Amazon.

Naszvadi
Posts: 1248
Joined: May 7th, 2016, 8:53 am
Contact:

Re: gloc.py - for glider guns we may have missed

Post by Naszvadi » May 4th, 2022, 7:57 am

Kazyan wrote:
April 29th, 2022, 9:29 pm
Many glider guns look like this:

Code: Select all

#C [[ GRID MAXGRIDSIZE 14 THEME Catagolue ]]
#CSYNTH gun_363 costs 3600 cells.
#C period 363 fullperiod 363 bbox 60 by 60
#CLL state-numbering golly
x = 60, y = 60, rule = LifeHistory
30.2A$30.A.A$32.A4.2A$28.4A.2A2.A2.A10.A$28.A2.A.A.A.A.2A9.ABA$30.
BABABA.A13.2B$31.B2ABA.A12.A2BAB$32.2B.BA14.A.ABA.2A$31.3B7.A10.A
3B2A.A$22.2A6.4B7.3A9.BA4.A$23.A6.B2A3B8.A10.4A$23.A.AB3.B2A3B7.A.
A8.2B.A$24.2AB.10B5.A.AB7.AB.AB$26.13B5.A3B7.3AB$26.14B6.4B7.2A$
26.15B5.6B6.AB$28.8B2.4B4.7B3.BA.A$28.6B5.4B2.8B3.B2A$27.9B4.17B$
26.4B4.2A5.16B$25.4B5.A6.16B$24.4B7.3A3.16B$23.4B10.A3.15B$22.4B
11.A.2AB.12B$21.4B10.2A.A.AB2.11B$20.4B11.A2.A5.10B3.2A$19.4B14.2A
5.2B2A6B3.A$18.4B21.3B2A6B4.A$17.4B23.10B3.2A$16.4B24.8B.B2A$3.2A
10.4B24.7B3.B2AB2A$4.A9.4B25.6B6.B.A$2.A10.4B27.6B4.2A3.A$2.5A5.4B
5.2A21.8B.A2.4A$7.A4.4B5.A21.9BA.A.A$4.3AB2.7B.BA.A12.A8.7B.2BAB.A
.2A$3.A.2B3.7B.B2A13.3A6.6B3.2B2.A.A$3.4A12B18.A4.7B4.B.2A2.A$.2A
2.BA3B2A7B17.2A4.7B3.A.A2.A.A$A2.3AB.2B2A7B17.4B.8B3.2A2.A.A$2A.A.
B3.10B19.11B8.A$3.A8.8B17.12B$3.2A7.9B16.12B$13.3B2.4B15.11B$11.5B
3.4B13.9B12.2A$11.2A7.B3A9.2B.10B11.A$12.A8.A3B7.2A14B.B4.BA.A$9.
3A10.A3B3.3BABA17B2.B2A$9.A13.7B2AB2A8B3A9B$24.5B2A11BA13B$25.7BA
3BA5BA3BA9B$26.5B5ABA18B$28.2BA7BA6BA10B$29.9BA5BAB5.B.4B$29.A2B5A
6B11.4B$29.ABA6BA2BAB12.4B$33.3B4.2B14.3BA$34.B6.2B14.ABA$40.B2AB
14.2A$41.2A16.B! 
...
replaced P3 part to an eater 1:

Code: Select all

x = 66, y = 65, rule = B3/S23
30b2o$30bobo$32bo4b2o$28b4ob2o2bo2bo$28bo2bobobobob2o$31bobobobo$32b2o
bobo$36bo$41bo$22b2o17b3o$23bo7b2o11bo$23bobo5b2o10bobo$24b2o17bobo$
44bo$59b2o$59bo$57bobo$57b2o2$34b2o$34bo$35b3o$37bo$37bob2o$35b2obobo$
35bo2bo18b2o$37b2o7b2o9bo$46b2o10bo$57b2o$54b2o$3b2o49b2ob2o$4bo52bo$
2bo51b2o3bo$2b5o14b2o30bo2b4o$7bo13bo30bobobo$4b3o12bobo12bo18bo2bob2o
$3bo15b2o13b3o19bobo$3b4o30bo17b2o2bo$b2o3bo3b2o24b2o14bobo2bobo$o2b3o
4b2o40b2o2bobo$2obo53bo$3bo$3b2o14b2o$18b2o$20bo36b2o$11b2o44bo$12bo
42bobo$9b3o43b2o$9bo10$41b2o$41b2o2$62b2o$62bo$63b3o$65bo!

dani
Posts: 1222
Joined: October 27th, 2017, 3:43 pm

Re: gloc.py - for glider guns we may have missed

Post by dani » May 4th, 2022, 8:02 am

Naszvadi wrote:
May 4th, 2022, 7:57 am
replaced P3 part to an eater 1
Those big p3s are typically used to reduce the bounding box, which is the usual metric applied to guns for some reason. Yours is 61x60 while with the p3 it's 60x60. I think this metric is used because guns are often packed together closely.

User avatar
ihatecorderships
Posts: 309
Joined: April 11th, 2021, 12:54 pm
Location: Falls Church, VA

Re: gloc.py - for glider guns we may have missed

Post by ihatecorderships » May 4th, 2022, 8:53 am

Could the script be made to output how many gliders are in the loop?
-- Kalan Warusa
Don't drink and drive, think and derive.

User avatar
Kazyan
Posts: 1247
Joined: February 6th, 2014, 11:02 pm

Re: gloc.py - for glider guns we may have missed

Post by Kazyan » May 4th, 2022, 10:22 am

ihatecorderships wrote:
May 4th, 2022, 8:53 am
Could the script be made to output how many gliders are in the loop?
Yes--here you go!

There's a work-in-progress "def PrintGunSkeleton(slideout,LaneNum,FirstReflector,SecondReflector):" function in there that is supposed to show the locations of a gun's reflectors and its syringe in Life 1.06 format, which should alleviate some confusion over how to make some of the guns, but it's not ready yet and thus its contents have been commented out.

EDIT: gloc now actually prints gun skeletons, featuring stray cells to tell you roughly where the sparks/sparkers should go. It does not select the sparker for you yet. These guns are printed Life 1.06 format because that's the format that I could figure out how to use for this purpose. It also rudely dumps them right into the terminal window/stdout, because I haven't taught it file management manners, so you're recommended to pipe gloc's output into an actual file of some kind. Here's an example of such a gun skeleton, which I have completed and then submitted:

Code: Select all

NW25T126, period 145 (3 signals), 4096 area (-251 cells), snark trombone slide pulled out by 7 diagonals; use periodic syringe

#P 0 0
..................*
................***
...............*
...............**
**
.*
.*.**
..*..*.......................*
...**........................*.*
..................**.........***
..................**...........*
.
.
.
...........................*...**
..........................*.*...*
.........................*.*...*
.....................**.*.*...*
.....................**.*..****.*
.........................*.*...*.*
........**...........**.**..*..*.*
.........*............*.*..**...*
......***.............*.*
......*................*
    
#P 12 -39

............*
..........***
.........*
.........**
.
.....*
*...*.*
...*..*
....**

#P -13 -16

**
.*
.*.*
..**
.
.
......**
.....*..*
......*.*
.......*
.
.
......*
EDIT2: gloc.py now prints gun skeletons to actual files, knows about a few more p5 bumper welds courtesy of wwei23, and has an updated list of gun sizes (which had to be updated due to its own found-and-confirmed guns).
Attachments
gloc.zip
v0.75 prints gun skeletons to files
(21.11 KiB) Downloaded 28 times
Tanner Jacobi
Coldlander, a novel, available in paperback and as an ebook. Now on Amazon.

User avatar
Kazyan
Posts: 1247
Joined: February 6th, 2014, 11:02 pm

Re: gloc.py - for glider guns we may have missed

Post by Kazyan » May 5th, 2022, 11:04 pm

I've submitted all guns from a recent gloc.py run, with the exception of these candidates remaining, which can't be completed mostly due to space constraints from a p7 periodic syringe or a p3 bumper.

Code: Select all

90 degree Hotcrystal mechanism, bouncer, syringe
	NW16T124, period 105 (4 signals), 3906 area (-181 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	(Bouncer/periodic syringe collision)
bouncer, bouncer, syringe
	NW15T92, period 119 (3 signals), 3520 area (-71 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	(Bouncer/periodic syringe collision)
	NW15T92, period 357 (1 signal ), 3520 area (-71 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	(Bouncer/periodic syringe collision)
snark, bouncer, syringe
	NW16T124, period 128 (3 signals), 3596 area (-184 cells), snark trombone slide pulled out by 2 diagonals; use periodic syringe
	(Bouncer/periodic syringe collision; maybe JLSable)
bumper, bumper, syringe
	NW17T90, period 133 (3 signals), 3835 area (-313 cells), snark trombone slide pulled out by 7 diagonals; use periodic syringe
	(Bumper/periodic syringe collision)
bouncer, snark, syringe
	NW16T124, period 364 (1 signal ), 3190 area (-50 cells), snark trombone slide pulled out by 0 diagonals; use periodic syringe
	(Bouncer/snark collision)
	NW16T124, period 182 (2 signals), 3190 area (-50 cells), snark trombone slide pulled out by 0 diagonals; use periodic syringe
	(Bouncer/snark collision)
	NW16T124, period 105 (4 signals), 3900 area (-187 cells), snark trombone slide pulled out by 7 diagonals; use periodic syringe
	(Bouncer doesn't fit in its most compact orientation)
	NW8T186, period 434 (1 signal ), 3600 area (-548 cells), snark trombone slide pulled out by 1 diagonals; use periodic syringe
	NW8T186, period 217 (2 signals), 3600 area (-548 cells), snark trombone slide pulled out by 1 diagonals; use periodic syringe
	(Both: Bouncer/snark collision)
	NW8T186, period 426 (1 signal ), 3381 area (-36 cells), snark trombone slide pulled out by 0 diagonals; use periodic syringe
	(Bouncer/snark collision)
snark, bouncer, syringe
	NW16T124, period 98 (4 signals), 3534 area (-360 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	NW16T124, period 392 (1 signal ), 3534 area (-66 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	NW16T124, period 196 (2 signals), 3534 area (-66 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	(All three: bouncer/periodic syringe collision)
bumper, bouncer, syringe
	NW18T106, period 371 (1 signal ), 3520 area (-262 cells), snark trombone slide pulled out by 2 diagonals; use periodic syringe
	(Bouncer/periodic syringe collision)
	NW16T124, period 413 (1 signal ), 3648 area (-246 cells), snark trombone slide pulled out by 5 diagonals; use periodic syringe
	(Bouncer/periodic syringe collision)
bumper, snark, syringe
	NW23T133, period 381 (1 signal ), 3392 area (-64 cells), snark trombone slide pulled out by 0 diagonals
	(p3 bumper/H-to-G collision)
bumper, 90 degree Hotcrystal mechanism, syringe
	NW15T113, period 453 (1 signal ), 4218 area (-70 cells), snark trombone slide pulled out by 8 diagonals
	(p3 HCM/p3 bumper collision)
	NW15T113, period 429 (1 signal ), 3834 area (-198 cells), snark trombone slide pulled out by 5 diagonals
	(p3 HCM/p3 bumper collision)
bumper, bumper, syringe
	NW3T135, period 412 (1 signal ), 3402 area (-558 cells), snark trombone slide pulled out by 3 diagonals; use periodic syringe
	(p4 bumper can't save that last row; probably JLSable)
Also, here's the newest version of gloc. It now considers the new p5 pipsquirter for the periodic syringe and a more compact version of NW3T135. Some of its gun size list is outdated; I think the next step is separate out the gun size list into a different file and make a helper script to update it.

Code: Select all

x = 41, y = 59, rule = LifeHistory
D3.D.D3.D2.3D2.5D3.D4.3D2.5D$2D2.D.D3.D.D3.D3.D4.2D3.D3.D.D$D.D.D.D3.
D5.D3.D5.D7.D.D$D2.2D.D.D.D3.2D4.D5.D5.2D3.3D$D3.D.D.D.D5.D3.D5.D7.D
5.D$D3.D.2D.2D.D3.D3.D5.D3.D3.D.D3.D$D3.D.D3.D2.3D4.D4.3D3.3D3.3D10$B
$2B$3B$4B$.4B$2.4B$3.4B$4.4B$5.4B16.2A$6.4B14.B2A2B3.2A$7.4B14.4B2.B
2AB$8.4B9.B.6B3.2B$9.4B6.10B2.2B$10.4B5.11B2A2B$11.4B3.12B2A3B.B$12.
4B2.18B2A$13.4B2.15B.B2A$14.19B3.B$15.18B$14.18B$14.2BD15B$13.3BDBD4B
.7B$14.2B3D4B2.6B$13.5BD5B.7B$12.13B.6B$11.4B7.9B$11.3B9.8B$9.4B11.8B
$9.2A14.7B$10.A15.6B$7.3A16.7B$7.A18.7B$26.7B3.B$26.8B.B2A$26.10B2A$
26.9B.B$27.7B$30.4B$29.4B$29.2AB$30.A$27.3A$27.A!
Attachments
gloc.zip
0.753 with better p5 pip and NW3T135
(19.96 KiB) Downloaded 30 times
Tanner Jacobi
Coldlander, a novel, available in paperback and as an ebook. Now on Amazon.

Post Reply