Life tag testing

For scripts to aid with computation or simulation in cellular automata.
Locked
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

Ran into some weirdness with the Build 171 LifeViewer. When I hit "Reply" on the Slow Salvo Seeds topic, the page is going unresponsive. Chrome just makes you kill the page or wait forever, but Firefox will let you debug or stop the script that's causing the trouble:

Script: http://conwaylife.com/forums/s…rosilver ... ugin.js:56

It appears to be something on the second page of the thread, since loading that page is also causing trouble. No doubt it's something I posted... maybe it's one of the

Code: Select all

tags?

When you hit Reply, you can see posts from the second page in the message history, so I'm pretty sure the offending pattern is in there somewhere.
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:Ran into some weirdness with the Build 171 LifeViewer. When I hit "Reply" on the Slow Salvo Seeds topic, the page is going unresponsive. Chrome just makes you kill the page or wait forever, but Firefox will let you debug or stop the script that's causing the trouble:

Script: http://conwaylife.com/forums/s…rosilver ... ugin.js:56

It appears to be something on the second page of the thread, since loading that page is also causing trouble. No doubt it's something I posted... maybe it's one of the

Code: Select all

tags?

When you hit Reply, you can see posts from the second page in the message history, so I'm pretty sure the offending pattern is in there somewhere.[/quote]
The issue wasn't a pattern at all, it was the [url=http://conwaylife.com/forums/viewtopic.php?f=2&t=1675&start=25#p22897]last post[/url] on the second page which contained content that LifeViewer tried to decode and got stuck in a very large loop. I've amended the post to prevent it hanging LifeViewer by adding an initial line.
I've also fixed the bug and I'll upload a new build later today.

Thanks for reporting.
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 174 is now available on the lazyslug server

Enhancements in this build:
  • new script command [[ DELETERANGE <1..16> ]] that defines how near live cells have to be to each other to be deleted as part of a pattern (default is 3 cells)
Fixes in this build:
  • RLE decoder was not failing on some invalid patterns
    • correctly failing test case is here
  • removed support for LV85 format patterns
Nathaniel please can you upload this build since it fixes a hang on the forum under rare conditions.
User avatar
Nathaniel
Site Admin
Posts: 907
Joined: December 10th, 2008, 3:48 pm
Location: New Brunswick, Canada
Contact:

Re: Life tag testing

Post by Nathaniel »

174 is live. Thanks for the patch!
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 175 is now available on the lazyslug server

Enhancements in this build:
  • creating rule lookup table is now 5x faster
  • UI icons are now shared across all viewers
  • "Click to Control" message now uses colour animation
  • added state value to coordinate display
An example of the new coordinate display can be seen here
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Two questions:
1) Is there a canonical version of Hensel's notation available?
2) Where can I find a list of symmetries (C1, D8 etc) along with descriptions?
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Two questions:
1) Is there a canonical version of Hensel's notation available?
Alan Hensel's neighbors2 table is the one everyone seems to be trying to standardize on. There are no weird exceptions. If you see a "v" in a rule string, that's the old buggy Life32 format instead. I wouldn't recommend trying to support that format, since there are rules (not containing a "v") where you can't possibly tell whether it should be interpreted as neighbors2-format or Life32-format.

It might be nice to put up a warning message if you do see a "v" in the rule string, though.

Alternatively, nobody seems to have complained about this script making any rules incorrectly, so the list of neighborhoods at the top of the script can be taken as canonical.
rowett wrote:2) Where can I find a list of symmetries (C1, D8 etc) along with descriptions?
Let's see... pictures and descriptions, and here's a list that I think is right but haven't double-checked. You can also dig the list out of apgsearch code, I suppose.
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:
rowett wrote:Two questions:
1) Is there a canonical version of Hensel's notation available?
Alan Hensel's neighbors2 table is the one everyone seems to be trying to standardize on.
rowett wrote:2) Where can I find a list of symmetries (C1, D8 etc) along with descriptions?
Let's see... pictures and descriptions, and here's a list that I think is right but haven't double-checked. You can also dig the list out of apgsearch code, I suppose.
Excellent, thanks :)
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 176 is now available on the lazyslug server

Enhancements in this build:
  • added the ability to define or randomly generate transition maps (see my post here for details)
    • [[ MAP <map>|<threshold> ]] defines the transition map for all generations
    • [[ MAPODD <map>|<threshold> ]] defines the transition map for odd generations (in which case the MAP definition is used for even generations and must be present)
    • <map> is a base64 encoded 512 bit value
    • <threshold> is a value <0.0..1.0> representing a random threshold to generate the 512 bit value
    • note that [[ MAP ]] overwrites any rule defined in the pattern (but respects History setting)
  • scripts (without waypoint definitions) can now display a message on start [[ "This is a message" ]]
  • a notification is displayed when the cell population becomes zero
Fixes in this build:
  • the cell state value in the coordinate display now works with non-executable patterns
  • multiple [[ LOOP ]] or [[ STOP ]] script commands are now flagged as errors
  • bounding box calculation occasionally created a box with the wrong height
  • custom colours DEAD and DEADRAMP were switched
See here for the MAP test page
See here for a 4x2 grid of Viewers using different randomly generated maps (each time you refresh the browser you'll get a new set)

Dave you could use a MAP to represent any two state rule that fits into a Moore neighbourhood or a subset (i.e. Hex, Von Neumann etc.). I chose a base64 representation of the 512bit string since it reduces it to only 86 characters. For reference Conway's Life (B3/S23) becomes:

Code: Select all

ARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAIAAaIDogIAAgACAAIAAAAAAAA
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Build 176 is now available on the lazyslug server

Enhancements in this build:
  • added the ability to define or randomly generate transition maps (see my post here for details)...
Looks good! I just tried re-creating your Conway's Life MAP string by hand. Got as far as ARYX... and concluded that I probably understand it just fine. That is one monstrous big rule space. I take it that a Hensel isotropic rule string to MAP string converter is in the works?

Ran into a minor detail today, that I thought I had mentioned sometime or other in LifeViewer discussions, but now I can't find any sign of it. Mark Niemiec has a big database of glider syntheses. His RLE format is completely canonical, except that target objects can be marked with a different color, distinguished by an 'x' in the RLE instead of 'o'.

I believe some cases can be found in Mark's patterns where 'y' and 'z' are used for two other alternate colors, but that's relatively rare.

Anyway, Golly just reduces 'x', 'y', and 'z' to plain old state 1, silently and reasonably gracefully -- but it looks like LifeViewer gets a little bit confused.

I haven't done a lot of investigating, but I'm pretty sure it would work okay to convert Mark's format to display as LifeHistory in LifeViewer, with 'x' and 'y' mapped onto states 3 and 5. 'z' really needs another ON state, orange or some such bright color, which LifeHistory doesn't have. But maybe LifeViewer could support a 'z' state without too much trouble?
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:That is one monstrous big rule space. I take it that a Hensel isotropic rule string to MAP string converter is in the works?
Yes, native support for Hensel's format is in progress. In the mean time you could work out the MAP strings and it would work already :)

dvgrn wrote:Ran into a minor detail today, that I thought I had mentioned sometime or other in LifeViewer discussions, but now I can't find any sign of it. Mark Niemiec has a big database of glider syntheses. His RLE format is completely canonical, except that target objects can be marked with a different color, distinguished by an 'x' in the RLE instead of 'o'.

I believe some cases can be found in Mark's patterns where 'y' and 'z' are used for two other alternate colors, but that's relatively rare.

Anyway, Golly just reduces 'x', 'y', and 'z' to plain old state 1, silently and reasonably gracefully -- but it looks like LifeViewer gets a little bit confused.

I haven't done a lot of investigating, but I'm pretty sure it would work okay to convert Mark's format to display as LifeHistory in LifeViewer, with 'x' and 'y' mapped onto states 3 and 5. 'z' really needs another ON state, orange or some such bright color, which LifeHistory doesn't have. But maybe LifeViewer could support a 'z' state without too much trouble?
Yes this is possible. I'll reduce 'x' and 'y' to states 3 and 5 so as far as LifeViewer is concerned these will always be "History" format patterns. I'll take a look at "z" and a new state 7 (in Orange).
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

I completely rewrote the RLE decoder from the ground up. The new version should be much more resilient.
  • Pattern reader
    • Ignores x and y definitions and bases the pattern size on the actual pattern data
    • Supports Mark Niemiec's x, y and z states
  • Rule decoder
    • Supports Alan Hensel's non-totalistic rules (from neighbors2, e.g. B2ce3ai_S23)
    • Contains a library of alias names ("Conway's Life", "2x2", "Maze", "HighLife" etc.)
    • Allows "History" to be added to any valid rule or Alias name (including Hensel's) to create [R]History rules
    • Allows birth and survival rule parts to be separated by "/", "_" or without separator by using the "B" and "S" letters
    • Is case-insensitive (so "Life", "LIFE", "life", "B3/S23" and "b3/s23" are all valid)
    • The following are all valid rule specifications for Conway's Life
      • 23/3
      • 23_3
      • B3/S23
      • B3_S23
      • B3S23
      • S23/B3
      • S23_B3
      • S23B3
      • Life
      • <blank or not supplied>
      • Conway's Life
    • The following are all valid rule specifications for Conway's Life with [R]History
      • 23/3History
      • 23_3History
      • B3/S23History
      • B3_S23History
      • B3S23History
      • S23/B3History
      • S23_B3History
      • S23B3History
      • LifeHistory
      • Conway's LifeHistory
      • History
I should have a release ready by the weekend.
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:I completely rewrote the RLE decoder from the ground up. The new version should be much more resilient.
Wow! I'm a little nervous, though. Does it still allow interspersed <br> tags and so forth? I'll have to think up a long list of the most likely ways to break the new decoder.
rowett wrote:I should have a release ready by the weekend.
I'll be traveling most of next weekend, but might have a chance to try out a new build sometime next week. Looking forward to the isotropic non-totalistic rule support!

(Yes, it will really support any-old-non-totalistic rule, I know, not just the Hensel isotropic ones. But I'm afraid I'd get lost in such a big multidimensional space, even with a MAP.)
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:
rowett wrote:I completely rewrote the RLE decoder from the ground up. The new version should be much more resilient.
Wow! I'm a little nervous, though. Does it still allow interspersed <br> tags and so forth? I'll have to think up a long list of the most likely ways to break the new decoder.
Yes it should still allow the interspersed <br> and other web/forum pollution. That's all dealt with by a pre-processor that reads the code blocks before it even gets to the decoder (and hasn't changed).
I've been running through all the many tests I've created and so far so good, but would much appreciate your expertise on breaking it!
I'm also vaguely thinking about hex rule support but the rendering is a pain and from some recent forum threads it looks like without hex rendering it's of dubious value.
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Dave I discovered from the thread that the tlife rule is B3/S2-i34q and have added it to LifeViewers alias list (which means those posts would now run in LifeViewer).
Do you know of other rule names that I could also add to the alias list?
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:Dave I discovered from the thread that the tlife rule is B3/S2-i34q and have added it to LifeViewers alias list (which means those posts would now run in LifeViewer).
Do you know of other rule names that I could also add to the alias list?
Ow, yes, there are a lot of them, and I haven't been keeping track.

Example: dlife = 23/3-n, from the Close Life Variants thread. There's also alife, hlife, hlife2, hlife3 -- on and on, and often no Hensel-format equivalent so I'd have to analyze the rule table to figure out what it does, and I really don't feel like it. I wonder if it would be easier to write a script to analyze an arbitrary two-state rule table and produce an equivalent Hensel-format rule string if it has one?

What I should probably do is a quick survey of all the threads on the Other Cellular Automata board, just to see what strings show up most often after ', rule = '. Some of the most popular rules would be nice to have LifeViewer support for, but offhand I don't know which those are (besides tlife).
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

dvgrn wrote:Ow, yes, there are a lot of them, and I haven't been keeping track.

What I should probably do is a quick survey of all the threads on the Other Cellular Automata board, just to see what strings show up most often after ', rule = '. Some of the most popular rules would be nice to have LifeViewer support for, but offhand I don't know which those are (besides tlife).
And is there a process by which one decides which rules should be canonical? What's to stop two different posters both generating a rule called "tlife" with different rule definition?
User avatar
dvgrn
Moderator
Posts: 12047
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Life tag testing

Post by dvgrn »

rowett wrote:And is there a process by which one decides which rules should be canonical? What's to stop two different posters both generating a rule called "tlife" with different rule definition?
I guess the process is natural selection, more or less. People tend to avoid doing that because it causes patterns to mysteriously not work in ugly and boring ways -- and everybody can edit their own postings on the forums, so even if someone makes a mistake and re-uses a name, it's always possible to fix the problem later.

Multiple-rules-same-name has happened occasionally with some of the Shapeloop rules, and it's very annoying and hard to figure out sometimes. Mostly it means I stop paying attention to the thread where it happens, and let someone else sort it out.

I don't think it has happened very often for isotropic non-totalistic rules, though, and that's mostly what we want to handle here, not the complicated multistate ones. I think my suggestion is that you should put up a quick post on Close Life Variants, and just say that anyone who wants their favorite named rule to be supported in LifeViewer, should supply you with the name and the equivalent Hensel-format string.

I bet you'll get a lot of good information that way -- and if a few people say "hlife3, but I don't know what that is in Hensel neighbors2 format", well, that will be easy enough for me or you or somebody else to figure out case-by-case.
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 177 is now available on the lazyslug server

Enhancements in this build:
  • added support for Alan Hensel's isotropic non-totalistic rule format - test
  • added support for Mark Niemiec's x, y and z states (pending state 7 completion) - test
  • added support for Hex neighbourhoods (currently only ANGLE=0 display) - test
    • hotkey "/" will toggle hex display (note this does not change the rule)
  • added alias list to help information
Fixes in this build:
  • there is now no limit to the pattern size that can be deleted when it hits the large grid boundary - test
  • moving the mouse within a Viewer without focus will also trigger the "Click to control" message
    • previously this was only triggered when moving the mouse onto the Viewer
Known issues:
  • the x coordinate cell display does not yet work correctly with Hex rules
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

On a related note I haven't yet thought about B0 fun for both Hensel and hex neighbourhoods, or for MAP come to think of it (other than Random MAP ensures the first entry is always a 0).

Has some bright soul already figured out the translations (like the mapping Andrew pointed me at for the totalistic rules)? If I can avoid using any CPU cycles in my brain it would be appreciated :)
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

LifeViewer rule format notes.

LifeViewer expects a rule in the following format:
(<alias>|<rule>)[<history>][<bounded-grid>]

<alias> is a table converting arbitrary strings to valid <rule> names

<rule> is a rule in totalistic Moore, totalistic Hex (postfixed with "H"), or Hensel's Neighbours2 format

<history> is the string "History"

<bounded grid> is a bounded grid definition prefixed with ":"

Rule parsing:
  • If there is a <bounded-grid> definition at the end of the rule string it is processed then removed from the rule string
  • If there is a <history> definition at the end of the rule string it is processed and then removed
  • The remaining rule string is tested to see if it is an alias and if so replaced with the alias definition
  • If there is a <neighbourhood> definition at the end of the string it is processed and then removed
  • The remaining rule string is decoded with the birth/survival parser
Notes:
  • rules and aliases are case insensitive
  • whitespace is ignored
  • the parser is strict and invalid characters cause the rule to be invalid
  • LifeViewer reads but does not execute patterns containing bounded grid definitions
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 178 is now available on the lazyslug server

Enhancements in this build:
  • new script command [[ HEXDISPLAY ]] to switch on hex display (used for unsupported rule patterns you want to show as hex)
Fixes in this build:
  • x coordinate display for hex rules now works correctly
  • better whitespace handling for rule decoding
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Next on my list is Bounded Grids. Is this the canonical definition?

Implemented so far:
  • Plane (finite width and height only)
  • Tube (bit of a hack)
  • Torus including shift
  • Klein-bottle including shift
  • Cross-surface
  • Sphere
A thin grey border is drawn around the bounded grid.
Fit view snaps to the bounded grid.

See here for the prototype.
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Build 179 is now available on the lazyslug server

Enhancements in this build: Fixes in this build:
  • tile counts were only being updated every even generation in help information
User avatar
rowett
Moderator
Posts: 4596
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: Life tag testing

Post by rowett »

Currently working on Generations support (with/without bounded grids and Hensel's neighbours2) and some Hex notations: Gwylim's and Callahan's.
And yes I know Generations sounds like it's not 2 state but it is really :)
Locked