Hacking apgsearch

For scripts to aid with computation or simulation in cellular automata.
Naszvadi
Posts: 1244
Joined: May 7th, 2016, 8:53 am
Contact:

Re: Hacking apgsearch

Post by Naszvadi » December 19th, 2017, 3:13 am

dvgrn wrote:...

With all that extra flipping/rotating/sorting work, it might not save much time in the end, but you wouldn't end up with identical census results in lots of groups of two or four or eight.
What I usually implement in such cases: Checking the minimality of the bounding box (all four "edges" contain at least one alive cell), and then finding the minimum of the sorted transitions and filtering upon if it is the as the pattern to be checked.

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

Re: Hacking apgsearch

Post by LaundryPizza03 » January 16th, 2018, 4:27 am

The script crashed when running the rule B2ae3ir4it6i/S2n3e. It reports that it is not valid in any algorithm.

Code: Select all

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

User avatar
Apple Bottom
Posts: 1034
Joined: July 27th, 2015, 2:06 pm
Contact:

Re: Hacking apgsearch

Post by Apple Bottom » January 16th, 2018, 7:42 am

LaundryPizza03 wrote:The script crashed when running the rule B2ae3ir4it6i/S2n3e. It reports that it is not valid in any algorithm.
Works For Me(tm). Are you sure you didn't have a typo in your rulestring, an extra character, something like that?
If you speak, your speech must be better than your silence would have been. — Arabian proverb

Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_

Proud member of the Pattern Raiders!

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

Re: Hacking apgsearch

Post by LaundryPizza03 » January 16th, 2018, 6:20 pm

Apple Bottom wrote:
LaundryPizza03 wrote:The script crashed when running the rule B2ae3ir4it6i/S2n3e. It reports that it is not valid in any algorithm.
Works For Me(tm). Are you sure you didn't have a typo in your rulestring, an extra character, something like that?
Yes. I tried again today and it still doesn't work. Also, Golly parses the rulestring without correction. The bug seems to affect just this rule.

Code: Select all

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

User avatar
Apple Bottom
Posts: 1034
Joined: July 27th, 2015, 2:06 pm
Contact:

Re: Hacking apgsearch

Post by Apple Bottom » January 17th, 2018, 4:20 am

LaundryPizza03 wrote:Yes. I tried again today and it still doesn't work. Also, Golly parses the rulestring without correction. The bug seems to affect just this rule.
Hmm. Which apgsearch version?
If you speak, your speech must be better than your silence would have been. — Arabian proverb

Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_

Proud member of the Pattern Raiders!

moony
Posts: 8
Joined: October 22nd, 2017, 10:55 pm

Re: Hacking apgsearch

Post by moony » January 23rd, 2018, 10:17 am

What exactly does the "magic soup" describe in apgsearch? I'm terrible at reading ASM, so i'm a little stuck. (I'm trying to improve the Cellular Automata simulation in The Powder Toy, which currently only supports B/S and B/S/G format rules, and want to add non totalistic rule support, so i'm investigating how APGSearch does it. Besides, the code needs a redo anyways, it's slow :P)

User avatar
Apple Bottom
Posts: 1034
Joined: July 27th, 2015, 2:06 pm
Contact:

Re: Hacking apgsearch

Post by Apple Bottom » January 23rd, 2018, 3:58 pm

moony wrote:What exactly does the "magic soup" describe in apgsearch? I'm terrible at reading ASM, so i'm a little stuck. (I'm trying to improve the Cellular Automata simulation in The Powder Toy, which currently only supports B/S and B/S/G format rules, and want to add non totalistic rule support, so i'm investigating how APGSearch does it. Besides, the code needs a redo anyways, it's slow :P)
The "magic sauce"? Calcyman mentioned that this is "[a] lookup table for a SIMD-based isotropic algorithm; currently unused in favour of a pure lookup table approach".
If you speak, your speech must be better than your silence would have been. — Arabian proverb

Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_

Proud member of the Pattern Raiders!

wwei23

Re: Hacking apgsearch

Post by wwei23 » April 1st, 2018, 5:26 pm

Apple Bottom wrote:This is a question for wwei23, primarily -- you've searched the "25p" pseudo-symmetry earlier this summer, which I understand is based on taking the Kronecker product of a C1 soup with itself:
wwei23 wrote: Basically, take a 16x16 soup, and replace each cell with a 16x16 block of cells. Then replace each 16x16 block of cells with the original soup. It was the only way I could get 25p to work.
Can you share the code you used for this, either the entire modified apgsearch script or the hashsoup() routine it uses? Thanks.
I just nested the C1 thing in itself, and multiplied by 16. That way, it places the cells 16 times x, y, for each cell in the original soup...

User avatar
77topaz
Posts: 1496
Joined: January 12th, 2018, 9:19 pm

Re: Hacking apgsearch

Post by 77topaz » April 1st, 2018, 6:10 pm

wwei23 wrote:I just nested the C1 thing in itself, and multiplied by 16. That way, it places the cells 16 times x, y, for each cell in the original soup...
Did you not read Apple Bottom's question? He asked for the code you used to do that, not a vague description in words.

wwei23

Re: Hacking apgsearch

Post by wwei23 » April 1st, 2018, 6:25 pm

77topaz wrote:
wwei23 wrote:I just nested the C1 thing in itself, and multiplied by 16. That way, it places the cells 16 times x, y, for each cell in the original soup...
Did you not read Apple Bottom's question? He asked for the code you used to do that, not a vague description in words.
I’m 1200 miles away from my computer, and can’t type out the actual CODE until Wednesday.
EDIT:
I have left the code on Apple Bottom's talk page. I find apgsearch the easiest one to modify for special symmetries.

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

Re: Hacking apgsearch

Post by LaundryPizza03 » May 1st, 2018, 8:09 pm

The hacked apg 1.x incorrectly labeled this xq2 as a "glider" because the canonical form matches that for the glider (153). Not a biggie, since Catagolue does not make this mistake.

Code: Select all

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

User avatar
77topaz
Posts: 1496
Joined: January 12th, 2018, 9:19 pm

Re: Hacking apgsearch

Post by 77topaz » May 1st, 2018, 8:33 pm

LaundryPizza03 wrote:The hacked apg 1.x incorrectly labeled this xq2 as a "glider" because the canonical form matches that for the glider (153). Not a biggie, since Catagolue does not make this mistake.
Actually, Catagolue did put the xq2_153 from your haul under xq4. But apgsearch v4.24-ll1.23 is able to tag the spaceship correctly.

wwei23

Re: Hacking apgsearch

Post by wwei23 » May 13th, 2018, 11:22 am

Will apgsearch work without APG_ExpungeGliders/ExpungeObjects/IdentifyGliders? I have to make rulearrays. The 7-state ones can be made pretty well. The 17-state ones cannot.

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

Re: Hacking apgsearch

Post by wildmyron » May 13th, 2018, 12:23 pm

wwei23 wrote:Will apgsearch work without APG_ExpungeGliders/ExpungeObjects/IdentifyGliders? I have to make rulearrays. The 7-state ones can be made pretty well. The 17-state ones cannot.
Apgsearch v1 depends on those rules to census the ash efficiently after running the soup. It would need some modification to run without them, and it will run much slower for CGoL and similar rules.

But if you are going to run it with something other than Golly, it will need major modification.

What are rulearrays and what will you be using to simulate the CA?
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.

wwei23

Re: Hacking apgsearch

Post by wwei23 » May 13th, 2018, 12:36 pm

A rulearray is the way I use MAP rules. Can be used for more than 2 states. Why would apgsearch have to be modified to work without the aforementioned rules?

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

Re: Hacking apgsearch

Post by wildmyron » May 13th, 2018, 6:55 pm

wwei23 wrote:Why would apgsearch have to be modified to work without the aforementioned rules?
Because it uses them. If they're not there it will create them again.
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.

wwei23

Re: Hacking apgsearch

Post by wwei23 » May 13th, 2018, 7:20 pm

Will it work if it is modified not to create them and if they are not there?

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

Re: Hacking apgsearch

Post by wildmyron » May 13th, 2018, 10:37 pm

wwei23 wrote:Will it work if it is modified not to create them and if they are not there?
I really don't understand why you feel the need to ask this question.

The script uses those rules.
If they don't exist it will create them.
If they can't be created (or you modify the script to not create them) ...

Actually - you should do some homework and find out for yourself what happens:
Run the script once to make sure all rule files have been created (if you haven't already).
Find this line in the script

Code: Select all

    soup.rg.saveAllRules()
and comment it out by inserting a # at the beginning of the line.
Save the modified script.
Delete one of the rule files you mentioned from your Rules folder.
Run the script again and see what happens.
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
Majestas32
Posts: 549
Joined: November 20th, 2017, 12:22 pm
Location: 'Merica

Re: Hacking apgsearch

Post by Majestas32 » May 14th, 2018, 10:28 am

I still don't know what rulearrays are. They're different from the rule cell arrays from majestic Simulator i assume
Searching:
b2-a5k6n7cs12-i3ij4k5j8
b2-a3c7cs12-i

Currently looking for help searching these rules.

wwei23

Re: Hacking apgsearch

Post by wwei23 » May 14th, 2018, 10:56 am

Majestas32 wrote:I still don't know what rulearrays are. They're different from the rule cell arrays from majestic Simulator i assume
Consider this neighborhood:

Code: Select all

001
000
101
We write this out in reading order: 001000101
Since Turro is a 2-state rule, we convert the above from base 2 to base 10. We get 71. The 71th index of the Turro rulearray is 1, so the neighborhood goes to 1.

User avatar
Majestas32
Posts: 549
Joined: November 20th, 2017, 12:22 pm
Location: 'Merica

Re: Hacking apgsearch

Post by Majestas32 » May 14th, 2018, 12:31 pm

Rule cell arrays are better tho.
Searching:
b2-a5k6n7cs12-i3ij4k5j8
b2-a3c7cs12-i

Currently looking for help searching these rules.

wwei23

Re: Hacking apgsearch

Post by wwei23 » May 14th, 2018, 2:36 pm

What’s that?

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

Re: Hacking apgsearch

Post by dani » May 14th, 2018, 2:42 pm

If you're going to write one line per post you should PM eachother as it tends to clog up the thread. Also, this is pretty off topic as it is anyway, so move it elsewhere.

User avatar
77topaz
Posts: 1496
Joined: January 12th, 2018, 9:19 pm

Re: Hacking apgsearch

Post by 77topaz » May 15th, 2018, 6:22 am

wwei23 wrote:Consider this neighborhood:

Code: Select all

001
000
101
We write this out in reading order: 001000101
Since Turro is a 2-state rule, we convert the above from base 2 to base 10. We get 71. The 71th index of the Turro rulearray is 1, so the neighborhood goes to 1.
So, what you mean by "rulearray" is actually just a MAP string? :?

wwei23

Re: Hacking apgsearch

Post by wwei23 » May 15th, 2018, 7:14 am

77topaz wrote:
wwei23 wrote:Consider this neighborhood:

Code: Select all

001
000
101
We write this out in reading order: 001000101
Since Turro is a 2-state rule, we convert the above from base 2 to base 10. We get 71. The 71th index of the Turro rulearray is 1, so the neighborhood goes to 1.
So, what you mean by "rulearray" is actually just a MAP string? :?
I guess: I’m not sure.

Post Reply