Congratulations!

[Valid Atom 1.0] This is a valid Atom 1.0 feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://www.tbray.org/ongoing/ongoing.atom

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <feed xmlns='http://www.w3.org/2005/Atom'
  3.      xmlns:thr='http://purl.org/syndication/thread/1.0'
  4.      xml:lang='en-us'>
  5. <title>ongoing by Tim Bray</title>
  6. <link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  7. <id>https://www.tbray.org/ongoing/</id>
  8. <link href='https://www.tbray.org/ongoing/' />
  9. <link rel='self' href='https://www.tbray.org/ongoing/ongoing.atom' />
  10. <link rel='replies'       thr:count='101'       href='https://www.tbray.org/ongoing/comments.atom' />
  11. <logo>rsslogo.jpg</logo>
  12. <icon>/favicon.ico</icon>
  13. <updated>2025-08-30T12:59:15-07:00</updated>
  14. <author><name>Tim Bray</name></author>
  15. <subtitle>ongoing fragmented essay by Tim Bray</subtitle>
  16. <rights>All content written by Tim Bray and photos by Tim Bray Copyright Tim Bray, some rights reserved, see /ongoing/misc/Copyright</rights>
  17. <generator uri='/misc/Colophon'>Generated from XML source code using Perl, Expat, Emacs, Mysql, Ruby, and ImageMagick. Industrial-strength technology, baby.</generator>
  18.  
  19. <entry>
  20. <title>Maritime Birds and Bees</title>
  21. <link href='https://www.tbray.org/ongoing/When/202x/2025/08/30/Maritime-Wildlife' />
  22. <link rel='replies'        thr:count='0'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/08/30/Maritime-Wildlife#comments' />
  23. <id>https://www.tbray.org/ongoing/When/202x/2025/08/30/Maritime-Wildlife</id>
  24. <published>2025-08-30T12:00:00-07:00</published>
  25. <updated>2025-08-30T12:59:04-07:00</updated>
  26. <category scheme='https://www.tbray.org/ongoing/What/' term='The World/Places/Maritimes' />
  27. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  28. <category scheme='https://www.tbray.org/ongoing/What/' term='Places' />
  29. <category scheme='https://www.tbray.org/ongoing/What/' term='Maritimes' />
  30. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Nova Scotia and New Brunswick each have plenty of wilderness; PEI not so much. So pictures of bears and cougars and so on     would be plausible, as would marine mammals. But no. Herewith, from our     <a href='/ongoing/When/202x/2025/08/27/Maritime-Vacation'>recent vacation</a>, birds and bees, with a little     lens-geek side trip</div></summary>
  31. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  32.    <p>Nova Scotia and New Brunswick each have plenty of wilderness; PEI not so much. So pictures of bears and cougars and so on
  33.    would be plausible, as would marine mammals. But no. Herewith, from our
  34.    <a href="/ongoing/When/202x/2025/08/27/Maritime-Vacation">recent vacation</a>, birds and bees, with a little
  35.    lens-geek side trip.</p>
  36.    <h2 id='p-1'>Birds</h2>
  37.    <p>Having touristed around Charlottetown, we drove down a series of smaller and smaller back roads and ended up
  38.    at Canceaux Cove near Rocky Point, which I thought might present a nice vista of the city. It did, but the city looks boring.
  39.    By way of consolation, there were these cute little birds running around on the beach and then flying loops in formation over the
  40.    water.</p>
  41.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT55982.png" alt="Small birds on a beach" />
  42.    <div class='caption'><p>Pretty sure these are
  43.    <a href="https://en.wikipedia.org/wiki/Semipalmated_plover">Semipalmated plovers</a>.</p></div>
  44.    <p>I wanted to get a picture of them in the air so I sauntered down the beach, assuming
  45.    they’d fly away picturesquely. They studiously ignored me and eventually I had to jump and down and wave my arms and even then
  46.    they took off grudgingly.</p>
  47.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT55984.png" alt="small birds flying over the ocean" />
  48.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT55987.png" alt="small birds flying over the ocean" />
  49.    <p>They were graceful and did this mysterious thing that birds can do, staying in formation with no obvious leader.
  50.    I’ve had the pleasure, very occasionally, of being in engineering teams like that.</p>
  51.    <h2 id='p-2'>Bees</h2>
  52.    <p>We went to
  53.    <a href="https://en.wikipedia.org/wiki/Annapolis_Royal">Annapolis Royal</a> because of its
  54.    <a href="https://historicgardens.wordpress.com">Historic Gardens</a> and wow, what a treat. I think even those who don’t see
  55.    themselves as garden fans would enjoy an hour or more sauntering around in there.  I like taking pictures of flowers and a lot
  56.    of these flowers had bees in them.</p>
  57.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56034-2.png" alt="Three orange flowers, one with bee" />
  58.    <p>This one was cute enough to reward a close-up.</p>
  59.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56034.png" alt="Close-up of bee in orange flower." />
  60.    <div class='caption'><p>Aren’t her wings cute?</p></div>
  61.    <p>And I ask, what could be better than a cute bee in a pretty flower? Obviously, <em>two</em> bees.</p>
  62.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56040.png" alt="Two bees in an orange flower" />
  63.    <p>And again, a closer look.</p>
  64.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56040-2.png" alt="Two bees in an orange flower, close-up" />
  65.    <p>Bees are admirable creatures and I don’t want to make fun of them, but this surprised-looking little citizen makes me
  66.    laugh. (She’s just navigating from one blossom to the next.)</p>
  67.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56045.png" alt="bee caught in flight among the blossoms" />
  68.    <h2 id='p-3'>Lens</h2>
  69.    <p>All of these are shot with Fujifilm’s
  70.    <a href="https://www.fujifilm-x.com/en-ca/products/lenses/xf55-200mmf35-48-r-lm-ois/">55-200mm</a> lens, which I’ve had for at
  71.    least eleven years. Up till now, I’ve always pointed it at faraway things, but wow, I think I’ll be taking this to more gardens
  72.    in future.</p>
  73.    <p>I mention this partly so I can link to this
  74.    <a href="https://www.lensrentals.com/blog/2016/02/the-long-awaited-scary-and-amazing-fuji-lens-teardown/?srsltid=AfmBOorQfgob6drIXwtTJ9xuixBbnSvZE2F8x7Jba0AA3U60uoFAB3gY">awesome
  75.    (and funny) teardown piece</a> from Lensrentals.</p>
  76.    <p>And, on the way out, let’s let that lens show off with a couple of roses.</p>
  77.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56057.png" alt="Yellow rose and bud" />
  78.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/30/TXT56058.png" alt="Pink roses, black background" />
  79.    <p>Remember, pink and black are the colors of rock &amp; roll.
  80.    And if you’re anywhere near Annapolis Royal, stop and visit that garden.</p>
  81. </div></content></entry>
  82.  
  83. <entry>
  84. <title>Maritime Vacation</title>
  85. <link href='https://www.tbray.org/ongoing/When/202x/2025/08/27/Maritime-Vacation' />
  86. <link rel='replies'        thr:count='0'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/08/27/Maritime-Vacation#comments' />
  87. <id>https://www.tbray.org/ongoing/When/202x/2025/08/27/Maritime-Vacation</id>
  88. <published>2025-08-27T12:00:00-07:00</published>
  89. <updated>2025-08-28T12:36:15-07:00</updated>
  90. <category scheme='https://www.tbray.org/ongoing/What/' term='The World/Places/Maritimes' />
  91. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  92. <category scheme='https://www.tbray.org/ongoing/What/' term='Places' />
  93. <category scheme='https://www.tbray.org/ongoing/What/' term='Maritimes' />
  94. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>The sound of the wind surging through birchy Eastern woods isn’t like the same coastal gusts in my own Pacific rain     forest; around you not above you, alto not baritone. The colors differ too: Forests, houses, soil, and sea. And everywhere     little white churches, each with its cemetery. A scattering of forts, far too many cannons.  And everything faces the sea</div></summary>
  95. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  96.    <p>The sound of the wind surging through birchy Eastern woods isn’t like the same coastal gusts in my own Pacific rain
  97.    forest; around you not above you, alto not baritone. The colors differ too: Forests, houses, soil, and sea. And everywhere
  98.    little white churches, each with its cemetery. A scattering of forts, far too many cannons.  And everything faces the sea.</p>
  99.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/PXL_20250814_142523016.png" alt="Cape Breton forest" />
  100.    <div class='caption'><p>Birchy Cape Breton forest.</p></div>
  101.    <p>For the first time since Covid and, more important, since Lauren’s 2½-year battle with Long Covid, we went on the road for
  102.    pleasure; Lauren and I and our dear friend Sally from Warragul, Australia. To my shame, all my decades’ travel had never taken
  103.    me to Canada east of Montreal, so we spent a couple of weeks poking around Nova Scotia and Prince Edward Island, plus a bit of
  104.    New Brunswick. I took many pictures and it’ll take a few blog pieces to share those that I think deserve it.</p>
  105.    <p>No part of Canada’s settler culture is old by European or Asian standards, but ten generations of white people
  106.    lived and died here before the first rough town organized itself near what’s now Vancouver. They had to be buried someplace, thus the
  107.    graveyards everywhere you go. These were captured near Whycocomagh.</p>
  108.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/TXT55871.png" alt="Gravestone of Lillian S. DeWolfe, 1876-1958" />
  109.    <div class='caption'><p>Lillian S. DeWolfe, Oct 1876 Sept 1958.</p></div>
  110.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/TXT55874.png" alt="A simple grave marker saying only “sleeping”" />
  111.    <p>How long will it still matter that my hometown is one of the world’s youngest big cities?</p>
  112.    <p>Many graveyards are church attachments, but many more greet you at a random turn in the road; always framed by forest.
  113.    The density of churches is remarkable; all built of wood, mostly white, mostly well-kept. This one was attached to the graves
  114.    above and is untypically faded (but lovely inside).</p>
  115.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/TXT55869.png" alt="Square white wooden church, it needs a paint job" />
  116.    <p>Some of the churches have become boutiques and breweries, but those that haven’t still occur more densely than in any other
  117.    New World jurisdiction I’ve seen. Why should faith hold stronger down East?</p>
  118.    <p>Another church, St Dunstan’s Basilica in Charlottetown, offered perhaps the most intense experience of the whole trip,
  119.    because a singer and organist were practicing elaborate hymn treatments. Both were great, the organ is a magnificent Casavant,
  120.    and parish organist
  121.    <a href="https://en.wikipedia.org/wiki/Leo_Marchildon">Leo Marchildon</a> was having fun, putting lots of wind through those
  122.    pipes including the 32’ bass monsters.  My ears and I were smiling when we left.</p>
  123.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/TXT55925.png" alt="Stained glass in St. Dunstan’s Basilica, Charlottetown" />
  124.    <div class='caption'><p>The stained glass is nothing special<br/>but I liked the opened panes at the bottom.</p></div>
  125.    <p>Forts and cannons, I said; the Maritimes’ messy history included repeated captures and recaptures by the forces of France and
  126.    Britain and the USA, and quite a few of the forts had been put to their intended use, repelling or falling to one invader or
  127.    another.</p>
  128.    <p>The locals, at least the ones who set things up for tourists, seem to take their history seriously; I don’t pretend
  129.    expertise or even much interest in it, but I have to say that some cannons have good typography.</p>
  130.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/PXL_20250824_214613137.png" alt="Engraving on metal: Crown and “VR”" />
  131.    <div class='caption'><p>“VR” is Victoria Regina of course,<br/>so sometime in the second half of the 19<sup>th</sup>
  132.    century.</p></div>
  133.    <p>The colors are different, and an entry later in this series will dip in gleefully and give me a platform for camera geekery.
  134.    One expects changes in houses and vegetation when you travel four timezones away, but nothing prepared
  135.    me for the shockingly red soil in Prince Edward Island (hereinafter PEI).</p>
  136.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/TXT55937.png" alt="red and blue see, red soil, wind turbines" />
  137.    <div class='caption'><p>Past Tignish at PEI’s northern extremity,<br/>well off the paved-roads part.</p></div>
  138.    <p>I opened with words about everything facing the sea. Not entirely true, sometimes you’re looking at a lake.</p>
  139.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/PXL_20250823_162017189.png" alt="Kids in a large calm lake, circular ripples" />
  140.    <div class='caption'><p>Those kids don’t know how lucky they are.</p></div>
  141.    <p>This is in the wonderful Kejimkujik National Park in central Nova Scotia, mostly closed due to extreme wildfire peril.</p>
  142.    <p>All across the Maritimes, drought was in effect; crops failing, forest trails closed. Which reminds me; near that lake there was a
  143.    birch-bark-canoe workshop. I asked the guy making the canoe how long it took. He said “My great-grandpa could do it in seven days,
  144.    because back then there were birch trees big enough that you could make the whole hull out of a single piece.”  It’s very
  145.    difficult to find any aspect of life on earth that isn’t exhibiting Anthropocene damage.</p>
  146.    <p>Usually, it’s the sea that you’re looking at.</p>
  147.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/TXT56066.png" alt="Nova Scotia coastline near Annapolis Royal" />
  148.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/PXL_20250822_223613924.png" alt="rocky beach at low tide" />
  149.    <div class='caption'><p>Above, coastline near Annapolis Royal.<br/>Below, low tide near Chipman Brook.</p></div>
  150.    <p>From one end of Canada to the other; to me, the surprise was not so much the difference in the landscapes but the similarity
  151.    of the people; they spoke my accent, shopped in my stores, obeyed my road signs. More on that later. For now, this.</p>
  152.    <img src="https://www.tbray.org/ongoing/When/202x/2025/08/27/PXL_20250825_141305938.png" alt="Trees frame the seawater and a couple of oceanfront houses" />
  153.    <div class='caption'><p>On Bell Island, among the LaHaves.</p></div>
  154. </div></content></entry>
  155.  
  156. <entry>
  157. <title>RFC 9839 and Bad Unicode</title>
  158. <link href='https://www.tbray.org/ongoing/When/202x/2025/08/14/RFC9839' />
  159. <link rel='replies'        thr:count='2'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/08/14/RFC9839#comments' />
  160. <id>https://www.tbray.org/ongoing/When/202x/2025/08/14/RFC9839</id>
  161. <published>2025-08-14T12:00:00-07:00</published>
  162. <updated>2025-08-23T03:17:06-07:00</updated>
  163. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Text' />
  164. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  165. <category scheme='https://www.tbray.org/ongoing/What/' term='Text' />
  166. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Unicode is good. If you’re designing a data structure or protocol that has text fields, they should contain     Unicode characters encoded in UTF-8. There’s another question, though:     “<em>Which</em> Unicode characters?” The      answer is “Not all of them, please exclude some.”</div></summary>
  167. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  168.    <p>Unicode is good. If you’re designing a data structure or protocol that has text fields, they should contain
  169.    Unicode characters encoded in UTF-8. There’s another question, though:
  170.    “<em>Which</em> Unicode characters?” The
  171.    answer is “Not all of them, please exclude some.”</p>
  172.    <p>This issue keeps coming up, so Paul Hoffman and I put together an individual-submission draft
  173.    to the IETF and now (where by “now” I mean “two years later”) it’s been published as
  174.    <a href="https://www.rfc-editor.org/rfc/rfc9839.html">RFC 9839</a>. It explains which characters are bad, and why, then offers
  175.    three plausible less-bad subsets that you might want to use.
  176.    Herewith a bit of background, but…</p>
  177.    <h2 id='p-2'>Please</h2>
  178.    <p>If you’re actually working on something new that will have text fields, please read the RFC. It’s only ten pages long, and that’s
  179.    with all the IETF boilerplate. It’s written specifically for software and networking people.</p>
  180.    <h2 id='p-3'>The smoking gun</h2>
  181.    <p>The badness that 9839 focuses on is “problematic characters”, so let’s start with a painful example of what that means.
  182.    Suppose you’re designing a protocol that uses JSON and one of your constructs has a <code>username</code> field.
  183.    Suppose you get this message (I omit all the non-<code>username</code> fields). It’s
  184.    a perfectly legal JSON text:</p>
  185.    <div class="highlight"><pre><span></span><span class="p">{</span>
  186.  <span class="w">  </span><span class="nt">&quot;username&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;\u0000\u0089\uDEAD\uD9BF\uDFFF&quot;</span>
  187. <span class="p">}</span>    </pre></div>
  188.    <p>Unpacking all the JSON escaping gibberish reveals that the value of the <code>username</code> field contains four
  189.    numeric “code points” identifying Unicode characters:</p>
  190.    <ol>
  191.      <li><p>The first code point is zero, in Unicode jargon <code>U+0000</code>. In human-readable text it
  192.      has no meaning, but it will interfere with the operation of certain programming languages.</p></li>
  193.      <li><p>Next is Unicode <code>U+0089</code>, official name “CHARACTER TABULATION WITH JUSTIFICATION”. It’s what Unicode calls a
  194.      <a href="https://en.wikipedia.org/wiki/C0_and_C1_control_codes">C1
  195.      control code</a>, inherited from ISO/IEC 6429:1992, adopted from
  196.      <a href="https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf">ECMA 48</a> (1991), which calls it
  197.      “HTJ” and says: <i>HTJ causes the contents of the active field (the field in the presentation component that contains the
  198.      active presentation position) to be shifted forward so that it ends at the character position preceding the
  199.      following character tabulation stop. The active presentation position is moved to that following character
  200.      tabulation stop. The character positions which precede the beginning of the shifted string are put into the
  201.      erased state.</i></p>
  202.      <p>Good luck with that.</p></li>
  203.      <li><p>The third code point, <code>U+DEAD</code>, in Unicode lingo, is an “unpaired surrogate”.  To understand,
  204.      you’d have to learn how Unicode’s much-detested
  205.      <a href="https://en.wikipedia.org/wiki/UTF-16">UTF-16</a> encoding works.
  206.      I recommend not bothering.</p>
  207.      <p>All you need to know is that surrogates are only meaningful when they come in pairs in UTF-16 encoded text. There is
  208.      effectively no such text on the wire and thus no excuse for tolerating surrogates in your data. In fact, the UTF-8 specification
  209.      says that you mustn’t use UTF-8 to encode surrogates. But the real problem is that different libraries in different
  210.      programming languages don’t always do the same things when they encounter this sort of fœtid interloper.</p>    </li>
  211.      <li><p>Finally, <code>\uD9BF\uDFFF</code> is JSON for the code point <code>U+7FFFF</code>.
  212.      Unicode has a category called “noncharacter”, containing a few dozen code points that, for a variety of
  213.      reasons, some good,
  214.      don’t represent anything and must not be interchanged on the wire. <code>U+7FFFF</code> is one of those.</p></li>
  215.    </ol>
  216.    <p>The four code points in the example are all clearly problematic.
  217.    The just-arrived RFC 9839 formalizes the notion of “problematic” and
  218.    offers easy-to-cite language saying which of these problematic types you want to
  219.    exclude from your text fields. Which, if you’re going to use JSON, you should probably do.</p>
  220.    <h2 id='p-6'>Don’t blame Doug</h2>
  221.    <p>Doug Crockford I mean, the inventor of JSON.  If he (or I or really anyone careful) were inventing JSON now that Unicode is
  222.    mature, he’d have been fussier about its character repertoire. Having said that, we’re stuck with JSON-as-it-is forever, so we
  223.    need a good way to say which of the problematic characters we’re going to exclude even if JSON allows them.</p>
  224.    <h2 id='p-5'>PRECISion</h2>
  225.    <p>You may find yourself wondering why the IETF waited until 2025 to provide help with Bad Unicode.
  226.    It didn’t; here’s
  227.    <a href="https://www.rfc-editor.org/rfc/rfc8264.html">RFC 8264</a>: <cite>PRECIS Framework: Preparation, Enforcement, and
  228.    Comparison of Internationalized Strings in Application Protocols</cite>; the first PRECIS predecessor was published in 2002.
  229.    8264 is 43 pages long, containing a <em>very</em>
  230.    thorough discussion of many more potential Bad Unicode issues than 9839 does.</p>
  231.    <p>Like 9839, PRECIS specifies subsets of the Unicode character repertoire and goes further, providing a mechanism for defining
  232.    more.</p>
  233.    <p>Having said that, PRECIS doesn’t seem to be very widely used by people who are defining new data structures and protocols. My
  234.    personal opinion is that there are two problems which make it hard to adopt. First, it’s large and
  235.    complex, with many moving parts, and requires careful study to understand. Developers are (for good reason) lazy.</p>
  236.    <p>Second, using PRECIS ties you to a specific version of Unicode. In particular, it forbids the use of the (nearly a million)
  237.    unassigned code points. Since each release of Unicode includes new code point assignments, that means that a sender and receiver
  238.    need to agree on exactly which version of Unicode they’re both going to use if they want reliably interoperable behavior. This
  239.    makes life difficult for anyone writing a general-purpose code designed to be used in lots of different applications.</p>
  240.    <p>I personally think that the only version of Unicode anybody wants to use is “as recent as possible”, so they can be confident
  241.    of having all the latest emojis.</p>
  242.    <p>Anyhow, 9839 is simpler and dumber than PRECIS. But I think some people will find it useful and now the IETF agrees.</p>
  243.    <h2 id='p-7'>Source code</h2>
  244.    <p>I’ve written a little Go-language library to validate incoming text fields against each of the three subsets that 9839
  245.    specifies,
  246.    <a href="https://github.com/timbray/RFC9839">here</a>.  I don’t claim it’s optimal, but it is well-tested.</p>
  247.    <p>It doesn’t have a version number or release just yet, I’ll wait till a few folk have had a chance to spot any dumb mistakes I
  248.    probably made.</p>
  249.    <h2 id='p-9'>Details</h2>
  250.    <p>Here’s a compact summary of the world of problematic Unicode code points and data formats and standards.</p>
  251.    <table>
  252.      <tr valign="top" align="center"><td class="empty"></td><th colspan="3">Problematic classes excluded?</th></tr>
  253.      <tr valign="top"><td class="empty"></td><th>Surrogates</th><th>Legacy controls</th><th>Noncharacters</th></tr>
  254.      <tr align="center"><td>CBOR</td><td class="happy">yes</td><td class="unhappy">no</td><td class="unhappy">no</td></tr>
  255.      <tr align="center"><td>I-JSON</td><td class="happy">yes</td><td class="unhappy">no</td><td class="happy">yes</td></tr>
  256.      <tr align="center"><td>JSON</td><td class="unhappy">no</td><td class="unhappy">no</td><td class="unhappy">no</td></tr>
  257.      <tr align="center"><td>Protobufs</td><td class="unhappy">no</td><td class="unhappy">no</td><td class="unhappy">no</td></tr>
  258.      <tr align="center"><td>TOML</td><td class="happy">yes</td><td class="unhappy">no</td><td class="unhappy">no</td></tr>
  259.      <tr align="center"><td>XML</td><td class="happy">yes</td><td class="neutral">partial [1]</td><td class="neutral">partial [2]</td></tr>
  260.      <tr align="center"><td>YAML</td><td class="happy">yes</td><td class="neutral">mostly [3]</td><td class="neutral">partial [2]</td></tr>
  261.      <tr valign="top" align="center"><td class="empty"></td><th colspan="3">RFC 9839 Subsets</th></tr>
  262.      <tr align="center"><td>Scalars</td><td class="happy">yes</td><td class="unhappy">no</td><td class="unhappy">no</td></tr>
  263.      <tr align="center"><td>XML</td><td class="happy">yes</td><td class="neutral">partial</td><td class="neutral">partial</td></tr>
  264.      <tr align="center"><td>Assignables</td><td class="happy">yes</td><td class="happy">yes</td><td class="happy">yes</td></tr>
  265.    </table>
  266.    <p>Notes:</p>
  267.    <p><b>[1]</b> XML allows C1 controls.</p>
  268.    <p><b>[2]</b> XML and YAML don’t exclude the noncharacters outside the Basic Multilingual Pane.</p>
  269.    <p><b>[3]</b> YAML excludes all the legacy controls except for the mostly-harmless <code>U+0085</code>, another version of
  270.    <code>\n</code> used in IBM mainframe documents.</p>
  271.    <h2 id='p-8'>Thanks!</h2>
  272.    <p>9839 is not a solo production. It received an extraordinary amount of discussion and improvement from a lot of smart and
  273.    well-informed people
  274.    and the published version, 15 draft revisions later, is immensely better than my initial draft. My sincere thanks go to my
  275.    co-editor Paul Hoffman and to all those mentioned in the RFC’s “Acknowledgements” section.</p>
  276.    <h2 id='p-4'>On individual submissions</h2>
  277.    <p>9839 is the second “individual submission” RFC I’ve pushed through the IETF (the other is
  278.    <a href="https://datatracker.ietf.org/doc/html/rfc7725">RFC 7725</a>, which registers the HTTP 451 status code).  While it’s nice
  279.    to decide something is worth standardizing and eventually have that happen, it’s really a lot of work. Some of that work is
  280.    annoying.</p>
  281.    <p>I’ve been involved in
  282.    other efforts as Working-Group member, WG chair, and WG specification editor, and I can report authoritatively that creating an
  283.    RFC the traditional way, through a Working Group, is easier and better.</p>
  284.    <p>I feel discomfort advising others not to follow in my footsteps, but in this case I think it’s the right advice.</p>
  285. </div></content></entry>
  286.  
  287. <entry>
  288. <title>Long Links</title>
  289. <link href='https://www.tbray.org/ongoing/When/202x/2025/08/04/Long-Links' />
  290. <link rel='replies'        thr:count='1'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/08/04/Long-Links#comments' />
  291. <id>https://www.tbray.org/ongoing/When/202x/2025/08/04/Long-Links</id>
  292. <published>2025-08-04T12:00:00-07:00</published>
  293. <updated>2025-08-07T11:14:33-07:00</updated>
  294. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  295. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  296. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>All of these <cite>Long Links</cite> pieces have begun with more or less the same words, so why     stop now?  This is an annotated parade of links to long-form pieces. Most people won’t have the time     (nor the weird assortment of interests) to consume them all, but I hope that most readers will find one     or two      reward a visit</div></summary>
  297. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  298.    <p>All of these <cite>Long Links</cite> pieces have begun with more or less the same words, so why
  299.    stop now?  This is an annotated parade of links to long-form pieces. Most people won’t have the time
  300.    (nor the weird assortment of interests) to consume them all, but I hope that most readers will find one
  301.    or two
  302.    reward a visit.</p>
  303.    <h2 id='p-2'>Radisson (and Groseilliers)</h2>
  304.    <p>I don’t know if it is still the case, but in my youth, Canadian elementary education included several overexcited units
  305.    about the
  306.    <a href="https://en.wikipedia.org/wiki/Coureur_des_bois"><i>Coureurs des bois</i></a>, early European settlers
  307.    in “New France” (now Québec) who ventured, by foot and canoe, far to the north and west, mostly engaged in trading with the
  308.    indigenous peoples: trinkets (and later, serious hardware including guns) for furs.</p>
  309.    <p>The names I remembered were Radisson and Groseilliers, but I don’t recall learning much about who they were and what
  310.    they did. Then I ran across the 2019 book
  311.    <a href="https://www.biblioasis.com/shop/non-fiction/bush-runner-the-life-and-times-of-pierre-esprit-radisson/">Bush Runner:
  312.    The Adventures of Pierre-Esprit Radisson</a> and, wow… The writing is pedestrian but who cares because what a
  313.    story! Radisson lived an absolutely astonishing life. He went as deep into the bush as anyone of his era, interacted intensely
  314.    with the indigenous people as business partner, friend, and foe, worked for Charles of England and Louis of France (changing
  315.    sides several times), in 1670 founded the Hudson’s Bay Company (recently, 355 years later, deceased), and fortunately took
  316.    notes, a copy of which was preserved by Samuel Pepys.</p>
  317.    <p>I learned more from this book’s pages about the early history of Upper and Lower Canada than all those elementary-school
  318.    units had to offer, and had loads of fun doing so.  I guess this is a fairly Canadian-specific Long Link, but I think anyone
  319.    interested in the early history of Europeans in North America would find much to enjoy.</p>
  320.    <h2 id='p-4'>Music</h2>
  321.    <p>It’s rare these days that I discover interesting new musicians, but here are two of those rarities.</p>
  322.    <p><a href="https://luciehorsch.com">Lucie Horsch</a> plays recorder, you know, the cheap plastic thing they use to introduce
  323.    second-graders to music. It’s actually a lovely instrument and I wish we would switch to its German name,
  324.    “Blockflöte”, which to my ear sounds a bit like the instrument does. Anyhow, check out this YouTube entitled only
  325.    <a href="https://www.youtube.com/watch?v=LJyl2D16PZY&amp;list=RDLJyl2D16PZY&amp;start_radio=1">Lucie Horsch - Bach</a>,
  326.    annoyingly omitting any mention of <em>which</em> Bach. Annoyance aside, it’s a pretty great performance, Ms Horsch is the real
  327.    deal, full of virtuosity and grace.</p>
  328.    <p>I got an unusual mid-week message from Qobuz, all excited about
  329.    <a href="https://transgressiverecords.com/artist/the-new-eves/">The New Eves’</a> new record <cite>The New Eve Is
  330.    Rising</cite>. So I played it in the car on a long crosstown drive and now I’m all excited too. The New Eves are
  331.    talented, musically surprising, and above all, insanely brave.</p>
  332.    <p>Their music doesn’t sound like anything else and
  333.    flies in the face of all conventional wisdom concerning popular music. They take absurd chances and yeah, the album has klunkers
  334.    amid the bangers, but when I got to its end I went back and started at the beginning again. I found myself
  335.    smiling ear-to-ear over and over. Maybe I’m being a bit over-the-top here, but check them out:
  336.    <a href="https://www.youtube.com/watch?v=l9Q9ge6j_O4&amp;list=RDl9Q9ge6j_O4&amp;start_radio=1">Mother</a> is live.
  337.    <a href="https://www.youtube.com/watch?v=MovNWuNPXXE&amp;list=RDMovNWuNPXXE&amp;start_radio=1">Cow Song</a> is off the new
  338.    album and strong albeit with forgettable video.</p>
  339.    <h2 id='p-3'>Life online</h2>
  340.    <p>Every Long Links has hardcore-geek threads and there is no harder core imaginable than Filippo Valsordi’s
  341.    <a href="https://words.filippo.io/assembly-mutation/">Go Assembly Mutation Testing</a>. I have always admired (but never
  342.    actually used) mutation testing, and Filippo offers a convincing argument that it moves catching certain classes of bug from
  343.    nearly impossible to pretty easy. Good stuff!</p>
  344.    <p>And of course we can’t ignore genAI and programming. Most of you are likely aware of
  345.    <a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/">Measuring the Impact of Early-2025 AI on
  346.    Experienced Open-Source Developer Productivity</a>, but I’m linking again to boost its visibility, because hard
  347.    quantitative research on methodology is damn rare in our profession. I will confess to being a little (but just a little)
  348.    surprised at the conclusions.</p>
  349.    <p>It is apparently quite possible that Intel will exit the business of making high-end chips, leaving TSMC with a global
  350.    monopoly:
  351.    <a href="https://d2d.substack.com/p/d2d-contd-intel-and-the-wide-open">Intel and the Wide Open Barn Doors</a>.
  352.    This is an unsettling prospect.
  353.    Not, I have to say, surprising though. I’ve sneered at Intel leadership cluelessness for years and years, see
  354.    <a href="/ongoing/When/200x/2006/01/14/On-Intel">here</a> and
  355.    <a href="/ongoing/When/200x/2006/02/16/Viiv-Jive">here</a>.</p>
  356.    <p>Finally, here’s the charmingly-titled
  357.    <a href="https://www.raptitude.com/2025/06/how-to-surf-the-web-in-2025-and-why-you-should/">How to Surf the Web in 2025, and
  358.    Why You Should</a>. I love this piece.</p>
  359.    <h2 id='p-1'>Class Reductionism</h2>
  360.    <p>The news keeps making me want to build something around the <code>classreductionist.org</code> domain name I’ve owned for
  361.    years.</p>
  362.    <p>The tl;dr on Class Reductionism is something like “In the best possible world it’ll take generations to disassemble the
  363.    global tangle of intersectional oppression, but we could treat the symptoms effectively <em>right now this year</em> by sending
  364.    money to the poor. I’m talking about Universal Basic Income or suchlike. I wrote a
  365.    <a href="/ongoing/When/202x/2023/01/16/Class-Reductionism">couple thousand words</a> on the subject back in 2023, and there are
  366.    complexities, and I probably won’t put up that site. But I still do maintain that a very high proportion of our societal pain is
  367.    rooted in the egregious inequality, and consequent poverty, that seems a baked-in feature of Late Capitalism.</p>
  368.    <p>Let’s start with Nobelist Paul Krugman, who’s been writing an “Understanding Inequality” series on his paywalled newsletter
  369.    and then republishing a gratis version, start
  370.    <a href="https://stonecenter.gc.cuny.edu/tag/focus-inequality/">here</a>.  Very data-dense and educational.
  371.    Hmm, that site is slow; there’s a livelier table of contents
  372.    <a href="https://paulkrugman.substack.com/p/i-coulda-made-a-better-deal">here</a>.</p>
  373.    <p>Don’t kid yourself that this is just an American problem, see
  374.    <a href="https://www.nytimes.com/2025/06/23/business/china-upward-mobility-inequality.html?unlocked_article_code=1.cE8.Ptfc.XicZ0XVgHPsJ&amp;smid=url-share">‘The Better Life Is Out of Reach’: The Chinese Dream Is Slipping Away</a>.</p>
  375.    <p>Let’s pull the impersonal veil of facts and figures aside and focus on the human experience of what we used to call Class Struggle.
  376.    <a href="https://macleans.ca/society/confessions-of-the-working-poor/">Confessions of the Working Poor</a> is beautifully
  377.    written and opened my eyes to lifestyle choices that I didn’t even know some people have to make.</p>
  378.    <p>But hey, there are people who are just fine with this:
  379.    <a href="https://finance.yahoo.com/news/deltas-premium-play-is-taking-advantage-of-the-growing-economic-split-100044776.html">Delta's
  380.    premium play is taking advantage of the growing economic split</a>.</p>
  381.    <p>Look, being class-determinist-adjacent doesn’t mean you should ignore intersectional awfulness:
  382.    <a href="https://www.newyorker.com/magazine/2025/08/04/the-plunder-of-black-america-calvin-schermerhorn-book-review">What We
  383.    Miss When We Talk About the Racial Wealth Gap</a>.</p>
  384.    <h2 id='p-5'>No more sections</h2>
  385.    <p>The remaining Long Links refused to be organized so I had to turn them loose; call it the Long Tail.</p>
  386.    <p><a href="https://articles.c-a-s-t.com/the-venetian-origins-of-roman-type-a856eb3f0cb">The Venetian origins of roman
  387.    type</a>. You might think you don’t care about typography but still enjoy the pictures and descriptions here.</p>
  388.    <!--
  389.    <p><a href="https://www.newyorker.com/magazine/2025/07/28/mary-had-schizophrenia-then-suddenly-she-didnt">Mary Had
  390.    Schizophrenia—Then Suddenly She Didn’t</a></p>-->
  391.    <p>This guy is a full-time
  392.    <a href="https://urbancoyoteresearch.com/researcher/stanley-d-gehrt-phd">Coyote researcher</a>. What a great gig! I’m an admirer
  393.    of those animals and how they’ve carved themselves a comfy niche in most of North America’s big cities.  (Even if it means that
  394.    you better not let your cat out at night.) They’re also remarkably attractive.</p>
  395.    <p>Here’s another long list of Long Links, and many of you will wonder why anyone would choose to browse it:
  396.    <a href="https://petapixel.com/2025/07/18/the-best-camera-stores-in-tokyo-the-ultimate-guide/">The Best Camera Stores in
  397.    Tokyo: The Ultimate Guide</a>. Some of the interiors are remarkable.</p>
  398.    <p>Oh, while we’re on the subject of photography:
  399.    <a href="https://petapixel.com/2025/07/22/a-photojournalist-took-a-fujifilm-instax-camera-to-a-cartel-wedding/">A
  400.    Photojournalist Took a Fujifilm Instax Camera to a Mexican Cartel Wedding</a>.</p>
  401.    <p>GLP-1’s (i.e. Ozempic and friends) would probably dominate a large section of the news if weren’t for all the political
  402.    craziness. Here’s one small example:
  403.    <a href="https://www.glp1digest.com/p/how-glp-1s-are-breaking-life-insurance">How GLP-1s Are Breaking Life Insurance</a>.</p>
  404.    <p>Science is hard. There are lots of largely-unsolved areas, and “gap-map.org” tries to organize them:
  405.    <a href="https://www.gap-map.org/?sort=rank&amp;utm_source=substack&amp;utm_medium=email&amp;fields=astrophysics">Fundamental
  406.    Development Gap Map v1.0</a>. The UI is a little klunky but the thing still sucked me right in.</p>
  407.    <p>I’m going to give the last word to Laurie Penny. I don’t know what we’d do without her.
  408.    <a href="https://lauriepenny.substack.com/p/in-a-time-of-monsters-do-we-have">In a time of monsters: do we have any ideas for
  409.    surviving the zombie apocalypse that aren’t nightmare patriarchy?</a></p>
  410. </div></content></entry>
  411.  
  412. <entry>
  413. <title>De-Google Project Update</title>
  414. <link href='https://www.tbray.org/ongoing/When/202x/2025/07/29/DeGoogling' />
  415. <link rel='replies'        thr:count='19'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/07/29/DeGoogling#comments' />
  416. <id>https://www.tbray.org/ongoing/When/202x/2025/07/29/DeGoogling</id>
  417. <published>2025-07-29T12:00:00-07:00</published>
  418. <updated>2025-07-31T12:06:18-07:00</updated>
  419. <category scheme='https://www.tbray.org/ongoing/What/' term='The World/Life Online/De-Google' />
  420. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  421. <category scheme='https://www.tbray.org/ongoing/What/' term='Life Online' />
  422. <category scheme='https://www.tbray.org/ongoing/What/' term='De-Google' />
  423. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>I     <a href='/ongoing/When/202x/2024/03/09/DeGoogling'>introduced this family project</a> in the spring of 2024.     I won’t reproduce those arguments for why we’re working on this, but in the current climate I feel like I hardly need to.     Since that post, our aversion to Google dependency has only grown stronger. Progress has been non-zero but not fast</div></summary>
  424. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  425.    <p>I
  426.    <a href="/ongoing/When/202x/2024/03/09/DeGoogling">introduced this family project</a> in the spring of 2024.
  427.    I won’t reproduce those arguments for why we’re working on this, but in the current climate I feel like I hardly need to.
  428.    Since that post, our aversion to Google dependency has only grown stronger. Progress has been non-zero but not fast.</p>
  429.    <p>Here’s the table, with progress notes below.</p>
  430.    <table>
  431.      <tr valign="top"><th>Need</th><th>Supplier</th><th>Alternatives</th></tr>
  432.      <tr valign="top">
  433. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-3">Office</a></td>
  434. <td class="unhappy">Google Workspace</td>
  435. <td>Proton?</td>
  436.      </tr>
  437.      <tr valign="top">
  438. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-17">Data sharing</a></td>
  439. <td class="happy">Dropbox</td>
  440.      <td></td></tr>
  441.      <tr valign="top">
  442. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-17">Photos</a></td>
  443. <td class="unhappy">Google Photos</td>
  444.      <td>Dropbox?</td></tr>
  445.      <tr valign="top">
  446. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-16">Video meetings</a></td>
  447. <td class="unhappy">Google
  448. Meet</td>
  449.      <td>Jitsi, Signal?</td></tr>
  450.      <tr valign="top">
  451. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-10">Maps</a></td>
  452. <td class="unhappy">Google Maps</td>
  453.      <td>Magic Earth, Here, something OSM-based?</td></tr>
  454.      <tr valign="top">
  455. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-4">Browser</a></td>
  456. <td class="happy">Safari, Firefox, Vivaldi, LibreWolf</td>
  457.      <td></td></tr>
  458.      <tr valign="top">
  459. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-12">Search</a></td>
  460. <td class="unhappy">Google</td>
  461.      <td>Bing-based options, Kagi?</td></tr>
  462.      <tr valign="top">
  463. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-5">Chat</a></td>
  464. <td class="happy">Signal</td>
  465.      <td></td></tr>
  466.      <tr valign="top">
  467. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-6">Photo editing</a></td>
  468. <td class="neutral">Adobe
  469. Lightroom &amp; Nik</td>
  470.      <td>Capture One, Darktable, ?</td></tr>
  471.      <tr valign="top">
  472. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-7">In-car interface</a></td>
  473. <td class="neutral">Google Android Auto</td>
  474.      <td>Automaker software</td></tr>
  475.      <tr valign="top">
  476. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-8">Play my music</a></td>
  477. <td class="happy">Plex, USB</td>
  478.      <td></td></tr>
  479.      <tr valign="top">
  480. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-9">Discover music</a></td>
  481. <td class="happy">Qobuz</td>
  482. <td></td></tr>
  483.      <tr valign="top">
  484. <td><a href="/ongoing/When/202x/2024/03/09/DeGoogling#p-13">TV</a></td>
  485. <td class="neutral">Roku, Apple, migration</td>
  486.      <td></td></tr>
  487.    </table>
  488.    <p>Pink indicates a strong desire to get off the incumbent service, green means we’re happy-ish with what we’re using, and blue
  489.    means that, happy or not, it’s not near the top of the priority list.</p>
  490.    <p>I’ll reproduce the metrics we care about when looking to replace Google products, some combination of:</p>
  491.    <ol>
  492.      <li><p>Not ad-supported</p></li>
  493.      <li><p>Not VC-funded</p></li>
  494.      <li><p>Not Google, Microsoft, or Amazon</p></li>
  495.    </ol>
  496.    <p>The list used to include “Open Source” but I decided that while that’s good, it’s less important than the other three criteria.</p>
  497.    <p>Now let’s walk down the chart.</p>
  498.    <h2 id='p-3'>Office</h2>
  499.    <p>This is going to be a wrenching transition; we’ve been running the family on Google stuff forever, and I anticipate
  500.    muscle-memory pain. But increasingly, using Google apps feels like being in enemy territory. And, as I said last time, I
  501.    will not be sorry to shake the dust of Google Drive and Docs from my heels, I find them clumsy and am
  502.    always having trouble finding something that I know is in there.</p>
  503.    <p>While I haven’t dug in seriously yet, I keep hearing reasonably-positive things about Proton, and nothing substantive to
  504.    scare me away.  Wish us luck.</p>
  505.    <h2 id='p-17'>Data sharing (progress!)</h2>
  506.    <p>Dropbox is, eh, OK. It doesn’t seem actively evil, there’s no advertising, and the price is low.</p>
  507.    <h2 id='p-21'>Photos</h2>
  508.    <p>We’re a four-Android family including a couple of prolific photographers, and everything just gets pumped into Google and
  509.    then it fills up and then they want more money.  If we could configure the phones to skip Google and go straight to Dropbox,
  510.    that would be a step forward.</p>
  511.    <h2 id='p-16'>Video meetings</h2>
  512.    <p>Google meet isn’t painful but I totally suspect it of data-mining what should be private conversations. I’m getting the
  513.    feeling that the technical difficulty of videoconferencing is going steadily down, so I’m reasonably optimistic that
  514.    something a little less evil will come along with a fair price.</p>
  515.    <h2 id='p-10'>Maps</h2>
  516.    <p>The fear and loathing that
  517.    <a href="/ongoing/When/201x/2017/06/29/Fear-Google-Reviews">I started feeling in 2017</a> grows only stronger.  But replacements
  518.    aren’t obvious.
  519.    It’s a pity, maps
  520.    and directions and reviews feel like a natural monopoly that should be a public utility or something, rather than a corporate moat.</p>
  521.    <h2 id='p-4'>Browser (progress!)</h2>
  522.    <p>Chrome has seriously started making my flesh crawl; once again, enemy territory. Fortunately, there are lots of good options.
  523.    Even people like us who have multiple lives we need to keep separate can find enough better browsers out there.</p>
  524.    <p>Maybe I’ll have a look at one of the new genAI-company browsers ha ha just kidding.</p>
  525.    <h2 id='p-12'>Search</h2>
  526.    <p>The reports on Kagi keep being positive and giving it a try is definitely on the To-Do list.</p>
  527.    <h2 id='p-5'>Chat</h2>
  528.    <p>Signal is the only sane choice at this point in history for personal use.</p>
  529.    <h2 id='p-6'>Photo editing</h2>
  530.    <p>Adobe’s products are good, and I’m proficient and happy with Lightroom, but they are definitely suffering from bad genAI
  531.    craziness. Also the price is becoming unreasonable.</p>
  532.    <p>I’ve had a few Lightroom software failures in recent months and if that
  533.    becomes a trend, looking seriously at the alternatives will move to the top of the priority list.</p>
  534.    <h2 id='p-7'>In-car interface</h2>
  535.    <p>It’s tough, Android Auto is a truly great product. I think I’m stuck here for now, particularly given that I plan to be
  536.    driving a <a href="/ongoing/What/The%20World/Jaguar%20Diary/">2019-model-year car</a> for the foreseeable future. Also, it
  537.    supports my music apps.</p>
  538.    <h2 id='p-9'>Discover music and play mine (progress!)</h2>
  539.    <p>Progress here. I’ve almost completely stopped using YouTube Music in favor of Plex and Qobuz. Really no downside; YTM has
  540.    more or less completely lost the ability to suggest good new stuff.</p>
  541.    <h2 id='p-13'>TV</h2>
  542.    <p>Video continues morphing itself into Cable TV redux. We have an old Roku box that works fine and I think I’ve managed to find
  543.    its don’t-spy-on-us settings. We’ll keep subscribing to Apple+ as long as they keep shipping great shows.  I have zero regrets
  544.    about having
  545.    <a href="/ongoing/When/202x/2025/03/06/Canceled-Prime">left Prime behind</a>.</p>
  546.    <p>As for the rest, we’ve become migrants,
  547.    exclusively month-at-a-time subscriptions for the purpose of watching some serial or sports league, unsubscribe after the season
  548.    finale or championship game. The good news is that I
  549.    haven’t encountered much friction in unsubscribing, just a certain amount of earnest pleading.</p>
  550.    <h2 id='p-20'>Looking forward</h2>
  551.    <p>I have yet to confront any of the really hard parts of this project, but the sense of urgency is increasing. Let’s see.</p>
  552. </div></content></entry>
  553.  
  554. <entry>
  555. <title>QRS: Finite-state Struggles</title>
  556. <link href='https://www.tbray.org/ongoing/When/202x/2025/07/21/Automaton-merge-war' />
  557. <link rel='replies'        thr:count='2'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/07/21/Automaton-merge-war#comments' />
  558. <id>https://www.tbray.org/ongoing/When/202x/2025/07/21/Automaton-merge-war</id>
  559. <published>2025-07-21T12:00:00-07:00</published>
  560. <updated>2025-07-22T09:10:25-07:00</updated>
  561. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Quamina Diary' />
  562. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  563. <category scheme='https://www.tbray.org/ongoing/What/' term='Quamina Diary' />
  564. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Software' />
  565. <category scheme='https://www.tbray.org/ongoing/What/' term='Software' />
  566. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>I just posted a big     <a href='https://github.com/timbray/quamina'>Quamina</a> PR representing months of work, brought on     by the addition of a small basic regular-expression feature.  This ramble doesn’t exactly have a smooth story arc but I’m     posting it anyhow because I know there are people     out there interested in state-machine engineering and they are my people</div></summary>
  567. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  568.    <p>I just posted a big
  569.    <a href="https://github.com/timbray/quamina">Quamina</a> PR representing months of work, brought on
  570.    by the addition of a small basic regular-expression feature.  This ramble doesn’t exactly have a smooth story arc but I’m
  571.    posting it anyhow because I know there are people
  572.    out there interested in state-machine engineering and they are my people.</p>
  573.    <p>As far as I can tell, a couple of the problems I’m trying to solve
  574.    haven’t been addressed before, at least not by anyone who published their findings.
  575.    Partly because of that, I’m starting to wonder if all
  576.    <a href="/ongoing/What/Technology/Quamina%20Diary/">these disorderly Quamina postings</a> might
  577.    be worked into a small book or monograph or something. State machines are really freaking useful software constructs!
  578.    So yeah, this is a war story not an essay, but if you like finite automata you’ll likely be interested in bits of it.</p>
  579.    <h2 id='p-1'>The story thus far</h2>
  580.    <p>Prior to beginning work on Regular Expressions, I’d already wired shell-style “<code>*</code>” wildcards into Quamina, which
  581.    forced me to start working with NFAs and ε-transitions. The implementation wasn’t crushingly difficult, and
  582.    the performance was… OK-ish.</p>
  583.    <p>Which leads me to The Benchmark From Hell.
  584.    I wondered how the wildcard functionality would work under heavy stress, so I pulled in a list of 12,959 five-letter strings
  585.    from the Wordle source code, and inserted a “<code>*</code>” at a random position in each. Here are the first ten:</p>
  586.    <blockquote><pre><code>aalii*
  587. *aargh
  588. aar*ti
  589. abaca*
  590. a*baci
  591. a*back
  592. ab*acs
  593. ab*aft
  594. abak*a</code></pre></blockquote>
  595.    <p>I created an NFA for each and merged them together
  596.    <a href="/ongoing/When/202x/2024/07/28/Union-of-Finite-Automata">as described here</a>. Building and merging the automata were
  597.    plenty fast enough, and the merged NFA had 46,424 states, which felt reasonable.
  598.    Matching strings against it ran at under ten thousand per second, which is pretty poor given that Quamina can do a million or
  599.    two per second on patterns encoded in a DFA.</p>
  600.    <p>But, I thought, still reasonably usable.</p>
  601.    <h2 id='p-2'>The cursed “<code>?</code>”</h2>
  602.    <p>Last year, my
  603.    <a href="/ongoing/When/202x/2024/12/12/Quamina-Regular-Expression-Series">slow grind through the regexp features</a> had led me
  604.    to the zero-or-one quantifier “<code>?</code>”.  The state machine for these things is not rocket science; there’s a discussion
  605.    with pictures in my recent
  606.    <a href="/ongoing/When/202x/2025/07/07/Epsilon-Wrangling#p-3">Epsilon Wrangling</a>.</p>
  607.    <p>So I implemented that and fired off the unit tests, most of which
  608.    <a href="/ongoing/When/202x/2024/12/12/QRS-Parsing-Regular-Expressions#p-1">I didn’t have to write</a>, and they all failed.
  609.    Not a surprise I guess.</p>
  610.    <p>It turned out that the way I’d implemented ε-transitions for the wildcards
  611.    <a href="/ongoing/When/202x/2024/07/28/Union-of-Finite-Automata#p-9">was partially wrong</a>, as in it worked for the tight-loop
  612.    state-to-itself ε-transitions, but not for more general-purpose things like “<code>?</code>” requires.</p>
  613.    <p>In fact, it turns out that merging NFAs is hard (DFAs are easy), and I found precious little help online.
  614.    <a href="https://en.wikipedia.org/wiki/Thompson%27s_construction">Thompson’s construction</a> does give an answer: Make an
  615.    otherwise-empty state with two ε-transitions, one to each of the automata, and it’ll do the right thing. Let’s call that
  616.    a “splice state”. It’s easy to implement, so I did. Splicing is hardly “merging” in the Quamina sense, but still.</p>
  617.    <p>Unfortunately, the performance was hideously bad, just a few matches per second while pegging the CPU.
  618.    A glance at the final NFA was sobering; endless chains of splice states, some thousands long.</p>
  619.    <p>At this point
  620.    I became very unhappy and got stalled for months dealing with real-life issues while this problem lurked at the back
  621.    of my mind, growling for attention occasionally.</p>
  622.    <p>Eventually I let the growler out of the cave and started to think through approaches. But first…</p>
  623.    <h2 id='p-4'>Worth solving?</h2>
  624.    <p>Is it, really? What sane person is going to want to search for the union of thousands of regular expressions in general or
  625.    wild-carded strings in particular?</p>
  626.    <p>I didn’t think about this problem at all, because of my experience with Quamina’s parent,
  627.    <a href="https://github.com/aws/event-ruler">Ruler</a>. When it became popular among several AWS and Amazon teams, people
  628.    sometimes found it useful to match the union of not just thousands but a million or more different patterns. When you write
  629.    software that anyone actually uses, don’t expect the people using it to share your opinions on what is and isn’t
  630.    reasonable. So I wasn’t going to get any mental peace until I cracked this nut.</p>
  631.    <p>I eventually decided that three approaches were worth trying:</p>
  632.    <ol>
  633.      <li><p>Figure out a way really to merge, not just splice, the wildcarded patterns, to produce a simpler automaton.</p></li>
  634.      <li><p>Optimize the NFA-traversal code path.</p></li>
  635.      <li><p>Any NFA can be transformed into a DFA, says computer-science theory. So do that, because Quamina is really fast at
  636.      DFA-based matching.</p></li>
  637.    </ol>
  638.    <h2 id='p-5'>Nfa2Dfa</h2>
  639.    <p>I ended up doing all of these things and haven’t entirely given up on any of them.
  640.    The most intellectually-elegant was the transform-to-DFA approach, because if I did that, I could remove the fairly-complex
  641.    NFA-traversal logic from Quamina.</p>
  642.    <p>It turns out that the Net is rich with textbook extracts and YouTubes and slide-shows about how to do the NFA-to-DFA
  643.    conversion. It ended up being quite a pleasing little chunk of code, only a couple hundred lines.</p>
  644.    <p>The bad news: Converting each individual wildcard NFA to a DFA was amazingly fast, but then as I merged them in one by one,
  645.    the number of automaton states started increasing explosively and the process slowed down so much that I never had the patience
  646.    to let it finish. Finite-automata theory warns that this can happen, but it’s hard to characterize the cases where it does.
  647.    I guess this one of them.</p>
  648.    <p>Having said that, I haven’t discarded the <code>nfa2Dfa</code> code, because perhaps I ought to offer a Quamina option to
  649.    apply this if you have some collection of patterns that you want to run really super fast and are willing to wait for a while
  650.    for the transformation process to complete. Also, I may have missed opportunities to optimize the conversion; maybe it’s making
  651.    more states than it needs to?</p>
  652.    <h2 id='p-6'>Faster NFA traversal</h2>
  653.    <p>Recently in
  654.    <a href="/ongoing/When/202x/2025/07/07/Epsilon-Wrangling">Epsilon wrangling</a> I described how NFA traversal has to work,
  655.    relying heavily on implementing a thing called an ε-closure.</p>
  656.    <p>So I profiled the traversal process and discovered, unsurprisingly, that most of the time was going into memory allocation
  657.    while computing those ε-closures. So now Quamina has an ε-closure cache and will only compute each one once.</p>
  658.    <p>This helped a lot but not nearly enough, and the profiler was still telling me the pain was in Go’s allocation and
  659.    garbage-collection machinery. Whittling away at this kind of stuff is not rocket science. The standard Go trick I’ve seen over
  660.    and over is to keep all your data in slices, keep re-using them then chopping them back to <code>[:0]</code>
  661.    for each request.  After a while they’ll have grown to the
  662.    point where all the operations are just copying bytes around, no allocation required.</p>
  663.    <p>Which also helped, but the speed wasn’t close to what I wanted.</p>
  664.    <h2 id='p-7'>Merging wildcard automata</h2>
  665.    <p>I coded multiple ways to do this, and they kept failing. But I eventually found a way to build those
  666.    automata so that any two of them, or any one of them and a DFA, can merged and generate dramatically
  667.    fewer ε-transition chains.  I’m not going to write this up here for two reasons: First of all, it’s not <em>that</em>
  668.    interesting, and second, I worry that I may have to change the approach further as I go on implementing new regxp operators.</p>
  669.    <p>In particular, at one point I was looking at the code while it wasn’t working, and I could see that if I added a particular
  670.    conditional it would work, but I couldn’t think of a principled reason to do it. Obviously I’ll have to sort this out
  671.    eventually. In the meantime, if you’re the sort of um special person who is now burning with curiosity, check out my branch from
  672.    that PR and have a look at the <code>spinout</code> type.</p>
  673.    <p>Anyhow, I added that conditional even though it puzzled me a bit, and now you can add wildcard patterns to Quamina at 80K/second,
  674.    and my 12.9K wildcards generate an NFA with with almost 70K states, which can scan events at almost 400K/second. And that’s good
  675.    enough to ship the <code>“?”</code> feature.</p>
  676.    <p>By the way, I tried feeding that 70K-state automaton to the DFA converter, and gave up after it’d burned an hour of CPU and
  677.    grown to occupy many GB of RAM.</p>
  678.    <h2 id='p-8'>Next steps</h2>
  679.    <p>Add “<code>+</code>” and “<code>*</code>”, and really hope I don’t have to redesign the NFA machinery again.</p>
  680.    <p>Also, figure out the explanation for that puzzling <code>if</code> statement.</p>
  681.    <h2 id='p-9'>And I should say…</h2>
  682.    <p>Despite the very narrow not to say obsessive focus of this series, I’ve gotten a few bits and pieces of positive feedback. So
  683.    there are a few people out there who care about this stuff. To all of you, thanks.</p>
  684. </div></content></entry>
  685.  
  686. <entry>
  687. <title>Memory in Saskatchewan</title>
  688. <link href='https://www.tbray.org/ongoing/When/202x/2025/07/09/Saskatchewan' />
  689. <link rel='replies'        thr:count='9'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/07/09/Saskatchewan#comments' />
  690. <id>https://www.tbray.org/ongoing/When/202x/2025/07/09/Saskatchewan</id>
  691. <published>2025-07-09T12:00:00-07:00</published>
  692. <updated>2025-07-16T10:11:34-07:00</updated>
  693. <category scheme='https://www.tbray.org/ongoing/What/' term='The World/Places/Saskatchewan' />
  694. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  695. <category scheme='https://www.tbray.org/ongoing/What/' term='Places' />
  696. <category scheme='https://www.tbray.org/ongoing/What/' term='Saskatchewan' />
  697. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts/Photos' />
  698. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts' />
  699. <category scheme='https://www.tbray.org/ongoing/What/' term='Photos' />
  700. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>I just came back from Canada’s     <a href='https://en.wikipedia.org/wiki/Saskatchewan'>only rectangular province</a>. I was there to help out my 95-year-old     mother while her main      caregiver took vacation. It’s an unhappiness that my family has splashed itself across Canada in such a way that we have to get     on an airplane (or take drives measured in days) to see each other, but that’s where we are. I came back with pictures and     stories</div></summary>
  701. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  702.    <p>I just came back from Canada’s
  703.    <a href="https://en.wikipedia.org/wiki/Saskatchewan">only rectangular province</a>. I was there to help out my 95-year-old
  704.    mother while her main
  705.    caregiver took vacation. It’s an unhappiness that my family has splashed itself across Canada in such a way that we have to get
  706.    on an airplane (or take drives measured in days) to see each other, but that’s where we are. I came back with pictures and
  707.    stories.</p>
  708.    <p>Let me set the stage with a couple of photos. Everyone knows that Saskatchewan is flat and brown and empty, right?</p>
  709.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/TXT55665.png" alt="Flowers, intensely colored in near-black purple and yellow" />
  710.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/TXT55710.png" alt="Trees and lawns, behind a still body of water and somewhat reflected in it" />
  711.    <p>Mom lives in
  712.    <a href="https://en.wikipedia.org/wiki/Regina,_Saskatchewan">Regina</a>, the provincial capital, a city built round a huge
  713.    park that contains the Legislature (the flowers are from its front lawn), a sizeable lake, and an artificial
  714.    mini-mountain (the water and trees are from its tip).
  715.    Have no fear, I’ll get to some no-kidding prairie landscapes.</p>
  716.    <h2 id='p-1'>Health-care drama</h2>
  717.    <p>The night I arrived, after my Mom went to bed she got up again, tripped on something and fell hard. Her right arm was
  718.    swollen, bruised, and painful. The skin and adjacent blood vessels of very old people become thin and fragile; her whole
  719.    forearm was a bruise. I tried to get her to go to Emergency but she wasn’t having any of it: “You wait for hours and then they
  720.    give you a pain-killer, which is constipating.”  Since she could twist her wrist and wiggle her fingers and give my hand a firm
  721.    grasp, I didn’t push too hard.</p>
  722.    <p>A couple days later on Saturday she got her regular twice-a-week visit from the public
  723.    <a href="https://www.saskatchewan.ca/residents/health/accessing-health-care-services/care-at-home-and-outside-the-hospital/home-care">HomeCare</a>
  724.    nurse, a friendly and highly competent Nigerian immigrant, to check her meds and
  725.    general condition.
  726.    She looked at Mom’s wrist and said “Get her an appointment with her doctor, they’ll probably want an X-Ray.”</p>
  727.    <p>I called up her doctor at opening time Monday. The guy who answered the phone said
  728.    “Don’t have any appointments for a couple weeks but come on over, we’ll squeeze her in.” So we went in after morning coffee and
  729.    waited less than an hour.
  730.    The doctor looked at her arm for 45 seconds and said “I’m writing a prescription for an X-Ray” and there was a
  731.    radiologist around the corner and she was in ten minutes later. The doctor called me back that afternoon and said “Your
  732.    mother’s got a broken wrist, I got her an 8AM appointment tomorrow at Regina General’s Cast Clinic.”</p>
  733.    <p>The doctor at the clinic looked at her wrist for another 45 seconds and said “Yeah, put on a cast” so they did and we were
  734.    home by ten. I’d pessimistically overpaid a couple bucks for hospital parking.</p>
  735.    <p>The reason I’m including this is because I notice that this space has plenty of American readers. Did you notice that the
  736.    story entirely omits insurance companies and money (except parking)? In Canada your health-care comes with your taxes (granted,
  737.    higher than Americans’) and while the system is far from perfect, it can fix up an old lady’s broken wrist pretty damn fucking
  738.    quick without any bureaucratic bullshit. Also, Canada spends a huge amount less per head on health-care than the US does.</p>
  739.    <p>And Mom told me not to forget that Saskatchewan is the birthplace of Canadian single-payer universal healthcare.
  740.    <a href="https://en.wikipedia.org/wiki/Tommy_Douglas">Tommy Douglas</a>, the Social Democrat who made that happen, has been
  741.    named
  742.    <a href="https://en.wikipedia.org/wiki/The_Greatest_Canadian">The Greatest Canadian</a>.</p>
  743.    <h2 id='p-2'>Gentle surface</h2>
  744.    <p>Oh, did I say “flat and brown and empty”? Wrong, wrong, and wrong. The Prairies, in Canada and the US too, have textures and
  745.    colors and hills and valleys, it’s just that the slopes are gentle.  There are really flat parts and they make farmers’ lives easier, but
  746.    more or less every square inch that’s not a town or a park is farmed.
  747.    I took Mom for a drive out in the country southeast of Regina, from whence these views:</p>
  748.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/TXT55698.png" alt="A road leading slightly uphill, brilliant yellow canola on both sides" />
  749.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/TXT55700.png" alt="Yellow canola flowers under a blue sky" />
  750.    <div class='caption'><p>Note that in both shots we’re looking up a gentle slope. In the second, there’s farm infrastructure on
  751.    the distant horizon.<br/>Also consider the color of the sky.</p></div>
  752.    <p>In Canada that yellow-flowering crop is called “Canola”, which Wikipedia claims refers to a particular cultivar of
  753.    <i>Brassica napus</i>, commonly known as rapeseed or just rape, so you can see why when Canada’s
  754.    agribiz sector wanted to position its oil as the thing to use while cooking they went for the cultivar not the species
  755.    name. I’m old enough to remember when farmers still said just “rapeseed”. Hmm, Wikipedia also claims that the OED claims this:
  756.    The term “rape” derives from the Latin word for turnip, <i>rāpa</i> or <i>rāpum</i>, cognate with the Greek word ῥάφη,
  757.    <i>rhaphe</i>.</p>
  758.    <p>Let’s stick with canola.</p>
  759.    <h2 id='p-4'>Pixelated color</h2>
  760.    <p>After I’d taken those two canola-field shots I pulled out my Pixel and took another, but I’m not gonna share it because the
  761.    Pixel decided to turn the sky from what I thought was a complex and interesting hue into its opinion of “what a blue sky looks
  762.    like” only this sky didn’t.</p>
  763.    <p>Maybe it’s just me, but I think Google’s camera app is becoming increasingly opinionated about color, and not in a good
  764.    way. There are plenty of alternative camera apps, I should check them out.</p>
  765.    <p>In case it’s not obvious, I love photographing Saskatchewan and think it generally looks pretty great, especially when you
  766.    look up. On the province’s license plates it says “Land of living skies”, and no kidding.</p>
  767.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/PXL_20250704_032320050.png" alt="Saskatchewan’s living skies" />
  768.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/PXL_20250704_032334240.png" alt="Saskatchewan’s living skies" />
  769.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/TXT55717.png" alt="Saskatchewan’s living skies"/>
  770.    <div class='caption'><p>The first two are from the park behind Mom’s place,<br/>the third from that mini-mountain mentioned
  771.    above.</p></div>
  772.    <h2 id='p-6'>Experience and memory</h2>
  773.    <p>My Mom’s doing well for a nonagenerian. She’s smart. When I visited early last fall and we talked about the US election I was
  774.    bullish on Kamala Harris’s chances. She laughed at me and said “The Americans won’t elect a woman.” Well then.</p>
  775.    <p>But she’s forgetful in the short term. I took her to the Legislature’s
  776.    garden and to the top of the mini-mountain and for a drive out in the country and another adventure we’ll get to; she
  777.    enjoyed them all. But maybe she won’t remember them.</p>
  778.    <p>“Make memories” they say, but what if you show someone you love a good time and maybe they won’t remember it the
  779.    next day? I’m gonna say it’s still worthwhile and has a lesson to teach about what matters. There endeth the lesson.</p>
  780.    <h2 id='p-5'>The gallery</h2>
  781.    <p>Indigenous people make up 17% of Regina’s population, the highest share in any significant Canadian city. By “indigenous” I
  782.    mean the people that my ancestors stole the land from.  It’s personal with me; Around 1900, my Dad’s family, Norwegian
  783.    immigrants, took over some pretty
  784.    great farmland southeast of Edmonton by virtue of “homesteading”, such a <em>nice</em> word isn’t it?</p>
  785.    <p>Regina tries to honor its indigenous heritage and my favorite expression of that is its
  786.    <a href="https://mackenzie.art">Mackenzie Art Gallery</a>, a lovely welcoming space in the
  787.    <a href="https://www.saskatchewan.ca/government/directory?ou=a8e54600-77d6-4b7e-9702-f07a3dac1b47">T.C.Douglas building</a> (for
  788.    “T.C.” read “Tommy”. (Did I mention him?) Mom and I walked around it and had lunch in its very decent café.</p>
  789.    <p>Every time I’ve been there the big exhibitions in the big rooms have been indigenous-centered, and generally excellent.
  790.    I try to go every time I visit and I’ve never been disappointed.</p>
  791.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/PXL_20250708_172437441.png" alt="Indigenous art at Regina’s Mackenzie Gallery" />
  792.    <p>In 2025, anything I have to say about this piece would be superfluous.</p>
  793.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/PXL_20250708_173041377.png" alt="Every American Flag Is A Warning Sign" />
  794.    <p>I love modern-art galleries, especially with big rooms full of big pieces, even if I don’t like all the art.
  795.    Because it feels good to be in the presence of the work of people who are pouring out
  796.    what they have to offer, especially at large scale. If the task wasn’t hard enough that failures
  797.    are common then it wouldn’t be worthwhile, would it?</p>
  798.    <p>They’re especially great when there’s someone I love there enjoying it with me. Here’s Mom.</p>
  799.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/09/PXL_20250708_172836385.png" alt="Jean Bray considers indigenous art" />
  800.    <p>These days, any visit might be the last. I hope this wasn’t.</p>
  801. </div></content></entry>
  802.  
  803. <entry>
  804. <title>QRS: Epsilon Wrangling</title>
  805. <link href='https://www.tbray.org/ongoing/When/202x/2025/07/07/Epsilon-Wrangling' />
  806. <link rel='replies'        thr:count='0'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/07/07/Epsilon-Wrangling#comments' />
  807. <id>https://www.tbray.org/ongoing/When/202x/2025/07/07/Epsilon-Wrangling</id>
  808. <published>2025-07-07T12:00:00-07:00</published>
  809. <updated>2025-07-09T19:41:00-07:00</updated>
  810. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Quamina Diary' />
  811. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  812. <category scheme='https://www.tbray.org/ongoing/What/' term='Quamina Diary' />
  813. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Software' />
  814. <category scheme='https://www.tbray.org/ongoing/What/' term='Software' />
  815. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>I haven’t shipped any new features for     <a href='https://github.com/timbray/quamina'>Quamina</a> in many months, partly due to a flow of real-life distractions, but     also I’m up against tough performance problems in implementing     <a href='/ongoing/When/202x/2024/12/12/Quamina-Regular-Expression-Series'>Regular Expressions at massive scale</a>.     I’m still looking for a breakthrough, but have learned things about building and executing finite automata     that I think are worth sharing. This piece has to do with     <a href='https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton#NFA_with_ε-moves'>epsilons</a>; anyone who has studied     finite automata will know about them already, but I’ll offer background for those people to skip</div></summary>
  816. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  817.    <p>I haven’t shipped any new features for
  818.    <a href="https://github.com/timbray/quamina">Quamina</a> in many months, partly due to a flow of real-life distractions, but
  819.    also I’m up against tough performance problems in implementing
  820.    <a href="/ongoing/When/202x/2024/12/12/Quamina-Regular-Expression-Series">Regular Expressions at massive scale</a>.
  821.    I’m still looking for a breakthrough, but have learned things about building and executing finite automata
  822.    that I think are worth sharing. This piece has to do with
  823.    <a href="https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton#NFA_with_ε-moves">epsilons</a>; anyone who has studied
  824.    finite automata will know about them already, but I’ll offer background for those people to skip.</p>
  825.    <p>I’ve written about this before in
  826.    <a href="/ongoing/When/202x/2024/06/17/Epsilon-Love">Epsilon Love</a>. A commenter pointed out that the definition of “epsilon”
  827.    in that piece is not quite right per standard finite-automata theory, but it’s still a useful in that it describes how
  828.    epsilons support constructs like the shell-style “<code>*</code>”.</p>
  829.    <h2 id='p-2'>Background</h2>
  830.    <p>Finite automata come in two flavors: Deterministic (DFA) and Nondeterministic (NFA).  DFAs move from state to state one input
  831.    symbol at a time: it’s simple and easy to understand and to implement.
  832.    NFAs have two distinguishing characteristics: First, when you’re in a
  833.    state and an input symbol arrives, you can transfer to more than one other state. Second, a state can have “epsilon transitions”
  834.    (let’s say “ε” for epsilon), which can happen any time at all while you’re in that state, input or no input.</p>
  835.    <p>NFAs are more complicated to traverse (will discuss below) but you need them if you want to
  836.    implement regular expressions with <code>.</code> and <code>?</code> and <code>*</code> and so on. You can turn any NFA into a
  837.    DFA, and I’ll come back to that subject in a future piece.</p>
  838.    <p>For implementing NFAs, I’ve been using
  839.    <a href="https://en.wikipedia.org/wiki/Thompson%27s_construction">Thompson's construction</a>, where
  840.    “Thompson” is
  841.    <a href="https://en.wikipedia.org/wiki/Ken_Thompson">Ken Thompson</a>, co-parent of Unix. This technique is also nicely
  842.    described by Russ Cox in
  843.    <a href="https://swtch.com/~rsc/regexp/regexp1.html">Regular Expression Matching Can Be Simple And Fast</a>. You don’t need to
  844.    learn it to understand this piece, but I’ll justify design
  845.    choices by saying “per Thompson”.</p>
  846.    <p>I’m going to discuss two specific issues today, ε-closures and a simpler NFA definition.</p>
  847.    <h2 id='p-3'>ε-closures</h2>
  848.    <p>To set the stage, consider this regexp: <nobr><code>A?B?C?X</code></nobr></p>
  849.    <p>It should match “X” and “BX” and “ACX” and so on, but not “CAX” or “XX”.
  850.    Thompson says that you implement <code>A?</code> with a
  851.    transition to the next state on “A” and another ε-transition to that next state; because if you see an “A” you should transition,
  852.    but then you can transition anyhow even if you don’t.</p>
  853.    <p>The resulting NFA looks like this:</p>
  854.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/07/AcmBcmCcmX.png" alt="NFA matching A?B?C?X" />
  855.    <p> In finite-automaton
  856.    math, states are usually represented by the letter “q” followed by a number (usually italicized and subscripted, like
  857.    <i>q<sub>0</sub></i>, but not here, sorry). Note <code>q4</code>’s double circle which means it’s
  858.    a goal state, i.e. if we get here we’ve matched the regexp.
  859.    I should add that this was produced with
  860.    <a href="https://draw.io">draw.io</a>, which seems to make this sort of thing easy.
  861.    </p>
  862.    <h2 id='p-5'>Back to that NFA</h2>
  863.    <p>So, here’s a challenge: Sketch out the traversal code in your head. Think about the input strings “AX” and “BCX” and just “X”
  864.    and how you’d get through the NFA to the Q4 goal state.</p>
  865.    <p>The trick is what’s called the ε-closure. When you get to a state, before you look at the next input symbol, you have to set
  866.    up to process it. In this case, you need to be able to transition on an A or B or C. So what you do is pull together the
  867.    start state <code>q0</code> and also any other states you can reach from there through ε-transitions. In this case, the ε-closure
  868.    for the start state is <code>{q0, q1, q2, q3}</code>.</p>
  869.    <p>Suppose, then, that you see a “B” input symbol. You apply it to all the states in the ε-closure. Only <code>q1</code> matches,
  870.    transitioning you to
  871.    <code>q2</code>. Before you look at the next input symbol, you compute the ε-closure for <code>q2</code>, which turns
  872.    out to be <code>{q2, q3}</code>. With this ε-closure, you can match “C” or “X”. If you get a “C”, you”ll step to
  873.    <code>q3</code>, whose ε-closure is just itself, because “X” is the only path forward.</p>
  874.    <p>So your NFA-traversal algorithm for one step becomes something like:</p>
  875.    <ol>
  876.      <li><p>Start with a list of states.</p></li>
  877.      <li><p>Compute the ε-closure of that list.</p></li>
  878.      <li><p>Read an input symbol.</p></li>
  879.      <li><p>For each state in the ε-closure, see if you can traverse to another state.</p></li>
  880.      <li><p>If so, add it to your output list of states.</p></li>
  881.      <li><p>When you’re done, your output list of states is the input to this algorithm for the next step.</p></li>
  882.    </ol>
  883.    <h2 id='p-6'>Computation issues</h2>
  884.    <p>Suppose your regular expression is <code>(A+BC?)+</code>. I’m not going to sketch out the NFA, but just looking at it tells
  885.    you that it has to have loopbacks; once you’ve matched the parenthetized chunk you need to go back to a state where you can
  886.    recognize another occurrence.
  887.    For this regexp’s NFA, computing the ε-closures can lead you into an infinite loop. (Should be obvious, but I didn’t realize it until
  888.    after the first time it happened.)</p>
  889.    <p>You can have loops and you can also have dupes. In practice, it’s not that uncommon for a state to have more than one
  890.    ε-transition, and for the targets of these transitions to overlap.</p>
  891.    <p>So you need to watch for loops and to dedupe your output. I think the only way to avoid this is with a cookie-crumbs
  892.    “where I’ve been” trail, either as a list or a hash table.</p>
  893.    <p>Both of these are problematic because they require allocating memory, and that’s something you really don’t want to do when
  894.    you’re trying to match patterns to events at Quamina’s historic rate of millions per second.</p>
  895.    <p>I’ll dig into this problem in a future Quamina-Diary outing, but obviously, caching computed
  896.    epsilon closures would avoid re-doing this computation.</p>
  897.    <p>Anyhow, bear ε-closures in mind, because they’ll keep coming up as this series goes on.</p>
  898.    <h2 id='p-7'>And finally, simplifying “NFA”</h2>
  899.    <p>At the top of this piece, I offered the standard definition of NFAs: First, when you’re in a
  900.    state and an input symbol arrives, you can transfer to more than one other state. Second, you can have ε-transitions.
  901.    Based on my recent work, I think this definition is redundant. Because if you need to transfer to two different states on some
  902.    input symbol, you can do that with ε-transitions.</p>
  903.    <p>Here’s a mini-NFA that transfers from state <code>q0</code> on “A” to both <code>q1</code> and <code>q2</code>.</p>
  904.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/07/Splice-1.png" alt="An NFA transferring to two different states on an input symbol" />
  905.    <p>And here’s how you can achieve the same effect with ε-transitions:</p>
  906.    <img src="https://www.tbray.org/ongoing/When/202x/2025/07/07/Splice-2.png" alt="Transferring to two destinations using ε-transitions" />
  907.    <p>In that NFA, in <code>qS</code> the “S” stands for “splice”, because it’s a state that exists to connect
  908.    two threads of finite-automaton traversal.</p>
  909.    <p>I’m pretty sure that this is more than just a mathematical equivalence. In my regexp implementation, so far at least,
  910.    I’ve never encountered a need to do that first kind of dual transition. Furthermore, the “splice” structure is how Thompson
  911.    implements the regular-expression “<code>|</code>” operator.</p>
  912.    <p>So if you’re building an NFA, all the traversal stuff you need in a state is a simple map from input symbol to next state,
  913.    and a list of ε-transitions.</p>
  914.    <h2 id='p-8'>Next up</h2>
  915.    <p>How my own implementation of NFA traversal collided head-on into the Benchmark From Hell and still hasn’t recovered.</p>
  916. </div></content></entry>
  917.  
  918. <entry>
  919. <title>The Real GenAI Issue</title>
  920. <link href='https://www.tbray.org/ongoing/When/202x/2025/07/06/AI-Manifesto' />
  921. <link rel='replies'        thr:count='10'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/07/06/AI-Manifesto#comments' />
  922. <id>https://www.tbray.org/ongoing/When/202x/2025/07/06/AI-Manifesto</id>
  923. <published>2025-07-06T12:00:00-07:00</published>
  924. <updated>2025-07-06T12:06:43-07:00</updated>
  925. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/AI' />
  926. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  927. <category scheme='https://www.tbray.org/ongoing/What/' term='AI' />
  928. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Last week I published a     <a href='/ongoing/When/202x/2025/07/01/First-AI-Code'>featherweight narrative</a> about applying GenAI in a real-world context, to     a tiny programming problem.  Now I’m regretting that piece because I totally ignored the two central issues with     AI: What it’s meant to do, and how much it really costs</div></summary>
  929. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  930.    <p>Last week I published a
  931.    <a href="/ongoing/When/202x/2025/07/01/First-AI-Code">featherweight narrative</a> about applying GenAI in a real-world context, to
  932.    a tiny programming problem.  Now I’m regretting that piece because I totally ignored the two central issues with
  933.    AI: What it’s meant to do, and how much it really costs.</p>
  934.    <h2 id='p-1'>What genAI is for</h2>
  935.    <p>The most important fact about genAI in the real world is that there’ve been literally
  936.    <a href="https://finance.yahoo.com/news/how-nvidia-played-a-central-role-in-the-306-billion-ai-startup-boom-195741749.html?guccounter=1">hundreds
  937.    of billions</a> of dollars invested in it; that link is just startups, and ignores a comparable torrent of cash pouring out of Big
  938.    Tech.</p>
  939.    <p>The business leaders pumping all this money of course don’t understand the technology. They’re doing this for exactly one
  940.    reason: They think they can discard armies of employees and replace them with LLM services, at the cost of
  941.    shipping shittier products.  Do you think your management would spend that kind of money to help you with a quicker first draft or
  942.    a summarized inbox?</p>
  943.    <p>Adobe said the quiet part out loud:
  944.    <a href="https://petapixel.com/2024/05/03/adobe-throws-photographers-under-the-bus-again-skip-the-photoshoot/">Skip the
  945.    Photoshoot</a>. </p>
  946.    <p>At this point someone will point out that previous technology waves have generated as much employment as they’ve eliminated.
  947.    Maybe so, but that’s not what business leaders think they’re buying. They think they’re buying smaller payrolls.</p>
  948.    <p>Maybe I’m overly sensitive, but thinking about these truths leads to a mental stench that makes me want to stay away from
  949.    it.</p>
  950.    <h2 id='p-2'>How much does genAI cost?</h2>
  951.    <p>Well, I already mentioned all those hundreds of billions. But that’s pocket change. The investment community in general and
  952.    Venture Capital in particular will whine and moan, but the people who are losing the money are people who can afford to.</p>
  953.    <p>The first real cost is hypothetical: What if those business leaders are correct and they can gleefully dispose of millions of
  954.    employees? If you think we’re already suffering from egregious levels of inequality, what happens when a big chunk of the
  955.    middle class suddenly becomes professionally superfluous?  I’m no economist so I’ll stop there, but you don’t have to be a
  956.    rocket scientist to predict severe economic pain.</p>
  957.    <p>Then there’s the other thing that nobody talks about, the massive greenhouse-gas load that all those data centers are going
  958.    to be pumping out. This at a time when we we blow past one atmospheric-carbon metric after another and David Suzuki says
  959.    <a href="https://www.ipolitics.ca/2025/07/02/its-too-late-david-suzuki-says-the-fight-against-climate-change-is-lost/">the
  960.    fight against climate change is lost</a>, that we need to hunker down and work on survival at the local level.</p>
  961.    <h2 id='p-3'>The real problem</h2>
  962.    <p>It’s the people who are pushing it.  Their business goals are quite likely, as a side-effect, to make
  963.    the world a worse place, and they don’t give a fuck.  Their technology will inevitably worsen the onrushing climate catastrophe,
  964.    and they don’t give a fuck.</p>
  965.    <p>It’s probably not as simple as “They’re just shitty people”<span class='dashes'> —</span> it’s not exactly easy to escape the
  966.    exigencies of modern capitalism. But they are people who are doing shitty things.</p>
  967.    <h2 id='p-4'>Is genAI useful?</h2>
  968.    <p>Sorry, I’m having trouble even thinking about that now.</p>
  969. </div></content></entry>
  970.  
  971. <entry>
  972. <title>My First GenAI Code</title>
  973. <link href='https://www.tbray.org/ongoing/When/202x/2025/07/01/First-AI-Code' />
  974. <link rel='replies'        thr:count='3'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/07/01/First-AI-Code#comments' />
  975. <id>https://www.tbray.org/ongoing/When/202x/2025/07/01/First-AI-Code</id>
  976. <published>2025-07-01T12:00:00-07:00</published>
  977. <updated>2025-07-01T11:38:00-07:00</updated>
  978. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/AI' />
  979. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  980. <category scheme='https://www.tbray.org/ongoing/What/' term='AI' />
  981. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Software' />
  982. <category scheme='https://www.tbray.org/ongoing/What/' term='Software' />
  983. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>At the moment, we have no idea what the impact of genAI on software development is going to be. The impact of     <em>anything</em> on coding     is hard to measure systematically, so we rely on anecdata and the community’s eventual consensus.     So, here’s my anecdata. Tl;dr: The AI was not useless</div></summary>
  984. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  985.    <p>At the moment, we have no idea what the impact of genAI on software development is going to be. The impact of
  986.    <em>anything</em> on coding
  987.    is hard to measure systematically, so we rely on anecdata and the community’s eventual consensus.
  988.    So, here’s my anecdata. Tl;dr: The AI was not useless.</p>
  989.    <h2 id='p-1'>The problem</h2>
  990.    <p>My current work on
  991.    <a href="/ongoing/What/Technology/Quamina%20Diary/">Quamina</a> involves dealing with collections of finite-automata states,
  992.    which, in the Go programming language, are represented as slices of pointers to state instances:</p>
  993.    <blockquote><p><code>[]*faState</code></p></blockquote>
  994.    <p>The problem I was facing was deduping them, so that there would be only one instance corresponding to any particular
  995.    collection. This is what, in Java, the <code>intern()</code> call does with strings.</p>
  996.    <p>The algorithm isn’t rocket science:</p>
  997.    <ol>
  998.      <li><p>Dedupe the states, i.e. turn the collection into a set.</p></li>
  999.      <li><p>For each set of states, generate a key.</p></li>
  1000.      <li><p>Keep a hash table of sets around, and use the key to see whether you’ve already got such a set, and if so return
  1001.      it. Otherwise, make a new entry in the hash table and return that.</p></li>
  1002.    </ol>
  1003.    <p>I’m out of touch with the undergrad CS curriculum, but this feels like a second-year assignment or thereabouts? Third?</p>
  1004.    <h2 id='p-2'>Enter Claude</h2>
  1005.    <p>So I prompted Claude thus:</p>
  1006.    <blockquote><p>I need Go code to provide a "intern"-like function for lists of pointers. For example, if I have several
  1007.    different []*int arrays, which may contain duplicates, I want to call intern() on each of them and get back a single canonical
  1008.    pointer which is de-duplicated and thus a set.</p></blockquote>
  1009.    <p>Claude did pretty well. It got the algorithm right, the code was idiomatic and usefully commented, and it also provided a
  1010.    decent unit test (but in a <code>main()</code> stanza rather than a proper Go test file).
  1011.    I didn’t try actually running it.</p>
  1012.    <p>The interesting part was the key computation. I, being lazy, had just done a Go <code>fmt.Sprintf("%p")</code>
  1013.    incantation to get a hex string representing each state’s address, sorted them, joined them, and that was the key.</p>
  1014.    <p>Claude worked with the pointers more directly.</p>
  1015.    <pre><code> // Sort by pointer address for consistent ordering
  1016. sort.Slice(unique, func(i, j int) bool {
  1017. return uintptr(unsafe.Pointer(unique[i])) &lt; uintptr(unsafe.Pointer(unique[j]))
  1018. })</code></pre>
  1019.    <p>Then it concatenated the raw bytes of the map addresses and lied to Go by claiming it was a string.</p>
  1020.    <pre><code> // Create key from pointer addresses
  1021. key := make([]byte, 0, len(slice)*8)
  1022. for _, ptr := range slice {
  1023. addr := uintptr(unsafe.Pointer(ptr))
  1024. // Convert address to bytes
  1025. for i := 0; i &lt; 8; i++ {
  1026. key = append(key, byte(addr>>(i*8)))
  1027. }
  1028. }
  1029. return string(key)</code></pre>
  1030. <p>This is an improvement in that the keys will be half the size of my string version.
  1031. I didn’t copy-paste Claude’s code wholesale, just replaced ten or so lines of key construction.</p>
  1032.    <h2 id='p-3'>Take-away</h2>
  1033.    <p>I dunno. I thought the quality of the code was fine, wouldn’t have decomposed the functions in the same way but wouldn’t have
  1034.    objected on review. I was pleased with the algorithm, but then I would be since it was the same one I’d written, and, having
  1035.    said that, quite possibly that’s the only algorithm that anyone has used. It will be <em>super</em> interesting if someone
  1036.    responds to this write-up saying “You and Claude are fools, here’s a much better way.”</p>
  1037.    <p>Was it worth fifteen minutes of my time to ask Claude and get a slightly better key computation?
  1038.    Only if this ever turns out
  1039.    to be a hot code path and I don’t think anybody’s smart enough to know that in advance.</p>
  1040.    <p>Would I have saved time by asking Claude first? Tough to tell; Quamina’s data structures are a bit non-obvious and I would
  1041.    have had to go to a lot of prompting work to get it to emit code I could use directly.
  1042.    Also, since Quamina is low-level performance-critical infrastructure code, I’d be nervous about having any volume of code
  1043.    that I didn’t really <em>really</em> understand.</p>
  1044.    <p>I guess my take-away was that in this case, Claude knew the Go idioms and APIs better than I did; I’d never looked at the
  1045.    <a href="https://pkg.go.dev/unsafe">unsafe</a> package.</p>
  1046.    <p>Which reinforces my
  1047.    suspicion that genAI is going to be especially useful at helping generate code to talk to big complicated
  1048.    APIs that are hard to remember all of.  Here’s an example: Any moderately competent Android developer could add a feature to an
  1049.    app where it strobes the flash and surges the vibration in sync with how fast you’re shaking the device back and forth,
  1050.    probably in an afternoon. But it would require a couple of dozen calls into the dense forest of Android APIs, and I suspect a
  1051.    genAI might get you there a lot faster by just filling the calls in as prompted.</p>
  1052.    <p>Reminder: This is just anecdata.</p>
  1053. </div></content></entry>
  1054.  
  1055. <entry>
  1056. <title>Qobuz and Mac</title>
  1057. <link href='https://www.tbray.org/ongoing/When/202x/2025/06/22/Qobuz-and-Others' />
  1058. <link rel='replies'        thr:count='0'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/06/22/Qobuz-and-Others#comments' />
  1059. <id>https://www.tbray.org/ongoing/When/202x/2025/06/22/Qobuz-and-Others</id>
  1060. <published>2025-06-22T12:00:00-07:00</published>
  1061. <updated>2025-06-26T13:13:08-07:00</updated>
  1062. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts/Music' />
  1063. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts' />
  1064. <category scheme='https://www.tbray.org/ongoing/What/' term='Music' />
  1065. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Back in March I offered     <a href='/ongoing/When/202x/2025/03/27/Music-Plus-Qobuz'>Latest Music (feat. Qobuz)</a>, describing all the ways I listen to     music (Tl;dr: YouTube Music, Plex, Qobuz, record player). I stand by my opinions there but wanted to write more on two subjects:     First Qobuz, because it suddenly got a lot better. And a recommendation, for people with fancy A/V setups, that you include a cheap     Mac Mini</div></summary>
  1066. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1067.    <p>Back in March I offered
  1068.    <a href="/ongoing/When/202x/2025/03/27/Music-Plus-Qobuz">Latest Music (feat. Qobuz)</a>, describing all the ways I listen to
  1069.    music (Tl;dr: YouTube Music, Plex, Qobuz, record player). I stand by my opinions there but wanted to write more on two subjects:
  1070.    First Qobuz, because it suddenly got a lot better. And a recommendation, for people with fancy A/V setups, that you include a cheap
  1071.    Mac Mini.</p>
  1072.    <h2 id='p-1'>Qobuz</h2>
  1073.    <p>That other piece had a list of the reasons to use Qobuz, but times have changed, so let’s revise it:</p>
  1074.    <ol>
  1075.      <li><p>It pays artists more per stream than any other service, by a wide margin.</p></li>
  1076.      <li><p>It seems to have as much music as anyone else.</p></li>
  1077.      <li><p>It’s album-oriented, and I appreciate artists curating their own music.</p></li>
  1078.      <li><p>Classical music is a first-class citizen.</p></li>
  1079.      <li><p>It’s actively curated; they highlight new
  1080.      music regularly, and pick a “record of the week”. To get a feel, check out
  1081.      <a href="https://www.qobuz.com/ca-en/magazine">Qobuz Magazine</a>; you don’t have to be a subscriber.</p></li>
  1082.      <li><p>It gives evidence of being built by people who love music.</p></li>
  1083.      <li><p>They’re obsessive about sound quality, which is great, but only makes a difference if you’re listening through quality
  1084.      speakers.</p></li>
  1085.      <li><p>A few weeks ago, the mobile app quality switched from adequate to
  1086.      excellent.</p></li>
  1087.    </ol>
  1088.    <h2 id='p-2'>That app</h2>
  1089.    <p>I want to side-trip a bit here, starting with a question. How long has it been since an app you use has added a feature that
  1090.    was genuinely excellent and let you do stuff you couldn’t before and didn’t get in your way and created no suspicion that it was
  1091.    strip-mining your life for profit?  I’m here to tell you that this can still happen, and it’s a crushing criticism
  1092.    of my profession that it so rarely does.</p>
  1093.    <p>I’m talking about
  1094.    <a href="https://www.qobuz.com/ca-en/connect">Qobuz Connect</a>. I believe there are other music apps that can do this sort of
  1095.    stuff, but it feels like magic to me.</p>
  1096.    <p>It’s like this. I listen to music at home on an audiophile system with big speakers, in
  1097.    <a href="/ongoing/What/The%20World/Jaguar%20Diary/">our car</a>, and on
  1098.    <a href="/ongoing/When/201x/2019/08/06/Jeanneau-795">our boat</a>.  The only app I touch is the
  1099.    <a href="https://play.google.com/store/apps/details?id=com.qobuz.music">Qobuz Android app</a>. The only time it’s actually
  1100.    receiving and playing the music itself is in the car, with the help of Android Auto.  In the other scenarios it’s talking to
  1101.    Qobuz running on a Mac, which actually fetches the music and routes it to the audio system.
  1102.    Usually it figures out what player I want it to control automatically, although there’ve been a couple
  1103.    times when I drove away in the car and it got confused about where to send the music. Generally, it works great.</p>
  1104.    <p>The app’s music experience is rich and involving.</p>
  1105.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/22/Screenshot_20250622-230116.png" alt="Qobuz Android app screenshot" />
  1106.    <p>It has New Releases and curated playlists and a personalized stream for
  1107.    me and a competent search function for those times I absolutely must listen to Deep Purple or Hania Rani or
  1108.    whoever.</p>
  1109.    <p>I get a chatty not-too-long email from Qobuz every Friday, plugging a few of the week’s new releases, with sideways and
  1110.    backward looks too. (This week: A Brian Wilson stream.) The app has so much stuff, especially among the themed streams, that I
  1111.    sometimes get lost. But somehow it’s not irritating; what’s on the screen remains musically interesting and you can always hit
  1112.    the app’s Home button.</p>
  1113.    <p>Qobuz has its own musical tastes that guide its curation. They’re not always compatible with
  1114.    mine<span class='dashes'> —</span> my tolerance for EDM and mainstream Hip-hop remains low. And I wish they were
  1115.    stronger on Americana. But the intersection is broad enough to provide plenty of enjoyable new-artist experiences. Let me share
  1116.    one with you:
  1117.    <a href="https://kwashibu.bandcamp.com/album/love-warrior-s-anthem">Kwashibu Area Band</a>, from Ghana.</p>
  1118.    <p>Oh, one complaint: Qobuz was eating my Pixel’s battery. So I poked around online and it’s a known problem; you have to use the
  1119.    Android preferences to stop it from running in the background. Huh? What was it doing in the background anyhow?! But it seems to
  1120.    work fine even when it’s not doing it.</p>
  1121.    <h2 id='p-3'>A Mac, you say?</h2>
  1122.    <p>The music you’re listening to is going to be stored on disk, or incoming from a streaming service. Maybe you want to serve
  1123.    some of the stored music out to listen to it in the car or wherever. There are a variety of audio products in the
  1124.    “Streamer” category that do some of these things in various combinations. A lot of them make fanciful claims about the
  1125.    technology inside and are thus expensive, you can easily spend thousands.</p>
  1126.    <p>But any reasonably modern computer can do all these things and more, plus it also can drive a big-screen display, plus it will
  1127.    probably run the software behind whatever next year’s New Audio Hotness is.</p>
  1128.    <p>At this point the harder-core geeks will adopt a superior tone of voice to say “I do all that stuff with FreeBSD and a bunch of
  1129.    open-source packages running on a potato!”</p>
  1130.    <p>More power to ’em. But I recommend a basic Apple Silicon based Mac Mini, M1 is fine, which you can get for like $300 used on
  1131.    eBay. And if you own a lot of music and video you can plug in a 5T USB drive for a few more peanuts. This will run Plex and
  1132.    Qobuz and almost any other imaginable streaming software. Plus you can plug it into your home-theater screen and it has a modern
  1133.    Web browser so you can also play anything from anywhere on the Web.</p>
  1134.    <p>I’ve been doing this for a while but I had one big gripe. When I wanted to stream music from the Mac, I needed to use a
  1135.    keyboard and mouse, so I keep one of each, Bluetooth-flavored, nearby. But since I got Qobuz running that’s become a very rare
  1136.    occurrence.</p>
  1137.    <h2 id='p-4'>You’re forgetting something</h2>
  1138.    <p>Oh, and yeah, there’s the record player. Playing it requires essentially no software at all, isn’t that great?</p>
  1139. </div></content></entry>
  1140.  
  1141. <entry>
  1142. <title>Long Links</title>
  1143. <link href='https://www.tbray.org/ongoing/When/202x/2025/06/21/Long-Links' />
  1144. <link rel='replies'        thr:count='6'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/06/21/Long-Links#comments' />
  1145. <id>https://www.tbray.org/ongoing/When/202x/2025/06/21/Long-Links</id>
  1146. <published>2025-06-21T12:00:00-07:00</published>
  1147. <updated>2025-06-21T11:56:27-07:00</updated>
  1148. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  1149. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  1150. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>“Wow, Tim, didn’t you do a      <a href='/ongoing/When/202x/2025/05/06/Long-Links'>Long Links</a> just last month? Been spending too much time doomscrolling,     have we?” Maybe. There sure are a lot of tabs jostling each other along the top of that browser. Many     are hosting works that are both long and good. So here they are; you probably don’t have time for all of ’em but my hope     is that one or two might reward your visit</div></summary>
  1151. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1152.    <p>“Wow, Tim, didn’t you do a
  1153.    <a href="/ongoing/When/202x/2025/05/06/Long-Links">Long Links</a> just last month? Been spending too much time doomscrolling,
  1154.    have we?” Maybe. There sure are a lot of tabs jostling each other along the top of that browser. Many
  1155.    are hosting works that are both long and good. So here they are; you probably don’t have time for all of ’em but my hope
  1156.    is that one or two might reward your visit.</p>
  1157.    <p>Let’s start with a really important subject: Population growth oh actually these days it’s population shrinkage.
  1158.    For a short-sharp-shock-flavored introduction I recommend
  1159.    <a href="https://www.youtube.com/watch?v=Ufmu1WD2TSk">South Korea Is Over</a>
  1160.    which explains the brick wall societies with fertility rates way below the replacement rate of 2.1 children per woman per
  1161.    lifetime are hurtling toward. South Korea, of course, being the canonical example. But also Japan and Taiwan and Italy and Spain
  1162.    and so on.</p>
  1163.    <p>And, of course, the USA, where the numbers aren’t <em>that</em> much higher:
  1164.    <a href="https://www.macrotrends.net/global-metrics/countries/usa/united-states/fertility-rate">U.S. Fertility Rate
  1165.    (1950-2025)</a>. Even so, the population still grows (because of immigration), albeit at less than 1% per annum:
  1166.    <a href="https://www.macrotrends.net/global-metrics/countries/usa/united-states/population-growth-rate">U.S. Population Growth
  1167.    Rate</a>. If the MAGAs get their way and eventually stop all non-white immigration, the US will be in South Korea
  1168.    territory within a generation or two. </p>    
  1169.    <p>A reasonable person might ask why. It’s not really complicated, as you can read here:
  1170.    <a href="https://www.nytimes.com/2025/06/15/opinion/birth-rate-parenting-natalism.html?unlocked_article_code=1.Pk8.OBam.dOi0UpP-8-DV&amp;smid=url-share">A Bold Idea to Raise the Birthrate: Make Parenting Less Torturous</a>.
  1171.    From which I quote: “To date, no government policies have significantly improved their nation’s birthrates for a sustained
  1172.    period.” The essay argues convincingly that it’s down to two problems: Capitalism and sexism. Neither of which offers an easy
  1173.    fix. </p>
  1174.    <p>Speaking of the travails of late capitalism, here’s how bad it’s getting:
  1175.    <a href="https://www.nytimes.com/2025/03/01/opinion/crisis-working-homeless.html?unlocked_article_code=1.Qk8.jsTO.aUBSAMHw7Op2&amp;smid=url-share">America
  1176.    Is Pushing Its Workers Into Homelessness</a>.</p>
  1177.    <p>For a refreshingly different take on the business world, here’s Avery Pennarun, CEO of Tailscale:
  1178.    <a href="https://apenwarr.ca/log/20250530">The evasive evitability of enshittification</a>. Not sure I buy what he’s saying, but
  1179.    still worth reading.</p>
  1180.    <p>Most people who visit these pages are geeks or geek-adjacent. If you’re one of those, and especially if you enjoy the small
  1181.    but vibrant genre of Comical Tech War Stories, I recommend
  1182.    <a href="https://yeet.cx/blog/lock-free-rust/">Lock-Free Rust: How to Build a Rollercoaster
  1183.    While It’s on Fire</a></p>
  1184.    <p>And here’s write-up on an AWS product which has one of the best explanations I’ve ever read of the different flavors modern
  1185.    databases come in: <a href="https://www.redshift-observatory.ch/white_papers/downloads/introduction_to_the_fundamentals_of_amazon_redshift.html">Introduction to the Fundamentals of Amazon Redshift</a></p>
  1186.    <p>Of course, the geek conversation these days is much taken up with the the impact of genAI as in “vibe coding”. To
  1187.    summarize the conversation: A few people, not obviously fools,  are saying “This stuff seems to help me” and many others, also
  1188.    apparently sensible, are shouting back “You’re lying to yourself, it can’t be helping!”  Here is some of the testimony:
  1189.    Kellan on <a href="https://laughingmeme.org//2025/05/25/vibe-coding-for-teams.html">Vibe
  1190.    coding for teams, thoughts to date</a>, Armin Ronacher on
  1191.    <a href="https://lucumr.pocoo.org/2025/6/12/agentic-coding/">Agentic Coding Recommendations</a>,
  1192.    Harper on <a href="https://harper.blog/2025/05/08/basic-claude-code/">Basic Claude Code</a>, and
  1193.    Klabnik on
  1194.    <a href="https://steveklabnik.com/writing/a-tale-of-two-claudes/">A tale of two Claudes</a></p>
  1195.    <p>I lean to believing narratives of personal experience, but on the other hand the skeptics make good points. Another
  1196.    random piece of evidence: Because I’m lazy, I tend to resist adopting technologies that have steep learning curves, which genAI
  1197.    currently does. On many occasions, this has worked out well because those technologies have turned out not to pay off very
  1198.    well. Am I a canary in the coal mine?</p>
  1199.    <h2 id='p-2'>*cough*</h2>
  1200.    <p>Since I introduced myself into the narrative, I’ll note that today is my 70th birthday. I am told that this means
  1201.    that my wisdom has now been maximized, so you’re safe in believing whatever you read in this space.  I don’t have anything
  1202.    special to say to commemorate the occasion,
  1203.    so here’s a picture of my neighborhood’s network infrastructure, which outlines the form of a
  1204.    cathedral’s nave. I’m sure there’s a powerful metaphor lurking in there.</p>
  1205.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/21/TXT55659.png" alt="Many electrical and data wires festoon a back alley" />    
  1206.    <p>Oh, and here’s a photography Long Link: <a href="https://www.lux.camera/what-is-hdr/">What is HDR, anyway?</a>
  1207.    It’s actually a pitch for a nice-looking mobile camera app, but it offers real value on things that can
  1208.    affect the quality of your pictures.</p>
  1209.    <p>Regular readers will know that I’m fascinated by the many unsolved issues and open questions in cosmology, which are by
  1210.    definition the largest problems facing human consciousness. The ΛCDM-vs-MOND controversy, i.e. “Is there really dark
  1211.    matter or does gravity get weird starting at the outer edges of galaxies?”, offers great entertainment value. And, there is
  1212.    news!</p>
  1213.    <p>First of all, here’s a nice overview on the controversy:
  1214.    <a href="https://arxiv.org/pdf/2505.21638v1">Modified Newtonian Dynamics: Observational Successes and Failures</a>.</p>
  1215.    <p>Which points out that the behavior of “wide binary” star systems ought to help resolve the issue, but that people who
  1216.    study it keep coming up with contradictory findings. Here’s the latest, from Korean researchers: Press release
  1217.    <a href="http://www.sejongpr.ac.kr/sejongnewspaperview.do?currentPage=1&amp;searchField=&amp;searchValue=&amp;boardType=3&amp;pkid=73549&amp;utm_source=beehiiv&amp;utm_medium=newsletter&amp;utm_campaign=mediamobilize&amp;_bhlid=3e40dce99e536f4015a1dd2c6afd193a465d17ea">New method of measuring gravity with 3D velocities of wide binary stars is developed and confirms modified gravity</a>
  1218.    and peer-reviewed paper:
  1219.    <a href="https://iopscience.iop.org/article/10.3847/1538-4357/adce09">Low-acceleration Gravitational Anomaly
  1220.    from Bayesian 3D Modeling of Wide Binary Orbits: Methodology and Results with Gaia Data Release 3</a>.
  1221.    Spoiler: They think the gravity gets weird. I have a math degree but cosmology math is generally way over my head. Having said
  1222.    that, I think those South Koreans may be a bit out over their skis; I generally distrust heroic statistical methods. We’ll
  1223.    see.</p>
  1224.    <p>Let’s do politics. It turns out that the barbaric junta which oppresses the people of China does not limit its barbarism
  1225.    to its own geography:
  1226.    <a href="https://www.cbc.ca/news/politics/china-targets-dissidents-canada-1.7543745?cmp=rss">Followed, threatened and smeared
  1227.    — attacks by China against its critics in Canada are on the rise</a>.</p>
  1228.    <p>More politics: The MAGAs are always railing against “elites”. Here are two discussions of what they mean:
  1229.    <a href="https://www.theatlantic.com/ideas/archive/2025/04/class-money-finances/682301/">What the Comfort Class Doesn’t
  1230.    Get</a> and <a href="https://siderea.dreamwidth.org/1865048.html">When They Say Elites, They Mean Us</a>.</p>
  1231.    <p>The world’s biggest political issue <em>should</em> be the onrushing climate crisis. When Trump and his toadies
  1232.    are justly condemned and ridiculed by future historians, it is their malevolent cluelessness on this subject that
  1233.    may burn the hottest. Who knows, maybe they’ll pay attention to this:
  1234.    <a href="https://www.bloomberg.com/news/newsletters/2025-06-18/insurers-want-businesses-to-wake-up-to-costs-of-extreme-heat">Insurers Want Businesses to Wake Up to Costs of Extreme Heat</a>.</p>
  1235.    <h2 id='p-1'>The list of Long Links is too long</h2>
  1236.    <p>So I’ll try to end cheerfully.</p>
  1237.    <p>A graceful essay about an old camera and a dreamy picture:
  1238.    <a href="https://petapixel.com/2025/05/27/a-bridge-across-time-for-sebastiao-salgado/">A Bridge Across Time: For
  1239.    Sebastião Salgado</a></p>
  1240.    <p>Latin Wikipedia has 140,000 articles; consider the delightful discussion of
  1241.    <a href="https://la.wikipedia.org/wiki/Equus_asinus"><cite>Equus asinus</cite></a>.</p>
  1242.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/21/equus-asinus.png" alt="Asinus in opere tesselato Byzantino" />
  1243.    <div class='caption'><p>Asinus in opere tesselato Byzantino</p></div>
  1244.    <p>Here’s a lovely little song from TORRES and Julien Baker:
  1245.    <a href="https://www.youtube.com/watch?v=TurU_Jn-LEg">The Only Marble I’ve Got Left</a>.</p>
  1246.    <p>Finally, a clear-eyed if lengthy essay on why and how to think:
  1247.    <a href="https://www.newyorker.com/culture/open-questions/should-you-question-everything">Should You Question
  1248.    Everything?</a></p>
  1249. </div></content></entry>
  1250.  
  1251. <entry>
  1252. <title>June 2025 C2PA News</title>
  1253. <link href='https://www.tbray.org/ongoing/When/202x/2025/06/17/More-C2PA' />
  1254. <link rel='replies'        thr:count='1'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/06/17/More-C2PA#comments' />
  1255. <id>https://www.tbray.org/ongoing/When/202x/2025/06/17/More-C2PA</id>
  1256. <published>2025-06-17T12:00:00-07:00</published>
  1257. <updated>2025-06-19T09:20:16-07:00</updated>
  1258. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Identity' />
  1259. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  1260. <category scheme='https://www.tbray.org/ongoing/What/' term='Identity' />
  1261. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Things are happening in the C2PA world; here are a couple of useful steps forward, plus cheers and boos for Adobe.     Plus a live working C2PA demo you can try out</div></summary>
  1262. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1263.    <p>Things are happening in the C2PA world; here are a couple of useful steps forward, plus cheers and boos for Adobe.
  1264.    Plus a live working C2PA demo you can try out.</p>
  1265.    <p>Refresher: The
  1266.    <a href="https://c2pa.org/">C2PA</a> technology is driven by the
  1267.    <a href="https://contentauthenticity.org/">Content Authenticity Initiative</a> and usually marketed as “Content Credentials”.
  1268.    I’ve written before about it, an
  1269.    <a href="/ongoing/When/202x/2023/10/28/C2PA-Workflows">introduction in 2023</a> and a
  1270.    <a href="/ongoing/When/202x/2024/10/29/Lane-Provenance">progress report</a> last October.</p>
  1271.    <p>Let’s start with a picture.</p>
  1272.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/17/TXT55648.png" alt="A dark picture full of vague swirls and jiggly lights" />
  1273.    <div class='caption'><p>I was standing with the camera by the ocean at dusk and accidentally left it in the “B” long-exposure
  1274.    setting, so this isn’t really a picture <em>of</em> anything but I thought it was kinda pretty.</p></div>
  1275.    <h2 id='p-1'>Validating Content Credentials</h2>
  1276.    <p>As I write this, there are now at least two C2PA-validator Chrome extensions: the
  1277.    <a href="https://chromewebstore.google.com/detail/contentlens-c2pa-validato/gdejpnjeepoffhkbcgnjdbkgpohdhmln?hl=en">ContentLens
  1278.    C2PA Validator</a> from
  1279.    <a href="https://www.contentlens.ai/">ContentLens</a> and
  1280.    <a href="https://chromewebstore.google.com/detail/c2pa-content-credentials/mjkaocdlpjmphfkjndocehcdhbigaafp?hl=en">C2PA Content
  1281.    Credentials</a> from
  1282.    <a href="https://www.digimarc.com/">Digimarc</a>.</p>
  1283.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/17/cc-readout.png" alt="C2PA verifier display" class="inline" />
  1284.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/17/cc2-readout.png" alt="C2PA verifier display" class="inline" />
  1285.    <p>If you install either of them, and then you click on that picture just above in Chrome to get the larger version, then you
  1286.    right-click on the larger picture, the menu will offer Content-Credentials validation.</p>
  1287.    <p>Doing this will produce a little
  1288.    “CR” logo at the top right corner, meaning that the C2PA data has been
  1289.    verified as being present and signed by a trusted certificate issuer, in this case Adobe.</p>
  1290.    <p>Then there’s a popup; the two extensions’ are on the right. They’re different, in interesting ways. Let’s walk through the
  1291.    second one.</p>
  1292.    <p>The little thumbnail at the top of the popup is what the image looked like when the C2PA was added. Not provided by the other
  1293.    verifier.</p>
  1294.    <p>The paragraph beginning “Displaying credentials…” says that the C2PA manifest was embedded in the JPG as opposed to stored
  1295.    out on the
  1296.    cloud; The cloud works fine, and is perhaps a good idea because the C2PA manifest can be quite large. I’m not clear on what the
  1297.    “watermark” is about.</p>
  1298.    <p>“Issued by Adobe” means that the Chrome extension verified the embedded C2PA against Adobe’s public key and can be
  1299.    confident that yes, this was really signed by them.</p>
  1300.    <p>“<b>Produced by</b> Timothy Bray” is interesting. How can it know? Well, it turns out that it used LinkedIn’s API to verify
  1301.    that I am
  1302.    <a href="https://www.linkedin.com/in/timbraysoftwareguy/">timbraysoftwareguy</a> over on LinkedIn. But it goes further; LinkedIn
  1303.    has an integration with
  1304.    <a href="https://www.clearme.com">Clear</a>, the airport-oriented identity provider. To get a Clear account you have to upload
  1305.    government-issued ID, it’s not trivial.</p>
  1306.    <p>So this short sentence expands to (take a deep breath) “The validator extension verified that Adobe said that
  1307.    LinkedIn said that Clear said that the government ID of the person who posted this says that he’s named Timothy Bray.”</p>
  1308.    <p>Note that the first extension’s popup also tells you that Adobe has verified what my LinkedIn and Instagram accounts
  1309.    are. This seems super-useful and I wonder why the other omits it.</p>
  1310.    <p>“<b>App or device used</b>…” is simple enough, but I’m not actually sure how it works; I guess Adobe has embedded a keypair
  1311.    in my Lightroom installation? If I’d taken the picture with a C2PA-equipped camera this is where that history would be
  1312.    displayed.</p>
  1313.    <p>“<b>AI tool used</b> None”. Interesting and useful, since Adobe provides plenty of genAI-powered tools. Of course, this
  1314.    relies on Lightroom telling the truth, but still.</p>
  1315.    <p>The “View More” button doesn’t currently work; it takes you to the interactive
  1316.    <a href="https://contentcredentials.org/verify/">contentcredentials.org/verify</a> page,
  1317.    which seems to fail in retrieving the JPG. If you download the picture then upload it into the verify page (go ahead, it’s
  1318.    free)
  1319.    that seems to work fine. In addition to the info on the popup, the verify page will tell you (nontechically i.e. vaguely) what I
  1320.    did to the picture with Lightroom.</p>
  1321.    <h2 id='p-3'>What’s good about this?</h2>
  1322.    <p>Well, it’s here and it works! There’s all this hype about how cool it will be when the C2PA includes info about what model
  1323.    of camera and lens it used and what the shutter speed was and so on, but eh, who cares really? What matters to me (and
  1324.    should matter to the world) is <em>provenance</em>: Who posted this thing?</p>
  1325.    <p>As I write this, supporters of Israel and Iran are
  1326.    <a href="https://www.404media.co/the-ai-slop-fight-between-iran-and-israel/?ref=daily-stories-newsletter">having an AI Slop
  1327.    Fight</a> with fake war photos and videos.
  1328.    In a C2PA-rich world, you could check; If some clip doesn’t have Content Credentials you should
  1329.    probably be suspicious, and if it does, it matters whether it was uploaded by someone at
  1330.    <a href="https://www.idf.il/en/">IDF.il</a> versus
  1331.    <a href="https://www.bbc.com">BBC.co.uk</a>.</p>
  1332.    <h2 id='p-2'>What’s wrong with this?</h2>
  1333.    <p>Look, I hate to nitpick. I’m overwhelmingly positive on this news, it’s an existence proof that C2PA can be made to work in
  1334.    the wild.
  1335.    My impression is that most of the money and muscle comes from Adobe; good on ’em.
  1336.    But there are things that would make it more useful, and usable by more Web sites. These are not listed in
  1337.    any particular order.</p>
  1338.    <h2 id='p-7'>Identity!</h2>
  1339.    <p>Adobe, it’s nice that you let me establish my identity with LinkedIn, Instagram, and Clear. But what I’d
  1340.    <em>really</em> like is if you could also verify and sign my Fediverse and Bluesky handles. And, Fediverse and ATProto
  1341.    developers, would you please, first of all, stop stripping C2PA manifests from uploaded photo EXIF, and secondly, add your own
  1342.    link to the C2PA chain saying something like “Originally posted by @timbray@cosocial.ca.”</p>
  1343.    <p>Because having verifiable media provenance in the world of social media would be a strong tool against disinformation
  1344.    and slop.</p>
  1345.    <p>Oh, and another note to Adobe: When I export a photo, the embed-manifest also offers me the opportunity, under the heading
  1346.    “Web3”, to allow the image “be used for NFT creative attribution on supported marketplaces” where the supported marketplaces are
  1347.    Phantom and MetaMask. Seriously, folks, in 2025? Please get this scammy cryptoslime out of my face.</p>
  1348.    <h2 id='p-4'>Browsers please…</h2>
  1349.    <p>This was done with Chrome extensions. There are people working on extensions for Firefox and
  1350.    Safari, but they’re not here yet. Annoyingly, the extensions also don’t seem to work in mobile Chrome, which is where most
  1351.    people look at most media.</p>
  1352.    <p>I would love it if this were done directly and automatically by the browser.
  1353.    The major browsers aren’t perfect, but their creators are known to take security seriously, and I’d be much happier trusting
  1354.    one of them, rather than an extension from a company I’d never previously heard of.</p>
  1355.    <h2 id='p-8'>… or maybe JavaScript?</h2>
  1356.    <p>The next-best solution would be a nice JS package that just Does The Right
  1357.    Thing. It should work like the way I do fonts: If you look in the source for the page you are now reading, the splodge of JS at
  1358.    the top includes a couple of lines
  1359.    that mention “typekit.com”. Typekit (since acquired by Adobe) offers access to a huge selection of excellent fonts.
  1360.    Those JS invocations result in the text you are now reading being displayed in
  1361.    <a href="/ongoing/When/201x/2011/07/17/Tisa">FF Tisa Web Pro</a>.</p>
  1362.    <p>Which<span class='dashes'> —</span> this is important<span class='dashes'> —</span> is not free. And to be clear, I am
  1363.    willing to pay to get Content Credentials for the pictures on this blog. It feels exactly like paying a small fee for access to
  1364.    a professionally-managed font library.
  1365.    Operating a Content-Credentials service wouldn’t be free, it’d require running a
  1366.    server and wrangling certs. At scale, though, it should be pretty cheap.</p>
  1367.    <p>So here’s an offer: If someone launches a service that allows me to straightforwardly include the
  1368.    fact that this picture was sourced from tbray.org in my Content Credentials, my wallet is (modestly) open.</p>
  1369.    <p>By the way, the core JavaScript code is already under construction; here’s
  1370.    <a href="https://github.com/microsoft/c2pa-extension-validator">Microsoft</a> and the
  1371.    <a href="https://opensource.contentauthenticity.org/docs/introduction">Content Authority Initiative</a> itself.
  1372.    There’s also a Rust crate for server-side use, and a “c2patool” command-line utility based on it..</p>
  1373.    <h2 id='p-6'>Open-Source issues</h2>
  1374.    <p>You’ll notice that the right-click-for-Content-Credentials doesn’t work on the smaller version of the picture embedded in the
  1375.    text you are now reading; just the larger one.  This is because the decades-old Perl-based <span class='o'>ongoing</span>
  1376.    publishing software runs the main-page pictures through
  1377.    <a href="https://imagemagick.org/index.php">ImageMagick</a>, which doesn’t do C2PA. I should find a way to route around this.</p>
  1378.    <p>In fact, it wouldn’t be rocket science for ImageMagick (or open-source packages generally) to write C2PA manifests and insert
  1379.    them in the media files they create.  But how should they sign them? As noted, that requires a server that provides cert-based
  1380.    signatures, something that nobody would expect from even well-maintained open-source packages.</p>
  1381.    <p>I dunno, maybe someone should provide a managed-ImageMagick service that (for a small fee) offers signed-C2PA-manifest
  1382.    embedding?</p>
  1383.    <h2 id='p-9'>What’s next?</h2>
  1384.    <p>The work that needs to be done is nontrivial but, frankly, not that taxing. And the rewards would be high.
  1385.    Because it feels like a no-brainer that knowing who posted something is a big deal. Also the inverse: Knowing that you
  1386.    <em>don’t</em> know who posted it.</p>
  1387.    <p>Where is it an especially big deal? On social media, obviously. It’s really time for those guys to start climbing on board.</p>
  1388. </div></content></entry>
  1389.  
  1390. <entry>
  1391. <title>AI Angst</title>
  1392. <link href='https://www.tbray.org/ongoing/When/202x/2025/06/06/My-AI-Angst' />
  1393. <link rel='replies'        thr:count='13'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/06/06/My-AI-Angst#comments' />
  1394. <id>https://www.tbray.org/ongoing/When/202x/2025/06/06/My-AI-Angst</id>
  1395. <published>2025-06-06T12:00:00-07:00</published>
  1396. <updated>2025-06-08T15:39:49-07:00</updated>
  1397. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/AI' />
  1398. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  1399. <category scheme='https://www.tbray.org/ongoing/What/' term='AI' />
  1400. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>My input stream is full of it: Fear and loathing and cheerleading and prognosticating on what generative AI means and whether     it’s Good or Bad and what we should be doing. All the channels: Blogs and peer-reviewed papers and social-media posts and     business-news stories. So there’s lots of AI angst out there, but this is mine.     I think the following is a bit unique because it focuses on cost, working backward from there. As for the     genAI tech itself, I guess I’m a moderate; there is a there there, it’s not all slop. But first…</div></summary>
  1401. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1402.    <p>My input stream is full of it: Fear and loathing and cheerleading and prognosticating on what generative AI means and whether
  1403.    it’s Good or Bad and what we should be doing. All the channels: Blogs and peer-reviewed papers and social-media posts and
  1404.    business-news stories. So there’s lots of AI angst out there, but this is mine.
  1405.    I think the following is a bit unique because it focuses on cost, working backward from there. As for the
  1406.    genAI tech itself, I guess I’m a moderate; there is a there there, it’s not all slop. But first…</p>
  1407.    <h2 id='p-5'>The rent is too damn high</h2>
  1408.    <p>I promise I’ll talk about genAI applications but let’s start with money. <em>Lots</em> of money, big numbers! For example,
  1409.    venture-cap startup money pouring into AI, which as of now apparently adds up to
  1410.    <a href="https://finance.yahoo.com/news/how-nvidia-played-a-central-role-in-the-306-billion-ai-startup-boom-195741749.html">$306
  1411.    billion</a>. And that’s just startups; Among the giants, Google alone
  1412.    <a href="https://www.ciodive.com/news/google-cloud-generative-ai-data-center-capacity-buildouts/739357/">apparently plans
  1413.    $75B</a> in capital expenditure on AI
  1414.    infrastructure, and they represent maybe a quarter at most of cloud capex. You think those are big numbers? McKinsey offers
  1415.    <a href="https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/the-cost-of-compute-a-7-trillion-dollar-race-to-scale-data-centers">The cost of compute: A $7 trillion race to scale data centers</a>.</p>
  1416.    <p>Obviously, lots of people are
  1417.    wondering when and where the revenue will be to pay for it all. There’s one thing we know for sure:
  1418.    The pro-genAI voices are fueled by hundreds of billions of dollars worth of fear and desire; fear that it’ll
  1419.    never pay off and desire for a piece of the money. Can you begin to imagine the pressure for revenue that investors and
  1420.    executives and middle managers are under?</p>
  1421.    <p><a href="https://cosocial.ca/@timbray/114572118905328515">Here’s an example</a> of the kind of debate that ensues.</p>
  1422.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/06/Anil-MCP.png" alt="Anil Dash on Mastodon, on MCP vs the Fediverse" />
  1423.    <div class='caption'><p>“MCP” is
  1424.    <a href="https://en.wikipedia.org/wiki/Model_Context_Protocol">Model Context Protocol</a>, used for communicating between LLM
  1425.    software and other systems and services.<br/>I have no opinion as to its quality or utility.</p></div>
  1426.    <p>I suggest that when you’re getting a pitch for genAI technology, you should have that greed and
  1427.    fear in the back of your mind. Or maybe at the front.</p>
  1428.    <h2 id='p-7'>And that’s just the money</h2>
  1429.    <p>For some reason, I don’t hear much any more about the environmental cost of genAI, the gigatons of carbon pouring out of the
  1430.    system, imperilling my children’s future. Let’s please not ignore that; let’s read things like
  1431.    <a href="https://www.eesi.org/articles/view/data-center-energy-needs-are-upending-power-grids-and-threatening-the-climate">Data
  1432.    Center Energy Needs Could Upend Power Grids and Threaten the Climate</a> and let’s make sure every freaking conversation about
  1433.    genAI acknowledges this grievous cost.</p>
  1434.    <p>Now let’s look at a few sectors where genAI is said to be a big deal: Coding, teaching, and professional
  1435.    communication. To keep things balanced, I’ll start in a space where I have kind things to say.</p>
  1436.    <h2 id='p-2'>Coding</h2>
  1437.    <p>Wow, is my tribe ever melting down. The pro- and anti-genAI factions are hurling polemical thunderbolts at each
  1438.    other, and I mean extra hot and pointy ones. For example, here are 5600 words entitled
  1439.    <a href="https://blog.glyph.im/2025/06/i-think-im-done-thinking-about-genai-for-now.html">I Think I’m Done Thinking About genAI
  1440.    For Now</a>. Well-written words, too.</p>
  1441.    <p>But, while I have a lot of sympathy for the contras and am sickened by some of the promoters, at the moment
  1442.    I’m mostly in tune with Thomas Ptacek’s
  1443.    <a href="https://fly.io/blog/youre-all-nuts/">My AI Skeptic Friends Are All Nuts</a>. It’s long and (fortunately) well-written
  1444.    and I (mostly) find it hard to disagree with.</p>
  1445.    <p>it’s as simple as this: I keep hearing talented programmers
  1446.    whose integrity I trust tell me “Yeah, LLMs are helping me get shit done.” The probability that they’re all lying or being
  1447.    fooled seems very low.</p>
  1448.    <p>Just to be clear, I note an absence of concern for cost and carbon in these conversations. Which is unacceptable. But let’s
  1449.    move on.</p>
  1450.    <p>It’s worth noting that I learned two useful things from Ptacek’s essay that I hadn’t really understood. First, the “agentic”
  1451.    architecture of programming tools: You ask the agent to create code and it asks the LLM, which will sometimes
  1452.    hallucinate; the agent will observe that it doesn’t compile or makes all the unit tests fail, discards it, and re-prompts. If
  1453.    it takes the agent module 25 prompts to generate code that while imperfect is at least correct, who cares?</p>
  1454.    <p>Second lesson, and to be fair this is just anecdata: It feels like the Go programming language is especially well-suited to
  1455.    LLM-driven automation. It’s small, has a large standard library, and a culture that has strong shared idioms for doing almost
  1456.    anything. Anyhow, we’ll find out if this early impression stands up to longer and wider industry experience.</p>
  1457.    <p>Turning our attention back to cost, let’s assume that eventually all or most developers become somewhat LLM-assisted. Are
  1458.    there enough of them, and will they pay enough, to cover all that investment?  Especially given that models that are both
  1459.    open-source and excellent are certain to proliferate? Seems dubious.</p>
  1460.    <p>Suppose that, as Ptacek suggests, LLMs/agents allow us to automate the tedious low-intellectual-effort parts of our
  1461.    job. Should we be concerned about how junior developers learn to get past that “easy stuff” and on the way to senior skills?
  1462.    That seems a very good question, so…</p>
  1463.    <h2 id='p-10'>Learning</h2>
  1464.    <p>Quite likely you’ve already seen Jason Koebler’s
  1465.    <a href="https://www.404media.co/teachers-are-not-ok-ai-chatgpt/?ref=daily-stories-newsletter">Teachers Are Not OK</a>, a
  1466.    frankly horrifying survey of genAI’s impact on secondary and tertiary education. It is a tale of unrelieved grief and pain
  1467.    and wreckage. Since genAI isn’t going to go away and students aren’t going to stop being lazy,
  1468.    it seems like we’re going to re-invent the way people teach and learn.</p>
  1469.    <p>The stories of students furiously deploying genAI to avoid the effort of actually, you know,
  1470.    learning, are sad. Even sadder  are those of genAI-crazed administrators leaning on faculty to become more efficient and
  1471.    “businesslike” by using it.</p>
  1472.    <p>I really don’t think there’s a coherent pro-genAI case to be made in the education context.</p>
  1473.    <h2 id='p-11'>Professional communication</h2>
  1474.    <p>If you want to use LLMs to automate communication with your family or friends or lovers, there’s nothing I can say that will
  1475.    help you. So let’s restrict this to conversation and reporting around work and private projects and voluntarism and so on.</p>
  1476.    <p>I’m
  1477.    pretty sure this is where the people who think they’re going to make big money with AI think it’s going to come from.
  1478.    If you’re interested in that thinking,
  1479.    <a href="https://docs.google.com/presentation/d/1Der8WWGeVxdOWx37bMV_nj9N1tUAVcvSSRa6qxKx75g/edit?slide=id.p1#slide=id.p1">here’s
  1480.    a sample</a>; a slide deck by a Keith Riegert for the book-publishing business which, granted, is a bit stagnant and a whole lot
  1481.    overconcentrated these days. I suspect scrolling through it will produce a strong emotional reaction for quite a few readers here.
  1482.    It’s also useful in that it talks specifically about costs.</p>
  1483.    <p>That is for corporate-branded output. What about personal or internal professional communication; by which I mean emails and
  1484.    sales reports and committee drafts and project pitches and so on? I’m pretty negative about this. If your email or pitch
  1485.    doc or whatever needs to be summarized, or if it has the colorless affectless error-prone polish of 2025’s LLMs, I would
  1486.    probably discard it unread.
  1487.    I already found the switch to turn off Gmail’s attempts to summarize my emails.</p>
  1488.    <p>What’s the genAI world’s equivalent of “Tl;dr”? I’m thinking “TA;dr” (A for AI)
  1489.    or “Tg;dr” (g for genAI) or just “LLM:dr”.</p>
  1490.    <p>And this vision of everyone using genAI to amplify their output and everyone else using it to summarize and filter
  1491.    their input feels simply perverse.</p>
  1492.    <p>Here’s what I think is
  1493.    <a href="https://infosec.exchange/@codinghorror/114606355212363074">an important finding</a>, ably summarized by Jeff Atwood:</p>
  1494.    <img src="https://www.tbray.org/ongoing/When/202x/2025/06/06/Dare-Jeff.png" alt="Dare Obasanjo and Jeff Atwood on how to survive AI" />
  1495.    <p>Seriously, since LLMs by design emit streams that are optimized for plausibility and for harmony with the model’s
  1496.    training base, in an AI-centric world there’s a powerful incentive to say things that are implausible, that are out of tune,
  1497.    that are, bluntly, weird. So there’s one upside.</p>
  1498.    <p>And let’s go back to cost. Are the prices in Riegert’s slide deck going to pay for trillions in capex?
  1499.    Another example: My family has a Google workplace account, and the price just went up from $6/user/month to
  1500.    $7. The announcement from Google emphasized that this was related to the added value provided by Gemini. Is $1/user/month gonna
  1501.    make this tech make business sense?</p>
  1502.    <h2 id='p-13'>What I can and can’t buy</h2>
  1503.    <p>I can sorta buy the premise that there are genAI productivity boosts to be had in the code space and maybe some other
  1504.    specialized domains.  I can’t buy for a second that genAI is anything but toxic for anything education-related.  On the
  1505.    business-communications side, it’s damn well gonna be tried because billions of dollars and many management careers depend on
  1506.    it paying off. We’ll see but I’m skeptical.</p>
  1507.    <p>On the money side? I don’t see how the math and the capex work. And all the time, I think about the carbon that’s poisoning
  1508.    the planet my children have to live on.</p>
  1509.    <p>I think that the best we can hope for is the eventual financial meltdown leaving a few useful islands of things that
  1510.    are actually useful at prices that make sense.</p>
  1511.    <p>And in a decade or so, I can see business-section stories about all the big data center shells that were never filled in,
  1512.    standing there empty, looking for another use. It’s gonna be tough, what can you do with buildings that have no windows?</p>
  1513. </div></content></entry>
  1514.  
  1515. <entry>
  1516. <title>Union of Finite Automata</title>
  1517. <link href='https://www.tbray.org/ongoing/When/202x/2024/07/28/Union-of-Finite-Automata' />
  1518. <link rel='replies'        thr:count='0'        type='application/xhtml+xml'        href='/ongoing/When/202x/2024/07/28/Union-of-Finite-Automata#comments' />
  1519. <id>https://www.tbray.org/ongoing/When/202x/2024/07/28/Union-of-Finite-Automata</id>
  1520. <published>2024-07-28T12:00:00-07:00</published>
  1521. <updated>2025-06-02T11:49:20-07:00</updated>
  1522. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Quamina Diary' />
  1523. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  1524. <category scheme='https://www.tbray.org/ongoing/What/' term='Quamina Diary' />
  1525. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>In building Quamina, I needed to compute the union of two finite automata (FAs). I remembered from some university course 100 years     ago that this was possible in theory, so I went looking for the algorithm, but was left unhappy.     The descriptions I found tended to be hyper-academic, loaded with mathematical notation that I found unhelpful, and     didn’t describe an approach that I thought a reasonable programmer would reasonably take. The purpose of this <span class="o">ongoing</span> entry is to present a      programmer-friendly description of the problem and of the algorithm I adopted, with the hope that some future developer, facing     the same problem, will have a more satisfying search experience.<br/> <i>[Important update: There’s a serious error halfway through; see <a href='#p-9'>here</a>.]</i></div></summary>
  1526. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1527.    <p>In building Quamina, I needed to compute the union of two finite automata (FAs). I remembered from some university course 100 years
  1528.    ago that this was possible in theory, so I went looking for the algorithm, but was left unhappy.
  1529.    The descriptions I found tended to be hyper-academic, loaded with mathematical notation that I found unhelpful, and
  1530.    didn’t describe an approach that I thought a reasonable programmer would reasonably take. The purpose of this <span
  1531.    class='o'>ongoing</span> entry is to present a
  1532.    programmer-friendly description of the problem and of the algorithm I adopted, with the hope that some future developer, facing
  1533.    the same problem, will have a more satisfying search experience.<br/>
  1534.    <i>[Important update: There’s a serious error halfway through; see <a href="#p-9">here</a>.]</i></p>
  1535.    <p>There is very little math in this discussion (a few subscripts), and no
  1536.    circles-and-arrows pictures. But it does have working Go code.</p>
  1537.    <h2 id='p-1'>Finite automata?</h2>
  1538.    <p>I’m not going to rehash the theory of FAs (often called state machines). In practice the purpose of an FA is to match (or
  1539.    fail to match) some
  1540.    input against some pattern. What the software does when the input matches the pattern (or doesn’t) isn’t relevant to
  1541.    our discussion today.
  1542.    Usually the inputs are strings and the patterns are regular expressions or equivalent. In practice, you compile a pattern
  1543.    into an FA, and then you go through the input, character by character, trying to traverse the FA to find out whether it matches
  1544.    the input.</p>
  1545.    <p>An FA has a bunch of states, and for each state
  1546.    there can be a list of input symbols that lead to transitions to other states. What exactly I mean by “input symbol” turns out to be
  1547.    interesting and affects your choice of algorithm, but let’s ignore that for now.</p>
  1548.    <p>The following statements apply:</p>
  1549.    <ol>
  1550.      <li><p>One state is designated as the “start state” because, well, that’s where you start.</p></li>
  1551.      <li><p>Some states are called “final”, and reaching them means you’ve matched one or more patterns. In Quamina’s FAs, each
  1552.      state has an extra field (usually empty) saying “if you got here you matched P*, yay!”, where P* is a list of labels for the
  1553.      (possibly more than one) patterns you matched.</p></li>
  1554.      <li><p>It is possible that you’re in a state and for some particular input, you transition to more than one other state. If
  1555.      this is true, your FA is <em>nondeterministic</em>, abbreviated NFA.</p></li>
  1556.      <li><p>It is possible that a state can have one or more “epsilon transitions”, ones that you can just take any time, not requiring
  1557.      any particular input. (I wrote about this in
  1558.      <a href="/ongoing/When/202x/2024/06/17/Epsilon-Love">Epsilon Love</a>.)
  1559.      Once again, if this is true, you’ve got an NFA. If neither this statement nor the previous are true, it’s
  1560.      a <em>deterministic</em> finite automaton, DFA.</p></li>
  1561.    </ol>
  1562.    <p>The discussion here works for NFAs, but lots of interesting problems can be solved with DFAs, which are simpler and faster,
  1563.    and this algorithm works there too.</p>
  1564.    <h2 id='p-2'>Union?</h2>
  1565.    <p>If I have <code>FA1</code> that matches “foo” and <code>FA2</code> that matches “bar”, then their union,
  1566.    <code>FA1 ∪ FA2</code>, matches both “foo”
  1567.    and “bar”. In practice Quamina often computes the union of a large number of FAs, but it does so a pair at a time, so we’re
  1568.    only going to worry about the union of two FAs.</p>
  1569.    <h2 id='p-3'>The academic approach</h2>
  1570.    <p>There are plenty of Web pages and YouTubes covering this. Most of them are full of Greek characters and math symbols. They go
  1571.    like this:</p>
  1572.    <ol>
  1573.      <li><p>You have two FAs, call them <code>A</code> and <code>B</code>. <code>A</code> has states <code>A<sub>1</sub></code>, …
  1574.      <code>A<sub>maxA</sub></code>, <code>B</code> has <code>B<sub>1</sub></code>, … <code>B<sub>maxB</sub></code></p></li>
  1575.      <li><p>The union contains all the states in <code>A</code>, all the states in <code>B</code>, and the “product” of
  1576.      <code>A</code> and <code>B</code>, which is to say states you could call <code>A<sub>1</sub>B<sub>1</sub></code>,
  1577.      <code>A<sub>1</sub>B<sub>2</sub></code>, <code>A<sub>2</sub>B<sub>1</sub></code>, <code>A<sub>2</sub>B<sub>2</sub></code>,
  1578.      … <code>A<sub>maxA</sub>B<sub>maxB</sub></code>.</p></li>
  1579.      <li><p>For each state <code>A<sub>X</sub>B<sub>Y</sub></code>, you work out its transitions by looking at the transitions of
  1580.      the two states being combined. For some input symbol, if <code>A<sub>X</sub></code> has a transition to
  1581.      <code>A<sub>XX</sub></code> but <code>B<sub>Y</sub></code> has no transition, then the combined state just has the A
  1582.      transition. The reverse for an input where <code>B<sub>Y</sub></code> has a transition but <code>A<sub>X</sub></code>
  1583.      doesn’t. And if <code>A<sub>X</sub></code> transitions to <code>A<sub>XX</sub></code> and <code>B<sub>Y</sub></code> transitions to
  1584.      <code>B<sub>YY</sub></code>, then the transition is to <code>A<sub>XX</sub>B<sub>YY</sub></code>.</p></li>
  1585.      <li><p>Now you’ll have a lot of states, and it usually turns out that many of them aren’t reachable. But there are plenty of
  1586.      algorithms to filter those out. You’re done, you’ve computed the union and <code>A<sub>1</sub>B<sub>1</sub></code> is its
  1587.      start state!</p></li>
  1588.    </ol>
  1589.    <h2 id='p-4'>Programmer-think</h2>
  1590.    <p>If you’re like me, the idea of computing all the states, then throwing out the unreachable ones, feels wrong. So here’s
  1591.    what I suggest, and has worked well in practice for Quamina:</p>
  1592.    <ol>
  1593.      <li><p>First, merge <code>A<sub>1</sub></code> and <code>B<sub>1</sub></code> to make your new start state
  1594.      <code>A<sub>1</sub>B<sub>1</sub></code>. Here’s how:</p></li>
  1595.      <li><p>If an input symbol causes no transitions in either <code>A<sub>1</sub></code> or <code>B<sub>1</sub></code>, it also
  1596.      doesn’t cause any in <code>A<sub>1</sub>B<sub>1</sub></code>.</p></li>
  1597.      <li><p>If an input symbol causes a transition in <code>A<sub>1</sub></code> to <code>A<sub>X</sub></code> but no transition
  1598.      in <code>B<sub>1</sub></code>, then you adopt <code>A<sub>X</sub></code> into the union, and any other <code>A</code> states
  1599.      it points to, and any they point to, and so on.</p></li>
  1600.      <li><p>And of course if <code>B<sub>1</sub></code> has a transition to <code>B<sub>Y</sub></code> but
  1601.      <code>A<sub>1</sub></code> doesn’t transition, you flip it the other way, adopting <code>B<sub>Y</sub></code> and its
  1602.      descendents.</p></li>
  1603.      <li><p>And if <code>A<sub>1</sub></code> transitions to <code>A<sub>X</sub></code> and <code>B<sub>1</sub></code> transitions
  1604.      to <code>B<sub>Y</sub></code>, then you adopt a new state <code>A<sub>X</sub>B<sub>Y</sub></code>, which you compute
  1605.      recursively the way you just did for <code>A<sub>1</sub>B<sub>1</sub></code>. So you’ll never compute anything that’s not
  1606.      reachable.</p></li>
  1607.    </ol>
  1608.    <p>I could stop there. I think that’s enough for a competent developers to get the idea?  But it turns out there
  1609.    are a few details, some of them interesting. So, let’s dig in.</p>
  1610.    <h2 id='p-5'>“Input symbol”?</h2>
  1611.    <p>The academic discussion of FAs is very abstract on this subject, which is fair enough, because when you’re talking about how
  1612.    to build, or traverse, or compute the union of FAs, the algorithm doesn’t depend very much on what the symbols actually are. But
  1613.    when you’re writing code, it turns out to matter a lot.</p>
  1614.    <p>In practice, I’ve done a lot of work with FAs over the years, and I’ve only ever seen four things used as input symbols
  1615.    to drive them. They are:</p>
  1616.    <ul>
  1617.      <li><p>Unicode “characters” represented by code points, integers in the range 0…1,114,111 inclusive.</p></li>
  1618.      <li><p>UTF-8 bytes, which have values in the range 0…244 inclusive.</p></li>
  1619.      <li><p>UTF-16 values, unsigned 16-bit integers. I’ve only ever seen this used in Java programs because that’s what
  1620.      its native <code>char</code> type is. You probably don’t want to do this.</p></li>
  1621.      <li><p>Enum values, small integers with names, which tend to come in small collections.</p></li>
  1622.    </ul>
  1623.    <p>As I said, this is all I’ve seen, but 100% of the FAs that I’ve seen automatically generated and subject to
  1624.    set-arithmetic operations like Union are based on UTF-8. And that’s what Quamina uses, so that’s what I’m going to use in the
  1625.    rest of this discussion.</p>
  1626.    <h2 id='p-7'>Code starts here</h2>
  1627.    <p>This comes from Quamina’s
  1628.    <a href="https://github.com/timbray/quamina/blob/main/nfa.go">nfa.go</a>. We’re going to look at the function
  1629.    <code>mergeFAStates</code>, which implements the merge-two-states logic described above.</p>
  1630.    <p>Lesson: This process can lead to a lot of wasteful work. Particularly if either or both of the states transition on ranges of
  1631.    values like <code>0…9</code> or <code>a…z</code>. So we only want to do the work merging any pair of states once, and we want
  1632.    there only to be one merged value.  Thus we start with a straightforward memo-ization.</p>
  1633.    <div class="tbc"><pre>
  1634. <span class="kd">func</span><span class="w"> </span><span class="nx">mergeFAStates</span><span class="p">(</span><span class="nx">state1</span><span class="p">,</span><span class="w"> </span><span class="nx">state2</span><span class="w"> </span><span class="o">*</span><span class="nx">faState</span><span class="p">,</span><span class="w"> </span><span class="nx">keyMemo</span><span class="w"> </span><span class="kd">map</span><span class="p">[</span><span class="nx">faStepKey</span><span class="p">]</span><span class="o">*</span><span class="nx">faState</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="nx">faState</span><span class="w"> </span><span class="p">{</span>
  1635. <span class="w">    </span><span class="c1">// try to memo-ize</span>
  1636. <span class="w">    </span><span class="nx">mKey</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">faStepKey</span><span class="p">{</span><span class="nx">state1</span><span class="p">,</span><span class="w"> </span><span class="nx">state2</span><span class="p">}</span>
  1637. <span class="w">    </span><span class="nx">combined</span><span class="p">,</span><span class="w"> </span><span class="nx">ok</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">keyMemo</span><span class="p">[</span><span class="nx">mKey</span><span class="p">]</span>
  1638. <span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="nx">ok</span><span class="w"> </span><span class="p">{</span>
  1639. <span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="nx">combined</span>
  1640. <span class="w">    </span><span class="p">}</span>
  1641. </pre>
  1642.    <p>Now some housekeeping. Remember, I noted above that any state might contain a signal saying that arriving here
  1643.    means you’ve matched pattern(s). This is called <code>fieldTransitions</code>, and the merged state obviously has to
  1644.    match all the things that either of the merged states match. Of course, in the vast majority of cases neither merged state
  1645.    matched anything and so this is a no-op.</p>
  1646. <pre>
  1647. <span class="w">    </span><span class="nx">fieldTransitions</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">append</span><span class="p">(</span><span class="nx">state1</span><span class="p">.</span><span class="nx">fieldTransitions</span><span class="p">,</span><span class="w"> </span><span class="nx">state2</span><span class="p">.</span><span class="nx">fieldTransitions</span><span class="o">...</span><span class="p">)</span></pre>
  1648.    <p>Since our memo-ization attempt came up empty, we have to allocate an empty structure for the new merged state, and add it to the
  1649.    memo-izer.</p>
  1650.    <pre>
  1651. <span class="w">    </span><span class="nx">combined</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="o">&amp;</span><span class="nx">faState</span><span class="p">{</span><span class="nx">table</span><span class="p">:</span><span class="w"> </span><span class="nx">newSmallTable</span><span class="p">(),</span><span class="w"> </span><span class="nx">fieldTransitions</span><span class="p">:</span><span class="w"> </span><span class="nx">fieldTransitions</span><span class="p">}</span>
  1652. <span class="w">    </span><span class="nx">keyMemo</span><span class="p">[</span><span class="nx">mKey</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">combined</span></pre>
  1653.    <p>Here’s where it gets interesting.  The algorithm talks about looking at the inputs that cause transitions in the states we’re
  1654.    merging. How do you find them?  Well, in the case where you’re transitioning on UTF-8 bytes, since there are only 244 values,
  1655.    why not do the simplest thing that could possibly work and just check each byte value?</p>
  1656.    <p>Every Quamina state contains a table that encodes the byte transitions, which operates  like the Go construct
  1657.    <code>map[byte]state</code>. Those tables are implemented in
  1658.    <a href="/ongoing/When/202x/2022/06/25/Small-Tables">a compact data structure optimized for fast traversal</a>. But for doing this
  1659.    kind of work, it’s easy to “unpack” them into a fixed-sized table; in Go, <code>[244]state</code>. Let’s do that for the states
  1660.    we’re merging and for the new table we’re building.</p>
  1661. <pre><span class="w">    </span><span class="nx">u1</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">unpackTable</span><span class="p">(</span><span class="nx">state1</span><span class="p">.</span><span class="nx">table</span><span class="p">)</span>
  1662. <span class="w">    </span><span class="nx">u2</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">unpackTable</span><span class="p">(</span><span class="nx">state2</span><span class="p">.</span><span class="nx">table</span><span class="p">)</span>
  1663. <span class="w">    </span><span class="kd">var</span><span class="w"> </span><span class="nx">uComb</span><span class="w"> </span><span class="nx">unpackedTable</span></pre>
  1664. <p><code>uComb</code> is where we’ll fill in the merged transitions.</p>
  1665. <p>Now we’ll run through all the possible input values; <code>i</code> is the byte value,  <code>next1</code> and <code>next2</code>
  1666. are the transitions on that value. In practice, <code>next1</code> and <code>next2</code> are going to be null most of the time.</p>
  1667. <pre><span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="nx">i</span><span class="p">,</span><span class="w"> </span><span class="nx">next1</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="nx">u1</span><span class="w"> </span><span class="p">{</span>
  1668. <span class="w">        </span><span class="nx">next2</span><span class="w"> </span><span class="o">:=</span><span class="w"></span><span class="nx"> u2</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span></pre>
  1669.    <p>Here’s where we start building up the new transitions in the unpacked array <code>uComb</code>.</p>
  1670.    <p>For many values of <code>i</code>, you can avoid actually merging the states to create a new one. If the transition is the
  1671.    same in both input FAs, or if either of them are null, or if the transitions for this value of <code>i</code> are the same as
  1672.    for the last value.  This is all about avoiding unnecessary work and the <code>switch</code>/<code>case</code> structure is the
  1673.    result of a bunch of profiling and optimization.</p>
  1674. <pre><span class="w">        </span><span class="k">switch</span><span class="w"> </span><span class="p">{</span>
  1675. <span class="w">        </span><span class="k">case</span><span class="w"> </span><span class="nx">next1</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nx">next2</span><span class="p">:</span><span class="w"> </span><span class="c1">// no need to merge</span>
  1676. <span class="w">            </span><span class="nx">uComb</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">next1</span>
  1677. <span class="w">        </span><span class="k">case</span><span class="w"> </span><span class="nx">next2</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">nil</span><span class="p">:</span><span class="w"> </span><span class="c1">// u1 must be non-nil</span>
  1678. <span class="w">            </span><span class="nx">uComb</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">next1</span>
  1679. <span class="w">        </span><span class="k">case</span><span class="w"> </span><span class="nx">next1</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">nil</span><span class="p">:</span><span class="w"> </span><span class="c1">// u2 must be non-nil</span>
  1680. <span class="w">            </span><span class="nx">uComb</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">next2</span>
  1681. <span class="w">        </span><span class="k">case</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="p">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">next1</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nx">u1</span><span class="p">[</span><span class="nx">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nx">next2</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="nx">u2</span><span class="p">[</span><span class="nx">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]:</span><span class="w"> </span><span class="c1">// dupe of previous step - happens a lot</span>
  1682. <span class="w">            </span><span class="nx">uComb</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">uComb</span><span class="p">[</span><span class="nx">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></pre>
  1683.    <p>If none of these work, we haven’t been able to avoid merging the two states. We do that by a recursive call to invoke
  1684.    all the logic we just discussed.</p>
  1685.    <p>There is a complication. The automaton might be nondeterministic, which means that there might be more than one transition
  1686.    for some byte value. So the data structure actually behaves like <code>map[byte]*faNext</code>, where <code>faNext</code> is a
  1687.    wrapper for a list of states you can transition to.</p>
  1688.    <p>So here we’ve got a nested loop to recurse for each possible combination of transitioned-to states that can occur on this
  1689.    byte value. In a high proportion of cases the FA is deterministic, so there’s only one state from each FA being merged and this
  1690.    nested loop collapses to a single recursive call.</p>
  1691. <pre><span class="w">        </span><span class="k">default</span><span class="p">:</span><span class="w"> </span><span class="c1">// have to recurse &amp; merge</span>
  1692. <span class="w">            </span><span class="kd">var</span><span class="w"> </span><span class="nx">comboNext</span><span class="w"> </span><span class="p">[]</span><span class="o">*</span><span class="nx">faState</span>
  1693. <span class="w">            </span><span class="k">for</span><span class="w"> </span><span class="nx">_</span><span class="p">,</span><span class="w"> </span><span class="nx">nextStep1</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="nx">next1</span><span class="p">.</span><span class="nx">states</span><span class="w"> </span><span class="p">{</span>
  1694. <span class="w">                </span><span class="k">for</span><span class="w"> </span><span class="nx">_</span><span class="p">,</span><span class="w"> </span><span class="nx">nextStep2</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="nx">next2</span><span class="p">.</span><span class="nx">states</span><span class="w"> </span><span class="p">{</span>
  1695. <span class="w">                    </span><span class="nx">comboNext</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">append</span><span class="p">(</span><span class="nx">comboNext</span><span class="p">,</span><span class="w"> </span><span class="nx">mergeFAStates</span><span class="p">(</span><span class="nx">nextStep1</span><span class="p">,</span><span class="w"> </span><span class="nx">nextStep2</span><span class="p">,</span><span class="w"> </span><span class="nx">keyMemo</span><span class="p">))</span>
  1696. <span class="w">                </span><span class="p">}</span>
  1697. <span class="w">            </span><span class="p">}</span>
  1698. <span class="w">            </span><span class="nx">uComb</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="o">&amp;</span><span class="nx">faNext</span><span class="p">{</span><span class="nx">states</span><span class="p">:</span><span class="w"> </span><span class="nx">comboNext</span><span class="p">}</span>
  1699. <span class="w">        </span><span class="p">}</span>
  1700. <span class="w">    </span><span class="p">}</span></pre>
  1701.    <p>We’ve filled up the unpacked state-transition table, so we’re almost done. First, we have to compress it into its
  1702.    optimized-for-traversal form.</p>
  1703. <pre><span class="w">    </span><span class="nx">combined</span><span class="p">.</span><span class="nx">table</span><span class="p">.</span><span class="nx">pack</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">uComb</span><span class="p">)</span></pre>
  1704.    <p>Remember, if the FA is nondeterministic, each state can have “epsilon” transitions which you can follow any time without
  1705.    requiring any particular input. The merged state needs to contain all the epsilon transitions from each input state.</p>
  1706. <pre><span class="w">    </span><span class="nx">combined</span><span class="p">.</span><span class="nx">table</span><span class="p">.</span><span class="nx">epsilon</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">append</span><span class="p">(</span><span class="nx">state1</span><span class="p">.</span><span class="nx">table</span><span class="p">.</span><span class="nx">epsilon</span><span class="p">,</span><span class="w"> </span><span class="nx">state2</span><span class="p">.</span><span class="nx">table</span><span class="p">.</span><span class="nx">epsilon</span><span class="o">...</span><span class="p">)</span>
  1707.  
  1708. <span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="nx">combined</span>
  1709. <span class="p">}</span></pre>
  1710.    </div>
  1711.    <p>And, we’re done. I mean, we are once all those recursive calls have finished crawling through the states being merged.</p>
  1712.    <h2 id='p-9'>Oops</h2>
  1713.    <p>The discussion of epsilons above is wrong, in a way that’s harder to reproduce than you might think.
  1714.    The discussion is still
  1715.    correct for DFA’s and (weirdly) (I think) (not sure why yet) the shell-style “wildcard” <code>*</code> operator, which means
  1716.    <code>.*</code> in a regular expression.</p>
  1717.    <p>It’s not clear that in general there’s a way to merge (Quamina-style) two NFA states when either or both of them have epsilon transitions.
  1718.    Per the
  1719.    academic literature, the right way to get the union of two NFAs is to have an empty branch state with two epsilon transitions,
  1720.    one to each NFA. So you traverse the two in parallel.</p>
  1721.    <p>It took me a a whole lot of pain to figure this out and I haven’t entirely worked out the best implementation. I promise more
  1722.    regular-expressions-at-scale walls of text and code in this space when I do.</p>
  1723.    <p>I write this because when you type “merge nondeterministic finite automata” into Web search, the blog you are now reading is
  1724.    dangerously high in the search results.</p>
  1725.    <h2 id='p-8'>Is that efficient?</h2>
  1726.    <p>As I said above, this is an example of a “simplest thing that could possibly work” design. Both the recursion and the
  1727.    unpack/pack sequence are kind of code smells, suggesting that this could be a pool of performance quicksand.</p>
  1728.    <p>But apparently not. I ran a benchmark where I added 4,000 patterns synthesized from the Wordle
  1729.    word-list; each of them looked like this:</p>
  1730.    <p><code>{"allis": { "biggy": [ "ceils", "daisy", "elpee", "fumet", "junta", … </code> (195 more).</p>
  1731.    <p>This produced a <em>huge</em> deterministic FA with about 4.4 million states, with the addition of these hideous worst-case
  1732.    patterns running at 500/second. Good enough for rock ’n’ roll.</p>
  1733.    <p>How about nondeterministic FAs? I went back to that Wordle source and, for each of its 12,959 words, added a pattern with a
  1734.    random wildcard; here are three of them:</p>
  1735.    <p><code>{"x": [ {"shellstyle": "f*ouls" } ] }<br/>
  1736. {"x": [ {"shellstyle": "pa*sta" } ] }<br/>
  1737. {"x": [ {"shellstyle": "utter*" } ] }</code></p>
  1738.   <p>This produced an NFA with 46K states, the addition process ran at 70K patterns/second.
  1739.   </p>
  1740.   <p>Sometimes the simplest thing that could possibly work, works.</p>
  1741. </div></content></entry>
  1742.  
  1743. <entry>
  1744. <title>Perfectly Different Colors</title>
  1745. <link href='https://www.tbray.org/ongoing/When/202x/2025/05/31/Colors' />
  1746. <link rel='replies'        thr:count='3'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/05/31/Colors#comments' />
  1747. <id>https://www.tbray.org/ongoing/When/202x/2025/05/31/Colors</id>
  1748. <published>2025-05-31T12:00:00-07:00</published>
  1749. <updated>2025-06-02T08:51:38-07:00</updated>
  1750. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts/Photos' />
  1751. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts' />
  1752. <category scheme='https://www.tbray.org/ongoing/What/' term='Photos' />
  1753. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts/Photos/Cameras' />
  1754. <category scheme='https://www.tbray.org/ongoing/What/' term='Cameras' />
  1755. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>This considers how two modern cameras handle a difficult color challenge, illustrated by photos of a perfect rose and a piano</div></summary>
  1756. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1757.    <p>This considers how two modern cameras handle a difficult color challenge, illustrated by photos of a perfect rose and a piano.</p>
  1758.    <p>We moved into our former place in January 1997 and, that summer, discovered the property included this slender little rose
  1759.    that only had a couple blossoms every year, but they were perfection, beautifully shaped and in a unique shade of red I’d
  1760.    never seen anywhere else (and still haven’t). Having no idea of its species, we’ve always called it “our perfect rose”.</p>
  1761.    <p>So when
  1762.    <a href="/ongoing/When/202x/2025/02/28/Moved">we moved</a> last year, we took the rose with us. It seems to
  1763.    like the new joint, has a blossom out and two more on the way and it’s still May.</p>
  1764.    <p>I was looking at it this morning and it occurred to me that its color might be an interesting challenge to the two fine cameras I use
  1765.    regularly, namely a Google Pixel 7 and a Fujifilm X-T5.</p>
  1766.    <p>First the pictures.</p>
  1767.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/31/PXL_20250531_185139866.png" alt="The “perfect” rose." />
  1768.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/31/TXT55657.png" alt="The “perfect” rose" />
  1769.    <h2 id='p-2'>Limitations</h2>
  1770.    <p>First of all, let’s agree that this comparison is horribly flawed. To start with, by the time the pixels have made it from
  1771.    the camera to your screen, they’ve been through Lightroom, possibly a social-media-software uploader and renderer, and then
  1772.    your browser (or mobile app) and screen contribute their opinions.
  1773.    Thus the colors are likely to vary a lot depending where you are and what you’re using.</p>
  1774.    <p>Also, it’s hard to get really comparable shots out of the Pixel and Fuji; their lenses and processors and underlying
  1775.    architectures are really different. I was going to disclose the reported shutter speeds, aperture, and ISO values, but they are
  1776.    so totally non-comparable that I decided that’d be actively harmful. I’ll just say that I tried to let each do its best.</p>
  1777.    <p>I post-processed both, but limited that to cropping; nothing about the color or exposure was touched.</p>
  1778.    <p>And having said all that, I think the exercise retains interest.</p>
  1779.    <h2 id='p-1'>Which?</h2>
  1780.    <p>The Pixel is above, the Fuji below.</p>
  1781.    <p>The Pixel is wrong. The Fuji is… not bad. The blossom’s actual color, to my eye, has a little more orange than I see in the
  1782.    photo; but only a little. The Pixel subtracts the orange and introduces a suggestion of violet that the blossom, to
  1783.    my eye, entirely lacks.</p>
  1784.    <p>Also, the Pixel is artificially sharpening up the petals; in reality, the contrast was low and the shading nuanced; just as
  1785.    presented by the X-T5.</p>
  1786.    <p>Is the Pixel’s rendering a consequence of whatever its sensor is?  Or of the copious amount of processing that
  1787.    contributes to Google’s widely-admired (by me too) “computational photography”? I certainly have no idea. And in fact,
  1788.    most of the pictures I share come from my Android because the best camera (this is always true) is the one you have with
  1789.    you. For example…</p>
  1790.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/31/PXL_20250531_032232026.png" alt="Grand piano by itself in an old church" />
  1791.    <div class='caption'><p>That same evening we took in a concert put on by the local Chopin Society featuring 89-year-old
  1792.    <a href="MikhailVoskresensky">Mikhail Voskresensky</a>, who plays really fast and loud in an old super-romantic style, just the
  1793.    thing for the music: Very decent Beethoven and Mozart, kind of aimless Grieg, and the highlight, a lovely take on Chopin’s
  1794.    Op. 58 Sonata, then a <cite>Nocturne</cite> in the encores.</p>
  1795.    <p>Anyhow, I think the Camera I Had With Me did fine. This is
  1796.    <a href="https://www.thecathedral.ca/programs/architecture-heritage">Vancouver’s oldest still-standing
  1797.    building</a>, Christ Church Cathedral, an exquisite space for the eyes and ears.</p></div>
  1798.    <p>Maybe I’ll do a bit more conscious color-correction on the Pixel shots in future (although I didn’t on the piano). Doesn’t
  1799.    mean it’s not a great camera.</p>
  1800. </div></content></entry>
  1801.  
  1802. <entry>
  1803. <title>Comparing Numbers Badly</title>
  1804. <link href='https://www.tbray.org/ongoing/When/202x/2025/05/30/Number-Comparison-Representation' />
  1805. <link rel='replies'        thr:count='4'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/05/30/Number-Comparison-Representation#comments' />
  1806. <id>https://www.tbray.org/ongoing/When/202x/2025/05/30/Number-Comparison-Representation</id>
  1807. <published>2025-05-30T12:00:00-07:00</published>
  1808. <updated>2025-05-30T16:15:25-07:00</updated>
  1809. <category scheme='https://www.tbray.org/ongoing/What/' term='Language' />
  1810. <category scheme='https://www.tbray.org/ongoing/What/' term='Language' />
  1811. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology/Math' />
  1812. <category scheme='https://www.tbray.org/ongoing/What/' term='Technology' />
  1813. <category scheme='https://www.tbray.org/ongoing/What/' term='Math' />
  1814. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>This is just a gripe about two differently bad ways to compare numbers. They share a good alternative</div></summary>
  1815. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1816.    <p>This is just a gripe about two differently bad ways to compare numbers. They share a good alternative.</p>
  1817.    <h2 id='p-1'>“Order of magnitude”</h2>
  1818.    <p>Typically sloppy usages: “AI increases productivity by an order of magnitude”, “Revenue from recorded music is orders of
  1819.    magnitude smaller than back in the Eighties”.</p>
  1820.    <p>Everyone reading this probably already knows that “order of magnitude” has a precise meeting: Multiply or divide by
  1821.    ten. But clearly, the people who write news stories and marketing spiels either don’t, or are consciously using the idioms to
  1822.    lie. In particular, they are trying to say “more than” or “less than” in a dramatic and impressive-sounding way.</p>
  1823.    <p>Consider that first example. It is saying that AI delivers a ten-times gain in productivity. If they’d actually said “ten
  1824.    times” people would be more inclined to ask “What units?” and “How did you measure?” This phrase makes me think that its author
  1825.    is probably lying.</p>
  1826.    <p>The second example is even more pernicious. Since “orders” is plural, they are claiming at least two orders of magnitude,
  1827.    i.e. that revenue is down by <em>at least</em> a factor of a hundred. The difference between two, three, and four orders of
  1828.    magnitude is huge!  I’d probably argue that the phrase “order<b>s</b> of magnitude” should probably
  1829.    never be used. In this case, I highly doubt that the speaker has any data, and that they’re just trying to say that the
  1830.    revenue is down really a lot.</p>
  1831.    <p>The solution is simple: Say “by a factor of ten” or “ten times as high” or “at least 100 times less.”  Assuming your claim is
  1832.    valid, it will be easily understood; Almost everyone has a decent intuitive understanding of what a ten-times or hundred-times
  1833.    difference feels like.</p>
  1834.    <h2 id='p-2'>“Percent”</h2>
  1835.    <p>What actually got me started reading this was reading a claim that some business’s “revenue increased by 250%.”
  1836.    Let’s see. If the revenue were one million and it increased by 10%, it’d be 1.1 million. If it increased by 100% it’d be two
  1837.    million. 200% is three million. So what they meant by 250% is that the revenue increased by a factor of 3.5.  It is <em>so
  1838.    much</em> easier to understand “3.5 times” than 250%. Furthermore, I bet a lot of people intuitively feel that 250% means “2.5
  1839.    times”, which is just wrong.</p>
  1840.    <p>I think quoting percentages is clear and useful for values less than 100. There is nothing wrong with talking about a 20%
  1841.    increase or 75% decrease.</p>
  1842.    <p>So, same solution: For percentages past 100, don’t use them, just say “by a factor of X”. Once again, people have an instant
  1843.    (and usually correct) gut feel for what a 3.5-times increase feels like.</p>
  1844.    <h2 id='p-3'>“But English is a living language!”</h2>
  1845.    <p>Not just living, but also squirmy and slutty, open to both one-night stands and permanent relationships with neologisms no
  1846.    matter how ugly and
  1847.    imports from other dialects no matter how sketchy. Which is to say, there’s nothing I can do to keep “orders of magnitude” from
  1848.    being used to mean “really a lot”.</p>
  1849.    <p>In fact, it’s only a problem when you’re trying to communicate a numeric difference. But that’s an important application of
  1850.    human language.</p>
  1851.    <p>Perversely, I guess you could argue that these
  1852.    bad idioms are useful in helping you detect statements that are probably either ignorant or just lies. Anyhow, now you know that
  1853.    when I hear them, I hear patterns that make me inclined to disbelieve. And I bet I’m not the only one.</p>
  1854. </div></content></entry>
  1855.  
  1856. <entry>
  1857. <title>CL XLVI: Happy Colors</title>
  1858. <link href='https://www.tbray.org/ongoing/When/202x/2025/05/27/Happy-Colors' />
  1859. <link rel='replies'        thr:count='0'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/05/27/Happy-Colors#comments' />
  1860. <id>https://www.tbray.org/ongoing/When/202x/2025/05/27/Happy-Colors</id>
  1861. <published>2025-05-27T12:00:00-07:00</published>
  1862. <updated>2025-05-28T21:58:08-07:00</updated>
  1863. <category scheme='https://www.tbray.org/ongoing/What/' term='The World/Cottage Life' />
  1864. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  1865. <category scheme='https://www.tbray.org/ongoing/What/' term='Cottage Life' />
  1866. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Last weekend we were at our cabin on     <a href='https://en.wikipedia.org/wiki/Keats_Island_(British_Columbia)'>Keats Island</a> and I came away with two     <a href='/ongoing/What/The%20World/Cottage%20Life/'>cottage-life</a> pictures I     wanted to write about. To write cheery stuff actually, a rare pleasure in these dark days.  Both have a story but this first one’s     simple</div></summary>
  1867. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1868.    <p>Last weekend we were at our cabin on
  1869.    <a href="https://en.wikipedia.org/wiki/Keats_Island_(British_Columbia)">Keats Island</a> and I came away with two
  1870.    <a href="/ongoing/What/The%20World/Cottage%20Life/">cottage-life</a> pictures I
  1871.    wanted to write about. To write cheery stuff actually, a rare pleasure in these dark days.  Both have a story but this first one’s
  1872.    simple.</p>
  1873.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/27/PXL_20250525_212106021.png" alt="Evergreen branches in spring with the new life showing" />
  1874.    <p>It’s just an ordinary evergreen tree, not very tall, nothing special about it. But spring’s here! So at the end of each branch
  1875.    there’s a space where the needles are new and shout their youth in light green, a fragile color as compared to the soberly rich
  1876.    shade of the middle-aged needles further up the branch. Probably a metaphor for something complicated but I just see a tree
  1877.    getting on with the springtime business of tree-ness. Good on it.</p>
  1878.    <p>Now a longer story.
  1879.    What happened was, we had an extra-low tide. Tide is a big deal, we get 17 vertical feet at the extremes which can cause
  1880.    problems for boats and docks and if you happen to arrive with several days worth of supplies at low tide well it sucks to be
  1881.    you, because you’re gonna be toting everything up that much further.</p>
  1882.    <p>But I digress.</p>
  1883.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/27/PXL_20250525_172750708.png" alt="Purple sea stars hide among dark rocks" />
  1884.    <p>I went for a walk at low tide because you see things that are usually mostly hidden. For example these
  1885.    <a href="https://en.wikipedia.org/wiki/Starfish">starfish</a>, also known as sea stars or even “asteroids”. No, really, check
  1886.    that link.</p>
  1887.    <p>These are
  1888.    <a href="https://en.wikipedia.org/wiki/Pisaster_ochraceus"><i>Pisaster ochraceus</i></a>, distinguished by that pleasing violet color.
  1889.    Have a close look. They’re intertidal creatures hiding from the unaccustomed light and air. The important thing is that
  1890.    they’re more or less whole, which is to say free of
  1891.    <a href="https://en.wikipedia.org/wiki/Sea_star_wasting_disease">wasting disease</a>, of which there’s been a major epizootic in
  1892.    recent years. The disease isn’t subtle, it makes their arms melt away into purple goo; extremely gross.</p>
  1893.    <p>Plus, ecologies being what they are, there are downstream effects. Sea stars predate on sea urchins only recently they
  1894.    haven’t been because wasting disease. It turns out that sea urchins eat the kelp that baby shrimp trying to grow up hide in.
  1895.    Fewer stars, more urchins, less prawns. Which means that the commercial prawn-fishers have been coming up
  1896.    empty and going out of business.</p>
  1897.    <p>Anyhow, seeing a cluster of disease-free stars is nice, whether you’re in the seafood business or you just like
  1898.    the stars for their own sake, as I do.</p>
  1899.    <p>And light-green needles too. And spring. Enjoy it while you can.</p>
  1900. </div></content></entry>
  1901.  
  1902. <entry>
  1903. <title>The Lens of Spring</title>
  1904. <link href='https://www.tbray.org/ongoing/When/202x/2025/05/17/Springtime-Lens' />
  1905. <link rel='replies'        thr:count='3'        type='application/xhtml+xml'        href='/ongoing/When/202x/2025/05/17/Springtime-Lens#comments' />
  1906. <id>https://www.tbray.org/ongoing/When/202x/2025/05/17/Springtime-Lens</id>
  1907. <published>2025-05-17T12:00:00-07:00</published>
  1908. <updated>2025-05-18T11:53:07-07:00</updated>
  1909. <category scheme='https://www.tbray.org/ongoing/What/' term='The World/Economics' />
  1910. <category scheme='https://www.tbray.org/ongoing/What/' term='The World' />
  1911. <category scheme='https://www.tbray.org/ongoing/What/' term='Economics' />
  1912. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts/Photos/Cameras' />
  1913. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts' />
  1914. <category scheme='https://www.tbray.org/ongoing/What/' term='Photos' />
  1915. <category scheme='https://www.tbray.org/ongoing/What/' term='Cameras' />
  1916. <category scheme='https://www.tbray.org/ongoing/What/' term='Arts/Photos' />
  1917. <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Back in the early days of this blog, I used to publish posts that were mostly pictures of plants and flowers. Especially at this     time of year. I think that energy went into Twitter and now the Fediverse, where it’s so easy to take a picture and post it     right then. This week I got a freshly-repaired lens back from the shop and it put me in the mood to get closer to the     botanical frenzy springing at us from every direction. Herewith four pix of two plants, one of a lens, and more thoughts on a     familiar subject: Whether it’s better to repair than to replace</div></summary>
  1918. <content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
  1919.    <p>Back in the early days of this blog, I used to publish posts that were mostly pictures of plants and flowers. Especially at this
  1920.    time of year. I think that energy went into Twitter and now the Fediverse, where it’s so easy to take a picture and post it
  1921.    right then. This week I got a freshly-repaired lens back from the shop and it put me in the mood to get closer to the
  1922.    botanical frenzy springing at us from every direction. Herewith four pix of two plants, one of a lens, and more thoughts on a
  1923.    familiar subject: Whether it’s better to repair than to replace.</p>
  1924.    <p>The lens, by the way, was the
  1925.    <a href="https://www.fujifilm-x.com/en-ca/products/lenses/xf18-55mmf28-4-r-lm-ois/">Fuji 18-55</a> oops its full name is
  1926.    “Fujinon XF18-55mmF2.8-4 R LM OIS” so there. I
  1927.    <a href="/ongoing/When/201x/2013/03/06/Fuji-X-E1-in-Tokyo">bought it</a> in March of 2013 and have dropped it more than once; I
  1928.    have retained 1,432 pictures taken with it over the years. But then it stopped working.</p>
  1929.    <p>More words on that later, but pictures first.</p>
  1930.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/17/TXT55621.png" alt="A yellow Fru Dagmar Hastrup rose blossom" />
  1931.    <div class='caption'><p>Roses have names and this one is “Fru Dagmar Hastrup”. Therein
  1932.    <a href="/ongoing/When/200x/2008/06/26/Yellow-Rugosa">lies a tale</a> that is either 17 or 111 years old, depending how you
  1933.    count.</p></div>
  1934.    <p>That’s the first picture I took with the repaired 18-55. But then I thought that the whole point of this basic zoom was that
  1935.    you could go wide to capture big things, or long to, well, zoom in on ’em. So I went out front.</p>
  1936.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/17/TXT55626.png" alt="Looking up into the branches of a large deciduous tree" />
  1937.    <div class='caption'><p>Trees have names too. This is a
  1938.    <a href="https://en.wikipedia.org/wiki/Fraxinus_americana">White Ash</a> (<i>Fraxinus americana</i>).</p></div>
  1939.    <p>That ash is one of the trees lining the street we
  1940.    <a href="/ongoing/When/202x/2025/02/28/Moved">moved onto last October</a>. It’s really immense. Let’s crank the zoom way wide and
  1941.    capture most of it.  Doing this reveals really great geometry, so let’s subtract the color and add some
  1942.    <a href="https://nikcollection.dxo.com/nik-silver-efex/">Silver Efex</a> sizzle.</p>
  1943.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/17/TXT55625-Edit.png" alt="Black and white rendition of the spreading branches of a large tree" />
  1944.    <p>And then we can zoom back in.</p>
  1945.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/17/TXT55628.png" alt="The first fork in the trunk of a large tree, with moss and outgrowths" />
  1946.    <p>The closer you get, the better it looks.</p>
  1947.    <h2 id='p-1'>Fixing that lens</h2>
  1948.    <p>I like quirky fast compact opinionated prime lenses just as much as the next photoenthusiast, but a decent midrange zoom
  1949.    is just too useful not to have. I could’ve replaced this one with the new-fangled
  1950.    <a href="https://www.fujifilm-x.com/en-ca/products/lenses/xf16-50mmf28-48-r-lm-wr/">16-50mm</a> (also has a long complicated
  1951.    Real Name but never mind). That would cost me extra money and
  1952.    <a href="https://www.youtube.com/watch?v=1rLcCkilADY&amp;t=3s">might not even be better</a>.</p>
  1953.    <p>So I poked around on the Fujifilm Web site and sure enough, they offer repair as a service, just package it up and mail it
  1954.    in. A few days after doing so I got an email quoting me a price and asking for approval, which I granted.
  1955.    You shouldn’t be surprised. Way back in 2011 I wrote
  1956.    <a href="/ongoing/When/201x/2011/10/20/Worth-Repairing">Worth Fixing</a>, the exemplar of which was a different excellent lens.
  1957.    And then just last year my
  1958.    <a href="/ongoing/When/202x/2024/06/01/Parable-of-the-Sofa">Parable of the Sofa</a> touched a few
  1959.    nerves. So I didn’t think very hard about it.</p>
  1960.    <p>But then I realized I hadn’t even checked whether the price was reasonable. So I
  1961.    <a href="https://www.ebay.com/sch/i.html?_nkw=xf18-55">turned to eBay</a> and, well, I could have got a mint-condition
  1962.    secondhand 18-55 for less than the cost of the repair. Not a lot less, but still. Oh well. If it were reasonable to care
  1963.    about a single instance of a standardized commercial product, I’d care about that lens.</p>
  1964.    <p>Anyhow, it works pretty well. Showing its age, but still reasonably handsome.</p>
  1965.    <img src="https://www.tbray.org/ongoing/When/202x/2025/05/17/PXL_20250518_040716981.png" alt="Fujifilm x-T5 camera with the 18-55mm lens attached" />
  1966.    <p>If I live long enough maybe I’ll take another thousand pictures with it.</p>
  1967. </div></content></entry>
  1968.  
  1969. </feed>
  1970.  

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid Atom 1.0" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//www.tbray.org/ongoing/ongoing.atom

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda