Catagolue Discussion Thread

For general discussion about Conway's Game of Life.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Execution of Old Guns by Variable-Speed Firing Squad

Post by confocaloid »

I myself use several different multistate extensions of CGoL for different tasks.
I still think two-state RLE is in general a better choice for an exchange format to share patterns. This boils down to keeping things simple.

For me, the objects/sparks used to add markings aren't any kind of "junk", I disagree with the part "junk in the corner", I can see and understand how those objects are useful.
Vort wrote: December 2nd, 2024, 1:28 pm Teaching people how to press Alt-J in Golly should not be that hard, right?
For me it looks easier than explaining why junk in the corner may be important.
If other software can't provide similar experience, it should be easy to implement such conversion. [...]
Last edited by confocaloid on December 2nd, 2024, 1:37 pm, edited 1 time in total.
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
dvgrn
Moderator
Posts: 12030
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Execution of Old Guns by Variable-Speed Firing Squad

Post by dvgrn »

Vort wrote: December 2nd, 2024, 12:04 pm Second, it is easy to forget to remove this junk while combining gun with other components. But it is not easy to get rid of it once it is uploaded (another problem, which no one was interested to solve when I mentioned it).
Heh, it's definitely not a matter of nobody being interested in solving that problem. A lot of us would be very happy to see Catagolue be able to release its death grip on the very first gun of a given bounding box size that gets uploaded, especially when there's a bounding box glitch involved.

However, there are a lot of feature requests and bug reports related to various parts of Catagolue, and calcyman only has just so much spare time to go around fixing things.

It seems like what's needed here might be a whole new subsystem, maybe with a button that can be clicked to report problems with existing gun patterns or syntheses, and then maybe a set of people empowered to act as reviewers to validate those reports and tell Catagolue that it's okay to remove that data so that corrected versions can be uploaded.

However, none of that is necessarily going to happen in the foreseeable future, unless someone wants to figure out all of the necessary code changes to Catagolue and submit a pull request that calcyman can quickly accept. Until then, it seems like our best bet will be to remind people periodically about current workarounds for the bounding-box problem.

Pretty much the same caveat applies to using LifeHistory instead of plain two-state Life in the submission process, or as an optional way to deliver or display the current record-breaking guns. It seems like a fine idea to me -- at least two previous incarnations of glider-gun collections included LifeHistory versions, for exactly the reasons you've mentioned. But that doesn't mean that anyone will actually be stepping up to provide the required code changes, any time soon -- so in the mean time, we work with what we have.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Execution of Old Guns by Variable-Speed Firing Squad

Post by Vort »

dvgrn wrote: December 2nd, 2024, 1:37 pm However, there are a lot of feature requests and bug reports related to various parts of Catagolue, and calcyman only has just so much spare time to go around fixing things.
I see activity here mostly when something goes horribly wrong. And even then, not right away.
Of course, I may be totally incorrect, but for me it looks more like lack of interest.
dvgrn wrote: December 2nd, 2024, 1:37 pm It seems like what's needed here might be a whole new subsystem, maybe with a button that can be clicked to report problems with existing gun patterns or syntheses, and then maybe a set of people empowered to act as reviewers to validate those reports and tell Catagolue that it's okay to remove that data so that corrected versions can be uploaded.
Introducing humans to verification process is bad idea.
In my opinion, it is enough to have different boolean function, deciding which gun is better.
For example, check area first, and if they equal, check minimum population.
Instead of minimum population other property can be used.
User avatar
dvgrn
Moderator
Posts: 12030
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Execution of Old Guns by Variable-Speed Firing Squad

Post by dvgrn »

Vort wrote: December 2nd, 2024, 2:03 pm I see activity here mostly when something goes horribly wrong. And even then, not right away.
Of course, I may be totally incorrect, but for me it looks more like lack of interest.
Heh, seems like "lack of time" would produce pretty much the same results as "lack of interest" -- given a lack of help from anyone else in fixing things. But we could try running some tests to see which one it is!

The relevant code for identifying guns appears to be a Python lifelib function, identify_gun() -- which I see uses LifeHistory as a stage in the validation process:

Code: Select all

def identify_gun(rle, lt4):

    a = lt4.pattern(rle)

    if a.empty():
        return []

    a = a[524288]
    x = lt4.pattern('', 'LifeHistory')
    x += a
    x = x[524288]
    p = x.population

    if (p < 1000000):
        return None

    if (p > 1500000):
        return None

    envelope = x.layers()[1]
    livecells = x[8].layers()[0]
    y = livecells - envelope
    envelope = x[256].layers()[1]

    if (y.population != 5):
        return None

    z = lt4.pattern("", "b3s23")
    z += y

    if (z.apgcode != 'xq4_153'):
        return None

    w = lt4.pattern("", "LifeHistory")
    w += z[-2097152]
    w = w[4194304]


    band = w.layers()[1]

    pbb = envelope - band
    r1 = z.getrect()
    r2 = z[1024].getrect()

    pbb += pbb(r1[0] - r2[0], r1[1] - r2[1])

    r = pbb.getrect()
    if (len(r) != 4):
        return None

    envelope = envelope[r[0] : r[0] + r[2], r[1] : r[1] + r[3]]
    r = envelope.getrect()

    geater = lt4.pattern("bo$2bo$3o4$5b2o$5bo$6b3o$8bo!", "b3s23")

    eater = z.replace(geater[:3, :3], geater[100], orientations='rotate4reflect', n_phases=2)

    if (eater.population != 7):
        return None

    x += eater

    x = x[128]

    multiple = x.oscar(eventual_oscillator=False, maxexp=20)['period']

    print('True period: %d' % multiple)

    if (multiple > 100000):
        print('Period too large')
        return []

    gun = lt4.pattern("", "b3s23")
    gun += livecells

    if ((gun - gun[multiple]).population > 0):
        return None

    salvo = gun[multiple] - gun

    if salvo.population != 5:
        y = z.destream(salvo)[1:-1]
        y.append(y[-1])
        print(y)

        if (len(set(y)) != 1) or (sum(y) != multiple):
            print('Warning: intermittent glider gun')
            return []

        period = y[-1]
    else:
        period = multiple

    print('Stream period: %d' % period)

    if (period > 10000):
        print('Period too large')
        return []

    for i in range(period):

        h = gun[1]
        g = gun & envelope
        if (g[1] == (h & envelope)):
            gun = g
            break
        gun = h
    else:
        print('Failure 1!')
        return None

    for i in range(period):

        h = gun[1]
        if (h - envelope).population > 0:
            break
        gun = h
    else:
        print('Failure 2!')
        return None

    thing = lt4.pattern("", "LifeHistory")
    thing += gun
    thing = thing[multiple]
    thing = thing[r[0] : r[0] + r[2], r[1] : r[1] + r[3]]
    thing = thing(-r[0], -r[1])

    res = '\n\n#CSYNTH gun_%d costs %d cells.\n#C period %d fullperiod %d bbox %d by %d\n' % (period, r[2] * r[3], period, multiple, r[2], r[3])
    print(res)
    res += thing.rle_string()

    to_update = [(('gun_%d' % period), r[2] * r[3], res)]

    if (period == multiple):
        to_update.append((('guntrue_%d' % period), r[2] * r[3], res.replace('gun_', 'guntrue_')))

    return to_update
So ... what's the right way to fix this code so that it produces the correct bounding box for interesting cases like the p165 and p1320 that Sokwe posted (if the extra "decorations" are removed)?

I bet calcyman would happily take an interest in a pull request containing a version of this function that always gives the right bounding box.
Vort wrote: December 2nd, 2024, 2:03 pm Introducing humans to verification process is bad idea.
Sure, perfect code and spotlessly clean data are highly preferable.

That's not what Catagolue has at the moment, though.

Given current reality, I'd personally kinda like to be able to push a button on any given Catagolue page, to report that there's a problem with the synthesis (or glider gun) that needs fixing. But then, some bad actor might come along and push that button on pages when there isn't actually any problem. So we can't just have Catagolue purge data just because somebody says it's bad data; it seems like some level of human review might be needed to keep trolls from doing damage.

On the other hand, in the near term before all of the current bugs are squashed, it might be nice to have a setup where someone-who-isn't-calcyman can be trusted to tell Catagolue that it's okay to delete specific erroneous submissions, so that new guns can be submitted to replace them.

... I'm guessing that a flag-and-review system won't ever actually get implemented, though, whether it's a good idea or not -- so maybe there's no need to discuss it further at this point.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Execution of Old Guns by Variable-Speed Firing Squad

Post by Vort »

dvgrn wrote: December 2nd, 2024, 2:43 pm... given a lack of help from anyone else in fixing things. ...
Users are best at spotting problems, while authors are best at figuring out how exactly these problems should be solved.
dvgrn wrote: December 2nd, 2024, 2:43 pm... But we could try running some tests to see which one it is! ...
This code is not that easy to read and I have not much experience in Game of Life to propose new version of bounding box calculations.
However, I don't like one particular line there: "if (period > 10000):". Shouldn't there be 9999 instead?
dvgrn wrote: December 2nd, 2024, 2:43 pm... Given current reality, I'd personally kinda like to be able to push a button on any given Catagolue page, to report that there's a problem with the synthesis (or glider gun) that needs fixing. ...
Why think in terms of problems rather than "gun A is better than gun B"?
I accept that my suggestion of changing comparison function may have flaws, but which ones exactly?
Sokwe
Moderator
Posts: 3382
Joined: July 9th, 2009, 2:44 pm

Re: Catagolue Discussion Thread

Post by Sokwe »

Vort wrote: December 2nd, 2024, 10:59 am
confocaloid wrote: December 2nd, 2024, 11:11 am
dvgrn wrote: December 2nd, 2024, 1:37 pm
I moved this discussion to the Catagolue discussion thread, as it was more about how catagolue operates than about gun reductions.
Sokwe wrote: December 1st, 2024, 7:32 pm p1320 (the blocker is in the correct place; don't move it):
Unfortunately, despite my directive, the "incorrect" gun (i.e., the Catagolue bug-inducing gun due to the moved blocker) has already been submitted to Catagolue. It makes me wonder whether it would have been better to say nothing, rather than draw attention to the fact that the blocker could be moved.
-Matthias Merzenich
User avatar
dvgrn
Moderator
Posts: 12030
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Catagolue Discussion Thread

Post by dvgrn »

Sokwe wrote: December 2nd, 2024, 6:29 pm Unfortunately, despite my directive, the "incorrect" gun (i.e., the Catagolue bug-inducing gun due to the moved blocker) has already been submitted to Catagolue. It makes me wonder whether it would have been better to say nothing, rather than draw attention to the fact that the blocker could be moved.
Oof, and I even tried to warn people more specifically, as quick as I could. Well, let's just figure out how to fix the bug instead of keeping on failing to work around it successfully.

I've been doing most of my experimental coding in straight Golly Python recently -- but I did successfully move on from my old laptop that had a lifelib installation on it that was so thoroughly broken that I couldn't get it working. I don't have a lot of time available this week, but I might be able to sort out a workable pull request for this issue by the end of this coming weekend. If someone else with more recent or more extensive lifelib experience gets to it first, I'll be very grateful.

Seems like it will be easy enough to add another processing step onto the end of the current script.

Once the current code has accepted a pattern as a valid gun and has figured out that its period is P,

1) copy the gun to a new universe,
2) run it for P ticks and locate the output glider,
3) remove that glider,
4) switch to LifeHistory,
5) run for another P ticks,
6) remove the next glider in that same location,
7) start clearing rows of 4 blue state-2 cells along the glider's output lane until removing the blue cells in another row of 4 fails to change the bounding box of the full gun pattern,
8) calculate how many ticks to run the gun to put the leading line-of-3 edge of the next glider on that row of cells.

... I think that might work, for every case I can think of. There are simpler methods that work almost all of the time, but they'll fail for a few unlikely combinations of sparkers along the edge, some of which are messily suppressing some of the output gliders in a stream.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Catagolue Discussion Thread

Post by confocaloid »

dvgrn wrote: December 2nd, 2024, 7:07 pm [...]
7) start clearing rows of 4 blue state-2 cells along the glider's output lane until removing the blue cells in another row of 4 fails to change the bounding box of the full gun pattern,
8) calculate how many ticks to run the gun to put the leading line-of-3 edge of the next glider on that row of cells.
[...]
Unfortunately that fails to capture the right semantics, and will give an incorrect bounding box for some known cases.

For example, if the input is a phase of the p1320 glider gun discussed recently, except with the blocker moved away from its correct safe location, then your steps 7 and 8 will lead to an incorrect bounding box (46 by 42):

Code: Select all

x = 106, y = 49, rule = LifeHistory
31.2A7.A50.2A7.A$27.2A.A.A5.3A46.2A.A.A5.3A$16.2A9.2A.A6.A38.2A9.2A.A
6.A$7.A.A2.A2.A.3A10.2AB4.2A28.A.A2.A2.A.3A10.2AB4.2A$6.A.2A2.4A4.A6.
2ABAB2AB.3B27.A.2A2.4A4.A6.2ABAB2AB.3B$6.A9.B2A.A6.A.B2A.A3B29.A9.B2A
.A6.A.B2A.A3B$4.2A.9A2BA.3A5.ABA2B2AB2A26.2A.9A2BA.3A5.ABA2B2AB2A$5.A
.A2.B2.A.B2.2B2.AB5.7B2A27.A.A2.B2.A.B2.2B2.AB5.7B2A$3.BAB.AB.2A4B2.
2B2ABA7.2B3.B26.BAB.AB.2A4B2.2B2ABA7.2B3.B$2.B4AB2.4A3BA.2BA3B4.3B8.A
.A19.B4AB2.4A3BA.2BA3B4.3B8.A.A$3.2B.AB4.A2.2BA3BA4B.4B9.2A.A19.2B.AB
4.A2.2BA3BA4B.4B9.2A.A$14.AB.2ABA11B11.A30.AB.2ABA11B11.A$15.2A.A2.A
2B.8B5.5A.2A29.2A.A2.A2B.8B5.5A.2A$16.A.A.2A3.8B4.BA3.A.A31.A.A.2A3.
8B4.BA3.A.A$16.A.A.A5.8B3.2BA3B.A31.A.A.A5.8B3.2BA3B.A$11.B2A3.A2.A6.
2B3A3B3.B2AB2.2A25.B2A3.A2.A6.2B3A3B3.B2AB2.2A$11.3AB3.2A5.3BA3BA2B3.
BAB.2A27.3AB3.2A5.3BA3BA2B3.BAB.2A$10.A.2AB9.3BA5BA4B2.2A.A26.A.2AB9.
3BA5BA4B2.2A.A$9.A.A.2B8.4BA5BA4B3.A.A.A23.A.A.2B8.4BA5BA4B3.A.A.A$9.
A2.A2.2B5.5BA5BA3B4.A2.2A23.A2.A2.2B5.5BA5BA3B4.A2.2A$10.2A3.3B3.4B2.
BA3BA3B4.2A28.2A3.3B3.4B2.BA3BA3B4.2A$4.2A9.3B.5B5.3A3B29.2A9.3B.5B5.
3A3B$3.A.A8.9B4.5B31.A.A8.9B4.5B$3.A8.B.8B5.2A34.A8.B.8B5.2A$2A.AB.B
3.11B7.A31.2A.AB.B3.11B7.A$.A.A.2AB.12B4.3A33.A.A.2AB.12B4.3A$.A.A.2A
14B4.A27.2D6.A.A.2A14B4.A$2A.A2.5B2A8B12.2B19.2D4.2A.A2.5B2A8B12.2B$A
2.4A3BA2BA5B.B2A8.6B13.7D3.A2.4A3BA2BA5B.B2A8.6B$.2A2.BAB.2B2A6B.BA.A
5.10B15.2D5.2A2.BAB.2B2A6B.BA.A5.10B$3.2A6.7B5.A3.2A3BA2BA3B2A12.2D8.
2A6.7B5.A3.2A3BA2BA3B2A$3.A7.2B.4B5.2A.B5A4B5AB21.A7.2B.4B5.2A.B5A4B
5AB$5.A9.4B8.2A3BA2BA3B2A24.A9.4B8.2A3BA2BA3B2A$4.2A10.4B9.10B25.2A
10.4B9.10B$16.5B10.6B39.5B10.6B$17.5B11.2B42.5B11.2B$14.3B2.4B7.2AB2.
B2A36.3B2.4B7.2AB2.B2A$9.B2.BA3B3.4B4.BA8BAB29.B2.BA3B3.4B4.BA8BAB$8.
3AB2A2B2A3.5B.BA2BA4BA2BAB27.3AB2A2B2A3.5B.BA2BA4BA2BAB$8.4A4B2A4.7BA
8BAB28.4A4B2A4.7BA8BAB$9.3B2A2.B6.6B.2A4.2A31.3B2A2.B6.6B.2A4.2A$9.3B
12.4B41.3B12.4B$25.4B$26.4B$27.4B$28.4B$29.4B$30.4B$31.4B!
For this gun, the correct bounding box is higher (46 by 43), due to a spark created while eating one of gliders:

Code: Select all

x = 46, y = 43, rule = LifeHistory
31.2A7.A4.A$27.2A.A.A5.3A$16.2A9.2A.A6.A$7.A.A2.A2.A.3A10.2AB4.2A$6.A
.2A2.4A4.A6.2ABAB2AB.3B$6.A9.B2A.A6.A.B2A.A3B$4.2A.9A2BA.3A5.ABA2B2AB
2A$5.A.A2.B2.A.B2.2B2.AB5.7B2A$3.BAB.AB.2A4B2.2B2ABA7.2B3.B$2.B4AB2.
4A3BA.2BA3B4.3B8.A.A$3.2B.AB4.A2.2BA3BA4B.4B9.2A.A$14.AB.2ABA11B11.A$
15.2A.A2.A2B.5BA2B5.5A.2A$16.A.A.2A3.6B2A4.BA3.A.A$16.A.A.A5.8B3.2BA
3B.A$11.B2A3.A2.A6.8B3.B2AB2.2A$11.3AB3.2A5.4BAB2A2B3.BAB.2A$10.A.2AB
9.5B2A3BA3B2.2A.A$9.A.A.2B8.10BABA2B3.A.A.A$9.A2.A2.2B5.11BABAB4.A2.
2A$10.2A3.3B3.4B2.7BAB4.2A$4.2A9.3B.5B5.6B$3.A.A8.9B4.5B$3.A8.B.8B5.
2A$2A.AB.B3.11B7.A$.A.A.2AB.12B4.3A$.A.A.2A14B4.A$2A.A2.5B2A8B12.2B$A
2.4A3BA2BA5B.B2A8.6B$.2A2.BAB.2B2A6B.BA.A5.2A6B2A$3.2A6.7B5.A3.BA2BA
4BA2BAB$3.A7.2B.4B5.2A.B6A2B6AB$5.A9.4B8.BA2BA4BA2BAB$4.2A10.4B9.2A6B
2A$16.5B10.6B$17.4BA11.2B$14.3B2.3BA7.2BA2.A2B$9.B2.BA3B3.3AB4.2B3A2B
3A2B$8.3AB2A2B2A3.5B.2BA2BA2BA2BA2B$8.4A4B2A4.8B2A4B2A2B$9.3B2A2.B6.
6B.2A4.2A$9.3B12.3B$A24.2B!
Instead of manipulating envelopes row-by-row (which does not match the idea behind determining the bounding box and the canonical phase of a gun), one needs to capture the meanings of "the bounding box of a gun" and "the canonical phase of a gun", so that correctness would follow "by definition".

In the same example of the "misinterpreted" p1320 glider gun, the algorithm must be able to distinguish between the following three phases (shown in the pattern below) separated by 440 ticks.
  • In the phase shown on the left, the output glider is already visible and does escape without interacting with the rest of the gun in any way.
    Therefore, the output glider must be deleted from that phase immediately (without waiting until it actually leaves the bounding box; indeed, at this point the bounding box is not yet calculated, so it would be impossible to decide when the glider leaves it).
  • In the phase shown in the middle, the "non-output glider" fails to escape, and is later deleted while producing a spark.
    Since there are later interactions, the glider must be kept in that phase.
  • In the phase shown on the right, the "non-output glider" fails to escape, and is later deleted while producing a different spark.
    Since there are later interactions, the glider must be kept in that phase.
Determining the bounding box boils down to computing every phase of the gun, deleting a glider as soon as it can be proved that the glider will escape without any later interactions, and then computing the bounding box of the set-theoretic union of all resulting phases.

This would capture the intended idea, and this would avoid the problematic circularity when some kind of "guess" on what the bounding box is is used in an algorithm that is supposed to calculate the bounding box in the first place.

Once the bounding box is calculated, determining the canonical phase boils down to finding the last phase before the output glider (if allowed to escape) leaves the now-known bounding box.

Code: Select all

x = 166, y = 43, rule = B3/S23
31b2o7bo4bo45b2o7bo4bo45b2o7bo4bo$27b2obobo5b3o46b2obobo5b3o46b2obobo
5b3o$16b2o9b2obo6bo38b2o9b2obo6bo38b2o9b2obo6bo$7bobo2bo2bob3o10b2o5b
2o28bobo2bo2bob3o10b2o5b2o28bobo2bo2bob3o10b2o5b2o$6bob2o2b4o4bo6b2obo
b2o32bob2o2b4o4bo6b2obob2o32bob2o2b4o4bo6b2obob2o$6bo10b2obo6bo2b2obo
32bo10b2obo6bo2b2obo32bo10b2obo6bo2b2obo$4b2ob9o2bob3o5bobo2b2ob2o26b
2ob9o2bob3o5bobo2b2ob2o26b2ob9o2bob3o5bobo2b2ob2o$5bobo5bo8bo13b2o27bo
bo5bo8bo13b2o27bobo5bo8bo13b2o$4bo2bo2b2o8b2obo40bo2bo2b2o8b2obo40bo2b
o2b2o8b2obo$3b4o3b4o3bo3bo18bobo20b4o3b4o3bo3bo18bobo20b4o3b4o3bo3bo
18bobo$6bo5bo4bo3bo18b2obo22bo5bo4bo3bo18b2obo22bo5bo4bo3bo18b2obo$14b
o2b2obo22bo30bo2b2obo22bo30bo2b2obo22bo$15b2obo2bo8bo7b5ob2o29b2obo2bo
8bo7b5ob2o29b2obo2bo8bo7b5ob2o$16bobob2o9b2o5bo3bobo31bobob2o9b2o5bo3b
obo31bobob2o9b2o5bo3bobo$16bobobo18bo4bo31bobobo18bo4bo31bobobo18bo4bo
$12b2o3bo2bo18b2o3b2o26b2o3bo2bo18b2o3b2o26b2o3bo2bo18b2o3b2o$11b3o4b
2o9bob2o6bo2b2o27b3o4b2o9bob2o6bo2b2o27b3o4b2o9bob2o6bo2b2o$10bob2o15b
2o3bo5b2obo26bob2o15b2o3bo5b2obo26bob2o15b2o3bo5b2obo$9bobo21bobo5bobo
bo23bobo21bobo5bobobo23bobo21bobo5bobobo$9bo2bo20bobo5bo2b2o23bo2bo20b
obo5bo2b2o23bo2bo20bobo5bo2b2o$10b2o22bo5b2o28b2o22bo5b2o28b2o22bo5b2o
$4b2o58b2o58b2o$3bobo57bobo57bobo$3bo23b2o34bo23b2o34bo23b2o$2obo24bo
31b2obo24bo31b2obo24bo$bobob2o18b3o33bobob2o18b3o33bobob2o18b3o$bobob
2o18bo35bobob2o18bo35bobob2o18bo$2obo7b2o47b2obo7b2o47b2obo7b2o$o2b4o
3bo2bo7b2o37bo2b4o3bo2bo7b2o37bo2b4o3bo2bo7b2o$b2o3bo4b2o8bobo5b2o6b2o
22b2o3bo4b2o8bobo37b2o3bo4b2o8bobo7b6o$3b2o18bo4bo2bo4bo2bo23b2o18bo3b
2o3bo2bo3b2o22b2o18bo6bo6bo$3bo19b2o2b6o2b6o22bo19b2o2b5o4b5o22bo19b2o
4bo8bo$5bo22bo2bo4bo2bo25bo21b2o3bo2bo3b2o24bo24bo6bo$4b2o23b2o6b2o25b
2o58b2o25b6o2$21bo59bo59bo$22bo9bo2bo46bo7b2o4b2o44bo$13bo6b3o7b3o2b3o
35bo6b3o6bo8bo34bo6b3o8bo4bo$8b3ob2o2b2o11bo2bo2bo2bo29b3ob2o2b2o10bo
2bo4bo2bo28b3ob2o2b2o13b6o$8b4o4b2o12b2o4b2o30b4o4b2o11bo8bo29b4o4b2o
13bo4bo$12b2o16b2o4b2o34b2o16b2o4b2o34b2o2$o59bo59bo!
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
Sokwe
Moderator
Posts: 3382
Joined: July 9th, 2009, 2:44 pm

Re: Catagolue Discussion Thread

Post by Sokwe »

dvgrn wrote: December 2nd, 2024, 7:07 pm Once the current code has accepted a pattern as a valid gun and has figured out that its period is P,
Unfortunately, the bug sometimes creates an invalid RLE for what it thinks is the gun (although the period calculation is always correct), such as in this case:
Vort wrote: July 1st, 2024, 12:30 pm [gun_1650 as it appeared in Catagolue at the time:]

Code: Select all

#C [[ GRID MAXGRIDSIZE 14 THEME Catagolue ]] 
#CSYNTH gun_1650 costs 2915 cells.
#C period 1650 fullperiod 1650 bbox 53 by 55
#CLL state-numbering golly
x = 53, y = 55, rule = LifeHistory
2B2A4B2A17BA2BA3BA2BA15B$27BA2BA4BA2BA14B$28B5A5BA14B$31BA3BAB2A
14B$44BA2BABA3B$30BA5BA5B2AB3A2BA2B$28B3A12BABA3BA3B$44BAB2ABA3B$
28B2A7B3A7B2A4B$52BA$33BABA16BA$26BA2BABA3BA17B$27BA4BAB2A17B$27BA
4BA20B$29B2A22B$53B$53B$44B2A7B$44B2A7B$53B$20B2A31B$20B2A12BA18B$
33BABA17B$33BABA17B$34BA18B$11BA41B$10BABA40B$9BABA41B$9B2A42B$6B.
14BA31B$4B3.8BA4BABA30B$.B6.7BA4BABA30B$B6.8BA5BA31B$B5.47B$3B3.
47B$3B4.46B$3B3.47B$2B3.48B$2B4.47B$2B6.3B5.12BA24B$B14.12BABA23B$
4B11.12BABA23B$3B2A11.12BA24B$3B2A10.BA36B$4B11.ABA35B$5B11.2A32BA
2B$7B11.2B3A27BA2B$10B2.2B3.33BA2B$40B.12B$53B$16B2A35B$16B2A35B$.
52B$8.4B.25B4.7B2A2B$9.4B4.B2.12B10.7B2A2B!
Vort wrote: July 2nd, 2024, 3:30 am In gun_1650 case, Catagolue detects bounding box of 53x55 and then crops gun in this state:

Code: Select all

x = 52, y = 57, rule = B3/S23
31bo$30bobo$30bobo$6b2o5b2o2b2ob2o7b2ob2o2b2o$6bo2b2obo2bo2bob2o7bo5bo
2bo$7b2obob2ob2obo11b3o4bo2bo$3b2o3bobo2bobo2bob2o10bo2bobob2o7b2o$o2b
o2bo4bo3bob2o2bo11b2o2bo10bo$3o2b2obo3bobobo2bo16b2o7b2obo$3b2o2b5o6b
2o22b2o3bo$2bo2bo6b2o4bo23bo$3b2o8bo16b2o$29bo2bo9bo2bo$30b2o10bobo$9b
2o34bo2b2o$2o6bo2bo6b2o18bobo5bo2bo$bo7b2o7bo18b3o2bob2ob2o$bobo12bobo
17bob2o4bo$2b2o12b2o7b2o9b2o5bobob2o$20b2o2bobo17b2ob2o$21bo2bo$19bo2b
3o$19b3o8bo8b2o2bo$22bo5b2o7bo5bo3bobo$21b2o6b2o12bo2b2o$36bo6b3o4bo$
16b2o16b3ob4obobob2o2bo$16bobo14bo4bobo4bo2bob2o$8bo7bo17b5obob2ob2obo
$7bobo30bobo2bo2bob2o$7bobo26b3obobobo2b2ob2o$8bo22b2o3bo2bo3bo$12b2o
17bobo3b2o$12bobo18bo$14bo7b2o9b2o$14b2o6bo2bo$22bo2bo$22bo2$21b2o3bo$
17b2o3bob2o2b2o$17bo2bobo6bo$19b2ob7o$21bo$21bob4o$22b2o2bo2$33bobo$
33bo3bo$23b2o12bo5b2o$23b2o8bo4bo4b2o$37bo$33bo3bo$23bo9bobo$23b2o2$
22b2o!
This results in the loss of the bottom two cells and a subsequent explosion.
Perhaps it would be helpful to know exactly what idgun.py is doing and exactly why it fails to get the correct bounding box. To that end, I somewhat quickly read over the script and gave excessive annotations of what I think identify_gun() is doing at each step:

Code: Select all

# rle: the input rle of the gun to be tested.
#      The input rle is always in 2-state b3s23.
# lt4: a 4-layer lifetree.  This is necessary for
#      representing the pattern in LifeHistory.
def identify_gun(rle, lt4):

    # Create a new pattern, a, based on the input rle, and
    # exit if the input pattern is empty.
    a = lt4.pattern(rle)

    if a.empty():
        return []

    # Advance pattern a by 524288 generations.  This is to remove dying
    # sparks that aren't actually part of the gun before analysis.
    a = a[524288]
    
    # Create a new empty LifeHistory pattern, x, and paste pattern a into x.
    x = lt4.pattern('', 'LifeHistory')
    x += a
    
    # Advance x by 524288 generations.  This gives a LifeHistory
    # view of the gun with a *very* long stream of output gliders.
    x = x[524288]
    
    # Perform a population check to make sure the results make sense.
    # This is not the source of the bug, so it's not important to us.
    p = x.population

    if (p < 1000000):
        return None

    if (p > 1500000):
        return None

    # Get the envelope (all cells that were ever alive) of x.
    # This assignment is temporary.  envelope will soon be
    # reassigned to be the envelope of x[256] instead.
    envelope = x.layers()[1]
    
    # Get only the live cells of x[8] (note: x[8] is the pattern
    # obtained from advancing x by 8 generations).
    livecells = x[8].layers()[0]
    
    # If the gun is valid, y should be just the front-most glider in the output stream
    y = livecells - envelope
    
    # Get the envelope of the pattern obtained by advancing x by 256 generations.
    # Note that x has not changed, so envelope is now *not* the envelope of x.
    envelope = x[256].layers()[1]

    # Check if y is just a glider (if not, the "gun" is invalid).
    if (y.population != 5):
        return None

    z = lt4.pattern("", "b3s23")
    z += y

    if (z.apgcode != 'xq4_153'):
        return None

    # Note that z is just a glider in ordinary b3s23, but its
    # position in the plane matches the front-most glider of x[8]
    # (note: x[8] is the pattern obtained from advancing x by 8
    # generations).  That is, z is the front-most glider of the
    # input pattern after that pattern has been run for
    #   524288*2 + 8 = 1048584 generations.

    # Create a new LifeHistory pattern, w.
    w = lt4.pattern("", "LifeHistory")

    # First set w to be the glider z "reversed" by 2097152 generations
    # (i.e., moved backwards by 2097152 / 4 = 524288 full diagonals).
    w += z[-2097152]
    
    # Now advance w (which is just a single glider in LifeHistory) by
    #   2 * 2097152 = 4194304 generations.
    w = w[4194304]

    # Note that we have now advanced w by far more generations than we
    # initially reversed z by when creating w.  That is, the glider in
    # w has gone much further beyond the position of the glider in z.

    # Band is the envelope of w.  It's basically just an extremely
    # long strip of history cells covering the output glider stream
    # but also extending backwards out of the back of the gun.
    band = w.layers()[1]

    # Create pbb, which is just the envelope of x[256] with all the cells 
    # of band removed.  Essentially, this is the envelope of the gun,
    # except all cells along the output glider stream (both forwards *and*
    # backwards) are removed.
    pbb = envelope - band

    # Unfortunately, removing band from envelope means that pbb does not
    # contain any history cells along the output glider stream, even if
    # those history cells represent parts of the gun that aren't part of
    # the output glider stream.  Cells removed from the back of the gun
    # (i.e., on the edges opposite the direction of the output glider
    # stream) are accounted for later, but cells removed from the front
    # are never accounted for, causing the bug.

    # r1 and r2 are really just used to determine the direction of the
    # output glider stream.
    r1 = z.getrect()
    r2 = z[1024].getrect()

    # Update pbb by pasting a copy of pbb 256 full diagonals in the
    # opposite direction of the output glider stream.  This is used
    # to correct for the fact that (envelope - band) may have deleted
    # some cells at the edges of the gun opposite of the direction
    # of the output glider stream that are essential to calculating
    # the bounding box of the gun.  Unfortunately, it does *not*
    # account for cells at the edges of the gun in the same direction
    # as the output glider stream.
    pbb += pbb(r1[0] - r2[0], r1[1] - r2[1])

    # Set r to be a 4-element array where the elements represent
    # r[0]: the x-coordinate of the upper left corner of pbb
    # r[1]: the y-coordinate of the upper left corner of pbb
    # r[2]: the width of pbb
    # r[3]: the height of pbb
    r = pbb.getrect()
    if (len(r) != 4):
        return None

    # Trim the envelope of x to only the part covered by the bounding box of pbb.
    # This is where the bug occurs, because pbb does not include the history cells
    # of the dying sparks along the edges of the gun in the same direction as the
    # output glider stream.  This is the final assignment of envelope, which now
    # represents what the program thinks is the exact envelope of the gun.
    envelope = envelope[r[0] : r[0] + r[2], r[1] : r[1] + r[3]]
    
    # Update r to give the bounding box of the trimmed envelope.  This is the final
    # assignment of r, and the (possibly incorrect) width and height of the gun
    # reported by the script will be r[2] and r[3] respectively.
    r = envelope.getrect()

    # This next part just determines the period and stream period (i.e., pseudo period) of
    # the gun.  It might or might not be relevant for whatever fix we attempt for the bug.
    # The variable "period" represents the stream period, while "multiple" represents the
    # true period of the gun.
    geater = lt4.pattern("bo$2bo$3o4$5b2o$5bo$6b3o$8bo!", "b3s23")

    eater = z.replace(geater[:3, :3], geater[100], orientations='rotate4reflect', n_phases=2)

    if (eater.population != 7):
        return None

    x += eater

    x = x[128]

    multiple = x.oscar(eventual_oscillator=False, maxexp=20)['period']

    print('True period: %d' % multiple)

    if (multiple > 100000):
        print('Period too large')
        return []

    gun = lt4.pattern("", "b3s23")
    gun += livecells

    if ((gun - gun[multiple]).population > 0):
        return None

    salvo = gun[multiple] - gun

    if salvo.population != 5:
        y = z.destream(salvo)[1:-1]
        y.append(y[-1])
        print(y)

        if (len(set(y)) != 1) or (sum(y) != multiple):
            print('Warning: intermittent glider gun')
            return []

        period = y[-1]
    else:
        period = multiple

    print('Stream period: %d' % period)

    if (period > 10000):
        print('Period too large')
        return []

    # From this point on, I will assume that the bug doesn't exist, and
    # envelope truly represents the exact envelope of the gun.  If we're
    # in the bugged scenario, weird things can happen.  For example, see
    # https://conwaylife.com/forums/viewtopic.php?p=188842#p188842
    # https://conwaylife.com/forums/viewtopic.php?p=188881#p188881

    # The pattern "gun" was initialized above as the live cells of x[8],
    # which is essentially the original input pattern advanced by
    #   524288*2 + 8 = 1048584 generations.
    # This for loop simply advances gun so that it doesn't contain an
    # output glider intersecting the edge of envelope's bounding box.
    # Once this is true, it trims gun to only be the cells within the
    # bounding box of envelope.  So after this loop finishes, the
    # pattern "gun" will be a 2-state representation of the gun with
    # no cells of any output gliders beyond the gun's bounding box. 
    for i in range(period):

        h = gun[1]
        g = gun & envelope
        if (g[1] == (h & envelope)):
            gun = g
            break
        gun = h
    else:
        print('Failure 1!')
        return None

    # This for loop advances gun until the generation just before the
    # first output glider exits the bounding box of envelope.  That is,
    # it advances gun until it is in the generation matching the gun's
    # canonical form.
    for i in range(period):

        h = gun[1]
        if (h - envelope).population > 0:
            break
        gun = h
    else:
        print('Failure 2!')
        return None

    # Create a new LifeHistory pattern, thing, containing the canonical
    # generation of the 2-state gun we found above.
    thing = lt4.pattern("", "LifeHistory")
    thing += gun
    
    # Advance thing by the true period of the gun.  Since thing is a
    # LifeHistory pattern, this populates the history cells of the gun.
    thing = thing[multiple]
    
    # Trim thing to the bounding box of the gun found earlier.  This
    # removes the output glider stream generated by advancing thing
    # by the true period of the gun.
    thing = thing[r[0] : r[0] + r[2], r[1] : r[1] + r[3]]
    
    # Move thing so that the upper left corner is at coordinate (0,0).
    # This is now the final LifeHistory pattern representing the gun.
    thing = thing(-r[0], -r[1])

    # Generate RLE and report the gun for possible inclusion in the database.
    res = '\n\n#CSYNTH gun_%d costs %d cells.\n#C period %d fullperiod %d bbox %d by %d\n' % (period, r[2] * r[3], period, multiple, r[2], r[3])
    print(res)
    res += thing.rle_string()

    to_update = [(('gun_%d' % period), r[2] * r[3], res)]

    if (period == multiple):
        to_update.append((('guntrue_%d' % period), r[2] * r[3], res.replace('gun_', 'guntrue_')))

    return to_update
I'll try to illustrate this with the above p1320 gun as an example (slightly simplified for brevity).

Suppose we give the following as input:

Code: Select all

x = 49, y = 43, rule = B3/S23
34b2o7bo$30b2obobo5b3o$19b2o9b2obo6bo$10bobo2bo2bob3o10b2o5b2o$9bob2o
2b4o4bo6b2obob2o$9bo10b2obo6bo2b2obo$7b2ob9o2bob3o5bobo2b2ob2o$8bobo5b
o8bo13b2o$7bo2bo2b2o8b2obo$6b4o3b4o3bo3bo18bobo$9bo5bo4bo3bo18b2obo$
17bo2b2obo22bo$18b2obo2bo16b5ob2o$bo17bobob2o16bo3bobo$obo16bobobo18bo
4bo$bo13b2o3bo2bo8b3o7b2o3b2o$14b3o4b2o8bo3bo6bo2b2o$13bob2o13bo5bo6b
2obo$12bobo15bo5bo7bobobo$12bo2bo14bo5bo7bo2b2o$13b2o16bo3bo7b2o$7b2o
23b3o$6bobo$6bo23b2o$3b2obo24bo$4bobob2o18b3o$4bobob2o18bo$3b2obo7b2o$
3bo2b4o3bo2bo7b2o$4b2o3bo4b2o8bobo$6b2o18bo3b2o3bo2bo3b2o$6bo19b2o2b5o
4b5o$8bo21b2o3bo2bo3b2o$7b2o2$13b2o$9b2o4b4o14b2o4b2o$9b2o2b2ob3o13bo
8bo$13bo17bo2bo4bo2bo$32bo8bo$29bo3b2o4b2o$30bo$28b3o!
Note that an extra tub is included that actually extends the bounding box. The purpose of this is to illustrate one of the features of the function, and I hope it will be clear why I included the tub by the end of this example. The correct bounding box of the above pattern is 49x43, but identify_gun() will erroneously calculate it as 49x41 by shaving two rows off the bottom.

identify_gun() essentially starts by converting the input pattern to LifeHistory and running it for 2^20 generations. It then detects the location of the front-most glider in the output glider stream by saving the envelope of the whole pattern (all cells that were ever alive), running the pattern another 8 generations, deleting the saved envelope, and finally removing the small number of remaining dead history cells (i.e., state 2 cells). This results in a single glider from the output glider stream that is extremely far from where the gun was.

Next, it uses this detected glider to generate a band of history cells along the output glider stream path that extends backwards out the back of the gun (note: this will intersect that extra tub I added). It does this by "reversing" the glider by 2^21 generations, converting it to LifeHistory, then advancing it for 2^22 generations. This is illustrated by the following pattern showing the original gun with the band highlighted:

Code: Select all

x = 73, y = 74, rule = LifeHistory
D2$2.D2$4.D2$4.4D$5.4D$6.4D$7.4D44.2A7.A$8.4D39.2A.A.A5.3A$9.4D27.2A
9.2A.A6.A$10.4D17.A.A2.A2.A.3A10.2A5.2A$11.4D15.A.2A2.4A4.A6.2A.A.2A$
12.4D14.A10.2A.A6.A2.2A.A$13.4D11.2A.9A2.A.3A5.A.A2.2A.2A$14.4D11.A.A
5.A8.A13.2A$15.4D9.A2.A2.2A8.2A.A$16.4D7.4A3.4A3.A3.A18.A.A$17.4D9.A
5.A4.A3.A18.2A.A$18.4D16.A2.2A.A22.A$19.4D16.2A.A2.A16.5A.2A$20.2DCD
16.A.A.2A16.A3.A.A$21.CDCD15.A.A.A18.A4.A$22.C3D10.2A3.A2.A8.3A7.2A3.
2A$23.4D8.3A4.2A8.A3.A6.A2.2A$24.4D6.A.2A13.A5.A6.2A.A$25.4D4.A.A15.A
5.A7.A.A.A$26.4D3.A2.A14.A5.A7.A2.2A$27.4D3.2A16.A3.A7.2A$28.2C2D21.
3A$27.A.C3D$27.A2.4D17.2A$24.2A.A3.4D17.A$25.A.A.2A.4D13.3A$25.A.A.2A
2.4D12.A$24.2A.A6.D2CD$24.A2.4A3.A2DCD6.2A$25.2A3.A4.AC3D5.A.A$27.2A
8.4D6.A3.2A3.A2.A3.2A$27.A10.4D5.2A2.5A4.5A$29.A9.4D8.2A3.A2.A3.2A$
28.2A10.4D$41.4D$34.2A6.4D$30.2A4.4A3.4D7.2A4.2A$30.2A2.2A.3A4.4D5.A
8.A$34.A10.4D3.A2.A4.A2.A$46.4D3.A8.A$47.3DC3.2A4.2A$48.3DC$49.3CD$
50.4D$51.4D$52.4D$53.4D$54.4D$55.4D$56.4D$57.4D$58.4D$59.4D$60.4D$61.
4D$62.4D$63.4D$64.4D$65.4D2$68.D2$70.D2$72.D!
It now takes the envelope calculated earlier and removes the cells along the band (called pbb within the function). This gives the following pattern (blue cells changed to red for better visibility):

Code: Select all

#C pattern pbb at line 41 of idgun.py
x = 46, y = 41, rule = LifeHistory
31.2D7.D$27.2D.D.D5.3D$16.2D9.2D.D6.D$7.D.D2.D2.D.3D10.3D4.2D$6.D.2D
2.4D4.D6.8D.3D$6.D9.3D.D6.D.3D.4D$4.2D.12D.3D5.10D$5.D.D2.D2.D.D2.2D
2.2D5.9D$3.3D.2D.6D2.6D7.2D3.D$2.6D2.8D.6D4.3D8.D.D$3.2D.2D4.D2.11D.
4D9.2D.D$14.2D.15D11.D$15.2D.D2.3D.8D5.5D.2D$16.D.D.2D3.8D4.2D3.D.D$
16.D.D.D5.8D3.6D.D$11.3D3.D2.D6.8D3.4D2.2D$11.4D3.2D5.10D3.3D.2D$10.D
.3D9.14D2.2D.D$9.D.D.2D8.15D3.D.D.D$9.D2.D2.2D5.15D4.D2.2D$10.2D3.3D
3.4D2.9D4.2D$15.3D.5D5.6D$3.D10.9D4.5D$3.D8.D.8D5.2D$2D.2D.D4.10D7.D$
.D.D.3D4.9D4.3D$.D.D.4D4.8D4.D$2D.D2.4D4.7D12.2D$D2.8D4.4D.3D8.6D$.2D
2.3D.3D4.3D.2D.D5.10D$3.2D6.2D4.D5.D3.14D$3.D7.2D10.2D.16D$5.D8.D12.
14D$4.2D9.D13.10D$12.3D16.6D$7.D2.5D18.2D$6.10D14.3D2.3D$6.10D12.12D$
7.5D2.D10.D.14D$7.3D16.14D$27.2D.2D4.2D!
Notice that both the tub and the sparky area caused by the glider filters are not included in this pattern, so the bounding box is only 46x41 instead of the desired 49x43. The next step fixes the missing tub issue, but there is no step that fixes the issue caused by the glider filters.

To fix the missing tub issue, or rather, any issues on the edges opposite of the direction of the output glider stream, it simply places an additional copy of the above pattern 256 full diagonals in the opposite direction of the output glider stream:

Code: Select all

#C pattern pbb at line 45 of idgun.py
x = 302, y = 297, rule = LifeHistory
31.2D7.D$27.2D.D.D5.3D$16.2D9.2D.D6.D$7.D.D2.D2.D.3D10.3D4.2D$6.D.2D
2.4D4.D6.8D.3D$6.D9.3D.D6.D.3D.4D$4.2D.12D.3D5.10D$5.D.D2.D2.D.D2.2D
2.2D5.9D$3.3D.2D.6D2.6D7.2D3.D$2.6D2.8D.6D4.3D8.D.D$3.2D.2D4.D2.11D.
4D9.2D.D$14.2D.15D11.D$15.2D.D2.3D.8D5.5D.2D$16.D.D.2D3.8D4.2D3.D.D$
16.D.D.D5.8D3.6D.D$11.3D3.D2.D6.8D3.4D2.2D$11.4D3.2D5.10D3.3D.2D$10.D
.3D9.14D2.2D.D$9.D.D.2D8.15D3.D.D.D$9.D2.D2.2D5.15D4.D2.2D$10.2D3.3D
3.4D2.9D4.2D$15.3D.5D5.6D$3.D10.9D4.5D$3.D8.D.8D5.2D$2D.2D.D4.10D7.D$
.D.D.3D4.9D4.3D$.D.D.4D4.8D4.D$2D.D2.4D4.7D12.2D$D2.8D4.4D.3D8.6D$.2D
2.3D.3D4.3D.2D.D5.10D$3.2D6.2D4.D5.D3.14D$3.D7.2D10.2D.16D$5.D8.D12.
14D$4.2D9.D13.10D$12.3D16.6D$7.D2.5D18.2D$6.10D14.3D2.3D$6.10D12.12D$
7.5D2.D10.D.14D$7.3D16.14D$27.2D.2D4.2D216$287.2D7.D$283.2D.D.D5.3D$
272.2D9.2D.D6.D$263.D.D2.D2.D.3D10.3D4.2D$262.D.2D2.4D4.D6.8D.3D$262.
D9.3D.D6.D.3D.4D$260.2D.12D.3D5.10D$261.D.D2.D2.D.D2.2D2.2D5.9D$259.
3D.2D.6D2.6D7.2D3.D$258.6D2.8D.6D4.3D8.D.D$259.2D.2D4.D2.11D.4D9.2D.D
$270.2D.15D11.D$271.2D.D2.3D.8D5.5D.2D$272.D.D.2D3.8D4.2D3.D.D$272.D.
D.D5.8D3.6D.D$267.3D3.D2.D6.8D3.4D2.2D$267.4D3.2D5.10D3.3D.2D$266.D.
3D9.14D2.2D.D$265.D.D.2D8.15D3.D.D.D$265.D2.D2.2D5.15D4.D2.2D$266.2D
3.3D3.4D2.9D4.2D$271.3D.5D5.6D$259.D10.9D4.5D$259.D8.D.8D5.2D$256.2D.
2D.D4.10D7.D$257.D.D.3D4.9D4.3D$257.D.D.4D4.8D4.D$256.2D.D2.4D4.7D12.
2D$256.D2.8D4.4D.3D8.6D$257.2D2.3D.3D4.3D.2D.D5.10D$259.2D6.2D4.D5.D
3.14D$259.D7.2D10.2D.16D$261.D8.D12.14D$260.2D9.D13.10D$268.3D16.6D$
263.D2.5D18.2D$262.10D14.3D2.3D$262.10D12.12D$263.5D2.D10.D.14D$263.
3D16.14D$283.2D.2D4.2D!
It will use this pattern to trim the original envelope of the gun. I think it might be helpful here to see the original gun envelope with the pattern pbb overlayed on top. Here the red cells are those only in pbb, the white cells are those only in the original envelope, and the gray cells are in both:

Code: Select all

x = 323, y = 339, rule = LifeHistory
31.2D7.D$27.2D.D.D5.3D$16.2D9.2D.D6.D$7.D.D2.D2.D.3D10.3D4.2D$6.D.2D
2.4D4.D6.8D.3D$6.D9.3D.D6.D.3D.4D$4.2D.12D.3D5.10D$5.D.D2.D2.D.D2.2D
2.2D5.9D$3.3D.2D.6D2.6D7.2D3.D$2.6D2.8D.6D4.3D8.D.D$3.2D.2D4.D2.11D.
4D9.2D.D$14.2D.15D11.D$15.2D.D2.3D.8D5.5D.2D$16.D.D.2D3.8D4.2D3.D.D$
16.D.D.D5.8D3.6D.D$11.3D3.D2.D6.8D3.4D2.2D$11.4D3.2D5.10D3.3D.2D$10.D
.3D9.14D2.2D.D$9.D.D.2D8.15D3.D.D.D$9.D2.D2.2D5.15D4.D2.2D$10.2D3.3D
3.4D2.9D4.2D$15.3D.5D5.6D$3.D10.9D4.5D$3.D8.D.8D5.2D$2D.2D.D4.10D7.D$
.D.D.3D4.9D4.3D$.D.D.4D4.8D4.D$2D.D2.4D4.7D12.2D$D2.8D4.4D.3D8.6D$.2D
2.3D.3D4.3D.2D.D5.10D$3.2D6.2D4.D5.D3.14D$3.D7.2D10.2D.16D$5.D8.D12.
14D$4.2D9.D13.10D$12.3D16.6D$7.D2.5D18.2D$6.10D14.3D2.3D$6.10D12.12D$
7.5D2.D10.D.14D$7.3D16.14D$27.2D.2D4.2D216$287.2F7.F$283.2F.F.F5.3F$
272.2F9.2F.F6.F$263.F.F2.F2.F.3F10.3F4.2F$262.F.2F2.4F4.F6.8F.3F$262.
F9.3F.F6.F.3F.4F$260.2F.12F.3F5.10F$261.F.F2.F2.F.F2.2F2.2F5.9F$259.
3F.2F.6F2.6F7.2F3.F$258.6F2.8F.6F4.3F8.F.F$259.2F.2F4.F2.11F.4F9.2F.F
$270.2F.15F11.F$271.2F.F2.3F.8F5.5F.2F$254.C17.F.F.2F3.8F4.2F3.F.F$
253.C.C16.F.F.F5.8F3.6F.F$254.C12.3F3.F2.F6.8F3.4F2.2F$267.4F3.2F5.
10F3.3F.2F$266.F.3F9.14F2.2F.F$265.F.F.2F8.15F3.F.F.F$265.F2.F2.2F5.
15F4.F2.2F$266.2F3.3F3.4F2.9F4.2F$260.2C9.3F.5F5.6F$259.F.C8.9F4.5F$
259.F8.F.8F5.2F$256.2F.2F.F3.C10F7.F$257.F.F.3F.3C9F4.3F$257.F.F.4F4C
8F4.F$256.2F.F2.4F4C7F12.2F$256.F2.8F4C4F.3F8.6F$257.2F2.3F.3F4C3F.2F
.F5.10F$259.2F6.2F4CF5.F3.14F$259.F7.2F.4C5.2F.16F$261.F8.F4C8.14F$
260.2F9.F4C9.10F$268.3F2.4C10.6F$263.F2.5F3.4C11.2F$262.10F3.4C7.3F2.
3F$262.10F4.4C4.12F$263.5F2.F6.4CF.14F$263.3F12.4C14F$279.4C2F.2F4.2F
$280.4C$281.4C$282.4C$283.4C$284.4C$285.4C$286.4C$287.4C$288.4C$289.
4C$290.4C$291.4C$292.4C$293.4C$294.4C$295.4C$296.4C$297.4C$298.4C$
299.4C$300.4C$301.4C$302.4C$303.4C$304.4C$305.4C$306.4C$307.4C$308.4C
$309.4C$310.4C$311.4C$312.4C$313.4C$314.4C$315.4C2$318.C2$320.C2$322.
C!
identify_gun() basically crops the above pattern to the bounding box of pbb (i.e., the red and gray cells), and then removes the cells only in pbb (the red cells), giving the following pattern:

Code: Select all

x = 49, y = 41, rule = LifeHistory
34.2F7.F$30.2F.F.F5.3F$19.2F9.2F.F6.F$10.F.F2.F2.F.3F10.3F4.2F$9.F.2F
2.4F4.F6.8F.3F$9.F9.3F.F6.F.3F.4F$7.2F.12F.3F5.10F$8.F.F2.F2.F.F2.2F
2.2F5.9F$6.3F.2F.6F2.6F7.2F3.F$5.6F2.8F.6F4.3F8.F.F$6.2F.2F4.F2.11F.
4F9.2F.F$17.2F.15F11.F$18.2F.F2.3F.8F5.5F.2F$.C17.F.F.2F3.8F4.2F3.F.F
$C.C16.F.F.F5.8F3.6F.F$.C12.3F3.F2.F6.8F3.4F2.2F$14.4F3.2F5.10F3.3F.
2F$13.F.3F9.14F2.2F.F$12.F.F.2F8.15F3.F.F.F$12.F2.F2.2F5.15F4.F2.2F$
13.2F3.3F3.4F2.9F4.2F$7.2C9.3F.5F5.6F$6.F.C8.9F4.5F$6.F8.F.8F5.2F$3.
2F.2F.F3.C10F7.F$4.F.F.3F.3C9F4.3F$4.F.F.4F4C8F4.F$3.2F.F2.4F4C7F12.
2F$3.F2.8F4C4F.3F8.6F$4.2F2.3F.3F4C3F.2F.F5.10F$6.2F6.2F4CF5.F3.14F$
6.F7.2F.4C5.2F.16F$8.F8.F4C8.14F$7.2F9.F4C9.10F$15.3F2.4C10.6F$10.F2.
5F3.4C11.2F$9.10F3.4C7.3F2.3F$9.10F4.4C4.12F$10.5F2.F6.4CF.14F$10.3F
12.4C14F$26.4C2F.2F4.2F!
Notice that the tub has been added back, but the extra spark cells created by the glider filters have not, giving the erroneous bounding box of 49x41. From this point on, indentify_gun() treats this as the exact envelope of the gun (with gray and white cells actually being blue state-2 cells).

After this, the period/pseudo-period calculations will still be correct. The problems arise when it attempts to find the canonical phase of the gun (starting at line 100 of idgun.py). It will find a phase that it incorrectly thinks is the canonical phase, and can then crop the pattern in a way that it shouldn't like in the gun_1650 example quoted above. The final step is to take the (possibly incorrectly cropped) gun in 2-state Life, convert it to LifeHistory, run it for its full period, then crop again to get the final RLE. Unfortunately, the first incorrect crop could actually cause the pattern to explode, as was seen in the quoted gun_1650 example.
-Matthias Merzenich
User avatar
dvgrn
Moderator
Posts: 12030
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Catagolue Discussion Thread

Post by dvgrn »

confocaloid wrote: December 3rd, 2024, 1:34 am If the input is a phase of the p1320 glider gun discussed recently, except with the blocker moved away from its correct safe location, then your steps 7 and 8 will lead to an incorrect bounding box (46 by 42)...
Thanks! That gun is a beautiful example of a tricky case that we'll have to deal with correctly. The extra spark is generated by a glider filter and extends beyond the bounding box, but it fits entirely inside the envelope of the escaping glider.

Maybe I can see how to adjust my proposed algorithm to take care of that case -- see below.
Sokwe wrote: December 3rd, 2024, 5:33 am Unfortunately, the bug sometimes creates an invalid RLE for what it thinks is the gun (although the period calculation is always correct)...
Okay, we'll keep the part of idgun.py that correctly calculates the period, but then replace that invalid removal of the long glider envelope with some other type of analysis.

We might be able to start the analysis with the original submitted gun, plus the calculated period -- except that the new algorithm might then not accept the occasional submitted pattern that is a valid predecessor of a gun, but not a gun itself. We'll have to keep that case in mind, assuming we want to allow those as valid submissions.

New candidate algorithm:

1) Run the original submitted pattern in LifeHistory for P ticks. Record the bounding box at T=P.

2) Run the resulting pattern in steps of P cells, checking the bounding box at every step, until the bounding box is larger at time k+P than it was at time k. The pattern at time k will be the initial base gun to be analyzed.

If the original pattern included one or more gliders in the output stream outside the gun's bounding box, this proposed algorithm will incrementally test and remove each of those gliders, gradually whittling away the original submitted pattern to get a gun with the correct bounding box.

3) Record phases 0 through P for the base gun. The pattern at T=P should be the same as the pattern as T=0, except for the addition of a glider G. If this is not the case, terminate with the claim that the gun is not valid.

(It's still perfectly possible to build a predecessor pattern that will eventually settle into a valid gun, but that will fail the above test -- but I'm not clear on why it would be necessary for the algorithm to be able to accept weird submissions like that.)

4) Depending on the geometry and the phase of the gun that was submitted, glider G might still be well inside the bounding box, or it might be far outside the bounding box -- but I think that should be okay. Collect (by rewinding) the locations where glider G would have been in each phase from 0 to P (if it existed at that time).

5) Set N = 0.

6) Start analysis of the base gun at phase N.

7) If glider G exists at phase N, make a copy of the gun at phase 0 with glider G removed. Run the copy for P generations, checking each phase against the recorded phases N through P for the base gun. Adding glider G back at each phase should make it identical to the recorded phase of the base gun. I.e., the presence or absence of the glider causes no differences in evolution -- [base gun] XOR [copy + G] is empty for all phases. Increment N each time the XOR test comes up empty.

8) If glider G exists at phase 0 and doesn't interact with anything for an entire period of the gun, then take the new base gun to be phase 0 with glider G removed. Go back to step 3 and re-analyze from there. This will eventually remove any extraneous gliders in the submitted pattern and produce a minimal base gun pattern.

9) If glider G is not present at phase 0, or if it interacts with the rest of the gun in some way (as tested in step 7), then increment N and go back to step 6. Eventually this process will terminate with some value of N, beyond which an output glider no longer interacts with the rest of the gun.

10) Remove glider G from phase N of the base gun. In LifeHistory, run for P ticks. Remove glider G again. Run for up to P additional ticks, stopping whenever the bounding box changes size and taking the canonical gun to be one phase before that point.

------------------------------------

This seems like it will maybe work reliably for guns that consist of glider streams with filters applied to increase the period. Counterexamples or improvements to the algorithm are welcome!

However... are there other types of guns for which this algorithm might not work? I'm probably thinking too exclusively about sparky filtered guns at this point.

We can certainly test the algorithm against every gun pattern that we can get our hands on, and confirm that we get the right bounding box in each case.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Catagolue Discussion Thread

Post by confocaloid »

Sokwe wrote: December 3rd, 2024, 5:33 am [...] Perhaps it would be helpful to know exactly what idgun.py is doing and exactly why it fails to get the correct bounding box. To that end, I somewhat quickly read over the script and gave excessive annotations of what I think identify_gun() is doing at each step:

Code: Select all

[...]

    multiple = x.oscar(eventual_oscillator=False, maxexp=20)['period']

[...]

    # This for loop [...]

    # This for loop [...]
[...]
It looks like several parts of the code aim to replace phase-by-phase loops and cell-by-cell operations by (presumably faster) set-theoretic operations that work on the pattern as a whole.
However, those two phase-by-phase for loops and a call to x.oscar look like they might add up to enough redundant computation to deserve a rewrite of the other parts.
What are restrictions on how fast this code must run and how much memory it can use?
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
dvgrn
Moderator
Posts: 12030
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Catagolue Discussion Thread

Post by dvgrn »

confocaloid wrote: December 3rd, 2024, 11:18 am What are restrictions on how fast this code must run and how much memory it can use?
This is just a guess, but it seems unlikely that either execution speed or memory use will be an issue for any code we're likely to write -- just given the relatively low number of gun-pattern submissions that currently happen, or are likely to happen in the foreseeable future.

As you say, the current code contains a really impressive amount of redundant computation -- running in LifeHistory to T=524288, and so on. The current code seems to have been written with an eye to minimizing the coding complexity ... i.e., just "getting the job done" without worrying very much about efficiency at all.

On a bike ride this morning, I started thinking about a simpler algorithm than the one I outlined, that might work just as well -- not sure yet. Rough outline:

1) Run the input pattern for a long time, as before.
2) Truncate to some reasonable conservative bounds -- e.g. expand the original bounding box by 1024 cells in all directions, then remove any polyplets with parts outside that boundary (to avoid cutting any gliders in half while truncating).
3) Find the period P and the output glider G, as before.
4) Scan backwards along glider G's path, removing every output glider found along that path at a multiple of P ticks -- effectively rewinding the pattern by P ticks with every removal. Each removal is experimental. I.e., after each removal, test the resulting pattern by running for P ticks and confirm that we get the pre-removal pattern back.
5) As soon as we don't find a glider along the output path in the predicted location, or as soon as removing a glider and running for P ticks doesn't re-create the removed glider while causing no other changes ... stop the removal process.
6) The current pattern should be a valid glider gun, not necessarily in the canonical phase. Run that pattern one tick at a time in LifeHistory for N ticks, until the presence or absence of glider G makes a difference to the size of the bounding box.
7) We're not done quite yet! Remove glider G and continue running the pattern for P-N ticks. Take the bounding box after a total of P ticks as the final bounding box. Optionally, run the pattern until a new glider reaches that bounding box, and take the last phase before the bounding box increases as the canonical phase.

There's at least one hypothetical case where this algorithm might not give the expected results: a true-period p14 glider gun, where the mechanism depends on the presence of the previous glider to "Heisenburp" the next glider into existence. This algorithm might produce an overly conservative bounding box for that case -- possibly a different result depending on what phase the input p14 gun was in.

Maybe it's worth fixing that, just in hopes that someday it becomes an actual issue that needs to be handled correctly!
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Catagolue Discussion Thread

Post by confocaloid »

confocaloid wrote: December 3rd, 2024, 1:34 am [...] Instead of manipulating envelopes row-by-row (which does not match the idea behind determining the bounding box and the canonical phase of a gun), one needs to capture the meanings of "the bounding box of a gun" and "the canonical phase of a gun", so that correctness would follow "by definition". [...]
[...] Determining the bounding box boils down to computing every phase of the gun, deleting a glider as soon as it can be proved that the glider will escape without any later interactions, and then computing the bounding box of the set-theoretic union of all resulting phases. [...]
From a quick-and-dirty attempt to rewrite most of the code, some "interesting" test cases are:
  • All pseudo period guns (two or more output gliders per cycle), including both cases like gun_120 and cases like gun_14.
  • Those guns where an output glider can be deleted early, and once the output glider is deleted early, more than one full cycle is needed before the next glider leaves the bounding box of the gun. (Example: gun_15)
  • All guns that currently cause bounding box glitches. (Example: gun_184)
TBD fixing the existing bugs, making the code a lot faster than it is, convincing myself that the implementation is correct, and writing a convincing explanation of why it is correct.


edit 1: here is the result of processing another test case (along with lots of debugging noise). Without the Snark-based delay devices, the output glider stream still appears on schedule, however, tracking individual gliders in the stream reveals that they are delayed by a multiple of the gun period. More test cases can be generated by adding, removing, moving the delays.

Code: Select all

#C gliderlike_data: (5, 1, 1)
#C gliders per cycle: 1
#C detected gun period: 1024
#C detected stream period: 1024
#C removing escaping gliders and computing the envelope...
#C WARNING get_gun_envelope_and_phases 3: in phase #0 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #2 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #3 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #4 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #5 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #6 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #7 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #8 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #9 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #10 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #11 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #12 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #13 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #14 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #15 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #16 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #17 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #18 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #19 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #20 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #21 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #22 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #23 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #24 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #25 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #26 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #27 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #28 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #29 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #30 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #31 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #32 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #33 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #34 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #35 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #36 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #37 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #38 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #39 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #40 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #41 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #42 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #43 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #44 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #45 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #46 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #47 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #48 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #49 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #50 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #51 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #52 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #53 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #54 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #55 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #56 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #57 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #58 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #59 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #60 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #61 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #62 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #63 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #64 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #65 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #66 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #67 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #68 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #69 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #70 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #71 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #72 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #73 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #74 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #75 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #76 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #77 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #78 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #79 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #80 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #81 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #82 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #83 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #84 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #85 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #86 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #87 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #88 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #89 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #90 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #91 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #92 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #93 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #94 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #274 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #275 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #276 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #277 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #278 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #279 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #280 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #281 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #282 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #283 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #284 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #285 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #286 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #287 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #288 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #289 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #290 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #291 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #292 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #293 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #294 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #295 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #296 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #297 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #298 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #299 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #300 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #301 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #302 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #303 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #304 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #305 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #306 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #307 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #308 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #309 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #310 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #311 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #312 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #313 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #314 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #315 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #316 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #317 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #318 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #319 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #320 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #321 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #322 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #323 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #324 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #325 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #326 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #327 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #328 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #329 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #330 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #331 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #332 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #333 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #334 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #335 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #336 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #337 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #338 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #339 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #340 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #341 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #342 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #343 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #344 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #345 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #346 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #347 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #348 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #349 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #350 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #351 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #352 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #353 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #354 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #355 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #356 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #357 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #358 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #359 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #360 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #361 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #362 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #363 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #364 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #365 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #366 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #367 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #368 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #369 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #370 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #371 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #372 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #373 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #374 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #375 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #376 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #377 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #378 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #379 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #380 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #381 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #382 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #383 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #384 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #385 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #386 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #387 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #388 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #389 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #390 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #391 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #392 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #393 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #394 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #395 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #396 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #397 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #398 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #399 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #400 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #401 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #402 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #403 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #404 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #405 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #406 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #407 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #408 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #409 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #410 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #411 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #412 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #413 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #414 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #415 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #416 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #417 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #418 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #419 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #420 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #421 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #422 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #423 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #424 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #425 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #426 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #427 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #428 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #429 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #430 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #431 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #432 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #433 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #434 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #435 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #436 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #437 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #438 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #439 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #440 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #441 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #442 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #443 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #444 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #445 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #446 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #447 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #448 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #449 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #450 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #451 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #452 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #453 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #454 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #455 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #456 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #457 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #458 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #459 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #460 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #461 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #462 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #463 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #464 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #465 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #466 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #467 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #468 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #469 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #470 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #471 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #472 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #473 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #474 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #475 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #476 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #477 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #478 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #479 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #480 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #481 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #482 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #483 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #484 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #485 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #486 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #487 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #488 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #489 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #490 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #491 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #492 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #493 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #494 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #495 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #496 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #497 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #498 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #499 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #500 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #501 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #502 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #503 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #504 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1018 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1019 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1020 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1021 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1022 the removed cells were not an escaping glider
#C WARNING get_gun_envelope_and_phases 3: in phase #1023 the removed cells were not an escaping glider
#C removed 66 gliders from phases of the gun.
#C envelope bounding box: [-2, 0, 195, 322]
#C detected 1 canonical phases.


#CSYNTH gun_1024 costs 62790 cells.
#C period 1024 fullperiod 1024 bbox 322 by 195
#CLL state-numbering golly
x = 322, y = 195, rule = LifeHistory
4.B5.B$3.3B3.3B$.2B3A3.3A2B$2BA2B.A.A.2BA2B27.A2.2A$2BA3BA.A3BA2B
27.4A.A$BAB4A.4ABAB32.A$B2A4B.4B2AB8.2A15.7A.2A.A$7B.7B7.3B14.A2.B
3.A.A.2A$7B.7B7.A3BA12.2A2.2A.AB$5B2A.2A5B6.A4BA15.B2AB2A$4BA.A.A.
A4B5.A.ABAB17.5B$.4BA3.A4B4.BABA.A20.3B$3.3B3.3B5.A4BA13.2A5.5B$4.
B5.B.B4.A3BA13.A2.A3.2B2A2B$11.3B5.3B11.2B.A.A3.2B2A4B$11.3B.3B.2A
12.B2A.A3.9B$8.6B4A2B13.B3A5.7B$8.5B2A2B2AB14.2AB3.10B$6.6BA6BAB
16.14B$6.7B2A2B2A3B15.15B$7.7B4A5B15.15B$7.12B.4B10.A5.8B2.4B$3.B.
15B.4B7.3A4.7B5.4B$2.2A6B2A8B2.4B5.A7.9B4.4B$2.2A6B2A6B5.4B4.2A5.
4B4.2A5.4B$3.3B.11B6.9B4.4B5.A7.4B$4.B4.2B.3B9.B2A4B5.4B7.3A5.4B$
12.3B10.3B3A2B2.4B10.A6.4B$5.B5.B.B9.A4BA2B2ABA3B19.4B$4.3B3.3B9.B
A2BA4B5AB21.4B$2.4BA3.A4B7.BA2BA2B4AB2A23.4B$.4BA.A.A.A4B3.2AB3.2A
5B2AB25.4B$.5B2A.2A5B2.B3A5.2AB2A2B27.4B$.7B.7B2.B2A.A3.BABABA3B
27.4B13.A$.7B.7B2.2B.A.A3.8B28.4B10.3A$.B2A4B.4B2AB4.A2.A3.B3A2B
31.4B8.A$.BAB4A.4ABAB5.2A5.5B32.4B7.2A$.2BA3BA.A3BA2B13.3B34.4B3.
5B$.2BA2B.A.A.2BA2B12.5B34.4B2.3B$2.2B3A3.3A2B12.B2AB2A35.9B7.2A$
4.3B3.3B11.2A2.2A.AB2.2A32.8B8.A$5.B5.B12.A2.B3.A.A2.A33.10B3.B.A.
2A$25.7A.2A35.7B2A2B.B3A2.A$32.A37.7B2A3BAB2.2A$27.4A.A37.12B4A$
27.A2.2A36.2AB.7B3.2B.A$67.A.AB.7B2.B3A$67.A5.4B4.A$66.2A5.4B5.5A$
72.4B10.A$71.4B9.A$70.4B10.2A$69.4B$68.4B$67.4B$66.4B$65.4B$64.4B$
63.4B$62.4B$61.4B$60.4B$59.4B$58.4B$57.4B$56.4B$55.4B$54.4B$53.4B$
52.4B$51.4B$50.4B$49.4B$48.4B$47.4B186.2A52.2A$46.4B62.2A123.A.A
51.A.A$45.4B63.A.A124.A4.2A47.A4.2A$44.4B8.2A56.A4.2A114.4A.2A2.A
2.A41.4A.2A2.A2.A$43.4B9.A.A51.4A.2A2.A2.A112.A2.A.A.A.A.2A41.A2.A
.A.A.A.2A$42.4B12.A4.2A45.A2.A.A.A.A.2A114.BABABA.A46.BABABA.A$41.
4B9.4A.2A2.A2.A45.BABABA.A118.B2ABA.A47.B2ABA.A$40.4B10.A2.A.A.A.A
.2A46.B2ABA.A119.2B.BA49.2B.BA$39.4B13.BABABA.A50.2B.BA119.3B51.3B
$38.4B15.B2ABA.A49.3B113.2A6.4B42.2A6.4B$37.4B17.2B.BA41.2A6.4B
114.A6.B2A3B41.A6.B2A3B$36.4B17.3B45.A6.B2A3B112.A.AB3.B2A3B41.A.A
B3.B2A3B$35.4B9.2A6.4B45.A.AB3.B2A3B113.2AB.10B13.A26.2AB.10B13.A$
34.4B11.A6.B2A3B44.2AB.10B113.13B10.3A28.13B10.3A$33.4B12.A.AB3.B
2A3B46.13B112.14B8.A31.14B8.A$32.4B14.2AB.10B13.A30.14B111.15B7.2A
30.15B7.2A$31.4B17.13B10.3A30.15B112.8B2.4B3.5B32.8B2.4B3.5B$30.4B
18.14B8.A35.8B2.4B111.6B5.4B2.3B34.6B5.4B2.3B$29.4B19.15B7.2A34.6B
5.4B109.9B4.9B7.2A23.9B4.9B7.2A$28.4B22.8B2.4B3.5B33.9B4.4B107.4B
4.2A5.8B8.A22.4B4.2A5.8B8.A$27.4B23.6B5.4B2.3B34.4B4.2A5.4B105.4B
5.A7.10B3.B.A.2A18.4B5.A7.10B3.B.A.2A$26.4B23.9B4.9B7.2A23.4B5.A7.
4B103.4B7.3A4.7B2A2B.B3A2.A17.4B7.3A4.7B2A2B.B3A2.A$11.A13.4B23.4B
4.2A5.8B8.A22.4B7.3A5.4B101.4B10.A4.7B2A3BAB2.2A17.4B10.A4.7B2A3BA
B2.2A$11.3A10.4B23.4B5.A7.10B3.B.A.2A18.4B10.A6.4B99.4B16.12B4A18.
4B16.12B4A$14.A8.4B23.4B7.3A4.7B2A2B.B3A2.A17.4B19.4B97.4B15.2AB.
7B3.2B.A17.4B15.2AB.7B3.2B.A$13.2A7.4B23.4B10.A4.7B2A3BAB2.2A17.4B
21.4B95.4B15.A.AB.7B2.B3A17.4B15.A.AB.7B2.B3A$13.5B3.4B23.4B16.12B
4A18.4B23.4B93.4B16.A5.4B4.A19.4B16.A5.4B4.A$15.3B2.4B23.4B15.2AB.
7B3.2B.A17.4B25.4B91.4B16.2A5.4B5.5A13.4B16.2A5.4B5.5A$5.2A7.9B23.
4B15.A.AB.7B2.B3A17.4B27.4B89.4B23.4B10.A12.4B23.4B10.A$5.A8.8B23.
4B16.A5.4B4.A19.4B29.4B87.4B23.4B9.A13.4B23.4B9.A$2.2A.A.B3.10B23.
4B16.2A5.4B5.5A13.4B31.4B85.3AB23.4B10.2A11.4B23.4B10.2A$2.A2.3AB.
2B2A7B22.4B23.4B10.A12.4B33.4B83.3BA23.4B23.4B23.4B$3.2A2.BA3B2A7B
21.4B23.4B9.A13.4B35.4B81.3BA23.4B23.4B23.4B$5.4A12B20.4B23.4B10.
2A11.4B37.4B79.4B23.4B23.4B23.4B$5.A.2B3.7B.B2A17.4B23.4B23.4B39.
4B77.4B23.4B23.4B23.4B$6.3AB2.7B.BA.A15.4B23.4B23.4B41.4B75.4B23.
4B23.4B23.4B$9.A4.4B5.A14.4B23.4B23.4B43.4B73.4B23.4B23.4B23.4B$4.
5A5.4B5.2A12.4B23.4B23.4B45.4B71.4B23.4B23.4B23.4B$4.A10.4B10.A6.
4B23.4B23.4B47.4B69.4B23.4B23.4B23.4B$6.A9.4B7.3A5.4B23.4B23.4B49.
4B67.4B23.4B23.4B23.4B$5.2A10.4B5.A7.4B23.4B23.4B51.4B65.4B23.4B
23.4B23.4B$18.4B4.2A5.4B23.4B23.4B53.4B63.4B23.4B23.4B23.4B$19.9B
4.4B23.4B23.4B55.4B61.4B23.4B23.4B23.4B$20.6B5.4B23.4B23.4B57.4B
59.4B23.4B23.4B23.4B$20.8B2.4B23.4B23.4B59.4B57.4B23.4B23.4B23.4B$
18.15B23.A3B23.4B61.4B55.4B23.4B23.4B23.4B$18.14B23.A3B23.4B63.4B
53.4B9.A13.4B23.4B23.4B$18.13B23.B3A23.4B65.4B51.4B10.3A10.4B23.4B
23.4B$16.2AB.10B23.4B23.4B67.4B49.4B14.A8.4B23.4B23.4B$15.A.AB3.B
2A3B24.4B23.4B69.4B47.4B14.2A7.4B23.4B23.4B$15.A6.B2A3B23.4B23.4B
71.4B45.4B15.5B3.4B23.4B23.4B$14.2A6.4B24.4B23.4B73.4B43.4B18.3B2.
4B23.4B23.4B$23.3B23.4B23.4B75.4B41.4B9.2A7.9B23.4B23.4B$24.2B.BA
19.4B23.4B77.4B39.4B10.A8.8B23.4B23.4B$23.B2ABA.A17.4B23.4B79.4B
37.4B8.2A.A.B3.10B23.4B23.4B$22.BABABA.A16.4B23.4B81.4B35.4B9.A2.
3AB.2B2A7B22.4B23.4B$20.A2.A.A.A.A.2A12.4B23.4B83.4B33.4B11.2A2.BA
3B2A7B21.4B23.4B$20.4A.2A2.A2.A11.4B23.4B85.4B31.4B14.4A12B20.4B
23.4B$24.A4.2A12.4B23.4B87.4B29.4B15.A.2B3.7B.B2A17.4B23.4B$22.A.A
17.4B23.4B89.4B27.4B17.3AB2.7B.BA.A15.4B23.4B$22.2A17.4B23.4B91.4B
25.4B21.A4.4B5.A14.4B23.4B$40.4B23.4B93.4B23.4B17.5A5.4B5.2A12.4B
23.4B$39.4B23.4B95.4B21.4B18.A10.4B10.A6.4B23.4B$38.4B23.4B97.4B
19.4B21.A9.4B7.3A5.4B23.4B$37.4B23.4B99.4B10.A6.4B21.2A10.4B5.A7.
4B23.4B$36.4B23.4B101.4B7.3A5.4B35.4B4.2A5.4B23.4B$35.4B23.4B103.
4B5.A7.4B37.9B4.4B23.4B$34.4B23.4B105.4B4.2A5.4B39.6B5.4B23.4B$33.
4B23.4B107.9B4.4B40.8B2.4B23.4B$32.4B23.4B109.6B5.4B39.15B23.4B$
31.4B23.4B110.8B2.4B40.14B23.4B$30.4B23.4B109.15B41.13B23.4B$29.4B
23.4B110.14B40.2AB.10B23.4B$28.4B23.4B111.13B40.A.AB3.B2A3B24.4B$
27.4B23.4B110.2AB.10B41.A6.B2A3B23.4B$26.4B23.4B110.A.AB3.B2A3B42.
2A6.4B24.4B$11.A13.4B23.4B111.A6.B2A3B51.3B23.4B$11.3A10.4B23.4B
111.2A6.4B54.2B.BA19.4B$14.A8.4B23.4B121.3B53.B2ABA.A17.4B$13.2A7.
4B23.4B123.2B.BA49.BABABA.A16.4B$13.5B3.4B23.4B123.B2ABA.A46.A2.A.
A.A.A.2A12.4B$15.3B2.4B23.4B123.BABABA.A46.4A.2A2.A2.A11.4B$5.2A7.
9B23.4B122.A2.A.A.A.A.2A47.A4.2A12.4B$5.A8.8B23.4B123.4A.2A2.A2.A
45.A.A17.4B$2.2A.A.B3.10B23.4B128.A4.2A47.2A17.4B$2.A2.3AB.2B2A7B
22.4B127.A.A71.4B$3.2A2.BA3B2A7B21.4B128.2A71.4B$5.4A12B20.4B201.
4B$5.A.2B3.7B.B2A17.4B201.4B$6.3AB2.7B.BA.A15.4B201.4B$9.A4.4B5.A
14.4B201.4B$4.5A5.4B5.2A12.4B201.4B$4.A10.4B10.A6.4B201.4B$6.A9.4B
7.3A5.4B201.4B$5.2A10.4B5.A7.4B201.4B$18.4B4.2A5.4B201.4B$19.9B4.
4B201.4B$20.6B5.4B201.4B$20.8B2.4B201.4B$18.15B201.4B$18.14B201.4B
$18.13B201.4B$16.2AB.10B187.A13.4B$15.A.AB3.B2A3B189.3A10.4B$15.A
6.B2A3B192.A8.4B$14.2A6.4B193.2A7.4B$23.3B193.5B3.4B$24.2B.BA192.
3B2.4B$23.B2ABA.A181.2A7.9B$22.BABABA.A181.A8.8B$20.A2.A.A.A.A.2A
175.2A.A.B3.10B$20.4A.2A2.A2.A175.A2.3AB.2B2A7B$24.A4.2A178.2A2.BA
3B2A7B$22.A.A186.4A12B$22.2A187.A.2B3.7B.B2A$212.3AB2.7B.BA.A$215.
A4.4B5.A$210.5A5.4B5.2A$210.A10.3BA$212.A9.3BA$211.2A10.3AB!
The input RLE in this case was this:

Code: Select all

x = 276, y = 322, rule = B3/S23
6bo$5bob2o22bo$4bo3bo12b2o6b2obo69b2o52b2o$4bo5bo10b2o6bo3bo68bobo51bo
bo$bo2bo5bo16bo5bo70bo4b2o47bo4b2o$obo7bo16bo5bo2bo63b4ob2o2bo2bo41b4o
b2o2bo2bo$b2o2b4o18bo7bobo62bo2bobobobob2o41bo2bobobobob2o$29b4o2b2o
66bobobobo47bobobobo$b2o2b4o95b2obobo48b2obobo$obo7bo5bo12b4o2b2o71bo
53bo$bo2bo5bo4b3o3b2o4bo7bobo$4bo5bo3bobobo2b2o4bo5bo2bo57b2o52b2o$4bo
3bo4b3ob3o7bo5bo61bo7b2o44bo7b2o$5bob2o5bobobo10bo3bo61bobo5b2o44bobo
5b2o$6bo8b3o11b2obo63b2o25bo26b2o25bo$16bo14bo89b3o51b3o$120bo53bo$
120b2o52b2o$30b2o$10b2o6bo11b3o$8bob2o7bo10b2obo94b2o52b2o$7bo9b3o12bo
bo71b2o21bo30b2o21bo$10bo20bo2bo71bo22bob2o27bo22bob2o$6b2obo22b2o73b
3o11b2o4b3o2bo28b3o11b2o4b3o2bo$6b2o30b2o69bo11b2o3bo3b2o31bo11b2o3bo
3b2o$38bobo85b4o50b4o$40bo71b2o15bo36b2o15bo$40bob2o67bobo12b3o36bobo
12b3o$37b2obobo68bo13bo39bo13bo$37b2obobo67b2o14b5o33b2o14b5o$31b2o7bo
b2o86bo53bo$21b2o7bo2bo3b4o2bo84bo53bo$20bobo8b2o4bo3b2o85b2o52b2o$13b
2o5bo18b2o$12b3o4b2o19bo$11bob2o23bo$10bobo25b2o$10bo2bo$11b2o$5b2o10b
2o$4bobo9bo2bo$4bo12b2o$b2obo7bo$2bobob2o2b3o$2bobob2o2b2o$b2obo7bo$bo
2b4o3bo10b2o$2b2o3bo3bo10bobo$4b2o18bo59bo$4bo13bo5b2o58b3o$5bo13bo67b
o62bo$4b2o11b3o66b2o61bo$149b3o2$78b2o$78bo$75b2obo$75bo2b3o4b2o$76b2o
3bo3b2o$78b4o$78bo15b2o$79b3o12bobo$82bo13bo$77b5o14b2o$77bo24bo$79bo
20b3o$46bo31b2o19bo$44b3o52b2o$43bo$43b2o5$89b2o$88bobo5b2o$33b2o53bo
7b2o$32bobo5b2o45b2o$32bo7b2o$31b2o68bo$97b2obobo$45bo50bobobobo$41b2o
bobo46bo2bobobobob2o$40bobobobo46b4ob2o2bo2bo$37bo2bobobobob2o47bo4b2o
$37b4ob2o2bo2bo45bobo$41bo4b2o47b2o$39bobo$39b2o16$82bo$82b3o$85bo$84b
2o3$76b2o$76bo$73b2obo$73bo2b3o4b2o$74b2o3bo3b2o$76b4o$76bo15b2o$77b3o
12bobo$80bo13bo$75b5o14b2o$75bo$77bo$76b2o44$149bo$147b3o$146bo$146b2o
3$154b2o$155bo$155bob2o$147b2o4b3o2bo$147b2o3bo3b2o$152b4o$138b2o15bo$
137bobo12b3o$137bo13bo$136b2o14b5o$156bo$154bo$154b2o24$182b2o$182bobo
$126b2o56bo4b2o$126bobo51b4ob2o2bo2bo$128bo4b2o45bo2bobobobob2o$124b4o
b2o2bo2bo46bobobobo$124bo2bobobobob2o47b2obobo$127bobobobo54bo$128b2ob
obo$132bo41b2o$175bo7b2o$118b2o55bobo5b2o$119bo7b2o47b2o$119bobo5b2o$
120b2o25bo$145b3o$144bo$144b2o2$186b2o$152b2o32bo$81bo48b2o21bo33b3o$
81b3o46bo11bo10bob2o32bo$84bo46b3o7b3o7b3o2bo$83b2o48bo6bo3bo5bo3b2o$
140bob2o6b4o$136b2o3b2o10bo$75b2o58bobo12b3o$75bo59bo13bo$72b2obo58b2o
14b5o$72bo2b3o4b2o70bo$73b2o3bo3b2o68bo$75b4o73b2o$75bo15b2o$76b3o12bo
bo$79bo13bo$74b5o14b2o$74bo24bo$76bo20b3o$75b2o19bo$96b2o7$86b2o$85bob
o5b2o$85bo7b2o$84b2o2$98bo$94b2obobo$93bobobobo$90bo2bobobobob2o$90b4o
b2o2bo2bo$94bo4b2o$92bobo$92b2o16$81bo$81b3o$84bo$83b2o3$75b2o$75bo$
72b2obo$72bo2b3o4b2o$73b2o3bo3b2o$75b4o$75bo15b2o$76b3o12bobo$79bo13bo
$74b5o14b2o$74bo24bo$76bo20b3o$75b2o19bo$96b2o3$274bo$275bo$273b3o2$
86b2o$85bobo5b2o$85bo7b2o$84b2o2$98bo$94b2obobo$93bobobobo$90bo2bobobo
bob2o$90b4ob2o2bo2bo$94bo4b2o$92bobo$92b2o!
Last edited by confocaloid on December 4th, 2024, 5:02 am, edited 1 time in total.
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

confocaloid wrote: December 3rd, 2024, 11:18 am What are restrictions on how fast this code must run and how much memory it can use?
Present algorithm spent 38 (42 - 4) minutes to verify 586 guns.
If new algorithm will use < 4 seconds for verification, it will be good enough. < 10 seconds may be acceptable as well.

As for memory, I doubt it will be a problem - I expect server to have at least few GB of RAM available.
To hit such limit, code needs to be extremely unoptimized.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

confocaloid wrote: December 3rd, 2024, 1:34 am ... Instead of manipulating envelopes row-by-row (which does not match the idea behind determining the bounding box and the canonical phase of a gun), one needs to capture the meanings of "the bounding box of a gun" and "the canonical phase of a gun", so that correctness would follow "by definition". ...
It may be important to distinguish between "gun" and "gun + produced gliders".
"bounding box" is a property of "gun", while "canonical phase" usually consists of "gun + glider(s)".

This problem looks similar to recently discussed question about when glider collision starts.
But it is reversed here - it is needed to determine when glider-producing reaction just finished its job and at the next tick pattern have reaction + glider independent of it.

upd:
I think there is a need to have two canonical phases. For example, "canonical phase 1" and "canonical phase 2".
"phase 1" can be defined as first tick when independent glider appears.
"phase 2" is phase 1 advanced until next tick extends pattern beyond bounding box of phase 1.
For example, for gun_184:

Code: Select all

x = 74, y = 42, rule = LifeHistory
15.D38.3D$14.2D37.D3.D$15.D41.D$15.D40.D$15.D39.D$15.D38.D$14.3D36.5D
4$19.A39.A$17.3A37.3A$16.A39.A$16.2A38.2A$13.5B9.AB24.5B9.BA$12.2A2B
10.BA.A22.A3B10.2A.B$11.B2A3B2.B6.A.AB21.A5B2.B6.B.2A$11.6B.4B5.BA22.
BA4B.4B5.AB$9.3BABA8B2.B23.4BA9B2.B$8.7BA7B.4B20.5B4A6B.4B$8.5BAB2A5B
.5B20.4B2A4BA3B.5B$6.7B2AB2A11B17.6B2ABA2BA10B$5.9BA3BA12B14.13B2A11B
$4.9BA4BA13B12.11B5A12B$4.9BA3BA13B13.7B3A2B4A11B$4.8BA5BA10B15.7B2A
4BA11B$2.2AB.7B6A9B2.2BA9.2AB.5B2ABAB2A10B2.3B$.A.AB3.8BAB2A3B2A5.2AB
A7.A.AB3.3BA4BA3BAB3A5.B3A$.A5.5B2AB6A2B2A4.A.3B7.A5.5B2A5B6A4.A.3A$
2A4.6B2A3B3A4B4.A.A.BA6.2A4.7BA4BA2BA2B4.A.A.AB$7.6BA4BA4B5.A2.A15.
10B2A4B5.A2.A$7.16B6.2A16.4BABA4B2A3B6.2A$8.2B.11B26.2B.3BA7B$10.B3A
6B30.A3BA5B$9.BA2BA5B30.BA8B$8.2BABABA2B31.2BABAB2AB$5.BA2.2BA3BAB28.
AB2.2B3A3B$4.2A.B.6BAB27.BA.A.8B$4.B.2A3.5B28.A.AB3.5B$5.AB5.ABAB29.B
A5.2BAB$12.B2A37.3BA$13.A39.3A!
Sokwe
Moderator
Posts: 3382
Joined: July 9th, 2009, 2:44 pm

Re: Catagolue Discussion Thread

Post by Sokwe »

Vort wrote: December 4th, 2024, 5:24 am I think there is a need to have two canonical phases. For example, "canonical phase 1" and "canonical phase 2".
"phase 1" can be defined as first tick when independent glider appears.
"phase 2" is phase 1 advanced until next tick extends pattern beyond bounding box of phase 1.
For example, for gun_184:

Code: Select all

x = 74, y = 42, rule = LifeHistory
15.D38.3D$14.2D37.D3.D$15.D41.D$15.D40.D$15.D39.D$15.D38.D$14.3D36.5D
4$19.A39.A$17.3A37.3A$16.A39.A$16.2A38.2A$13.5B9.AB24.5B9.BA$12.2A2B
10.BA.A22.A3B10.2A.B$11.B2A3B2.B6.A.AB21.A5B2.B6.B.2A$11.6B.4B5.BA22.
BA4B.4B5.AB$9.3BABA8B2.B23.4BA9B2.B$8.7BA7B.4B20.5B4A6B.4B$8.5BAB2A5B
.5B20.4B2A4BA3B.5B$6.7B2AB2A11B17.6B2ABA2BA10B$5.9BA3BA12B14.13B2A11B
$4.9BA4BA13B12.11B5A12B$4.9BA3BA13B13.7B3A2B4A11B$4.8BA5BA10B15.7B2A
4BA11B$2.2AB.7B6A9B2.2BA9.2AB.5B2ABAB2A10B2.3B$.A.AB3.8BAB2A3B2A5.2AB
A7.A.AB3.3BA4BA3BAB3A5.B3A$.A5.5B2AB6A2B2A4.A.3B7.A5.5B2A5B6A4.A.3A$
2A4.6B2A3B3A4B4.A.A.BA6.2A4.7BA4BA2BA2B4.A.A.AB$7.6BA4BA4B5.A2.A15.
10B2A4B5.A2.A$7.16B6.2A16.4BABA4B2A3B6.2A$8.2B.11B26.2B.3BA7B$10.B3A
6B30.A3BA5B$9.BA2BA5B30.BA8B$8.2BABABA2B31.2BABAB2AB$5.BA2.2BA3BAB28.
AB2.2B3A3B$4.2A.B.6BAB27.BA.A.8B$4.B.2A3.5B28.A.AB3.5B$5.AB5.ABAB29.B
A5.2BAB$12.B2A37.3BA$13.A39.3A!
Note that the canonical phase of this gun (as it's currently defined) is this:

Code: Select all

x = 34, y = 31, rule = B3/S23
19bo$17b3o$16bo$16b2o$28bo$12bo13b2o$11bob2o13b2o$27bo$12b3o$13b2o$13b
obo$14bob2o$14bo3bo$15b3o$13b5o$13b3o$2b2o8bo4b2o$bobo12bo2bo3b2o6b3o$
bo9bo4bo3bo2b2o4bob3o$2o10b3o2bobo8bobobo$18bo9bo2bo$29b2o2$11b2o$10bo
b2o$10b3o$5bo8b2o$5bobo8bo$4bobo5bo$6bo8bo$12b3o!
-Matthias Merzenich
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

Sokwe wrote: December 4th, 2024, 7:22 am Note that the canonical phase of this gun (as it's currently defined) is this:
In such case some guns will contain their gliders in canonical phase and some not.
Maybe it's fine, maybe not. Looks like matter of taste.
For me, both approaches are fine.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Catagolue Discussion Thread

Post by confocaloid »

Vort wrote: December 4th, 2024, 7:28 am In such case some guns will contain their gliders in canonical phase and some not.
Correct, the canonical phase does not need to contain any output gliders. Not counting the p184 glider gun posted above, another example is this period-25 glider gun, whose canonical phase doesn't contain the output glider:

Code: Select all

x = 23, y = 22, rule = LifeHistory
11.2A4.2A$11.A.A2.A.A$13.A2BA$11.B2A2B2AB$11.3A2B3A$12.BA2BAB$6.2A6.2B
$7.A6.A$7.A.AB2.2B$5.2A.2AB.3A2B$4.A.A3.2B2ABA5B$4.A.A3.5B3A2BABA$2.2A
.A.2A.2B2A3B2A3BA$3.A.A.B.A.4BA6BA$3.A.AB2AB5.BA4BA$2A.A.ABAB7.2B2A$A
2.2ABAB$2.A4.AB$3.5A2$2.A.2A$2.2A.A!

Code: Select all

x = 34, y = 31, rule = LifeHistory
19.A$17.3A$16.A$16.2A$13.5B9.BA$12.A3B10.2A.B$11.AB2A2B2.B6.B.2A$11.6B
.4B5.AB$9.3B3A8B2.B$8.5B2A8B.4B$8.5BABA6B.5B$6.8BAB2A11B$5.9BA3BA12B$
4.11B3A14B$4.9B5A13B$4.9B3A13B$2.2AB.6BA4B2A9B2.3B$.A.AB3.8BA2BA3B2A5.
B3A$.A5.4BA4BA3BA2B2A4.A.3A$2A4.6B3A2BABA4B4.A.A.AB$7.11BA4B5.A2.A$7.
16B6.2A$8.2B.11B$10.B2A7B$9.BAB2A5B$8.2B3A4B$5.AB2.5B2AB$4.BA.A.7BA$4.
A.AB3.BA3B$5.BA5.3BA$12.3A!
Vort wrote: December 4th, 2024, 5:24 am "phase 1" can be defined as first tick when independent glider appears.
"phase 2" is phase 1 advanced until next tick extends pattern beyond bounding box of phase 1.
I think it would be redundant and confusing to have three defined notions of "preferred phase" which are just a few ticks away from each other. The existing old conventions should be sufficient in practice for comparing, collecting, deduplicating glider guns.

However, there are already cases with two or more possible choices of the canonical phase, namely pseudo period guns. For example a pseudo period 19 glider gun whose mechanism works at p57 will have three possible choices of the canonical phase, separated by 19 ticks. I think it makes sense to prefer lower population. Additionally, there might be a glider gun whose bounding box is a square, which would mean there are two possible choices of the canonical orientation. These choices are relatively unimportant, as they do not affect the bounding box area (which is the primary way of measuring guns) and it is straightforward to iterate over all possibilities, given a canonical phase, the gun's period and the output glider stream's period.
confocaloid wrote: December 3rd, 2024, 6:38 pm [...] TBD fixing the existing bugs, making the code a lot faster than it is, convincing myself that the implementation is correct, and writing a convincing explanation of why it is correct. [...]
The good news is that from limited testing, the existing bugs appear to be fixed. However, the other mentioned issues remain open. Currently step 2 (removing gliders and computing the envelope) is the most expensive step, it can take ~1 minute for some guns.

(1) Assume that the input pattern, after at most 65536 ticks, evolves into a single-barrel glider gun with output glider stream period below 10000. Calculate the output glider stream period, the gun period, and the direction of the output stream. If the assumption is broken, that will be detected here.
(2) Compute the envelope (the union of all phases of the gun after removing all safely-removable escaping gliders), and also keep one of phases of the gun for use in the next step.
(3) There are (gun_period / output_glider_stream_period) possible choices of the canonical phase. Find any choice (by evolving a phase kept from preceding step), and then compute all other possible choices by jumping (output_glider_stream_period) ticks at a time. Prefer a phase with lowest population.
(4) Convert the chosen phase to LifeHistory, advance it for one full cycle, and trim to the bounding box of the union of all phases.
(5) Reorient the pattern into canonical orientation, depending on the bounding box dimensions and the direction of the output glider stream.
(6) Output the results.
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

confocaloid wrote: December 4th, 2024, 9:32 am ... Correct, the canonical phase does not need to contain any output gliders. ...
confocaloid wrote: December 4th, 2024, 9:32 am ... I think it would be redundant and confusing to have three defined notions of "preferred phase" which are just a few ticks away from each other. The existing old conventions should be sufficient in practice for comparing, collecting, deduplicating glider guns. ...
readme.txt wrote:The pattern is in the last phase before a glider leaves the bounding box.
The thing is, for something to leave bounding box, it should exist in the first place. This is not the case for gun_184.
Also, what are the reasons of having "canonical phase" to be defined in this particular way?
I thought the goal is to have glider visible in predictable place and shape.

As for having several definitions, I don't see a problem here.
"phase 1" can be used to simplify normalization algorithm, "phase 2" can be used to make gun more recognizable by people.

edit: small clarification: this is not a glider, therefore transition to the next tick is not a "glider leaving the bounding box":

Code: Select all

x = 4, y = 3, rule = B3/S23
o$3bo$3o!
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Catagolue Discussion Thread

Post by confocaloid »

Vort wrote: December 4th, 2024, 9:59 am The thing is, for something to leave bounding box, it should exist in the first place. This is not the case for gun_184.
Why do you think so? As far as I can tell, both the p184 glider gun and the p25 glider gun above are indeed posted in the canonical phase.
In the next generation, an output glider appears and no longer interacts with anything else from that point in time. Therefore, the output glider can be safely removed from the next generation after the canonical phase. Once removed, it does not increase the bounding box.

Note that the definition only says "the last phase before a glider leaves the bounding box", but it does not require the glider to be present in that phase.
A glider can leave the bounding box of the gun in generation T+1, even if that glider was not yet present in generation T. I do not see an issue here.
Vort wrote: December 4th, 2024, 9:59 am Also, what are the reasons of having "canonical phase" to be defined in this particular way?
I thought the goal is to have glider visible in predictable place and shape.
The goal is to have a consistent way of measuring glider guns by the bounding box area and recording canonical form of guns.

Note that the same source (see below) says: "Every cell that is a part of the rotor or stator of the gun must be included in the bounding rectangle, excluding only the output gliders." That is, output gliders do not increase the bounding box of the gun.
This is a natural way to define the bounding box; once the glider is formed and it is possible to prove that the glider can be safely ignored, it is ignored.

Once the bounding box is determined, it is a natural choice to define canonical phase to be "the last phase before a glider leaves the bounding box".
That phase is completely contained within the bounding box of the gun (regardless of whether the glider already formed, and if so whether it was left intact or removed).
In comparison, the next generation (including the output glider) is no longer contained within the bounding box of the gun. Insisting on "having the glider visible" would have an undesirable consequence that in certain cases, the shown pattern would not fit in the bounding box of the gun.
readme.txt wrote: [...]
The goal of this collection is to include the smallest glider gun for each period. Size is measured by the area of the bounding rectangle of the gun. Every cell that is a part of the rotor or stator of the gun must be included in the bounding rectangle, excluding only the output gliders. [...]
[...]
In this collection, a glider gun must emit gliders in exactly one uniform stream. The period of the gun itself is irrelevant; only the effective period of the output gliders is considered.
[...]
If you send a large number of guns, it would be helpful if they are in the "canonical form" for this collection, which means:
1) The gliders travel to the lower right.
2) The pattern is in the last phase before a glider leaves the bounding box.
3) The width is greater than or equal to the height.
4) The initial pattern should recur exactly, except for the output gliders (and optional extra cells to mark the bounding box). Do not delete any extraneous sparks, etc.
[...]
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

confocaloid wrote: December 4th, 2024, 10:54 am Why do you think so? As far as I can tell, both the p184 glider gun and the p25 glider gun above are indeed posted in the canonical phase.
In the next generation, an output glider appears and no longer interacts with anything else from that point in time. Therefore, the output glider can be safely removed from the next generation after the canonical phase. Once removed, it does not increase the bounding box.

Note that the definition only says "the last phase before a glider leaves the bounding box", but it does not require the glider to be present in that phase.
A glider can leave the bounding box of the gun in generation T+1, even if that glider was not yet present in generation T. I do not see an issue here.
For me, "glider appears crossing bounding box" and "glider leaves the bounding box" are different things.
Probably I understand English not good enough.
confocaloid wrote: December 4th, 2024, 10:54 am
Vort wrote: December 4th, 2024, 9:59 am Also, what are the reasons of having "canonical phase" to be defined in this particular way?
I thought the goal is to have glider visible in predictable place and shape.
... The goal is to have a consistent way of measuring glider guns by the bounding box area ...
I was asking about phase exactly. But I figured it out already:
With such definition, it is easy to advance gun by fullperiod ticks, clip by bounding box and get exactly the same pattern as before.
User avatar
dvgrn
Moderator
Posts: 12030
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Catagolue Discussion Thread

Post by dvgrn »

Vort wrote: December 4th, 2024, 11:35 am For me, "glider appears crossing bounding box" and "glider leaves the bounding box" are different things.
Probably I understand English not good enough.
Seems like your understanding of English is pretty good. I'd say that in conventional English, if something is "leaving a box", then that does kind of imply that it was in the box before it left.

However, we're aiming for more of a technical definition for the canonical phase here, so we're taking some minor liberties with conventional English. If everything is inside the bounding box at time T, and then a glider shows up partly outside the bounding box at time T+1, then the phase at time T is the canonical phase we're looking for (whether or not an output glider actually existed in that phase).
confocaloid wrote: December 4th, 2024, 9:32 am Additionally, there might be a glider gun whose bounding box is a square, which would mean there are two possible choices of the canonical orientation.
It might not be too painful to close that loophole --- e.g., add a canonicalization rule that specifies that glider must emerge from the south edge rather than the east edge of square bounding boxes.
confocaloid wrote: December 4th, 2024, 9:32 amThe good news is that from limited testing, the existing bugs appear to be fixed. However, the other mentioned issues remain open. Currently step 2 (removing gliders and computing the envelope) is the most expensive step, it can take ~1 minute for some guns.
Interesting! Is that because your code is removing 65536 ticks worth of gliders, one glider at a time, and checking that each removal is harmless?
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

confocaloid wrote: December 4th, 2024, 9:32 am... Currently step 2 (removing gliders and computing the envelope) is the most expensive step, it can take ~1 minute for some guns. ...
I was talking about "phase 1" because it allows to skip removal safety checks during envelope computation:
Glider appears in the same spot every N ticks and can be easily removed specifically at the right time.

I don't know to to optimally find "phase 1" however.
User avatar
confocaloid
Posts: 6697
Joined: February 8th, 2022, 3:15 pm
Location: learn to protect yourself against stray gliders and sparks and self-destruct mechanisms

Re: Catagolue Discussion Thread

Post by confocaloid »

Vort wrote: December 4th, 2024, 12:57 pm Glider appears in the same spot every N ticks and can be easily removed specifically at the right time.
I might be missing the idea, however, it can be "unsafe" to remove a glider even if a glider will later escape undamaged on the same lane with the same timing. Removal safety checks are still needed, because of cases such as one posted earlier, as well as cases such as the following (track the movement of the glider that appears in generation 418).

Code: Select all

#C [[ STOP 418 ]]

#CSYNTH gun_736 costs 12519 cells.
#C period 736 fullperiod 736 bbox 117 by 107
#CLL state-numbering golly
x = 117, y = 107, rule = LifeHistory
29.2A$29.A.A$31.A4.2A$27.4A.2A2.A2.A$27.A2.A.A.A.A.2A$29.BABABA.A$
30.B2ABA.A$31.2B.BA$30.3B$21.2A6.4B$22.A6.B2A3B$22.A.AB3.B2A3B$23.
2AB.10B$25.13B$25.14B$25.15B$27.8B2.4B$27.6B5.4B$26.9B4.4B$25.4B4.
2A5.4B$24.4B5.A7.4B$23.4B7.3A5.4B$22.4B10.A6.4B$21.4B19.4B$20.4B
21.4B$19.4B23.4B$18.4B25.4B$17.4B27.4B21.2A5.2A$16.4B29.4B18.2B2AB
3.B2A2B$15.4B31.4B17.4B5.4B$4.A9.4B33.4B16.6B.6B$4.3A6.4B35.4B15.
6B.6B$7.A4.4B37.4B16.4B.4B$6.2A3.4B8.2A29.4B14.5B.5B$6.8B8.A.A30.
4B13.5B.5B$2.2A4.5B5.2A2.A33.4B11.6B.6B$.A.BAB.5B6.A.A.2A33.4B11.
5B.5B$.A.2AB2.5B6.2A.A2.A32.4B9.2B3AB.B3A2B$2A.B.B3.5B3.3B.B2.2A
33.4B8.2BA2BA.A2BA2B$A2.2A2B2.5B3.4B39.4B7.2BA3B.3BA2B$.2A2.AB.13B
.B38.4B6.6B.6B$3.2ABA13B.B2A38.4B5.3BA2B.2BA3B$.2A2.A5BA10B2A39.4B
4.4B2A.2A4B$A2.A2.4BABA7B.2B41.4B3.6B.6B$.2A3.4BABA7B45.4B2.6B.6B$
7.4BA7B47.4B.6B.6B$9.9B3.2A44.4B.5B.5B$6.B.10B.B2.A45.9B.2BA3B$5.
2A12B3A47.10BABA2B$5.2AB.8B.BA50.8B2ABA3B$6.B3.6B4.2A49.11BA2B4.4B
3.B.9B.B3.4B$11.4B6.A49.4BA5B2A2B4.4B.9B2A3BA2B.4B$12.4B4.A51.3BAB
A4BA3B2.2A13B3ABAB2A4B2A$13.4B3.2A51.6B3A3B3.2A13B3A4BA4B2A$14.4B
28.4B3.B.9B.B3.4B2.4B3A2B5.B.15BA3BA3B.B$15.4B27.4B.4B2A11B.4B3.7B
8.16B3A4B$16.4B25.2A7BABA15B2A3.6B5.B2A.B.2AB$17.4B24.2A6B2ABA15B
2A4.6B4.3A3B3A10B3A4B$18.4B24.B.6B2A15B.B6.6B.3A7B3A7BA3BA3B.B$19.
4B25.7BA15B9.6B3A7B3A4B3A4BA4B2A$20.4B41.3B.B.3B7.5B3A7B3A4B3ABAB
2A4B2A$21.4B23.7BA10B2A3B2AB8.6B3A3B3A6B2A3BA2B.4B$22.4B20.B.6B2A
9BAB2AB2ABA2B7.6B2A.B.2AB.9B.B3.4B$23.4B18.2A6B2ABA8BA7BA3B7.6B$
24.4B17.2A7BABA8BAB2AB2ABA2B9.4B$25.4B17.4B.4B2A9B2A3B2AB10.6B$26.
4B16.4B3.B.9B.3B.B.3B9.8B$27.4B51.4B2.4B$28.4B49.4B4.4B$29.4B47.4B
6.4B$30.4B45.4B8.4B$31.4B43.4B10.4B$32.4B41.BA2B12.4B$33.4B39.2A2B
14.4B$34.4B37.2B2A16.4B$35.4B35.4B18.4B$36.4B33.4B20.4B$37.4B31.4B
22.4B$38.4B29.4B24.4B$39.4B27.4B26.4B$40.4B25.4B28.4B$41.4B23.4B
30.4B$42.4B21.4B32.4B$43.4B19.4B34.4B$44.4B6.A10.4B36.4B$45.4B5.3A
7.4B38.4B$46.4B7.A5.4B40.4B$47.4B5.2A4.4B42.4B$48.4B4.9B44.4B$49.
4B5.6B46.4B$50.4B2.8B47.4B$51.15B46.4B$52.14B47.3BA$53.13B48.ABA$
54.10B.B2A47.2A$56.3B2AB3.BA.A47.B$56.3B2AB6.A$58.4B6.2A$58.3B$55.
AB.2B$54.A.AB2AB$54.A.ABABAB$51.2A.A.A.A.A2.A$51.A2.A2.2A.4A$53.2A
4.A$59.A.A$60.2A!
127:1 B3/S234c User:Confocal/R (isotropic CA, incomplete)
Unlikely events happen.
My silence does not imply agreement, nor indifference. If I disagreed with something in the past, then please do not construe my silence as something that could change that.
User avatar
Vort
Posts: 249
Joined: May 14th, 2024, 6:35 am

Re: Catagolue Discussion Thread

Post by Vort »

confocaloid wrote: December 4th, 2024, 3:36 pm ... I might be missing the idea, however, it can be "unsafe" to remove a glider even if a glider will later escape undamaged on the same lane with the same timing. ...
What I mean is that following pattern ("phase 1") contains enough information to obtain "canonical phase" ("phase 2") quickly:

Code: Select all

x = 117, y = 107, rule = LifeHistory
29.2A$29.A.A$31.A4.2A$27.4A.2A2.A2.A$27.A2.A.A.A.A.2A$30.A.A.A.A$31.
2A.A.A$35.A2$21.2A$22.A7.2A$22.A.A5.2A$23.2A7$33.2A$33.A$34.3A$36.A5$
73.2A5.2A$73.2A5.2A2$4.A$4.3A$7.A$6.2A15.2A$22.A.A$2.2A14.2A2.A$.A2.A
13.A.A.2A$.A.2A14.2A.A2.A$2A22.2A48.A5.A$A2.2A68.3A3.3A$.2A2.A66.2A2.
A.A2.2A$3.2A.A15.2A47.A.4A.4A.A$.2A2.A5.A10.2A49.3A3.3A$A2.A6.A.A59.
3A5.3A$.2A7.A.A$11.A$21.2A$22.A$5.2A12.3A52.A5.A$5.2A12.A53.2A4.A.A$
20.2A50.A.2A2.2A.2A$21.A49.3A4.2A.2A21.4A$20.A52.A2.A11.2A14.A2.2A6.
2A$20.2A53.A3.3A6.2A15.A2.2A5.2A$80.A24.A2.A$79.A.A24.2A$45.2A8.3A14.
2A16.A3.A$45.2A8.A3.A12.2A5.E.E7.A.A.A.A10.2A$55.A4.A19.2E5.2A2.A.A2.
2A7.A2.A$56.A3.A19.E6.2A7.2A7.A2.2A5.2A$87.2A2.A.A2.2A6.A2.2A6.2A$56.
A3.A7.3A18.A.A.A.A8.4A$55.A4.A5.2A.A.2A17.A3.A$45.2A8.A3.A5.A5.2A$45.
2A8.3A8.2A.A.2A$68.3A19$54.A$54.3A$57.A$56.2A7$66.2A$59.2A5.A.A$59.2A
7.A$68.2A2$55.A$54.A.A.2A$54.A.A.A.A$51.2A.A.A.A.A2.A$51.A2.A2.2A.4A$
53.2A4.A$59.A.A$60.2A!
Just delete yellow glider and advance pattern by 735 ticks.
Result will be precise envelope of the gun, with correct bounding box.
Advance it until something tries to expand beyond bounding box and you will get "canonical phase".
Post Reply