lifeviewer bug

Has something gone haywire? Let us know about it!
Post Reply
User avatar
pzq_alex
Posts: 792
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: lifeviewer bug

Post by pzq_alex » May 22nd, 2022, 9:36 am

On my mobile, zooming on levels between -1.0 and -1.6 causes patterns to look weird, sort of like some blinking dots.

Edit: only in LifeSuper for some reason.

Sample screenshot:
86E82270-EB32-4861-A63E-2CC877556778.jpeg
86E82270-EB32-4861-A63E-2CC877556778.jpeg (222.01 KiB) Viewed 1132 times
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » May 22nd, 2022, 10:41 am

pzq_alex wrote:
May 22nd, 2022, 9:36 am
On my mobile, zooming on levels between -1.0 and -1.6 causes patterns to look weird, sort of like some blinking dots.

Edit: only in LifeSuper for some reason.
It's because I haven't written a LifeSuper specific sub-sample renderer yet.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » May 23rd, 2022, 3:48 pm

rowett wrote:
May 22nd, 2022, 10:41 am
pzq_alex wrote:
May 22nd, 2022, 9:36 am
On my mobile, zooming on levels between -1.0 and -1.6 causes patterns to look weird, sort of like some blinking dots.

Edit: only in LifeSuper for some reason.
It's because I haven't written a LifeSuper specific sub-sample renderer yet.
The renderer has been implemented in build 715.

User avatar
pzq_alex
Posts: 792
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: lifeviewer bug

Post by pzq_alex » May 24th, 2022, 3:56 am

Code: Select all

x = 1, y = 1, rule = B3/S23:T10
o!
New bug: identifying this sets the zoom to -1.1.
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » May 25th, 2022, 4:57 pm

pzq_alex wrote:
May 24th, 2022, 3:56 am
New bug: identifying this sets the zoom to -1.1.
Fixed, thanks!

User avatar
breaker's glider gun
Posts: 670
Joined: May 23rd, 2021, 10:26 am
Location: the inside of a stuffed anaconda or maybe [click to not expand]

Re: lifeviewer bug

Post by breaker's glider gun » June 4th, 2022, 10:24 am

Code: Select all

x = 5, y = 20, rule = TripleB3S23
B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A
.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D!
copy, paste one up to extend, repeat (without the copy,)repeat, repeat, ect until it looks like this:

Code: Select all

x = 5, y = 26, rule = TripleB3S23
B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A
.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$
B.A.D$B.A.D$B.A.D!
then run and see the asymmetry!
ugh. I have irreproducible bugs again and again with those lines, but it ALWAYS fails when I try to reproduce it!
EDIT: new bug! Select all, ctrl+space, enter, ctrl+z, and poof! it's not there! (ctrl+z again to get it back)

Code: Select all

x = 5, y = 20, rule = TripleB3S23
B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A
.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D!
:?: :?: . . . :!:
Give me a suggestion of something to draw here!

User avatar
breaker's glider gun
Posts: 670
Joined: May 23rd, 2021, 10:26 am
Location: the inside of a stuffed anaconda or maybe [click to not expand]

Re: lifeviewer bug

Post by breaker's glider gun » June 9th, 2022, 1:12 pm

a post on LTL wrote:
go to the post, show in viewer, and try to run it. it won't work. Then open the next post's thing, and it will be 1 step in.

I reproduced the bug.
:?: :?: . . . :!:
Give me a suggestion of something to draw here!

User avatar
pzq_alex
Posts: 792
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: lifeviewer bug

Post by pzq_alex » June 13th, 2022, 9:15 pm

Create a new pattern in any generation rule with number of states = 201. Draw a dot in state 1. Let it run for some time, and hit reset. The dot will now be in state 56.
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 14th, 2022, 3:31 pm

breaker's glider gun wrote:
June 9th, 2022, 1:12 pm
a post on LTL wrote:
go to the post, show in viewer, and try to run it. it won't work. Then open the next post's thing, and it will be 1 step in.
Fixed, thanks for reporting!

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 14th, 2022, 3:31 pm

pzq_alex wrote:
June 13th, 2022, 9:15 pm
Create a new pattern in any generation rule with number of states = 201. Draw a dot in state 1. Let it run for some time, and hit reset. The dot will now be in state 56.
Fixed, thanks for reporting!

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 14th, 2022, 3:37 pm

breaker's glider gun wrote:
June 4th, 2022, 10:24 am
new bug! Select all, ctrl+space, enter, ctrl+z, and poof! it's not there! (ctrl+z again to get it back)

Code: Select all

x = 5, y = 20, rule = TripleB3S23
B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A
.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D$B.A.D!
The Undo system will not restart Advance Selection. The first Ctrl-Z in undoing the Paste. The second Ctrl-Z is undoing the Cut that happens when you first start Advance Selection.

User avatar
wirehead
Posts: 245
Joined: June 18th, 2022, 2:37 pm
Location: Under a thinking cap
Contact:

Re: lifeviewer bug

Post by wirehead » June 19th, 2022, 1:44 pm

LifeViewer requests custom .rule files at "/wiki/Rule:{}" (replacing {} with the rule name). That works great here on conwaylife.com, but on other websites where LifeViewer is embedded-- such as my blog -- it fails, because the origin is no longer conwaylife.com. CORS issues aside, is there a way to change the URL template that LifeViewer requests rule files at so I won't have to create a dumb "wiki" repository to put the rules at?
Langton's ant: Can't play the drums, can be taught.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 19th, 2022, 3:50 pm

wirehead wrote:
June 19th, 2022, 1:44 pm
LifeViewer requests custom .rule files at "/wiki/Rule:{}" (replacing {} with the rule name). That works great here on conwaylife.com, but on other websites where LifeViewer is embedded-- such as my blog -- it fails, because the origin is no longer conwaylife.com. CORS issues aside, is there a way to change the URL template that LifeViewer requests rule files at so I won't have to create a dumb "wiki" repository to put the rules at?
I believe calcyman does something smart with redirects on his website.

On lazyslug.com I actually take a copy so I can add @TREE sections to rules that don't have them since LifeViewer is so much faster at running @TREE rules than @TABLE rules (for example Blah's Mona Lisa). I have a script that automates this process if you're interested.

Another option is to append the @RULE definition to the RLE text. LifeViewer will look there for a rule if it can't find one anywhere else.

User avatar
wirehead
Posts: 245
Joined: June 18th, 2022, 2:37 pm
Location: Under a thinking cap
Contact:

Re: lifeviewer bug

Post by wirehead » June 19th, 2022, 8:16 pm

rowett wrote:
June 19th, 2022, 3:50 pm
On lazyslug.com I actually take a copy so I can add @TREE sections to rules that don't have them since LifeViewer is so much faster at running @TREE rules than @TABLE rules (for example Blah's Mona Lisa). I have a script that automates this process if you're interested.
Huh. I didn't think Lifeviewer ran @TABLE rules slower than @TREE ones. I thought it just loaded slower because it had to take the time to compile the @TABLE into a @TREE. TREE's obviously run fast because they are literally just nine table lookups once you load it into memory. Is that script part of LifeViewer already? I can help port make-ruletree.py to Javascript if you want.
rowett wrote:
June 19th, 2022, 3:50 pm
Another option is to append the @RULE definition to the RLE text. LifeViewer will look there for a rule if it can't find one anywhere else.
I can't do that because I use GitHub Pages and the Actions runner doesn't have access to my ~/.golly/Rules folder.

EDIT: I took a look at the Lifeviewer code, and where it generates the URL for the rule, it uses hard-coded constants (i.e. the aforementioned "/wiki/Rule:"). Couldn't you abstract this out into another configuration parameter in the Lifeviewer <meta> tag, so that someone who wants to use LifeViewer not on conwaylife.com (me!!!) doesn't have to match conwaylife.com's URL structure exactly?
LV_code_loc.png
LV_code_loc.png (136.92 KiB) Viewed 884 times
Langton's ant: Can't play the drums, can be taught.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 20th, 2022, 1:09 am

wirehead wrote:
June 19th, 2022, 8:16 pm
Huh. I didn't think Lifeviewer ran @TABLE rules slower than @TREE ones. I thought it just loaded slower because it had to take the time to compile the @TABLE into a @TREE.
Both Golly and LifeViewer have native implementations for the @TABLE algo.
wirehead wrote:
June 19th, 2022, 8:16 pm
TREE's obviously run fast because they are literally just nine table lookups once you load it into memory. Is that script part of LifeViewer already? I can help port make-ruletree.py to Javascript if you want.
Converting @TABLE to @TREE is trivial - implementations in Python and C++ exist in Golly. However many rules exist that take significant runtime (many minutes) and memory (multiple Gb) to convert. So it would not be possible to do this dynamically on rule load.
wirehead wrote:
June 19th, 2022, 8:16 pm
I took a look at the Lifeviewer code, and where it generates the URL for the rule, it uses hard-coded constants (i.e. the aforementioned "/wiki/Rule:"). Couldn't you abstract this out into another configuration parameter in the Lifeviewer <meta> tag, so that someone who wants to use LifeViewer not on conwaylife.com (me!!!) doesn't have to match conwaylife.com's URL structure exactly?
LV_code_loc.png
That's just the default. You can override it with the <meta> tag already. For example on the forums the following definition is used:
<meta name="LifeViewer" content="/wiki/Rule: ?action=raw">

The URL is built by concatentating the part beginning with /, the rule name, and an optional part beginning with ? or .

For the rule BlahMonaLisa2 you get: /wiki/Rule:BlahMonaLisa2?action=raw

On lazyslug.com the definition is <meta name="LifeViewer" content="/rules/ .rule> so you get /rules/BlahMonaLisa2.rule

User avatar
wirehead
Posts: 245
Joined: June 18th, 2022, 2:37 pm
Location: Under a thinking cap
Contact:

Re: lifeviewer bug

Post by wirehead » June 20th, 2022, 8:22 am

rowett wrote:
June 20th, 2022, 1:09 am
On lazyslug.com the definition is <meta name="LifeViewer" content="/rules/ .rule> so you get /rules/BlahMonaLisa2.rule
Well, where do I put the "lifeviewer textarea" to tell LV what class to look for and which element contains the pattern?

You might also want to edit the Tutorials/LifeViewer JavaScript plug-in page because this isn't documented there.
Langton's ant: Can't play the drums, can be taught.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 20th, 2022, 11:52 am

wirehead wrote:
June 20th, 2022, 8:22 am
Well, where do I put the "lifeviewer textarea" to tell LV what class to look for and which element contains the pattern?
See here for the original documentation on this topic. It doesn't include the newer repository settings mentioned above. To answer your question specifically just put them at the beginning of the content:
<meta name="LifeViewer" content="viewer textarea /wiki/Rule: ?action=raw">

There's actually a ton of "documentation" in that thread that I haven't had time to consolidate. I did some initial documentation on LifeWiki on the LifeViewer page (which was mostly a dump of LifeViewer's built-in Help) but there's a lot more to do. Very happy to answer any questions if anyone wants to help.
wirehead wrote:
June 20th, 2022, 8:22 am
You might also want to edit the Tutorials/LifeViewer JavaScript plug-in page because this isn't documented there.
Some kind soul wrote the tutorial. Feel free to update it if you get time!

Book
Posts: 385
Joined: August 28th, 2021, 2:38 pm
Location: California
Contact:

Re: lifeviewer bug

Post by Book » June 20th, 2022, 1:01 pm

Some kind soul wrote the tutorial. Feel free to update it if you get time!
The kind soul suggests a second tutorial on "advanced topics"--to be written by yet another kind soul, I hope.
Phil Bookman

User avatar
wirehead
Posts: 245
Joined: June 18th, 2022, 2:37 pm
Location: Under a thinking cap
Contact:

Re: lifeviewer bug

Post by wirehead » June 20th, 2022, 1:46 pm

rowett wrote:
June 20th, 2022, 11:52 am
Some kind soul wrote the tutorial. Feel free to update it if you get time!
I don't have a LifeWiki account, sorry.
Langton's ant: Can't play the drums, can be taught.

User avatar
wirehead
Posts: 245
Joined: June 18th, 2022, 2:37 pm
Location: Under a thinking cap
Contact:

Re: lifeviewer bug

Post by wirehead » June 20th, 2022, 4:45 pm

rowett wrote:
June 20th, 2022, 1:09 am
Both Golly and LifeViewer have native implementations for the @TABLE algo.
I know that, I just don't understand why Lifeviewer doesn't compile the rule into a faster format especially since it doesn't use Hashlife.

I found a really great explanation of Hashlife in Python here. Fabian Hemmer also has a Hashlife implementation in Javascript here but it's a little messy IMO and there aren't enough comments for me to understand what's going on. But I can still probably help with that.
rowett wrote:
June 20th, 2022, 1:09 am
Converting @TABLE to @TREE is trivial - implementations in Python and C++ exist in Golly. However many rules exist that take significant runtime (many minutes) and memory (multiple Gb) to convert. So it would not be possible to do this dynamically on rule load.
I figured that. On my test page and testing it with Dean Hickerson's Rule:3n+1 it took about 30 seconds on my Raspberry Pi 4B -- enough to trigger the annoying "This page is not responding" box. Of course, that's trying to convert it all at once.

But the great part about modern Javascript is that you can literally cause code to hang with a Promise and the browser won't care, and then it will pick right up where it left off when you resolve the promise. My idea is that you start up a conversion thread like my program above, but have it hang when it calls the function to look up the transition from the table. The conversion thread would push "requests" into a queue which would be monitored by the generation-advance thread (which already has been written) which, each generation, resolves all the requests that were also computed in the process of computing the next generation as well as 10 more that weren't computed. (10 is arbitrary). Eventually all the transitions would be hit, either by the pattern, or by the "10 extra", and boom, you have a table. This way it only bothers to convert if the user runs the pattern for long enough and there's really a need to be fast. I hope I explained this clear enough.

EDIT: whoops, sorry for double posting.

EDIT 2: I fixed the algorithm so that it actually produces the correct tree and now it takes 68 seconds (5 times "this page is not responding"). The code first converts the transitions into the NONE symmetry, which takes 66 seconds. Then converting those expanded transition function into a tree takes ~2 seconds. Weird. What does your implementation if the @TABLE algo look like? Maybe if I use your code it will be faster.
Langton's ant: Can't play the drums, can be taught.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 26th, 2022, 9:23 am

wirehead wrote:
June 20th, 2022, 4:45 pm
I just don't understand why Lifeviewer doesn't compile the rule into a faster format
Because it's easy to add the @TREE to the rule file.

User avatar
wirehead
Posts: 245
Joined: June 18th, 2022, 2:37 pm
Location: Under a thinking cap
Contact:

Re: lifeviewer bug

Post by wirehead » June 26th, 2022, 9:54 am

rowett wrote:
June 26th, 2022, 9:23 am
wirehead wrote:
June 20th, 2022, 4:45 pm
I just don't understand why Lifeviewer doesn't compile the rule into a faster format
Because it's easy to add the @TREE to the rule file.
I know, but not everyone has done that, and as a consequence some rules are a lot slower than others because they just have the TABLE section. Given that LifeViewer doesn't use Hashlife, why can't LifeViewer recompile it on the fly so all rules are equally fast? Or, at the very least, why hasn't someone written a wiki script that automatically adds TREE sections to all pages in the Rule: namespace that don't already have them? I'm not trying to argue, I just think it's a good question.
Langton's ant: Can't play the drums, can be taught.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: lifeviewer bug

Post by rowett » June 26th, 2022, 10:27 am

wirehead wrote:
June 26th, 2022, 9:54 am
why hasn't someone written a wiki script that automatically adds TREE sections to all pages in the Rule: namespace that don't already have them?
Probably because no one has asked before. As I said here I have a bash script that does this (in conjunction with Golly's RuleTableToTree command line application). I run it periodically to get the latest Rule namespace from LifeWiki, add any missing @TREE sections, and copy it to my website.

User avatar
breaker's glider gun
Posts: 670
Joined: May 23rd, 2021, 10:26 am
Location: the inside of a stuffed anaconda or maybe [click to not expand]

Re: lifeviewer bug

Post by breaker's glider gun » June 27th, 2022, 12:27 pm

breaker's glider gun wrote:
June 9th, 2022, 1:12 pm
a post on LTL wrote:
go to the post, show in viewer, and try to run it. it won't work. Then open the next post's thing, and it will be 1 step in.

I reproduced the bug.
this post wrote: GLORIOUS SNIP
show in viewer the signature and try to run it. it won't work. Then open the post's thingy, and it will be 1 generation in.
EDIT: could not reproduce.
:?: :?: . . . :!:
Give me a suggestion of something to draw here!

User avatar
pzq_alex
Posts: 792
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: lifeviewer bug

Post by pzq_alex » June 28th, 2022, 8:17 am

The LifeViewer in viewtopic.php?p=86546#p86532 failed to load, presumably because the preceding ruletable has no actual @RULE line (just the header), or the rule name starts with W.

Edit: heck, thath was my 400th post
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

Post Reply