Hacking apgsearch
Re: Hacking apgsearch
I like asking stupid questions:
Could you mod apgsearch 3.x?
Could you mod apgsearch 3.x?
Help wanted: How can we accurately notate any 1D replicator?
- praosylen
- Posts: 2443
- Joined: September 13th, 2014, 5:36 pm
- Location: Pembina University, Home of the Gliders
- Contact:
Re: Hacking apgsearch
In theory, I think so. In practice, I don't know enough of the low-level and hardware-specific tricks used in 3.x to do that, and it doesn't even compile using any compiler I can figure out how to get on my old Mac. It would just be far easier for me to write something completely from scratch. Anyone that knows how, though, please feel free to make a mod of 3.x (assuming it's actually possible and there's not some stupid hang-up I'm missing).muzik wrote:Could you mod apgsearch 3.x?
former username: A for Awesome
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
Re: Hacking apgsearch
I thought semitotalistoc rules are supported by 3.x, no? I **think** that it is possible by merely tweaking rule2asm.py..muzik wrote:I like asking stupid questions:
Could you mod apgsearch 3.x?
Re: Hacking apgsearch
not that I know how to do that.Scorbie wrote:I thought semitotalistoc rules are supported by 3.x, no? I **think** that it is possible by merely tweaking rule2asm.py..muzik wrote:I like asking stupid questions:
Could you mod apgsearch 3.x?
I haven't tried searching non totalistic rules with it, but checking hauls submitted for them shows that pretty much everyone uses the python version.
Help wanted: How can we accurately notate any 1D replicator?
- praosylen
- Posts: 2443
- Joined: September 13th, 2014, 5:36 pm
- Location: Pembina University, Home of the Gliders
- Contact:
Re: Hacking apgsearch
They aren't; apparently the boolean circuit corresponding to some rules ended up containing too many gates or something (I don't really understand this part especially well), so it was decided against. Tweaking rule2asm.py might be possible, but I don't know asm, so I'm not the one to test it, especially on my particular old computer. There may also be some other sections of the script (I would guess at least pseudo-object separation) that require knowledge of the particular rule, so those would take more work to mod.Scorbie wrote:I thought semitotalistoc rules are supported by 3.x, no? I **think** that it is possible by merely tweaking rule2asm.py..
former username: A for Awesome
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
Re: Hacking apgsearch
Can anybody have apgmera print every new object that appears:
New object: xp2_7
New object: xs4_33
New object: xq4_153
.
.
.
10000 soups completed (99999999 per second)
New object: xp2_7
New object: xs4_33
New object: xq4_153
.
.
.
10000 soups completed (99999999 per second)
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Hacking apgsearch
Wrong thread? I think this one's really for apgsearch 1.x, not apg(mera|nano). That said: patch here.drc wrote:Can anybody have apgmera print every new object that appears
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!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Re: Hacking apgsearch
From the apgsearch v1.0 thread,
The reason for this is down to the way apgsearch does periodicity detection and the length of time the Coalesce rule is run to ensure high period objects are correctly identified. In this case, p8 and p16 objects are relatively common, but the default periods which are detected by the naive stabilisation detection only include factors of 12 and 30. So even though most soups stabilise quickly, this is not detected in soups with a p8 or p16 object.* If one soup in the page has such an object, it is implicitly assumed there may be a high period object and the coalesce rule is run for much longer than necessary. This is not a big issue in terms of evolving the soup in the auxiliary rules, but all the ships leave a long trail of "dead but has been alive" cells. I believe the slowdown occurs because the final population of the universe before object identification occurs is very large, and everyone of those "dead but has been alive" cells is grabbed by the gridobj() function as part of the ship, as well as being scanned after the object has been removed. From my previous experience this explanation doesn't quite seem to explain the drastic slowdown, but when I make the following change to stabilise3(),
i.e. change the periods given to naivestab() from 12 to 16 and from 30 to 32, then the search speed jumps to over 150 soups/s.
I was running a test set to upload which I was going to cancel because of the plethora of un-separated small gliders, but accidentally uploaded it. At least there's a nice p16 puffer to compensate for all the noise in the p2 ships category.
I had generated the rule, in particular it was generated by apgsearch-isotropic-v0.2.py while testing the rule. However, I specified the rule as "B2e3/S23-j" to both programs, not "B2e3_S23-j" as you say is required. This works fine in my script and I'd forgotten that the other script requires the exact name of an existing rule file. When I use the '_' the correct rule is processed but like @drc, soup search is very slow (~3 soups/s, increasing to ~7 soups/s if I reduce the sqrtspp_optimal value to 6.A for awesome wrote:Did either of you generate the rule table before searching the rule? This is a drawback of 0.21i: it does not autogenerate the rule table for you; you have to use isotropic-rulegen.py to make the rule and enter it using an underscore, not a slash. I'll try to improve this when I get back from vacation in three weeks, or sooner if I can.wildmyron wrote:I think you meant to post this on the Hacking apgsearch thread, but in any case something is going wrong with the rule parsing. When I tried a search with apgsearch-2016-2-06-v0.54+0.21i-update.py it was actually trying to search B23/S23 - doomed to failure. Searching works fine when I used my version of non-totalistic apgsearch (apgsearch-isotropic-v0.2.py) The search runs as expected. (No upload capability though.) I have no idea what's going wrong there.drc wrote:It's having a hard time searching B2e3/S23-j, an extremely stable rule. What's going on (and I said heyyeyaaeyaaaeyaeyaa)
Btw, that's a nice rule, lots of variety in the natural spaceships.
The reason for this is down to the way apgsearch does periodicity detection and the length of time the Coalesce rule is run to ensure high period objects are correctly identified. In this case, p8 and p16 objects are relatively common, but the default periods which are detected by the naive stabilisation detection only include factors of 12 and 30. So even though most soups stabilise quickly, this is not detected in soups with a p8 or p16 object.* If one soup in the page has such an object, it is implicitly assumed there may be a high period object and the coalesce rule is run for much longer than necessary. This is not a big issue in terms of evolving the soup in the auxiliary rules, but all the ships leave a long trail of "dead but has been alive" cells. I believe the slowdown occurs because the final population of the universe before object identification occurs is very large, and everyone of those "dead but has been alive" cells is grabbed by the gridobj() function as part of the ship, as well as being scanned after the object has been removed. From my previous experience this explanation doesn't quite seem to explain the drastic slowdown, but when I make the following change to stabilise3(),
Code: Select all
# Phase I of stabilisation detection, designed to weed out patterns
# that stabilise into a cluster of low-period oscillators within
# about 6000 generations.
if (self.naivestab2(12, 10)):
return 4;
if (self.naivestab(16, 30, 200)):
return 4;
if (self.naivestab(32, 30, 200)):
return 5;
I was running a test set to upload which I was going to cancel because of the plethora of un-separated small gliders, but accidentally uploaded it. At least there's a nice p16 puffer to compensate for all the noise in the p2 ships category.
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.
Semi-active here - recovering from a severe case of LWTDS.
Re: Hacking apgsearch
Whenever I try to search rules (i.e. B34et/S23-a4eit6) in the neighbourhood of CommonRepl, it always messes with my computer. It'll be going smoothly, then it will hit a pattern like this:
Then my ram explodes and chrome (playing youtube videos in the background) crashes. I don't know why this is.
Code: Select all
x = 3, y = 7, rule = B34et_S23-a4eit6
b2o$2bo$b2o2$3o$2bo$b2o!
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Hacking apgsearch
A random stab in the dark: what are your memory limits in Golly (in File->Preferences->Control)? Might be that you're running out of memory and the OOM killer is kicking in.drc wrote:Whenever I try to search rules (i.e. B34et/S23-a4eit6) in the neighbourhood of CommonRepl, it always messes with my computer. It'll be going smoothly, then it will hit a pattern like this:
Then my ram explodes and chrome (playing youtube videos in the background) crashes. I don't know why this is.Code: Select all
x = 3, y = 7, rule = B34et_S23-a4eit6 b2o$2bo$b2o2$3o$2bo$b2o!
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!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
-
- Posts: 795
- Joined: May 30th, 2016, 8:47 pm
- Location: Milky Way Galaxy: Planet Earth
Re: Hacking apgsearch
Is it just me, or are those tiny Knightships? Anyways, your computer may just be having trouble with infinite growth.drc wrote:Whenever I try to search rules (i.e. B34et/S23-a4eit6) in the neighbourhood of CommonRepl, it always messes with my computer. It'll be going smoothly, then it will hit a pattern like this:
Then my ram explodes and chrome (playing youtube videos in the background) crashes. I don't know why this is.Code: Select all
x = 3, y = 7, rule = B34et_S23-a4eit6 b2o$2bo$b2o2$3o$2bo$b2o!
Code: Select all
x = 81, y = 96, rule = LifeHistory
58.2A$58.2A3$59.2A17.2A$59.2A17.2A3$79.2A$79.2A2$57.A$56.A$56.3A4$27.
A$27.A.A$27.2A21$3.2A$3.2A2.2A$7.2A18$7.2A$7.2A2.2A$11.2A11$2A$2A2.2A
$4.2A18$4.2A$4.2A2.2A$8.2A!
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Hacking apgsearch
I just tried B34et/S23-a4eit6 myself, and hit one of those soups after about 2000 soups. The culprit is the error-correcting phase in apgsearch; Golly's configured memory limits don't apply, likely because the allocations are done in Python as opposed to as part of Golly's own algorithms.
Golly kept hovering somewhere between 16 and 17 GB of allocated memory here, but did not go beyond that, and the machine otherwise remained usable. I'll leave it running for a while to see whether it's going to go anywhere, but it's quite slow as well (error correction's took almost 25 minutes), so whether it'll ever finish 10k soups and submit results to Catagolue remains to be seen. (It's already hit a similar pattern again almost right after.)
The soup in question's this, BTW:
Apparently it produced no less than 15 PATHOLOGICALs, in addition to a zz_LINEAR.
Golly kept hovering somewhere between 16 and 17 GB of allocated memory here, but did not go beyond that, and the machine otherwise remained usable. I'll leave it running for a while to see whether it's going to go anywhere, but it's quite slow as well (error correction's took almost 25 minutes), so whether it'll ever finish 10k soups and submit results to Catagolue remains to be seen. (It's already hit a similar pattern again almost right after.)
The soup in question's this, BTW:
Code: Select all
x = 16, y = 16, rule = B34et/S23-a4eit6
obbbbbobboooobob$
oobbobobbbobobbo$
boooobbbobboobob$
bbooboobbbbobobo$
obbooboboboobbbb$
bbbboobbbboboboo$
obbooobbobboobbo$
boooooboobbooobo$
bbbbobbooboooobb$
ooooobbbbbbooobo$
boobooobooboobbb$
boboobbbbbobobbo$
oobbbobbbbobbbbo$
obooobbbooooobob$
boobbbbboobobobo$
bobbbbboboooooob!
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!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Re: Hacking apgsearch
I have 4 GB... oh well, it can run most things just fine.Apple Bottom wrote:16 and 17 GB
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Hacking apgsearch
It gets better; apgsearch hit a soup where two of these patterns interact, and Golly's currently using about 21.5 GB of memory. (That's actually more than I have in this machine, but so far everything's still running fine. Fingers crossed.)drc wrote:I have 4 GB... oh well, it can run most things just fine.
EDIT: here's the soup:
Code: Select all
x = 16, y = 16, rule = B34et/S23-a4eit6
booobobbbbooboob$
bbbooboobobbobob$
bboobboboobobboo$
oobooboobbooboob$
oooooobboobbbbbo$
bbbobooooboobobb$
bobobobobboooooo$
ooboobbooboooobb$
bbbobobbbbobbbob$
ooobobobbobboooo$
oboooboobobooooo$
ooboobobboobobbo$
bobbooobbobbobbb$
obobobbbboboobob$
obbboboobooobbob$
oooobbobbbbbbbbo!
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!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Re: Hacking apgsearch
..how do you run non totalistic rules in HashLife?
Help wanted: How can we accurately notate any 1D replicator?
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Hacking apgsearch
Good question! I'm honestly not sure. Let me clarify the above saying "run it using hyperspeed", which seems to be using some sort of hash-based algorithm -- the pattern ran to a billion generations (with a population to match) in just a few minutes.muzik wrote:..how do you run non totalistic rules in HashLife?
Unrelated side note: Golly's now up to using 25 GiB of memory, and browsing the web on the same machine has become noticeably more laggy. Perhaps I should invest in some more RAM.
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!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Re: Hacking apgsearch
Does this still work with 2.8?
Help wanted: How can we accurately notate any 1D replicator?
- praosylen
- Posts: 2443
- Joined: September 13th, 2014, 5:36 pm
- Location: Pembina University, Home of the Gliders
- Contact:
Re: Hacking apgsearch
I don't know, but I doubt it's terribly difficult to fix. Try it, and if it doesn't work, just go through the source code -- you can skip the long dictionary of object names and scores -- and add the linemuzik wrote:Does this still work with 2.8?
Code: Select all
g.setalgo("RuleLoader")
P.S. You can actually use find and replace to do the same thing, at least on good text editors. Just replace all occurrences of
Code: Select all
g.setrule(
Code: Select all
g.setalgo("RuleLoader")
g.setrule(
former username: A for Awesome
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
Re: Hacking apgsearch
I'm trying to add size symmetries for APG 1. They are L (32x32), S (8x8), and 1D (1 x 20). How do I do this?
Re: Hacking apgsearch
Start by modifying the hashsoup function to generate soups with the desired "symmetry" For 32x32 you will need more random bits than SHA256 gives you. SHA512 gives you double, but you still need more. You can do this by calculating multiple hash values from slightly modified versions of the input string, e.g:Saka wrote:I'm trying to add size symmetries for APG 1. They are L (32x32), S (8x8), and 1D (1 x 20). How do I do this?
Code: Select all
def hashsoup(instring, sym):
s = hashlib.sha512(instring+'a').digest() + hashlib.sha512(instring+'b').digest()
...
Then you need to generate the soup from the random string. You can do this by adjusting the modular arithmetic for the 16x16 case to suit the new soup size.
The real question is: Why? What are you hoping to find that you otherwise won't?
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.
Semi-active here - recovering from a severe case of LWTDS.
Re: Hacking apgsearch
@wildmyron This is my first attemp at "real" apg hacking. How do I use rhe script you gave? I dont get it as of now
Re: Hacking apgsearch
@Saka: Well, I only quoted a small script fragment to show how you can generate the required random string. Have a good look at how the original apgsearch hashsoup function worked. I suggest that you special case the generation of the soup for your custom "symmetries" rather than trying to adapt the hashsoup function in apgsearch v1. There are also quite a few other places where small changes need to be made to accommodate new symmetries. I think it's unlikely anyone other than you will make these adaptations because you still haven't answered the question: Why?
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.
Semi-active here - recovering from a severe case of LWTDS.
Re: Hacking apgsearch
I answered it already: I just want to try this as my first "real" hacking attemptwildmyron wrote: you still haven't answered the question: Why?
Re: Hacking apgsearch
Well, in that case: Carry on!Saka wrote:I answered it already: I just want to try this as my first "real" hacking attemptwildmyron wrote: you still haven't answered the question: Why?
I suggest you start with a standalone version of hashsoup() for each of your desired symmetries. Then you can work on integrating it into the rest of apgsearch.
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.
Semi-active here - recovering from a severe case of LWTDS.
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Hacking apgsearch
On that note, SHA512 would yield enough for 20x20 soups -- might be interesting to investigate those since that's what Nathaniel's census used.wildmyron wrote:Start by modifying the hashsoup function to generate soups with the desired "symmetry" For 32x32 you will need more random bits than SHA256 gives you. SHA512 gives you double, but you still need more.
Alternatively, it would also be precisely enough for 16x32, which would be interesting to investigate for much the same reason that 8x32 is.
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!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!