simon-git: tilings (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Jun 27 23:32:48 BST 2024
TL;DR:
41d79b0 Fix crash when printing an error message in --check.
70856c7 Make --check into a function that returns true/false.
6d893a4 Add checking to the self-test mode.
df5aec1 New tiling description: the H7/H8 system for Spectres.
d452a4e Handle spectre-h7h8's spurs in checking and recursion.
59da08d Add the hat H7/H8 system, to go with the spectre one.
b8005c0 Add missing __str__ method on RecursiveAddress.
5249a34 Add --inextensible mode for patch-drawing.
1d0edf4 Use integer state indices for adjmatcher.
6b061d5 Store diagnostic paths in the adjmatcher.
Repository: https://git.tartarus.org/simon/tilings.git
On the web: https://git.tartarus.org/?p=simon/tilings.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2024-06-27 23:32:48
commit 41d79b021fe3a504d468329eeea71ad1738ae80e
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=41d79b021fe3a504d468329eeea71ad1738ae80e;hp=e48b770da1f72e3e7d6b10039f6aa90cbfc70c88
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jun 22 09:58:46 2024 +0100
Fix crash when printing an error message in --check.
I made a type-o. But as long as the checks _pass_, that error message
isn't printed, so I only just noticed it!
toplevel.sage | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 70856c716d1bdba7d8721d6398b916db5966bb8f
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=70856c716d1bdba7d8721d6398b916db5966bb8f;hp=41d79b021fe3a504d468329eeea71ad1738ae80e
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Jun 23 09:01:48 2024 +0100
Make --check into a function that returns true/false.
That way I can call it in the middle of the test mode.
toplevel.sage | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
commit 6d893a4b4fc67a97586c4923136d03318c6d6560
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=6d893a4b4fc67a97586c4923136d03318c6d6560;hp=70856c716d1bdba7d8721d6398b916db5966bb8f
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Jun 23 09:02:28 2024 +0100
Add checking to the self-test mode.
Now we run the --check checks over everything in the collection, as a
regression test of the checks themselves.
I've also added the two 'whole tile' Penrose tilings to the test
collection, by allowing tests to list a .tl file that _only_ passes
the validity checks and can't even build an adjacency matcher.
toplevel.sage | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
commit df5aec16c9cbdf2f7bb645eb63ff1623a8212972
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=df5aec16c9cbdf2f7bb645eb63ff1623a8212972;hp=6d893a4b4fc67a97586c4923136d03318c6d6560
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Jun 23 09:03:18 2024 +0100
New tiling description: the H7/H8 system for Spectres.
A thread on Mastodon this week caused me to learn the answer to the
hard part, namely how to map the edges of a single Spectre or Mystic
to those H7 and H8 patches shown in figure 2.1 of the Spectre paper.
The result is difficult to use, though. Both tile expansions have an
exceptionally long exterior spur - so long that it's capable of
completely separating the expansions of two other tiles, defeating my
current spur compensation system of sliding along the expansion edge
to a different pair of meeting edges. Additionally, the Mystic
expansion has an _internal_ spur, which I've never seen before, and if
that wasn't enough, it also has a spur running _along_ its boundary,
in the sense that the same three edges of the boundary are traversed
forwards, then backwards, then forwards again, by successive parts of
the expanded outline.
I hope to make this system cope with it in future, but writing it down
at all is a starting point.
spectre-h7h8.tl | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 145 insertions(+)
commit d452a4e0aec61d9202216291aa71ab5005df3090
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=d452a4e0aec61d9202216291aa71ab5005df3090;hp=df5aec16c9cbdf2f7bb645eb63ff1623a8212972
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Jun 23 09:08:31 2024 +0100
Handle spectre-h7h8's spurs in checking and recursion.
This tiling description has multiple cases where two pairs of edges
have the same pair of endpoints. The H7 patch has an _internal_ spur,
which would be easy to ignore except for the fact that one of its
edges happens to exactly coincide with a sensible internal edge
between two subtiles. And it has another spur coincident with part of
the patch boundary, so that 'ext' edges run forwards, then backwards,
then forwards along that boundary.
This commit loosens the validity checking to permit multiple edge
pairs to exist. The remaining constraint is just that between any pair
of endpoints there should be the same number of edges in both
directions.
To handle this situation in the neighbour tables used by the recursive
algorithm, I've done the simplest thing possible: just matched up the
edge pairs arbitrarily. So any instance of RecursiveAddress._recurse()
which tries to transit such a double edge will pick an arbitrary one
of the edges on the other side to transition out of.
In the case of crossing the internal H7 edge that's also part of an
internal spur, nothing should happen, because the neighbour table
pairs up the edges in sorted order. However, even if I hadn't done
that, it _should_ still be fine, on the theory that that spur must be
matched by an external spur of a neighbouring patch. So if the
algorithm tried to exit the supertile by a superedge that was part of
the internal spur, it would enter some other supertile via a superedge
that turned out to be on an _external_ spur; find the superedge on the
other side connected connected to the same supertile it had just come
from; turn round and go back again, re-entering the internal spur via
the other coincident edge pair, and after a detour, end up back in the
interior of the original supertile. The way I've _actually_ done it,
that will happen one step sooner, but I think it would have worked
either way.
Similarly, if you try to transition into or out of the patch boundary
by the 'wrong' edge, you'll do another recursive detour, cross the
spur, and eventually end up back where you should be.
This isn't the fastest way to do it. Probably I could do better by
making the two external edges explicit aliases of each other. But the
main aim of the recursive algorithm in this code is to be written as
simply as possible, so as to act as a cross-check on the more
elaborate finite state machine algorithms. So I'm not trying to
optimise it.
analysis.sage | 7 ++++++-
toplevel.sage | 16 ++++++++++------
2 files changed, 16 insertions(+), 7 deletions(-)
commit 59da08de54d7b62a31cdc8788d8429c3c5887e6e
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=59da08de54d7b62a31cdc8788d8429c3c5887e6e;hp=d452a4e0aec61d9202216291aa71ab5005df3090
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Jun 23 15:10:21 2024 +0100
Add the hat H7/H8 system, to go with the spectre one.
Thanks to Pieter Mostert for giving me the necessary clues to figure
out the edge mapping. I've been struggling with that for months and
getting nowhere.
hats-h7h8.tl | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
toplevel.sage | 1 +
2 files changed, 125 insertions(+)
commit b8005c0577b2e529191db2d839e1fe4693e774c7
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=b8005c0577b2e529191db2d839e1fe4693e774c7;hp=59da08de54d7b62a31cdc8788d8429c3c5887e6e
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jun 27 08:03:36 2024 +0100
Add missing __str__ method on RecursiveAddress.
Now that --patch is annotating its output SVGs with the coordinates of
each tile, we need the coordinates to be legible, no matter which
system produced them.
recursive.sage | 4 ++++
1 file changed, 4 insertions(+)
commit 5249a34817d4ec2884112496d06c7c8b8e774e59
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=5249a34817d4ec2884112496d06c7c8b8e774e59;hp=b8005c0577b2e529191db2d839e1fe4693e774c7
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jun 27 08:04:21 2024 +0100
Add --inextensible mode for patch-drawing.
While trying to track down the coordinates of an elusive hat pattern
yesterday I wanted to test-draw some possible prefixes of the
coordinate string, to see whether each one was consistent with what I
was trying to end up at. I didn't yet know what would come next in the
coordinate string, and didn't want the diagram cluttered with
guesswork, either mine or the software's.
toplevel.sage | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
commit 1d0edf4521e46e3ff85268749ff1c51940a5607e
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=1d0edf4521e46e3ff85268749ff1c51940a5607e;hp=5249a34817d4ec2884112496d06c7c8b8e774e59
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jun 27 08:19:45 2024 +0100
Use integer state indices for adjmatcher.
I'm finally tired of having to use those horrible Python repr() dumps
as state identifiers. Chasing through the state machine in 'less' is
terribly annoying because you keep having to disable regex search to
get those strings accepted, and also I have to widen my window to even
copy-paste them. So now we do a more normal thing for state machines:
assign each state an integer index, and keep the long descriptions
only for actually computing things about the states. Maybe this will
make transducer construction faster too.
While I was at it, I arranged that adjacency recognisers can be
nondeterministic state machines if they need to. I've never needed
that yet, but I've had at least one thought in the past that made me
worry it _might_ be needed. So now the groundwork is laid, just in
case.
finder.sage | 2 +-
toplevel.sage | 5 ++-
transducer.sage | 111 +++++++++++++++++++++++++++++---------------------------
3 files changed, 62 insertions(+), 56 deletions(-)
commit 6b061d5bb3b12080dc0c643de08a57b771f8bbe0
web diff https://git.tartarus.org/?p=simon/tilings.git;a=commitdiff;h=6b061d5bb3b12080dc0c643de08a57b771f8bbe0;hp=1d0edf4521e46e3ff85268749ff1c51940a5607e
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jun 27 17:25:48 2024 +0100
Store diagnostic paths in the adjmatcher.
When I'm trying to debug an adjacency matcher and find an
incomprehensible state, I often want to know: how did we even get
_into_ this state? What path will reach it from the start state?
Another question is: why is this state _still_ in the machine after
winnowing? Surely it's so broken you can't reach an accepting state
from here?
So now both of those questions are answered by the --adjmatcher
diagnostic dump. The initial matcher construction will remember an
example path from START to each state, and print it as part of the
diagnostics. And as long as you didn't say --no-winnow, the winnowing
step - which already traces back from the accepting states to
everything it's keeping - now records a path justifying why it kept
any given state.
toplevel.sage | 6 ++++++
transducer.sage | 41 +++++++++++++++++++++++++++++------------
2 files changed, 35 insertions(+), 12 deletions(-)
More information about the tartarus-commits
mailing list