<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:base="https://ptree.org/blog/">
 <title>Ptree Blog</title>
 <link href="https://ptree.org/blog/feed.xml" rel="self"/>
 <link href="https://ptree.org/blog/"/>
 <id>https://ptree.org/blog/</id>
 <updated>2026-11-24T00:00:00Z</updated>
 <author><name>Michael Dayah</name></author>
 <entry>
  <title>Live filtered summaries without a server round trip</title>
  <link href="https://ptree.org/blog/live-filtered-summaries.html"/>
  <id>https://ptree.org/blog/live-filtered-summaries.html</id>
  <updated>2026-11-24T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Press Nocturnal on Aves under Mass, drag the mass slider on Mammalia under Conservation, or sweep your pointer across the sidebar world map, and every other property's readout and legend box-whisker plot glide in real time to summarize only the filtered subset, computed entirely in the browser from the tiles already on screen.</summary>
  <content type="html">&lt;p&gt;Press &lt;code&gt;Nocturnal&lt;/code&gt; on &lt;a href=&quot;/#GBIF/Mass/212&amp;amp;fossils=hide&amp;amp;filter=diel:nocturnal&quot;&gt;Aves under Mass&lt;/a&gt;, drag the mass slider on &lt;a href=&quot;/#GBIF/Conservation/359&amp;amp;fossils=hide&amp;amp;filter=mass:10000..&quot;&gt;Mammalia under Conservation&lt;/a&gt;, or sweep your pointer across the sidebar world map, and every other property&amp;#39;s readout and legend box-whisker plot glide in real time to summarize only the filtered subset, computed entirely in the browser from the tiles already on screen.&lt;/p&gt;
&lt;h2&gt;Pooling the visible frontier in client memory&lt;/h2&gt;
&lt;p&gt;A naive server implementation would need to cross-tabulate arbitrary combinations of 39 biological properties and arbitrary map polygons across millions of taxa on every slider drag or mouse move. That query cannot stay at 60 frames per second over HTTP, and precomputing the cross-product would multiply storage by hundreds.&lt;/p&gt;
&lt;p&gt;The tiles already loaded on screen hold almost everything needed to approximate the answer immediately. Every numeric property carries a seven-knot summary (&lt;code&gt;min&lt;/code&gt;, &lt;code&gt;p5&lt;/code&gt;, &lt;code&gt;q1&lt;/code&gt;, &lt;code&gt;median&lt;/code&gt;, &lt;code&gt;q3&lt;/code&gt;, &lt;code&gt;p95&lt;/code&gt;, &lt;code&gt;max&lt;/code&gt;), a geometric or arithmetic mean (&lt;code&gt;gmean&lt;/code&gt;), and a measured species count (&lt;code&gt;count&lt;/code&gt;). Every categorical property carries per-bin species weights normalized within each question facet.&lt;/p&gt;
&lt;p&gt;When any filter or location is active, the client walks the deepest already-loaded, property-ready child frontier beneath the selected clade. For each child tile, every active filter contributes a match share between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A categorical filter computes the fraction of that child&amp;#39;s answering descendants that hold any pressed bin, normalized within each facet so multi-question properties never dilute one question with another.&lt;/li&gt;
&lt;li&gt;A numeric window integrates the child&amp;#39;s own cumulative distribution function between the two thumbs, staying strictly positive whenever the tile&amp;#39;s extent reaches the window.&lt;/li&gt;
&lt;li&gt;A location filter, whether a committed place or a live hover coordinate from &lt;a href=&quot;/blog/location-filtering-path2d.html&quot;&gt;the &lt;code&gt;Path2D&lt;/code&gt; map scrubber&lt;/a&gt;, tests the child&amp;#39;s cached range union for &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those shares multiply across every active filter other than the property being summarized, so clicking categories or dragging thumbs on Mass keeps Mass&amp;#39;s own legend steady while every other property in the menu glides to match.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;// Weight each child by its measured count times its match share across other active filters.
const entries = frontier.map((child, i) =&amp;gt; ({
	d: seg(child, key),
	w: d?.count ? d.count * shares[i] : 0,
	total: d ? d.total * shares[i] : 0,
}));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From those weighted child distributions, pooling a categorical property is a weighted sum of bucket weights. Pooling a numeric property gives the exact weighted geometric or linear mean directly in one pass, then inverts the weighted mixture of child CDFs by 24 steps of bisection (about 16 millionths of the domain width) to recover &lt;code&gt;p5&lt;/code&gt;, &lt;code&gt;q1&lt;/code&gt;, &lt;code&gt;median&lt;/code&gt;, &lt;code&gt;q3&lt;/code&gt;, and &lt;code&gt;p95&lt;/code&gt;. Menu readouts solve only the median; the active legend solves all five quantiles and feeds the pooled summary into the exact same &lt;code&gt;@property&lt;/code&gt; box-whisker updater that handles taxon hover. The entire update uses no extra DOM elements, no animation loop, and no server endpoint.&lt;/p&gt;
&lt;h2&gt;Bending the outer five percent with a cubic tail&lt;/h2&gt;
&lt;p&gt;Linear interpolation between consecutive knots works well across the interior 90% of a distribution (&lt;code&gt;p5&lt;/code&gt; to &lt;code&gt;p95&lt;/code&gt;), where species density varies gently. It breaks down badly in the outer 5% tails (&lt;code&gt;[min, p5]&lt;/code&gt; and &lt;code&gt;[p95, max]&lt;/code&gt;), where a single giant or miniature outlier stretches the interval over orders of magnitude.&lt;/p&gt;
&lt;p&gt;On &lt;code&gt;Amphibia&lt;/code&gt; mass, for example, Chinese giant salamanders stretch &lt;code&gt;Caudata&lt;/code&gt;&amp;#39;s upper tail far past &lt;code&gt;p95&lt;/code&gt;. Treating &lt;code&gt;[p95, max]&lt;/code&gt; as a flat rectangle spreads 5% of all salamander species evenly across that void, inflating the reconstructed &lt;code&gt;Amphibia&lt;/code&gt; &lt;code&gt;p95&lt;/code&gt; by &lt;code&gt;+107.8%&lt;/code&gt; even with no filter active.&lt;/p&gt;
&lt;p&gt;Replacing linear interpolation on only those two outer segments with a cubic power curve (&lt;code&gt;u ** 3&lt;/code&gt; below &lt;code&gt;p5&lt;/code&gt; and &lt;code&gt;1 - (1 - u) ** 3&lt;/code&gt; above &lt;code&gt;p95&lt;/code&gt;) packs tail probability near &lt;code&gt;p5&lt;/code&gt; and &lt;code&gt;p95&lt;/code&gt; and lets density taper smoothly to zero at &lt;code&gt;min&lt;/code&gt; and &lt;code&gt;max&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const u = (px - pxs[i]) / (pxs[i + 1] - pxs[i]);
const f = i === 0 ? u ** 3 : i === 5 ? 1 - (1 - u) ** 3 : u;
return KNOTS[i] + f * (KNOTS[i + 1] - KNOTS[i]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because &lt;code&gt;u ** 3&lt;/code&gt; is strictly increasing from &lt;code&gt;0&lt;/code&gt; to &lt;code&gt;1&lt;/code&gt; and matches the endpoints exactly, monotonicity and knot identity stay guaranteed with zero extra bytes on the wire. Reconstructing unfiltered classes from their direct child orders with the cubic tail produces exact geometric means and tight interior quantiles:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Clade and property&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;&lt;code&gt;p5&lt;/code&gt; error&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;&lt;code&gt;q1&lt;/code&gt; error&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;&lt;code&gt;median&lt;/code&gt; error&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;&lt;code&gt;gmean&lt;/code&gt; error&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;&lt;code&gt;q3&lt;/code&gt; error&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;&lt;code&gt;p95&lt;/code&gt; error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Aves mass&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-1.1%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+1.3%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+0.3%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;0.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+1.3%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+5.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mammalia longevity&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-4.9%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-3.4%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-1.5%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;0.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-1.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+2.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mammalia offspring&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+2.8%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+0.7%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-2.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;0.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-0.2%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+0.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Squamata mass&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-3.9%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-0.2%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+1.6%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;0.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+4.6%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+14.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amphibia mass&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-4.5%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;-3.3%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+1.3%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;0.0%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+5.6%&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;+20.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;code&gt;Amphibia&lt;/code&gt; mass &lt;code&gt;p95&lt;/code&gt; error drops from &lt;code&gt;+107.8%&lt;/code&gt; to &lt;code&gt;+20.4%&lt;/code&gt;, &lt;code&gt;Aves&lt;/code&gt; mass &lt;code&gt;p5&lt;/code&gt; drops from &lt;code&gt;-8.7%&lt;/code&gt; to &lt;code&gt;-1.1%&lt;/code&gt;, and &lt;code&gt;Mammalia&lt;/code&gt; longevity &lt;code&gt;p95&lt;/code&gt; drops from &lt;code&gt;+7.6%&lt;/code&gt; to &lt;code&gt;+2.0%&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Honest limits of client-side accuracy&lt;/h2&gt;
&lt;p&gt;Client-side frontier pooling is fast because it never sees individual species records. That shortcut comes with three real statistical limits that are worth measuring against exact species-level joins rather than hiding.&lt;/p&gt;
&lt;p&gt;First is the &lt;strong&gt;within-clade independence assumption&lt;/strong&gt;. Weighting a child tile by &lt;code&gt;count * share&lt;/code&gt; assumes that inside each individual child clade, the filtered trait and the target trait are independent. Whenever an ecological relationship separates &lt;em&gt;between&lt;/em&gt; orders or families, order-level pooling lands within a few percent of species truth on the very first click. Whenever the relationship lives &lt;em&gt;inside&lt;/em&gt; one huge, diverse order (like &lt;code&gt;Anura&lt;/code&gt; for frogs or &lt;code&gt;Passeriformes&lt;/code&gt; for perching birds), order-level pooling blends the two halves together until you open deeper branches:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Filter and target&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;Orders&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;Families&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;Genera&lt;/th&gt;
&lt;th align=&quot;right&quot;&gt;Exact species&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Aves nocturnal vs diurnal mass&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;126 g vs 33.8 g (3.7×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;125 g vs 33.9 g (3.7×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;122 g vs 33.0 g (3.7×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;120 g vs 33.8 g (3.6×)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elasmobranchii threatened vs LC mass&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;9.3 kg vs 4.1 kg (2.3×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;17.1 kg vs 1.2 kg (13.8×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;17.0 kg vs 1.4 kg (12.6×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;21.1 kg vs 1.2 kg (17.6×)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amphibia threatened vs LC mass&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;3.49 g vs 3.34 g (1.04×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;2.76 g vs 3.91 g (0.70×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;2.40 g vs 4.33 g (0.55×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;2.10 g vs 4.56 g (0.46×)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Amphibia threatened vs LC offspring&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;75.6 vs 88.1 (0.86×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;45.1 vs 130.5 (0.35×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;40.0 vs 155.7 (0.26×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;35.0 vs 180.0 (0.19×)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aves cold/temperate vs tropical offspring&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;2.60 vs 2.51 (1.03×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;2.78 vs 2.45 (1.14×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;3.00 vs 2.29 (1.31×)&lt;/td&gt;
&lt;td align=&quot;right&quot;&gt;3.50 vs 2.50 (1.40×)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Because the frontier walker automatically descends into any branch you have already opened on screen, every click deeper into the tree sharpens the parent clade&amp;#39;s filtered summary live with zero extra fetches.&lt;/p&gt;
&lt;p&gt;Second is &lt;strong&gt;differential coverage extrapolation&lt;/strong&gt;, which produces a striking paradox on &lt;code&gt;Mammalia&lt;/code&gt; when filtering &lt;code&gt;Organization: group&lt;/code&gt; against &lt;code&gt;Mass&lt;/code&gt;. Across the 1,160 mammal species that have &lt;em&gt;both&lt;/em&gt; social organization and body mass recorded in literature, group-living species have a median mass of &lt;code&gt;1.74 kg&lt;/code&gt; versus &lt;code&gt;90 g&lt;/code&gt; for solitary species (&lt;code&gt;19.3×&lt;/code&gt;). Order-level pooling reports &lt;code&gt;85.1 g&lt;/code&gt; versus &lt;code&gt;83.8 g&lt;/code&gt; (&lt;code&gt;1.02×&lt;/code&gt;). Why the massive divergence? &lt;code&gt;Chiroptera&lt;/code&gt; (bats, median &lt;code&gt;12.9 g&lt;/code&gt;) has &lt;code&gt;1,162&lt;/code&gt; species with measured body mass, but only &lt;code&gt;316&lt;/code&gt; species with social organization logged, of which &lt;code&gt;81%&lt;/code&gt; are group-living. A raw species join counts only &lt;code&gt;249&lt;/code&gt; doubly-measured bats and is dominated by well-studied primates (&lt;code&gt;2.5 kg&lt;/code&gt;), ungulates (&lt;code&gt;53 kg&lt;/code&gt;), and cetaceans (&lt;code&gt;424 kg&lt;/code&gt;). Clade pooling extrapolates &lt;code&gt;81% × 1,162 = 940&lt;/code&gt; social bats. Neither number is a bug: the raw join reflects which mammals scientists happened to study for both traits, while clade pooling reflects what happens if unmeasured bats resemble measured bats.&lt;/p&gt;
&lt;p&gt;Third is &lt;strong&gt;binary range granularity on map hover&lt;/strong&gt;. Testing a cursor point against a clade&amp;#39;s range union returns &lt;code&gt;1&lt;/code&gt; if &lt;em&gt;any&lt;/em&gt; descendant occurs there and &lt;code&gt;0&lt;/code&gt; otherwise. At class rank, cosmopolitan orders like &lt;code&gt;Rodentia&lt;/code&gt; or &lt;code&gt;Passeriformes&lt;/code&gt; light up almost everywhere on land; opening down to families and genera turns that broad presence check into sharp regional ecology.&lt;/p&gt;
&lt;p&gt;To see the ecological patterns that fall out when every property answers live filters in place, see &lt;a href=&quot;/blog/extinction-size-reversal.html&quot;&gt;Why big sharks and tiny frogs share the Red List&lt;/a&gt; and &lt;a href=&quot;/blog/three-click-discoveries.html&quot;&gt;Discoveries you can see in three clicks&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Chasing a sliver of the wrong color</title>
  <link href="https://ptree.org/blog/chasing-color-slivers.html"/>
  <id>https://ptree.org/blog/chasing-color-slivers.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Open a whole class of organisms in Ptree, and you sometimes spot a razor-thin sliver of color that has no business being there: a flicker of metamorphosis inside mammals, a stripe of photosynthesis inside land snails, or live birth inside a shell-bearing snail genus. Those slivers do not come from an audit script. They jump out of the interface on sight and send us straight back to the identity graph to figure out which two organisms were fused by mistake.</summary>
  <content type="html">&lt;p&gt;Open a whole class of organisms in Ptree, and you sometimes spot a razor-thin sliver of color that has no business being there: a flicker of metamorphosis inside mammals, a stripe of photosynthesis inside land snails, or live birth inside a shell-bearing snail genus. Those slivers do not come from an audit script. They jump out of the interface on sight and send us straight back to the identity graph to figure out which two organisms were fused by mistake.&lt;/p&gt;
&lt;h2&gt;Why this interface exposes identity leaks on sight&lt;/h2&gt;
&lt;p&gt;Most biodiversity portals show one species page at a time. A bad join between a snail and a bacterium can sit silently on one of 30,000 species pages for a decade because nobody opens that page and notices the contradiction. Even tools that summarize groups usually paint each branch by its majority category or mean value, which rounds a 0.2% error down to zero and hides the leak completely.&lt;/p&gt;
&lt;p&gt;Ptree’s visual grammar refuses to hide minorities. Categorical tiles stack every category’s proportion as a literal band of color, and numeric tiles draw whiskers out to clade extremes. Because those bars roll all the way up to &lt;code&gt;Life&lt;/code&gt;, a single mislinked homonym or mis-scoped clade default leaves a colored trace on its family, order, and class.&lt;/p&gt;
&lt;p&gt;That turns the viewer itself into a tree-wide debugger. You do not start by writing SQL. You click whichever child tile still carries that impossible sliver, repeat four or five times down the hierarchy, and land directly on the offending species and its provenance trace.&lt;/p&gt;
&lt;h2&gt;Four clicks from mammals to a wasp in a red panda genus&lt;/h2&gt;
&lt;p&gt;Look at &lt;a href=&quot;/#GBIF/Ontogeny/359&amp;amp;fossils=hide&quot;&gt;Mammalia under Ontogeny&lt;/a&gt;. Most of the tile is live birth (&lt;code&gt;carried&lt;/code&gt;) and direct development (&lt;code&gt;direct&lt;/code&gt;), with a small, biologically real sliver of egg-laying (&lt;code&gt;released&lt;/code&gt;) for the platypus and echidnas. Right beside it sits a microscopic sliver of &lt;code&gt;staged&lt;/code&gt; (larval metamorphosis) with a weight of 0.25 out of 14,136.&lt;/p&gt;
&lt;p&gt;Mammals do not have a larval stage. Follow that sliver down four clicks (&lt;code&gt;Carnivora&lt;/code&gt; → &lt;code&gt;Ailuridae&lt;/code&gt; → &lt;code&gt;Ailurus&lt;/code&gt; → &lt;em&gt;Aelurus grandis&lt;/em&gt;) and the culprit is waiting at the leaf. &lt;code&gt;Aelurus&lt;/code&gt; is both an old spelling of the red panda genus (&lt;code&gt;Ailurus&lt;/code&gt;) and a valid genus of Australian flower wasps in &lt;code&gt;Thynnidae&lt;/code&gt;. GBIF filed the doubtful species &lt;em&gt;Aelurus grandis&lt;/em&gt; under the red panda genus, while EOL and iNaturalist correctly hold &lt;em&gt;Aelurus grandis&lt;/em&gt; Kimsey, 1991 as a flower wasp. Joining those records by name pulled Holometabola’s complete metamorphosis straight into the red panda family and all the way up onto the &lt;code&gt;Mammalia&lt;/code&gt; tile.&lt;/p&gt;
&lt;h2&gt;Four clicks from land snails to a photosynthetic bacterium&lt;/h2&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF/Nutrition/1456&amp;amp;fossils=hide&quot;&gt;Stylommatophora under Nutrition&lt;/a&gt;, the order of terrestrial snails and slugs. Across nearly 33,000 living species, a thin bright-green stripe of &lt;code&gt;photosynthetic&lt;/code&gt; (weight 95) stands beside the predatory and herbivorous shares.&lt;/p&gt;
&lt;p&gt;Click the child that holds the green (&lt;code&gt;Microcystidae&lt;/code&gt;) and open its two genera: &lt;code&gt;Lamprocystis&lt;/code&gt; (weight 90) and &lt;code&gt;Microcystis&lt;/code&gt; (weight 1). Both names are cross-kingdom homonyms. &lt;code&gt;Microcystis&lt;/code&gt; is both a Pacific land-snail genus and the well-known toxic cyanobacterium; &lt;code&gt;Lamprocystis&lt;/code&gt; is both a land-snail genus (&lt;em&gt;Lamprocystis&lt;/em&gt; Pfeffer, 1883) and a purple photosynthetic sulfur bacterium. In EOL TraitBank, a bare-name match attached a chapter from &lt;em&gt;The Purple Phototrophic Bacteria&lt;/em&gt; onto the land-snail page for &lt;code&gt;Lamprocystis&lt;/code&gt;, stamping phototrophy across 90 terrestrial snail species. Five seconds of clicking down a green sliver diagnosed a cross-kingdom homonym leak that no table browser would ever surface.&lt;/p&gt;
&lt;h2&gt;Identity bugs caught the same way&lt;/h2&gt;
&lt;p&gt;Once you start reading slivers as diagnostic signals, entire classes of identity and inheritance errors fall out of the tree and straight into permanent regression cases:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wikidata’s Caribbean land-snail genus &lt;em&gt;Brachypodella&lt;/em&gt; carried the Fossilworks identifier of PBDB’s extinct rhinoceros &lt;em&gt;Brachypodella&lt;/em&gt; Heissig, 1973, leaking mammalian live birth (&lt;code&gt;carried&lt;/code&gt;) onto a snail genus until the crosswalk’s phylum splitter cut them apart.&lt;/li&gt;
&lt;li&gt;A geometrid moth (&lt;em&gt;Chloroclystis neoconversa&lt;/em&gt;) carried predatory shell-crushing nutrition from an armored fish order; a copper butterfly (&lt;em&gt;Lycaena&lt;/em&gt;) carried a mammal’s fossil age; a water boatman (&lt;em&gt;Sigara lateralis&lt;/em&gt;) carried a crustacean’s body construction; and an orchid (&lt;em&gt;Bletia catenulata&lt;/em&gt;) carried a green alga’s rounded cell shape.&lt;/li&gt;
&lt;li&gt;Merging a single poison frog (&lt;em&gt;Ameerega labialis&lt;/em&gt;) into the superfamily Dendrobatoidea let that one species’ Data Deficient status stand for all 315 poison frogs, wiping out the Endangered and Critically Endangered stripes on the entire clade until the merger was broken.&lt;/li&gt;
&lt;li&gt;The ram’s horn squid &lt;em&gt;Spirula spirula&lt;/em&gt; inherited Nautilidae’s CITES Appendix II trade restriction through its old synonym &lt;em&gt;Nautilus spirula&lt;/em&gt;, and both a moss (&lt;em&gt;Sematophyllum swartzii&lt;/em&gt;) and a fiddleneck (&lt;em&gt;Amsinckia lycopsoides&lt;/em&gt;) picked up Orchidaceae’s CITES listing.&lt;/li&gt;
&lt;li&gt;Toggle Fossils on &lt;a href=&quot;/#GBIF/SexMating/136&amp;amp;fossils=show&quot;&gt;Cephalopoda under Sex &amp;amp; mating&lt;/a&gt;, and living squids and octopuses show zero hermaphroditism while extinct ammonites (&lt;em&gt;Amaltheus&lt;/em&gt;) light up as hermaphrodites from a gastropod default. Toggle Fossils on &lt;a href=&quot;/#GBIF/GrowthForm/424&amp;amp;fossils=show&quot;&gt;Ephedrales under Growth form&lt;/a&gt;, and desert jointfirs suddenly turn into trees because extinct &lt;em&gt;Ephedripites&lt;/em&gt; pollen inherited a default from Ginkgoopsida.&lt;/li&gt;
&lt;li&gt;In SILVA, whole organisms surfaced inside the wrong phyla, with cichlids filed among mammals or parasitic flukes, a sacred ibis among mites, and a flesh fly beside its kinetoplastid parasite, because a sequenced sample carried the DNA of a parasite or a meal.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;When a sliver is missing, and when it is real&lt;/h2&gt;
&lt;p&gt;The absence of a sliver is just as loud as an impossible one. For months, &lt;a href=&quot;/#GBIF/Ontogeny/791&amp;amp;fossils=hide&quot;&gt;Monotremata under Ontogeny&lt;/a&gt; showed no egg-laying stripe at all, because Animal Diversity Web coded monotremes as altricial and no captured source bothered to state the one mammal fact every child knows: platypuses and echidnas lay eggs. Seeing a missing sliver where biology demands one sends you back to coverage and biological defaults instead of to the crosswalk.&lt;/p&gt;
&lt;p&gt;Better still, half the time an unexpected sliver turns out to be real biology. Open &lt;a href=&quot;/#GBIF/Nutrition/6&amp;amp;fossils=hide&quot;&gt;Plantae under Nutrition&lt;/a&gt; and look beside the 99% photosynthetic green: there is a 0.8% sliver of &lt;code&gt;parasitic&lt;/code&gt; and a 0.1% sliver of &lt;code&gt;predatory&lt;/code&gt;. Chase those slivers down the tree and you do not find a database bug. You land on dodder, mistletoe, &lt;em&gt;Rafflesia&lt;/em&gt;, pitcher plants, sundews, and the Venus flytrap.&lt;/p&gt;
&lt;p&gt;That is what makes proportional tree overlays so productive to live inside. Every tiny sliver of color in an unexpected branch poses a clean binary question: either an evolutionary exception worth seeing or a broken identity link worth fixing. Five clicks down the tree settles which one it is.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Folding deep trees into a single gutter</title>
  <link href="https://ptree.org/blog/folding-tree-gutter.html"/>
  <id>https://ptree.org/blog/folding-tree-gutter.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>A taxonomic path from Life to a species commonly crosses fifteen to twenty ranks, while a readable screen holds three or four columns of names. Panning a wide canvas horizontally hides the ancestors that explain where you are; wrapping or indenting a vertical list destroys the horizontal tree structure. Ptree keeps the active columns readable and folds every older generation into one narrow strip along the left edge.</summary>
  <content type="html">&lt;p&gt;A taxonomic path from Life to a species commonly crosses fifteen to twenty ranks, while a readable screen holds three or four columns of names. Panning a wide canvas horizontally hides the ancestors that explain where you are; wrapping or indenting a vertical list destroys the horizontal tree structure. Ptree keeps the active columns readable and folds every older generation into one narrow strip along the left edge.&lt;/p&gt;
&lt;h2&gt;Column budget&lt;/h2&gt;
&lt;p&gt;The viewer lets CSS decide how many live columns fit in the current viewport. On &lt;code&gt;.tree &amp;gt; main&lt;/code&gt;, two custom properties state the acceptable width of a column: &lt;code&gt;--fit-min&lt;/code&gt; at &lt;code&gt;14ex + 6.6ex&lt;/code&gt; and &lt;code&gt;--fit-max&lt;/code&gt; at &lt;code&gt;21ex + 6.6ex&lt;/code&gt;, where &lt;code&gt;6.6ex&lt;/code&gt; accounts for padding, icon, and chevron chrome. CSS subtracts the folded gutter (&lt;code&gt;--snakew&lt;/code&gt;) and trailing margin (&lt;code&gt;--edge-space&lt;/code&gt;) from &lt;code&gt;100cqi&lt;/code&gt;, then computes an integer column count with &lt;code&gt;round()&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.tree &amp;gt; main &amp;gt; * {
  --live-width: calc(100cqi - var(--snakew) - var(--edge-space) + var(--inset));
  --ncols: max(1, min(round(down, calc(var(--live-width) / var(--fit-min)), 1),
                      round(up, calc(var(--live-width) / var(--fit-max)), 1)));
  --colw: calc(var(--live-width) / var(--ncols));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Between resize events, CSS adjusts &lt;code&gt;--colw&lt;/code&gt; continuously so columns track the window width smoothly. JavaScript reads &lt;code&gt;--ncols&lt;/code&gt; only after resize settles, then re-runs the tree layout against that integer count.&lt;/p&gt;
&lt;h2&gt;How columns fold&lt;/h2&gt;
&lt;p&gt;When the expanded tree is &lt;code&gt;maxDepth&lt;/code&gt; columns deep and the screen fits &lt;code&gt;cols&lt;/code&gt; live columns, the Tree view computes &lt;code&gt;fold = Math.max(0, maxDepth - cols)&lt;/code&gt;. Every node at depth &lt;code&gt;d&lt;/code&gt; gets a virtual column index &lt;code&gt;vc = d - fold&lt;/code&gt;. Columns with &lt;code&gt;vc &amp;gt;= 0&lt;/code&gt; render normally at width &lt;code&gt;--colw&lt;/code&gt;. Columns with &lt;code&gt;vc &amp;lt; 0&lt;/code&gt; belong to the folded gutter on the left.&lt;/p&gt;
&lt;p&gt;A folded column is not removed from the DOM. Its &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; keeps the same &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; tiles, and each surviving tile rotates 90 degrees counter-clockwise so its name reads vertically inside the &lt;code&gt;--snakew&lt;/code&gt; gutter. Moving deeper shifts &lt;code&gt;--fold&lt;/code&gt; by one, and &lt;code&gt;.tree .plane&lt;/code&gt; and &lt;code&gt;.tree &amp;gt; main &amp;gt; header&lt;/code&gt; both translate horizontally by:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;transform: translateX(calc((1 + min(1, var(--fold))) * var(--snakew) / 2 - var(--fold) * var(--colw)));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When &lt;code&gt;--fold&lt;/code&gt; is &lt;code&gt;0&lt;/code&gt;, half of &lt;code&gt;--snakew&lt;/code&gt; centers the unfolded tree inside the viewport. As soon as &lt;code&gt;--fold&lt;/code&gt; reaches &lt;code&gt;1&lt;/code&gt;, the other half shifts to the left edge to open the gutter, and every further step slides the plane left by one &lt;code&gt;--colw&lt;/code&gt;. The tiles that cross from column &lt;code&gt;0&lt;/code&gt; into column &lt;code&gt;-1&lt;/code&gt; rotate into the strip in place using CSS transitions on the same elements.&lt;/p&gt;
&lt;h2&gt;Pruning and packing the strip&lt;/h2&gt;
&lt;p&gt;A deep lineage can have dozens of siblings at each folded rank. Showing every sibling from six folded columns inside one narrow strip would turn the gutter into an unreadable stack. Folded columns therefore enforce a reach limit of one: only the selected ancestor and its immediate neighbors within one step of the spine remain visible, and any lateral disclosures opened off those folded columns are pruned from the projection.&lt;/p&gt;
&lt;p&gt;Because folded tiles rotate 90 degrees, a tile&amp;#39;s horizontal width (&lt;code&gt;--colw&lt;/code&gt;) becomes its vertical height inside the gutter. Two folded tiles from different ranks would overlap vertically if they simply kept their unfolded row numbers. The packer solves this with two coupled row counts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;colwRows&lt;/code&gt; converts one tile&amp;#39;s visual width into row pitches (&lt;code&gt;Math.ceil(colw / pitch)&lt;/code&gt;), so the packer knows how many vertical rows a rotated tile consumes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stripRows&lt;/code&gt; tracks the combined vertical intervals occupied by folded nodes in &lt;code&gt;occupied&lt;/code&gt;. Each folded node is placed at the nearest free slot to its descendants&amp;#39; midpoint, nudging out of any interval already claimed by another folded rank.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each folded node stores its strip offset in two CSS custom properties: &lt;code&gt;--i&lt;/code&gt; for its base row and &lt;code&gt;--sp&lt;/code&gt; for its strip position in multiples of &lt;code&gt;var(--colw) - var(--colw-0)&lt;/code&gt;. When the window resizes and &lt;code&gt;--colw&lt;/code&gt; changes, both the rotated tiles and the SVG &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; fans attached to them track the new vertical strip pitch through &lt;code&gt;calc()&lt;/code&gt; without recomputing paths until resize finishes.&lt;/p&gt;
&lt;h2&gt;Connectors across the fold&lt;/h2&gt;
&lt;p&gt;An unfolded parent sends cubic curves from its right edge to its children&amp;#39;s left edges. A folded parent sits rotated inside the left gutter, so its outgoing fan leaves from the right edge of the vertical strip instead, marked with the &lt;code&gt;.fold&lt;/code&gt; class on its &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; element.&lt;/p&gt;
&lt;p&gt;When a folded ancestor&amp;#39;s children live in column &lt;code&gt;0&lt;/code&gt; directly beside the strip, the connector routes cleanly across the gutter gap. When a folded ancestor connects to another folded ancestor inside the same strip, &lt;code&gt;_detour()&lt;/code&gt; routes the link around the strip edge with rounded elbows of radius &lt;code&gt;pitch / 2&lt;/code&gt; so lineage paths stay traceable all the way back to the root.&lt;/p&gt;
&lt;p&gt;Drilling five or six levels deep in the &lt;a href=&quot;/#GBIF/&amp;amp;view=tree&quot;&gt;Tree view&lt;/a&gt; folds older ranks into the left gutter automatically, and clicking any rotated ancestor unfolds back to it.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Rehearsing AI tours on the real viewer</title>
  <link href="https://ptree.org/blog/rehearsing-ai-tours.html"/>
  <id>https://ptree.org/blog/rehearsing-ai-tours.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="backend" label="Backend"/>
  <summary>Ptree’s question box answers with a guided tour on the visitor’s screen instead of a chat log. A quick opener speaks and classifies the question while the main guide inspects the tree, streams short stretches of UI moves paired with captions, and rehearses every stop against the live viewer code in a worker thread before a word reaches the browser.</summary>
  <content type="html">&lt;p&gt;Ptree’s question box answers with a guided tour on the visitor’s screen instead of a chat log. A quick opener speaks and classifies the question while the main guide inspects the tree, streams short stretches of UI moves paired with captions, and rehearses every stop against the live viewer code in a worker thread before a word reaches the browser.&lt;/p&gt;
&lt;h2&gt;Keeping the visitor ahead of the model&lt;/h2&gt;
&lt;p&gt;Waiting for a language model to plan a twenty-stop tour before anything moves leaves the visitor staring at a frozen screen. Ptree overlaps every stage in parallel so that classification, lookups, failed stops, and rewrites all finish behind a moving playback buffer:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;At &lt;code&gt;t = 0&lt;/code&gt;, a fast opener model starts streaming one non-committal spoken sentence while classifying the question’s size (&lt;code&gt;command&lt;/code&gt;, &lt;code&gt;fact&lt;/code&gt;, &lt;code&gt;open&lt;/code&gt;, or &lt;code&gt;site&lt;/code&gt;), safety concern, language, and whether the question already matches a curated published tour. If a published tour matches, the background guide is canceled immediately and the curated script plays at zero guide cost.&lt;/li&gt;
&lt;li&gt;Without waiting for the opener to finish, the guide starts its first batch of tree lookups in parallel. As soon as that first lookup names a property, the viewer switches the tree to that color while the opening line is still playing.&lt;/li&gt;
&lt;li&gt;Rather than planning the entire tour before speaking, the guide sends short stretches through &lt;code&gt;say&lt;/code&gt;. Each &lt;code&gt;say&lt;/code&gt; call reports how many seconds of verified playback are queued on the visitor’s screen. Thinking is free while beats are playing and only costs the visitor on a still screen, so a turn that thinks too long with an empty queue is cut short and told to write from what it already holds.&lt;/li&gt;
&lt;li&gt;If the rehearsal worker catches a broken click during Stretch 2, it cuts the model’s stream immediately, discards everything from the failed stop onward, leaves the worker at the last valid stop, and returns the exact error to the guide. While Stretch 1 is still playing on the visitor’s screen, the guide rewrites Stretch 2 and queues the repaired beats ahead of the playhead. The visitor experiences one continuous tour with zero dead air and never sees the discarded attempt.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Reading what the visitor sees&lt;/h2&gt;
&lt;p&gt;The guide inspects the tree through read tools that return the exact formatting shown on screen:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;see&lt;/code&gt; reads a taxon’s lineage, sibling and child rows, property readouts, numeric spreads, range descriptions, citations, interactions, and active filters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;compare&lt;/code&gt; runs the multi-tree ancestry lookup and side-by-side property table from Compare.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;article&lt;/code&gt; and &lt;code&gt;look&lt;/code&gt; read the offline Wikipedia book and describe the organism’s served photograph through a vision pass when appearance matters.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;read&lt;/code&gt; opens Ptree’s public documentation pages (&lt;code&gt;/about/&lt;/code&gt;, &lt;code&gt;/about/methods.html&lt;/code&gt;, &lt;code&gt;/about/source-errors.html&lt;/code&gt;) for questions about the site itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every row includes its bracketed node ID so follow-up lookups address exact taxa rather than guessing spellings.&lt;/p&gt;
&lt;h2&gt;Moves paired with captions&lt;/h2&gt;
&lt;p&gt;Instead of paragraphs of prose, the model calls &lt;code&gt;say&lt;/code&gt; and &lt;code&gt;answer&lt;/code&gt; with beats in Ptree’s tour grammar: a bracketed UI verb followed by a short spoken caption.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[click property=nutrition] “Nutrition colors every branch by how organisms feed.”
[click legend=parasitic] “Pressing parasitic lights every lineage that takes food from a host.”
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the browser, the tour player moves a cursor across the screen, clicks controls, brushes legend categories, drags filter thumbs, highlights sentences in Wikipedia articles, and speaks each caption sentence by sentence. When the tour finishes, the viewer stays in that state, and the visitor has watched every click needed to reproduce it.&lt;/p&gt;
&lt;h2&gt;Running every stop in a worker first&lt;/h2&gt;
&lt;p&gt;Models hallucinate UI targets: tiles folded into the gutter, legend cells belonging to another property, or interaction partners not listed on the current page. Rather than letting a broken click reach the visitor, the rehearsal stage boots &lt;strong&gt;the real viewer modules inside a &lt;code&gt;linkedom&lt;/code&gt; worker thread&lt;/strong&gt; against the local origin at the visitor’s exact route and column count.&lt;/p&gt;
&lt;p&gt;As each beat streams from &lt;code&gt;say&lt;/code&gt; or &lt;code&gt;answer&lt;/code&gt;, the gate parses the grammar, resolves named places through &lt;code&gt;/api/place&lt;/code&gt;, and executes the stop on the worker’s live DOM. Because the stream is cut on the first refusal rather than read to completion, the guide never wastes tokens writing six more stops against a screen state that will never exist.&lt;/p&gt;
&lt;h2&gt;Replaying links after data rebuilds&lt;/h2&gt;
&lt;p&gt;Every ordinary tour that plays to completion without a visible flaw receives a deterministic three-word link (&lt;code&gt;/?tour=word-word-word&lt;/code&gt;) stored beside the data generation digest it passed against.&lt;/p&gt;
&lt;p&gt;When Ptree rebuilds its biodiversity stores, taxonomy and traits can shift. Rather than discarding old links or serving broken scripts, the first request for a tour from an older generation runs a single-flight rehearsal against the new data. If every stop still lands, the tour is stamped with the new generation and replays at zero model cost. If a stop breaks, only that tour is rewritten once under the same link.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>The stationary shape</title>
  <link href="https://ptree.org/blog/the-stationary-shape.html"/>
  <id>https://ptree.org/blog/the-stationary-shape.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>In physics, a path integral sums over every trajectory a system might take, and the path that survives is the one where the action is stationary: nudge it slightly in any direction and the cost barely moves. Software works the same way across time. Every structural decision in a codebase (a table key, a coordinate system, who owns a piece of state, or what a concept is named) shapes every future version of the app that will pass through it: features you have not imagined yet, data sources you have not captured yet, and views you have not drawn.</summary>
  <content type="html">&lt;p&gt;In physics, a path integral sums over every trajectory a system might take, and the path that survives is the one where the action is stationary: nudge it slightly in any direction and the cost barely moves. Software works the same way across time. Every structural decision in a codebase (a table key, a coordinate system, who owns a piece of state, or what a concept is named) shapes every future version of the app that will pass through it: features you have not imagined yet, data sources you have not captured yet, and views you have not drawn.&lt;/p&gt;
&lt;p&gt;The median engineering choice optimizes for today’s ticket and charges a tax along every later path. A local patch looks cheap on Monday and collects compound interest for the next five years. The right choice sits where the action is stationary: pull it in any future direction (another source, another property, another view, or another device) and the cost stays flat.&lt;/p&gt;
&lt;h2&gt;Designing for an interface that already exists&lt;/h2&gt;
&lt;p&gt;Path-integral thinking applies to interface design just as much as to code. We designed Ptree by imagining God himself tapping, scrolling, and navigating the entire tree of life on a finite two-dimensional panel just out of sight. The glass is flat, the width is bounded, and the tree holds millions of organisms and dozens of properties.&lt;/p&gt;
&lt;p&gt;Under that physical constraint, an optimal Platonic form has to exist. We can only approach it, never prove we have reached the bottom, yet assuming that an interface exists that even an omniscient user would be satisfied with for maximum density in a 2D panel changes how you work. Instead of assembling familiar widgets from existing design systems, you imagine a far future in which the artifact is already perfect and pull the current build toward it with every iteration.&lt;/p&gt;
&lt;p&gt;That constraint is how we arrived at &lt;a href=&quot;/blog/folding-tree-gutter.html&quot;&gt;the folding tree gutter&lt;/a&gt;. Nobody had built a tree explorer where deep ancestor columns fold into a single left gutter as you descend while remaining one click away. It came directly from asking for the best way to expand an arbitrary-depth tree inside a bounded 2D panel while folding away what is extra.&lt;/p&gt;
&lt;p&gt;The same constraint produced Ptree’s rolled-up proportional color tiles and morphing box-whisker plots. Putting a clade’s full distribution directly onto the tile’s own surface, without separate chart panels and without hiding minorities, gives maximum information density inside a finite 2D tile.&lt;/p&gt;
&lt;h2&gt;The test is whether unplanned features arrive free&lt;/h2&gt;
&lt;p&gt;Taste is easy to claim in the abstract, so stationary architecture has a concrete test. When an unplanned feature comes up six months later, does it fall out of the existing structure in a handful of lines, or does it demand adapters, caches, exception lists, and parallel tables?&lt;/p&gt;
&lt;p&gt;Two examples from Ptree show the difference. When I decided to let visitors dim every clade on screen that does not live near their coordinates or inside a chosen country, the entire feature took under 200 lines of client JavaScript and zero server changes. That was only possible because long before location filtering existed, taxon range outlines and selectable country polygons had been placed in the same SVG equirectangular projection, and identity had been modeled as one relation. The browser’s built-in &lt;code&gt;Path2D.isPointInPath()&lt;/code&gt; answered the query immediately.&lt;/p&gt;
&lt;p&gt;Cloudflare’s health checks gave the same proof on the server side. Monitors were getting rejected by Ptree’s origin because Apache enforces a Cloudflare-only access rule. The median fix is a path exemption in Apache or a cron job that syncs Cloudflare’s published IP ranges. The stationary fix touched zero lines of server config: configure the monitor to send the exact header that proxied traffic already carries.&lt;/p&gt;
&lt;p&gt;The API server follows the same rule. It has zero per-source branches. Every displayed backbone and every property source plugs into one neutral node-addressed dispatch table through a single registry. Adding an eleventh taxonomic tree or a fortieth trait dataset does not touch the HTTP server at all.&lt;/p&gt;
&lt;p&gt;The same principle turned a 250 GB photo-selection side pipeline into an ordinary tree rollup. Once photos and sounds shared the same fold-and-score shape as every other per-clade summary, picking a group’s representative recording from its own photo organism took a handful of lines instead of a separate subsystem.&lt;/p&gt;
&lt;h2&gt;Naming as wiring&lt;/h2&gt;
&lt;p&gt;Stationary shapes show up in vocabulary too. When a DOM radio value, a URL token, a SQLite store name, a property key, a filename, and a JavaScript export all refer to the same concept, giving them the exact same name lets the data select the operation directly:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const loaders = { wiki, interactions, data };
loaders[input.value](taxon);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Whenever you find yourself writing a translation map (&lt;code&gt;{ key: differentlyNamedFunction }&lt;/code&gt;), an &lt;code&gt;if&lt;/code&gt;/&lt;code&gt;else&lt;/code&gt; dispatcher, or a parallel allow-list that restates permanent DOM controls, the shape has drifted off the stationary path. Align the vocabulary and delete the adapter.&lt;/p&gt;
&lt;h2&gt;Growing cheaper as it grows&lt;/h2&gt;
&lt;p&gt;Most software projects grow heavier and slower to change every month, because each shortcut leaves behind a local quirk that every later feature has to work around. On the stationary path, the opposite happens: each clean representation makes the next unplanned idea cheaper than the last.&lt;/p&gt;
&lt;p&gt;Before accepting any change, ask which future versions it makes cheaper and which it makes dearer. A tiny patch that makes the next unplanned feature harder is wrong, no matter how few lines it adds.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Discoveries you can see in three clicks</title>
  <link href="https://ptree.org/blog/three-click-discoveries.html"/>
  <id>https://ptree.org/blog/three-click-discoveries.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="biology" label="Biology"/>
  <summary>Do mammals that live in groups live longer than solitary ones? In January 2023, a paper in Nature Communications answered that question using nearly a thousand species, a Bayesian phylogenetic analysis, and brain transcriptomes from 94 of them. The answer was yes, and the paper has already drawn dozens of citations.</summary>
  <content type="html">&lt;p&gt;Do mammals that live in groups live longer than solitary ones? In January 2023, a paper in &lt;a href=&quot;https://doi.org/10.1038/s41467-023-35869-7&quot;&gt;&lt;em&gt;Nature Communications&lt;/em&gt;&lt;/a&gt; answered that question using nearly a thousand species, a Bayesian phylogenetic analysis, and brain transcriptomes from 94 of them. The answer was yes, and the paper has already drawn dozens of citations.&lt;/p&gt;
&lt;p&gt;In Ptree, you can see that exact result in three clicks. Open &lt;a href=&quot;/#GBIF/Organization/359&amp;amp;fossils=hide&quot;&gt;Mammalia&lt;/a&gt;, press &lt;code&gt;Group&lt;/code&gt; in the Organization legend, and switch to Longevity so &lt;a href=&quot;/#GBIF/Longevity/359&amp;amp;fossils=hide&amp;amp;filter=organization:group&quot;&gt;only the group-living families stay lit&lt;/a&gt;. Then press &lt;code&gt;Single&lt;/code&gt; instead so &lt;a href=&quot;/#GBIF/Longevity/359&amp;amp;fossils=hide&amp;amp;filter=organization:single&quot;&gt;the solitary families take their place&lt;/a&gt;. Across the mammal families that are clearly social or solitary, median lifespan jumps from &lt;strong&gt;11.1 years to 20.1 years&lt;/strong&gt;. Age at maturity also doubles, from &lt;strong&gt;331 days to 656 days&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Body size does not explain the gap. Solitary hedgehogs weigh about 290 g and live about 7 years, while group-living marmosets weigh 420 g and live about 19. Solitary weasels and group-living chinchillas both weigh around 1.5 kg, yet weasels live about 14 years and chinchillas about 20. Solitary pangolins weigh 4 kg and live about 6 years, while kangaroos live in mobs, weigh 6 kg, and live about 13.&lt;/p&gt;
&lt;p&gt;No table in Ptree contains a column that says social mammals live longer. Social structure comes from one set of sources, and lifespan comes from another. When you place 42 cross-kingdom properties on one navigable tree with live filtering, patterns that normally take a multi-year study show up on sight.&lt;/p&gt;
&lt;p&gt;Want a topic for a biology paper? Every pattern below comes directly from Ptree&amp;#39;s live rollups, and you can verify each one in three clicks or go find a new one in thirty seconds.&lt;/p&gt;
&lt;h2&gt;Nocturnal mammals are 9× smaller, while nocturnal birds are 3× bigger&lt;/h2&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=diel:nocturnal&quot;&gt;Mammalia filtered to nocturnal families&lt;/a&gt; and compare it with &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=diel:diurnal&quot;&gt;diurnal mammals&lt;/a&gt;. Across 92 clearly nocturnal mammal families, the median body mass is &lt;strong&gt;288 grams&lt;/strong&gt;. Across 32 diurnal families, the median mass is &lt;strong&gt;2.7 kilograms&lt;/strong&gt;, which is &lt;strong&gt;9.4× heavier&lt;/strong&gt;. Diurnal mammals also live longer, at &lt;strong&gt;19.8 years versus 11.6 years&lt;/strong&gt;. You are looking directly at the legacy of the Mesozoic nocturnal bottleneck, when small mammals stayed in the dark while dinosaurs dominated the day.&lt;/p&gt;
&lt;p&gt;Now keep the same filter and move one branch over to &lt;a href=&quot;/#GBIF/Mass/212&amp;amp;fossils=hide&amp;amp;filter=diel:nocturnal&quot;&gt;nocturnal birds&lt;/a&gt; versus &lt;a href=&quot;/#GBIF/Mass/212&amp;amp;fossils=hide&amp;amp;filter=diel:diurnal&quot;&gt;diurnal birds&lt;/a&gt;. The direction reverses completely. Owls, barn owls, kiwis, potoos, and nightjars have a median mass of &lt;strong&gt;175 grams&lt;/strong&gt;, compared with &lt;strong&gt;52 grams&lt;/strong&gt; across 230 diurnal bird families (&lt;strong&gt;3.4× heavier&lt;/strong&gt;). They also live more than twice as long, at &lt;strong&gt;20.0 years versus 9.6 years&lt;/strong&gt;. The same two clicks on two warm-blooded classes reveal opposite evolutionary rules.&lt;/p&gt;
&lt;h2&gt;Precocial mammals outweigh altricial ones by 180×&lt;/h2&gt;
&lt;p&gt;Filter &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=developmentmode:precocial&quot;&gt;Mammalia to precocial families&lt;/a&gt;, whose young are born with open eyes and able to move right away (ungulates, whales, seals, sloths, and cavies). Compare them with &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=developmentmode:altricial&quot;&gt;altricial mammals&lt;/a&gt;, whose young are born blind and helpless.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Across 42 precocial mammal families, the median mass is &lt;strong&gt;37.5 kilograms&lt;/strong&gt;. Across 72 altricial families, it is &lt;strong&gt;208 grams&lt;/strong&gt;, a &lt;strong&gt;180-fold difference&lt;/strong&gt; on one screen.&lt;/li&gt;
&lt;li&gt;Precocial mammal families live twice as long (&lt;strong&gt;22.2 years versus 11.1 years&lt;/strong&gt;), spend nearly twice as long developing (&lt;strong&gt;126 days versus 71 days&lt;/strong&gt;), and have half as many young per litter (&lt;strong&gt;1.0 versus 1.9&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Switch to &lt;a href=&quot;/#GBIF/OffspringMass/212&amp;amp;fossils=hide&amp;amp;filter=developmentmode:precocial&quot;&gt;precocial birds&lt;/a&gt; versus &lt;a href=&quot;/#GBIF/OffspringMass/212&amp;amp;fossils=hide&amp;amp;filter=developmentmode:altricial&quot;&gt;altricial birds&lt;/a&gt; and the same trade-off appears again. Waterfowl, cranes, tinamous, and rails weigh &lt;strong&gt;10.1× more&lt;/strong&gt; (&lt;strong&gt;459 g versus 45 g&lt;/strong&gt;), lay eggs that are &lt;strong&gt;8.7× heavier&lt;/strong&gt; (&lt;strong&gt;37.7 g versus 4.4 g&lt;/strong&gt;), and live nearly twice as long (&lt;strong&gt;17.8 years versus 9.8 years&lt;/strong&gt;).&lt;/p&gt;
&lt;h2&gt;Migratory bird families live twice as long as residents&lt;/h2&gt;
&lt;p&gt;Compare &lt;a href=&quot;/#GBIF/Longevity/212&amp;amp;fossils=hide&amp;amp;filter=migration:migratory&quot;&gt;migratory bird families&lt;/a&gt; with &lt;a href=&quot;/#GBIF/Longevity/212&amp;amp;fossils=hide&amp;amp;filter=migration:resident&quot;&gt;resident bird families&lt;/a&gt;. The migratory families, including tropicbirds, skuas, auks, and shorebirds, have a median lifespan of &lt;strong&gt;20.7 years&lt;/strong&gt;, compared with &lt;strong&gt;9.3 years&lt;/strong&gt; across 94 resident families (&lt;strong&gt;2.2× longer&lt;/strong&gt;). They also lay smaller clutches (&lt;strong&gt;1.9 versus 2.5 eggs&lt;/strong&gt;). Long-distance travel favors slow, durable life histories over rapid breeding.&lt;/p&gt;
&lt;h2&gt;Skipping the tadpole cuts a frog&amp;#39;s clutch sevenfold&lt;/h2&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF/OffspringCount/952&amp;amp;fossils=hide&amp;amp;filter=developmentmode:direct&quot;&gt;Anura filtered to direct-developing frogs&lt;/a&gt;, whose eggs hatch straight into miniature froglets without a swimming tadpole stage (such as Craugastoridae, Eleutherodactylidae, and pumpkin toadlets). Compare them with &lt;a href=&quot;/#GBIF/OffspringCount/952&amp;amp;fossils=hide&amp;amp;filter=developmentmode:staged&quot;&gt;tadpole-stage families&lt;/a&gt;. Median clutch size drops from &lt;strong&gt;160 eggs to 23.9 eggs&lt;/strong&gt;, a &lt;strong&gt;6.7× reduction&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Next, filter frogs to &lt;a href=&quot;/#GBIF/OffspringCount/952&amp;amp;fossils=hide&amp;amp;filter=parentalcare:brooding&quot;&gt;brooding families&lt;/a&gt;, such as marsupial frogs that carry eggs in dorsal pouches and Darwin&amp;#39;s frogs that brood tadpoles in vocal sacs. Compared with &lt;a href=&quot;/#GBIF/OffspringCount/952&amp;amp;fossils=hide&amp;amp;filter=parentalcare:none&quot;&gt;frogs that give no parental care&lt;/a&gt;, the drop is even steeper: &lt;strong&gt;17.6 eggs versus 125 eggs&lt;/strong&gt; (&lt;strong&gt;7.1×&lt;/strong&gt;). When a parent carries or guards its clutch, it does not need to gamble hundreds of eggs on an open pond.&lt;/p&gt;
&lt;h2&gt;Live-bearing snakes and lizards have larger broods than egg-layers&lt;/h2&gt;
&lt;p&gt;Most people expect live birth to reduce brood size because each offspring costs more to carry. Check &lt;a href=&quot;/#GBIF/OffspringCount/11592253&amp;amp;fossils=hide&amp;amp;filter=developmentmode:carried&quot;&gt;live-bearing squamates&lt;/a&gt; (boas, pipe snakes, and dwarf boas) against &lt;a href=&quot;/#GBIF/OffspringCount/11592253&amp;amp;fossils=hide&amp;amp;filter=developmentmode:released&quot;&gt;egg-laying squamates&lt;/a&gt;. Across 11 clearly live-bearing families, the median brood size is &lt;strong&gt;8.7 young&lt;/strong&gt;, compared with &lt;strong&gt;3.8 eggs&lt;/strong&gt; across 43 egg-laying families (&lt;strong&gt;2.3× larger&lt;/strong&gt;). Egg-layers often produce several clutches in a season, whereas live-bearing species put a full season&amp;#39;s investment into one brood.&lt;/p&gt;
&lt;h2&gt;Anaerobic bacteria peak 7 °C hotter than aerobic ones&lt;/h2&gt;
&lt;p&gt;Cross-property filtering works just as well outside animals. Compare &lt;a href=&quot;/#GBIF/Temperature/3&amp;amp;filter=respiration:anaerobic&quot;&gt;anaerobic bacteria&lt;/a&gt; with &lt;a href=&quot;/#GBIF/Temperature/3&amp;amp;filter=respiration:aerobic&quot;&gt;aerobic bacteria&lt;/a&gt;. Across 155 clearly anaerobic bacterial families, the median optimal growth temperature is &lt;strong&gt;37.0 °C&lt;/strong&gt;, matching animal guts, warm anoxic sediments, and thermal vents. Across 250 aerobic families, the median is &lt;strong&gt;30.0 °C&lt;/strong&gt;. That is seven degrees of metabolic geography across 405 microbial families, visible in three clicks.&lt;/p&gt;
&lt;h2&gt;Trees make seeds 42× heavier than herbs&lt;/h2&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF/OffspringMass/7707728&amp;amp;fossils=hide&amp;amp;filter=growthform:tree&quot;&gt;vascular plants filtered to trees&lt;/a&gt; and toggle against &lt;a href=&quot;/#GBIF/OffspringMass/7707728&amp;amp;fossils=hide&amp;amp;filter=growthform:herb&quot;&gt;herbaceous families&lt;/a&gt;. Across 355 plant families, median seed mass jumps &lt;strong&gt;42-fold&lt;/strong&gt; from herbs to trees. Then switch the property to &lt;a href=&quot;/#GBIF/LeafEconomy/7707728&amp;amp;fossils=hide&amp;amp;filter=persistence:deciduous&quot;&gt;Leaf economy&lt;/a&gt; and toggle deciduous families against &lt;a href=&quot;/#GBIF/LeafEconomy/7707728&amp;amp;fossils=hide&amp;amp;filter=persistence:evergreen&quot;&gt;evergreen ones&lt;/a&gt;. Across 252 plant families, the Leaf Economics Spectrum appears immediately: deciduous plants invest in thinner, high-nitrogen foliage built for one season, while evergreens build denser needles and tough leaves that last for years.&lt;/p&gt;
&lt;h2&gt;Who survives human pressure, and what fossils conceal&lt;/h2&gt;
&lt;p&gt;Several major conservation findings appear directly under the &lt;code&gt;Population trend&lt;/code&gt; filter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compare &lt;a href=&quot;/#GBIF/LinearExtent/121&amp;amp;fossils=hide&amp;amp;filter=populationtrend:stable&quot;&gt;stable sharks and rays&lt;/a&gt; with &lt;a href=&quot;/#GBIF/LinearExtent/121&amp;amp;fossils=hide&amp;amp;filter=populationtrend:decreasing&quot;&gt;declining ones&lt;/a&gt;. The families that are holding steady have a median length of &lt;strong&gt;0.43 meters&lt;/strong&gt;, compared with &lt;strong&gt;1.63 meters&lt;/strong&gt; for declining families (&lt;strong&gt;3.8× smaller&lt;/strong&gt;). That is the same body-size divide reported in &lt;a href=&quot;https://doi.org/10.7554/eLife.00590&quot;&gt;&lt;em&gt;eLife&lt;/em&gt; (2014)&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Compare &lt;a href=&quot;/#GBIF/Maturity/359&amp;amp;fossils=hide&amp;amp;filter=populationtrend:stable&quot;&gt;stable mammals&lt;/a&gt; with &lt;a href=&quot;/#GBIF/Maturity/359&amp;amp;fossils=hide&amp;amp;filter=populationtrend:decreasing&quot;&gt;declining mammals&lt;/a&gt;. The stable families are &lt;strong&gt;4.6× smaller&lt;/strong&gt; (&lt;strong&gt;500 g versus 2.3 kg&lt;/strong&gt;), mature &lt;strong&gt;2.4× faster&lt;/strong&gt; (&lt;strong&gt;365 days versus 882 days&lt;/strong&gt;), and bear nearly twice as many young per litter (&lt;strong&gt;1.9 versus 1.0&lt;/strong&gt;). That is the fast-living rescue effect published in &lt;a href=&quot;https://doi.org/10.1126/science.1116030&quot;&gt;&lt;em&gt;Science&lt;/em&gt; (2005)&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Toggle Fossils on &lt;a href=&quot;/#GBIF/Organization/75&amp;amp;fossils=hide&quot;&gt;Hemichordata&lt;/a&gt;. A small phylum of solitary mud worms &lt;a href=&quot;/#GBIF/Organization/75&amp;amp;fossils=show&amp;amp;filter=organization:colonial&quot;&gt;fills with more than 600 extinct colonial graptolites&lt;/a&gt; that drifted through Paleozoic seas. Toggle Fossils on &lt;a href=&quot;/#GBIF/Mass/5479&amp;amp;fossils=hide&quot;&gt;Equidae&lt;/a&gt;, and &lt;a href=&quot;/#GBIF/Mass/5479&amp;amp;fossils=show&quot;&gt;the horse family shrinks back&lt;/a&gt; to its small forest-browsing ancestors.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;A discovery engine, not a lookup table&lt;/h2&gt;
&lt;p&gt;Most tools help you find an answer that you already know how to look up. Ptree pairs 42 properties across 11 scientific trees, which gives 861 unordered pairs of properties before you even combine two filters or choose a region on the map. Thousands of cross-kingdom patterns are sitting one click away that nobody has ever plotted together. Pick a branch, lock a filter, flip through the properties, and see what lights up.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>What extinction erased from the tree</title>
  <link href="https://ptree.org/blog/what-extinction-erased.html"/>
  <id>https://ptree.org/blog/what-extinction-erased.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="biology" label="Biology"/>
  <summary>Most nature guides show only what survived to the present day. Looking only at two living beavers, a handful of solitary mud worms, or 26 living crocodilians makes those remnants look typical of their lineages. In Ptree, fossils sit behind one live toggle (Fossils) on every property and tree, so one click restores what extinction cut away from every branch of life.</summary>
  <content type="html">&lt;p&gt;Most nature guides show only what survived to the present day. Looking only at two living beavers, a handful of solitary mud worms, or 26 living crocodilians makes those remnants look typical of their lineages. In Ptree, fossils sit behind one live toggle (&lt;code&gt;Fossils&lt;/code&gt;) on every property and tree, so one click restores what extinction cut away from every branch of life.&lt;/p&gt;
&lt;h2&gt;Beavers shrank and exploded at the same time&lt;/h2&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF/Mass/5493&amp;amp;fossils=hide&quot;&gt;Castoridae under Mass with fossils hidden&lt;/a&gt;. The living beaver family holds two surviving species inside a narrow 20 to 25 kilogram band, with a median of &lt;strong&gt;20.7 kilograms&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now turn &lt;a href=&quot;/#GBIF/Mass/5493&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;. The family expands from 2 measured species to &lt;strong&gt;30&lt;/strong&gt;, and the box-whisker plot opens in both directions at once. The median drops &lt;strong&gt;18-fold&lt;/strong&gt;, from &lt;strong&gt;20.7 kilograms down to 1.18 kilograms&lt;/strong&gt;, pulled down by dozens of small burrowing fossil beavers as light as 310 grams. At the same time, the upper whisker rises &lt;strong&gt;6-fold&lt;/strong&gt;, from &lt;strong&gt;25 kilograms to 150 kilograms&lt;/strong&gt;, reaching &lt;em&gt;Castoroides&lt;/em&gt;, the black-bear-sized giant beaver of Ice Age North America. The two survivors conceal both the small burrowing majority of beaver history and the giant at its upper edge.&lt;/p&gt;
&lt;h2&gt;Whole lifestyles vanish when fossils are hidden&lt;/h2&gt;
&lt;p&gt;Extinction removes whole ways of living and leaves behind atypical remnants.&lt;/p&gt;
&lt;p&gt;Look at &lt;a href=&quot;/#GBIF/Organization/75&amp;amp;fossils=hide&quot;&gt;Hemichordata under Organization with fossils hidden&lt;/a&gt;. Living hemichordates read as &lt;strong&gt;72% solitary&lt;/strong&gt; (&lt;code&gt;120&lt;/code&gt; solitary versus &lt;code&gt;46&lt;/code&gt; colonial), and under &lt;a href=&quot;/#GBIF/Movement/75&amp;amp;fossils=hide&quot;&gt;Movement&lt;/a&gt; they are &lt;strong&gt;86% burrowing&lt;/strong&gt; acorn worms. Turn &lt;a href=&quot;/#GBIF/Organization/75&amp;amp;fossils=show&quot;&gt;Fossils on for Organization&lt;/a&gt; and &lt;a href=&quot;/#GBIF/Movement/75&amp;amp;fossils=show&quot;&gt;Movement&lt;/a&gt;, and more than 600 extinct colonial graptolites flood back into the phylum. Coloniality flips from &lt;strong&gt;28% to 85%&lt;/strong&gt; (&lt;code&gt;46&lt;/code&gt; to &lt;code&gt;677&lt;/code&gt;), and drifting jumps from &lt;strong&gt;13% to 77%&lt;/strong&gt; (&lt;code&gt;18&lt;/code&gt; to &lt;code&gt;621&lt;/code&gt;). A phylum that looks like solitary mud worms today spent hundreds of millions of years drifting through Paleozoic oceans in floating colonies.&lt;/p&gt;
&lt;p&gt;The same inversion happens in &lt;a href=&quot;/#GBIF/Movement/215&amp;amp;fossils=hide&quot;&gt;Crinoidea under Movement&lt;/a&gt;, the sea lilies and feather stars. Living crinoids are dominated by unstalked, mobile feather stars, so only &lt;strong&gt;16%&lt;/strong&gt; (&lt;code&gt;111&lt;/code&gt; of &lt;code&gt;703&lt;/code&gt; represented) are stationary. Turn &lt;a href=&quot;/#GBIF/Movement/215&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;, and stationary crinoids surge to &lt;strong&gt;65%&lt;/strong&gt; (&lt;code&gt;1,599&lt;/code&gt; of &lt;code&gt;2,443&lt;/code&gt;), restoring the stalked sea-lily meadows that carpeted ancient seafloors. Across all of &lt;a href=&quot;/#GBIF/Movement/50&amp;amp;fossils=show&quot;&gt;Echinodermata&lt;/a&gt;, stationary species jump &lt;strong&gt;7-fold&lt;/strong&gt; (&lt;code&gt;350&lt;/code&gt; to &lt;code&gt;2,530&lt;/code&gt;) with one click.&lt;/p&gt;
&lt;h2&gt;The giants we lost&lt;/h2&gt;
&lt;p&gt;Across vertebrates, toggling &lt;code&gt;Fossils&lt;/code&gt; shows how sharply recent and deep-time extinctions pruned the top of the size scale:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&quot;&gt;Mammalia under Mass&lt;/a&gt;, the living 95th percentile is &lt;strong&gt;75.6 kilograms&lt;/strong&gt;, roughly one adult human. Turn &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;, and the 95th percentile &lt;strong&gt;more than doubles to 159.7 kilograms&lt;/strong&gt;, while the median climbs from &lt;strong&gt;77 grams to 118 grams&lt;/strong&gt; and the third quartile nearly triples from &lt;strong&gt;737 grams to 2.0 kilograms&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/9701&amp;amp;fossils=hide&quot;&gt;Canidae&lt;/a&gt;, living dogs have a median mass of &lt;strong&gt;7.0 kilograms&lt;/strong&gt; and a 95th percentile of &lt;strong&gt;26.4 kilograms&lt;/strong&gt;. Turn &lt;a href=&quot;/#GBIF/Mass/9701&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt; (&lt;code&gt;42&lt;/code&gt; to &lt;code&gt;134&lt;/code&gt; measured species), and the median nearly doubles to &lt;strong&gt;13.3 kilograms&lt;/strong&gt;, the 95th percentile jumps &lt;strong&gt;3.5-fold to 92.8 kilograms&lt;/strong&gt;, and the upper whisker reaches &lt;strong&gt;207 kilograms&lt;/strong&gt; for Miocene bone-crushing dogs.&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/11493978&amp;amp;fossils=hide&quot;&gt;Crocodylia&lt;/a&gt;, the living 95th percentile is &lt;strong&gt;163 kilograms&lt;/strong&gt;. Turn &lt;a href=&quot;/#GBIF/Mass/11493978&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;, and the upper whisker leaps &lt;strong&gt;25-fold to 5.16 tonnes&lt;/strong&gt; (95th percentile &lt;strong&gt;4.14 tonnes&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/131&amp;amp;fossils=hide&quot;&gt;Amphibia&lt;/a&gt;, living frogs and salamanders peak at &lt;strong&gt;59 kilograms&lt;/strong&gt;. Turn &lt;a href=&quot;/#GBIF/Mass/131&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;, and the upper whisker stretches &lt;strong&gt;8.5-fold to 500 kilograms&lt;/strong&gt;, restoring crocodile-sized Paleozoic and Triassic amphibians.&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/5483&amp;amp;fossils=hide&quot;&gt;Hominidae&lt;/a&gt;, living great apes peak at &lt;strong&gt;140 kilograms&lt;/strong&gt;. Turn &lt;a href=&quot;/#GBIF/Mass/5483&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;, and the upper whisker more than doubles to &lt;strong&gt;300 kilograms&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/1459&amp;amp;fossils=hide&quot;&gt;Rodentia&lt;/a&gt;, living rodents top out at the &lt;strong&gt;55-kilogram&lt;/strong&gt; capybara. Turn &lt;a href=&quot;/#GBIF/Mass/1459&amp;amp;fossils=show&quot;&gt;Fossils on&lt;/a&gt;, and the upper bound jumps &lt;strong&gt;3.7-fold to 201 kilograms&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The lineages that only survived as giants&lt;/h2&gt;
&lt;p&gt;Extinction does not always cut from the top. Several famous large-mammal families lost their small-bodied early diversity and survived only at the giant end of their own history.&lt;/p&gt;
&lt;p&gt;Toggle Fossils on &lt;a href=&quot;/#GBIF/Mass/5479&amp;amp;fossils=hide&quot;&gt;Equidae&lt;/a&gt; to &lt;a href=&quot;/#GBIF/Mass/5479&amp;amp;fossils=show&quot;&gt;show extinct horses&lt;/a&gt;. Measured species jump from 15 to 118, and the family’s median mass &lt;strong&gt;drops by more than half&lt;/strong&gt;, from &lt;strong&gt;291 kilograms down to 119 kilograms&lt;/strong&gt;, with early forest browsers stretching the lower whisker down to &lt;strong&gt;3.5 kilograms&lt;/strong&gt;. The exact same contraction appears when you turn Fossils on in &lt;a href=&quot;/#GBIF/Mass/799&amp;amp;fossils=show&quot;&gt;Proboscidea&lt;/a&gt; (elephants fall from a &lt;strong&gt;6.4-tonne&lt;/strong&gt; living median to &lt;strong&gt;3.9 tonnes&lt;/strong&gt;), &lt;a href=&quot;/#GBIF/Mass/9415&amp;amp;fossils=show&quot;&gt;Rhinocerotidae&lt;/a&gt; (&lt;strong&gt;1.78 tonnes&lt;/strong&gt; down to &lt;strong&gt;1.17 tonnes&lt;/strong&gt;), and &lt;a href=&quot;/#GBIF/Mass/798&amp;amp;fossils=show&quot;&gt;Primates&lt;/a&gt; (median mass drops in half from &lt;strong&gt;2.52 kilograms to 1.18 kilograms&lt;/strong&gt;, even as extinct great apes push the upper tail to 300 kilograms).&lt;/p&gt;
&lt;h2&gt;Empires reduced to relicts&lt;/h2&gt;
&lt;p&gt;Some branches barely register as major clades until you restore their extinct members:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;/#GBIF/Construction/110&amp;amp;fossils=hide&quot;&gt;Brachiopoda&lt;/a&gt; swells &lt;strong&gt;21-fold&lt;/strong&gt; when you &lt;a href=&quot;/#GBIF/Construction/110&amp;amp;fossils=show&quot;&gt;show fossils&lt;/a&gt;, jumping from &lt;strong&gt;761&lt;/strong&gt; living taxa to &lt;strong&gt;15,864&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/#GBIF/Construction/136&amp;amp;fossils=hide&quot;&gt;Cephalopoda&lt;/a&gt; swells &lt;strong&gt;15-fold&lt;/strong&gt; when you &lt;a href=&quot;/#GBIF/Construction/136&amp;amp;fossils=show&quot;&gt;show fossils&lt;/a&gt;, from &lt;strong&gt;1,202&lt;/strong&gt; living squids, octopuses, and nautiluses to &lt;strong&gt;17,714&lt;/strong&gt; once ammonites, belemnites, and orthocones reappear.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/#GBIF/Setting/351&amp;amp;fossils=hide&quot;&gt;Merostomata&lt;/a&gt; (horseshoe crabs and their extinct relatives) expands &lt;strong&gt;14-fold&lt;/strong&gt; when you &lt;a href=&quot;/#GBIF/Setting/351&amp;amp;fossils=show&quot;&gt;show fossils&lt;/a&gt;, from &lt;strong&gt;17&lt;/strong&gt; taxa to &lt;strong&gt;240&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/#GBIF/Movement/9273948&amp;amp;fossils=show&quot;&gt;Trilobita&lt;/a&gt; adds &lt;strong&gt;8,713&lt;/strong&gt; arthropod species that vanish completely when fossils are hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because every numeric whisker and categorical bar morphs in place when you flip &lt;code&gt;Fossils&lt;/code&gt;, survivorship bias shows up directly on screen: the living world snaps back into the wider history that produced it.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Why big sharks and tiny frogs share the Red List</title>
  <link href="https://ptree.org/blog/extinction-size-reversal.html"/>
  <id>https://ptree.org/blog/extinction-size-reversal.html</id>
  <updated>2026-11-24T00:00:00Z</updated>
  <category term="biology" label="Biology"/>
  <summary>Conservation lore says big animals disappear first: whales, tigers, sharks, elephants. Filter Conservation to threatened species across the five major vertebrate classes in Ptree, and that rule holds sharply across sharks, mammals, and birds, then flips completely upside down the moment you step into lizards, snakes, frogs, and salamanders.</summary>
  <content type="html">&lt;p&gt;Conservation lore says big animals disappear first: whales, tigers, sharks, elephants. Filter &lt;code&gt;Conservation&lt;/code&gt; to threatened species across the five major vertebrate classes in Ptree, and that rule holds sharply across sharks, mammals, and birds, then flips completely upside down the moment you step into lizards, snakes, frogs, and salamanders.&lt;/p&gt;
&lt;h2&gt;When big means endangered&lt;/h2&gt;
&lt;p&gt;Lock &lt;code&gt;CR&lt;/code&gt;, &lt;code&gt;EN&lt;/code&gt;, and &lt;code&gt;VU&lt;/code&gt; in the Conservation legend and compare threatened branches against Least Concern ones across the large-bodied vertebrate classes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/121&amp;amp;fossils=hide&amp;amp;filter=conservation:CR%7CEN%7CVU&quot;&gt;Elasmobranchii under Mass&lt;/a&gt;, threatened sharks and rays are dramatically heavier than Least Concern species: &lt;strong&gt;9.3 kg versus 4.1 kg&lt;/strong&gt; across orders, widening to &lt;strong&gt;17.1 kg versus 1.2 kg&lt;/strong&gt; once families open (&lt;strong&gt;21.1 kg versus 1.2 kg&lt;/strong&gt; across individual species, a &lt;strong&gt;17.6-fold&lt;/strong&gt; gap). Slow growth, late maturity, and industrial fisheries hit the largest sharks and rays hardest.&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=conservation:CR%7CEN%7CVU&quot;&gt;Mammalia under Mass&lt;/a&gt;, threatened mammals are &lt;strong&gt;5× to 7.8× heavier&lt;/strong&gt; (&lt;strong&gt;372 g versus 74 g&lt;/strong&gt; across orders; &lt;strong&gt;420 g versus 54 g&lt;/strong&gt; across species) and bear half as many young per litter (&lt;strong&gt;1.1 versus 2.3&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/212&amp;amp;fossils=hide&amp;amp;filter=conservation:CR%7CEN%7CVU&quot;&gt;Aves under Mass&lt;/a&gt;, threatened birds outweigh Least Concern species by &lt;strong&gt;2.7×&lt;/strong&gt; (&lt;strong&gt;90 g versus 34 g&lt;/strong&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can watch the same gradient continuously without clicking a single conservation button. Open &lt;a href=&quot;/#GBIF/Conservation/359&amp;amp;fossils=hide&amp;amp;filter=mass:10000..&quot;&gt;Mammalia under Conservation&lt;/a&gt; and drag the Mass filter window smoothly from &lt;code&gt;≤ 100 g&lt;/code&gt; up to &lt;code&gt;≥ 100 kg&lt;/code&gt;: the red-and-orange threatened share climbs steadily from &lt;strong&gt;11.8% to 25.7%&lt;/strong&gt; (&lt;strong&gt;10.5% to 35.9%&lt;/strong&gt; at species level), while the nocturnal share on &lt;code&gt;Day cycle&lt;/code&gt; drops from &lt;strong&gt;64.5% to 23.8%&lt;/strong&gt; (&lt;strong&gt;72.2% to 10.0%&lt;/strong&gt; at species level). Across warm-blooded vertebrates and large marine predators, size buys slow reproduction and high visibility to humans.&lt;/p&gt;
&lt;h2&gt;When small means endangered&lt;/h2&gt;
&lt;p&gt;Keep the exact same &lt;code&gt;CR&lt;/code&gt;, &lt;code&gt;EN&lt;/code&gt;, and &lt;code&gt;VU&lt;/code&gt; filter active and step across into terrestrial ectotherms. The sign flips backward:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On &lt;a href=&quot;/#GBIF/Mass/11592253&amp;amp;fossils=hide&amp;amp;filter=conservation:CR%7CEN%7CVU&quot;&gt;Squamata under Mass&lt;/a&gt;, threatened lizards and snakes are &lt;em&gt;smaller&lt;/em&gt; than Least Concern species (&lt;strong&gt;9.4 g versus 12.5 g&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Open families inside &lt;a href=&quot;/#GBIF/OffspringCount/131&amp;amp;fossils=hide&amp;amp;filter=conservation:CR%7CEN%7CVU&quot;&gt;Amphibia under Offspring count&lt;/a&gt; and &lt;a href=&quot;/#GBIF/Mass/131&amp;amp;fossils=hide&amp;amp;filter=conservation:CR%7CEN%7CVU&quot;&gt;Mass&lt;/a&gt;. Threatened frogs and salamanders are less than half the body weight of Least Concern species (&lt;strong&gt;2.1 g versus 4.6 g&lt;/strong&gt; at species level; &lt;strong&gt;2.76 g versus 3.91 g&lt;/strong&gt; at families) and lay a fifth as many eggs (&lt;strong&gt;35 versus 180&lt;/strong&gt;; &lt;strong&gt;45 versus 131&lt;/strong&gt; at families).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Big mammals and big sharks are wiped out by hunting, bycatch, and slow recovery. Tiny tropical frogs, dwarf chameleons, and miniature geckos face a completely different trap: tiny body sizes go hand in hand with tiny geographic ranges, specialized cloud-forest microhabitats, and small clutches laid away from open ponds. Clear one hillside or warm one mountain peak by two degrees, and the entire species disappears.&lt;/p&gt;
&lt;h2&gt;How oceans pull mammals and birds in lockstep&lt;/h2&gt;
&lt;p&gt;Body size does not just bend extinction risk; habitat pulls size, lifespan, and offspring count together as one linked package across completely unrelated classes.&lt;/p&gt;
&lt;p&gt;Press &lt;code&gt;Ocean&lt;/code&gt; versus &lt;code&gt;Land&lt;/code&gt; on &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=setting:ocean&quot;&gt;Mammalia under Mass&lt;/a&gt;, &lt;a href=&quot;/#GBIF/Longevity/359&amp;amp;fossils=hide&amp;amp;filter=setting:ocean&quot;&gt;Longevity&lt;/a&gt;, and &lt;a href=&quot;/#GBIF/OffspringCount/359&amp;amp;fossils=hide&amp;amp;filter=setting:ocean&quot;&gt;Offspring count&lt;/a&gt;. Median mass leaps &lt;strong&gt;3,720×&lt;/strong&gt; (&lt;strong&gt;288 kg versus 77.5 g&lt;/strong&gt;; &lt;strong&gt;208 kg versus 65.8 g&lt;/strong&gt; across species), median lifespan nearly quadruples (&lt;strong&gt;32.1 versus 8.3 years&lt;/strong&gt;), and litter size collapses from &lt;strong&gt;2.06&lt;/strong&gt; down to &lt;strong&gt;1.00&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now move to &lt;a href=&quot;/#GBIF/Longevity/212&amp;amp;fossils=hide&amp;amp;filter=setting:ocean&quot;&gt;Aves under Longevity&lt;/a&gt; and press the exact same &lt;code&gt;Ocean&lt;/code&gt; button. Seabirds and penguins independently slide along all three axes in the exact same direction: &lt;strong&gt;10.3× heavier&lt;/strong&gt; (&lt;strong&gt;330 g versus 32.1 g&lt;/strong&gt;), &lt;strong&gt;twice as long-lived&lt;/strong&gt; (&lt;strong&gt;20.6 versus 10.0 years&lt;/strong&gt;), and laying smaller clutches (&lt;strong&gt;1.7 versus 2.5 eggs&lt;/strong&gt;; &lt;strong&gt;1.5&lt;/strong&gt; across species). Cold water demands thermal mass, and patchy oceanic food rewards long-lived adults that invest heavily in one or two offspring per year.&lt;/p&gt;
&lt;h2&gt;How flight and cold climates bend the size and lifespan law&lt;/h2&gt;
&lt;p&gt;Across mammals as a whole, smaller animals live fast and die young. Two single-click filters expose the clearest exceptions to that rule:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Flight breaks the mammal size–lifespan curve.&lt;/strong&gt; Press &lt;code&gt;Flying&lt;/code&gt; on &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;filter=motility:flying&quot;&gt;Mammalia under Mass&lt;/a&gt; and &lt;a href=&quot;/#GBIF/Longevity/359&amp;amp;fossils=hide&amp;amp;filter=motility:flying&quot;&gt;Longevity&lt;/a&gt;. Median body mass collapses &lt;strong&gt;8-fold&lt;/strong&gt; compared with ground-moving mammals (&lt;strong&gt;13.3 g versus 117 g&lt;/strong&gt;), yet median lifespan nearly doubles (&lt;strong&gt;11.7 versus 7.1 years&lt;/strong&gt;; &lt;strong&gt;11.5 versus 5.5 years&lt;/strong&gt; across species). Taking to the air cuts predation on adults so sharply that twelve-gram bats routinely outlive terrestrial mammals ten times their weight.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cold climates double mammal litters.&lt;/strong&gt; Filter &lt;a href=&quot;/#GBIF/OffspringCount/359&amp;amp;fossils=hide&amp;amp;filter=climate:cold%7Ctemperate&quot;&gt;Mammalia to cold and temperate climates&lt;/a&gt; versus tropical ones, and median litter size more than doubles (&lt;strong&gt;2.62 versus 1.16&lt;/strong&gt;, matching the exact species ratio of &lt;strong&gt;2.64 versus 1.00&lt;/strong&gt;). Where winter compresses the breeding window into a few fertile months, mammals pack more young into each litter instead of spacing single births across the year.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Every readout and box-whisker shift above updates live in the browser as you toggle categories or drag a slider. For how Ptree computes those filtered distributions on the client without a server round trip, see &lt;a href=&quot;/blog/live-filtered-summaries.html&quot;&gt;Live filtered summaries without a server round trip&lt;/a&gt;; for more cross-property contrasts across plants, microbes, and vertebrates, see &lt;a href=&quot;/blog/three-click-discoveries.html&quot;&gt;Discoveries you can see in three clicks&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Against BEM and component wrappers</title>
  <link href="https://ptree.org/blog/against-bem-and-wrappers.html"/>
  <id>https://ptree.org/blog/against-bem-and-wrappers.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Front-end engineering spent the last fifteen years treating the CSS cascade like a toxic spill that had to be contained inside isolated components, shadow trees, CSS-in-JS hashes, and BEM naming schemes (card__header--highlighted). Every one of those tools exists to solve one organizational problem: keeping a large team of developers from accidentally breaking each other's styles.</summary>
  <content type="html">&lt;p&gt;Front-end engineering spent the last fifteen years treating the CSS cascade like a toxic spill that had to be contained inside isolated components, shadow trees, CSS-in-JS hashes, and BEM naming schemes (&lt;code&gt;card__header--highlighted&lt;/code&gt;). Every one of those tools exists to solve one organizational problem: keeping a large team of developers from accidentally breaking each other&amp;#39;s styles.&lt;/p&gt;
&lt;p&gt;If you are not trying to protect forty strangers from each other, neutralizing the cascade throws away the most powerful part of the browser.&lt;/p&gt;
&lt;h2&gt;BEM destroys algebra&lt;/h2&gt;
&lt;p&gt;A BEM class name fuses an element&amp;#39;s container, its role, and its state into one opaque token. That forces you to restate every shared relationship over and over, and it makes composition impossible.&lt;/p&gt;
&lt;p&gt;In Ptree, classes compose algebraically. A segmented toolbar control is not &lt;code&gt;.toolbar__button--first-selected&lt;/code&gt;; it is &lt;code&gt;&amp;lt;input class=&amp;quot;Raised Start&amp;quot;&amp;gt;&lt;/code&gt; whose checked state inherits from one global rule (&lt;code&gt;input.Raised:checked + :is(label, button)&lt;/code&gt;). A tile is &lt;code&gt;.tile&lt;/code&gt;, an expandable tile adds &lt;code&gt;.expandable&lt;/code&gt;, a leaving element adds &lt;code&gt;.leaving&lt;/code&gt;, and a shared container toggles &lt;code&gt;.Common&lt;/code&gt;, &lt;code&gt;.Filtering&lt;/code&gt;, or &lt;code&gt;.Colored&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Every class owns a rule of its own:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A class with no CSS rule is dead weight and gets deleted.&lt;/li&gt;
&lt;li&gt;A class whose only job is to undo another rule means the first rule was scoped too broadly. Fix the scope instead of layering a patch on top.&lt;/li&gt;
&lt;li&gt;A state that already exists natively (&lt;code&gt;:checked&lt;/code&gt;, &lt;code&gt;aria-busy&lt;/code&gt;, &lt;code&gt;aria-expanded&lt;/code&gt;, &lt;code&gt;aria-current&lt;/code&gt;) never gets a parallel class or &lt;code&gt;data-*&lt;/code&gt; mirror beside it.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because rules are global and algebraic, a new view or a new property inherits the whole visual grammar (focus rings, selection borders, extinct daggers, common-name staggered fades, and print layout) without copying a single component stylesheet.&lt;/p&gt;
&lt;h2&gt;Wrapper divs are structural noise&lt;/h2&gt;
&lt;p&gt;Component frameworks normalize wrapping every two elements in three nested &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s so each component has its own box, props boundary, and styling scope. Those wrappers are not free. They break CSS Grid and Subgrid alignment, hide parent-child semantics from sibling selectors, bloat the DOM across thousands of tree nodes, and force JavaScript to coordinate what CSS could have inherited directly.&lt;/p&gt;
&lt;p&gt;Flat, semantically truthful markup carries more information in fewer nodes. Ptree&amp;#39;s categorical legend is one &lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt; of &lt;code&gt;&amp;lt;dt&amp;gt;&lt;/code&gt; cells; its property menu is one &lt;code&gt;&amp;lt;menu&amp;gt;&lt;/code&gt; of &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; + &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; pairs; its tree view is one &lt;code&gt;&amp;lt;div class=&amp;quot;plane&amp;quot;&amp;gt;&lt;/code&gt; holding &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; layers. When a divider bar is needed between two facets of a multi-question legend (like Ontogeny&amp;#39;s three axes), the legend does not wrap each facet in a grouping &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;. The first cell of each facet publishes an &lt;code&gt;anchor-name&lt;/code&gt;, and &lt;code&gt;&amp;lt;dl&amp;gt;&lt;/code&gt; draws the dividing bars with &lt;code&gt;::before&lt;/code&gt; and &lt;code&gt;::after&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Deletion as proof&lt;/h2&gt;
&lt;p&gt;Earlier in Ptree&amp;#39;s development, the property legend had its own JavaScript subsystem rebuilding legend DOM whenever you switched properties or hovered taxa. Deleting that dynamic-legend subsystem and replacing it with permanent HTML keys plus registered &lt;code&gt;@property&lt;/code&gt; custom properties made the legend faster, smoother, and more capable. Continuous morphing, hover-peeking, and range filtering came straight from the cascade.&lt;/p&gt;
&lt;p&gt;Once you use the cascade as a global compute engine instead of fighting it, most of the component machinery modern front-end recommends has nothing left to do.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Animating tree connectors without a frame loop</title>
  <link href="https://ptree.org/blog/animating-tree-connectors.html"/>
  <id>https://ptree.org/blog/animating-tree-connectors.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Every branch line in Ptree's Tree view bends smoothly when a clade expands, collapses, pages, or folds into the left gutter. There is no requestAnimationFrame loop anywhere in the viewer. The browser's own CSS transition engine interpolates SVG d paths, group translations, and camera motion from one DOM write per layout.</summary>
  <content type="html">&lt;p&gt;Every branch line in Ptree&amp;#39;s Tree view bends smoothly when a clade expands, collapses, pages, or folds into the left gutter. There is no &lt;code&gt;requestAnimationFrame&lt;/code&gt; loop anywhere in the viewer. The browser&amp;#39;s own CSS transition engine interpolates SVG &lt;code&gt;d&lt;/code&gt; paths, group translations, and camera motion from one DOM write per layout.&lt;/p&gt;
&lt;h2&gt;Matching path topology so &lt;code&gt;d&lt;/code&gt; can interpolate&lt;/h2&gt;
&lt;p&gt;CSS &lt;code&gt;transition: d&lt;/code&gt; only interpolates between two SVG paths when they have the exact same sequence of path commands. If a straight horizontal link uses &lt;code&gt;M ... L ...&lt;/code&gt; while a curved link uses &lt;code&gt;M ... C ...&lt;/code&gt;, the browser snaps between them instead of morphing.&lt;/p&gt;
&lt;p&gt;The connector builder generates every standard branch curve with the exact same command structure. Each curve splits vertically at half the row pitch and converts quadratic arcs to cubic Béziers by placing cubic control points two-thirds of the way toward the quadratic corner. Endpoints are formatted to three decimals and control points to six, with &lt;code&gt;STEEP = 0.5&lt;/code&gt; controlling how sharply steep fans leave the parent stem. Even a perfectly horizontal link to a child on the same row emits the same cubic command skeleton with zero vertical offset, so moving that child up or down on the next layout interpolates cleanly without snapping.&lt;/p&gt;
&lt;p&gt;Detour paths around folded strips use rounded elbows of radius &lt;code&gt;R = pitch / 2&lt;/code&gt; and share their own consistent command template.&lt;/p&gt;
&lt;h2&gt;One-column SVG coordinates&lt;/h2&gt;
&lt;p&gt;Each parent node&amp;#39;s outgoing edges sit inside one &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; element inside &lt;code&gt;.tree .plane &amp;gt; svg&lt;/code&gt;. Sizing the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; to the whole tree width would change what &lt;code&gt;100%&lt;/code&gt; means every time a column is added and shift every existing group. Instead, the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; is fixed to one column wide (&lt;code&gt;width: var(--colw)&lt;/code&gt;) with &lt;code&gt;overflow: visible&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.tree .plane &amp;gt; svg {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: calc(-1 * var(--colw));
  width: var(--colw);
  height: calc(var(--extent) * var(--lh));
  overflow: visible;
  pointer-events: none;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; translates by &lt;code&gt;--vc&lt;/code&gt; in column percentages and &lt;code&gt;--i&lt;/code&gt; in row pitches:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.tree .plane &amp;gt; svg &amp;gt; g {
  --fan-origin: calc(var(--vc) * 100%), calc(var(--i) * var(--lh) + var(--sp) * (var(--colw) - var(--colw-0)));
  transform: translate(var(--fan-origin));
  transition: transform var(--glide) var(--glide-ease);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because each &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; draws in local coordinates relative to its parent&amp;#39;s attachment point, shifting an entire subtree horizontally or vertically updates only &lt;code&gt;--vc&lt;/code&gt; and &lt;code&gt;--i&lt;/code&gt; on the &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; without touching any path string inside it.&lt;/p&gt;
&lt;h2&gt;Arrival and retraction with &lt;code&gt;@starting-style&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;New fans and edges enter without a two-frame JavaScript dance. When the layout creates a &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt;, it writes &lt;code&gt;--start-translate&lt;/code&gt;, &lt;code&gt;--start-d&lt;/code&gt;, and &lt;code&gt;--born&lt;/code&gt; inline, and CSS reads them inside &lt;code&gt;@starting-style&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.tree .plane &amp;gt; svg path {
  fill: none;
  stroke: var(--branch-color);
  stroke-width: var(--line-w);
  stroke-linecap: square;
  transition: d var(--glide) var(--glide-ease),
              transform var(--glide) var(--glide-ease),
              opacity var(--glide) var(--glide-ease);
}
@starting-style {
  .tree .plane &amp;gt; svg &amp;gt; g { --fan-origin: var(--start-translate); }
  .tree .plane &amp;gt; svg path { opacity: 0; d: var(--start-d); }
  .tree .plane &amp;gt; svg &amp;gt; g:not(.fold) &amp;gt; path { transform: scaleY(var(--born)); }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For an ordinary newly opened fan, &lt;code&gt;--born&lt;/code&gt; is &lt;code&gt;0&lt;/code&gt;, so the curves unroll vertically from the parent&amp;#39;s row via &lt;code&gt;scaleY(0)&lt;/code&gt; to &lt;code&gt;scaleY(1)&lt;/code&gt; while fading in. For a thicker &lt;code&gt;.spine&lt;/code&gt; path drawn over an edge that was already on screen, &lt;code&gt;--born&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt;, so the highlight fades in at full length without unrolling a second time.&lt;/p&gt;
&lt;p&gt;When a branch collapses, &lt;code&gt;_reap()&lt;/code&gt; adds &lt;code&gt;.leaving&lt;/code&gt; instead of removing the element immediately:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;.tree .plane &amp;gt; svg &amp;gt; g:not(.fold) &amp;gt; path.leaving,
.tree .plane &amp;gt; svg &amp;gt; g.leaving &amp;gt; path {
  transform: scaleY(0);
  opacity: 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The edges fold back onto their parent&amp;#39;s row on the exact reverse of entry. Once the view&amp;#39;s transition counter returns to zero, &lt;code&gt;_sweep()&lt;/code&gt; removes every &lt;code&gt;.leaving&lt;/code&gt; element and any emptied &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; container.&lt;/p&gt;
&lt;h2&gt;Keeping SVG lines locked to HTML tiles on high-DPI screens&lt;/h2&gt;
&lt;p&gt;Early versions translated the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; and the &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; node layer separately when panning sideways. On high-DPI screens, Chrome composites an HTML box&amp;#39;s &lt;code&gt;transform&lt;/code&gt; at any device pixel ratio, but only composites an SVG element&amp;#39;s own &lt;code&gt;transform&lt;/code&gt; at an effective zoom of 1 (&lt;a href=&quot;https://issues.chromium.org/issues/40172437&quot;&gt;Chromium bug 40172437&lt;/a&gt;). The connectors ran on the main thread and visibly trailed behind the tiles during a glide.&lt;/p&gt;
&lt;p&gt;The fix is two lines of markup: both the &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; and the tile &lt;code&gt;&amp;lt;ul&amp;gt;&lt;/code&gt; layer sit inside one HTML &lt;code&gt;&amp;lt;div class=&amp;quot;plane&amp;quot;&amp;gt;&lt;/code&gt;, and &lt;code&gt;.plane&lt;/code&gt; carries the horizontal &lt;code&gt;translateX&lt;/code&gt;. Because the HTML wrapper owns the composited transform, the SVG lines and HTML tiles pan as one surface at every pixel ratio.&lt;/p&gt;
&lt;h2&gt;Smooth vertical camera handoff&lt;/h2&gt;
&lt;p&gt;Expanding a column above or below the clicked tile changes total tree height and moves rows vertically. Calling &lt;code&gt;scrollTo({ behavior: &amp;quot;smooth&amp;quot; })&lt;/code&gt; fights with simultaneous CSS transitions on tiles and stops abruptly when another click arrives.&lt;/p&gt;
&lt;p&gt;Instead, &lt;code&gt;Branching._camera()&lt;/code&gt; simulates vertical scrolling by setting a transitioned &lt;code&gt;transform: translateY()&lt;/code&gt; on &lt;code&gt;.scene&lt;/code&gt; equal to the distance between the current &lt;code&gt;scrollTop&lt;/code&gt; and the target scroll offset. It computes that offset purely from tracked scroll, tracked viewport height, and CSS-resolved pitch (&lt;code&gt;--label-metrics&lt;/code&gt;), with zero DOM layout reads during the layout task. When all transitions settle (or immediately if the user touches the wheel, scrollbar, pointer, or keyboard), &lt;code&gt;_rebaseCamera()&lt;/code&gt; freezes &lt;code&gt;transform&lt;/code&gt; at its computed offset, applies the exact opposite untransitioned &lt;code&gt;translate&lt;/code&gt;, and transfers the delta into native &lt;code&gt;scrollTop&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const offset = new DOMMatrixReadOnly(getComputedStyle(this._scene).transform).m42;
this._scene.style.transform = `translateY(${offset}px)`;
this._scene.style.translate = `0 ${-offset}px`;
this.root.scrollTop = this._scroll = this.root.scrollTop - offset - base;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Nothing moves on screen during the handoff, native scrolling resumes from the exact pixel where the glide stopped, and interrupting a glide mid-flight cancels smoothly without snapping.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Your backyard as a phylogenetic tree</title>
  <link href="https://ptree.org/blog/backyard-phylogenetic-tree.html"/>
  <id>https://ptree.org/blog/backyard-phylogenetic-tree.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="biology" label="Biology"/>
  <summary>Field guides organize local wildlife as flat lists of species, while global phylogenies strip away geography. Ptree keeps both dimensions live at once. Drop a pin on your neighborhood or select any country, state, mountain range, or sea, and every branch that does not live there dims out while all 42 property overlays and every legend filter stay active. One global tree of life turns into a local ecological instrument with zero extra views.</summary>
  <content type="html">&lt;p&gt;Field guides organize local wildlife as flat lists of species, while global phylogenies strip away geography. Ptree keeps both dimensions live at once. Drop a pin on your neighborhood or select any country, state, mountain range, or sea, and every branch that does not live there dims out while all 42 property overlays and every legend filter stay active. One global tree of life turns into a local ecological instrument with zero extra views.&lt;/p&gt;
&lt;h2&gt;Dropping a pin on 42 properties&lt;/h2&gt;
&lt;p&gt;Open any clade and add a place to the URL (&lt;code&gt;&amp;amp;location=US-TN&lt;/code&gt;, &lt;code&gt;&amp;amp;location=MG&lt;/code&gt;, &lt;code&gt;&amp;amp;location=alps&lt;/code&gt;, &lt;code&gt;&amp;amp;location=mediterranean-sea&lt;/code&gt;, or any &lt;code&gt;latitude,longitude&lt;/code&gt; coordinate). Instead of asking abstract questions about &amp;quot;all birds&amp;quot; or &amp;quot;all plants,&amp;quot; you are looking at the trait profile of one real place on Earth:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/Spread/6&amp;amp;fossils=hide&amp;amp;location=MG&quot;&gt;Madagascar’s plants under Spread&lt;/a&gt; and &lt;a href=&quot;/#GBIF/Conservation/359&amp;amp;fossils=hide&amp;amp;location=MG&quot;&gt;Madagascar’s mammals under Conservation&lt;/a&gt;. Endemic lineages glow across the flora while threatened lemur and tenrec branches light up red and orange, and continental mammals that never reached the island fade into the background.&lt;/li&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/Spread/359&amp;amp;fossils=hide&amp;amp;location=NZ&quot;&gt;New Zealand’s mammals under Spread&lt;/a&gt; beside &lt;a href=&quot;/#GBIF/Movement/212&amp;amp;fossils=hide&amp;amp;location=NZ&quot;&gt;New Zealand’s birds under Movement&lt;/a&gt;. An island ecosystem’s whole conservation dilemma appears in two clicks: terrestrial mammals light up overwhelmingly as introduced and invasive, right next to native flightless and ground-moving birds.&lt;/li&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/Persistence/7707728&amp;amp;fossils=hide&amp;amp;location=US-TN&quot;&gt;Tennessee’s vascular plants under Persistence&lt;/a&gt; or &lt;a href=&quot;/#GBIF/PopulationTrend/212&amp;amp;fossils=hide&amp;amp;location=US-TN&quot;&gt;Tennessee’s birds under Population trend&lt;/a&gt;. You can combine neighboring regions with a pipe (&lt;code&gt;&amp;amp;location=US-TN|US-NC&lt;/code&gt;) or click any coordinate on the globe, such as &lt;a href=&quot;/#GBIF/Mass/359&amp;amp;fossils=hide&amp;amp;location=64.1,-21.9&quot;&gt;mammals around Reykjavik&lt;/a&gt;, &lt;a href=&quot;/#GBIF/GrowthForm/6&amp;amp;fossils=hide&amp;amp;location=alps&quot;&gt;plants across the Alps&lt;/a&gt;, or &lt;a href=&quot;/#GBIF/VerticalRange/52&amp;amp;fossils=hide&amp;amp;location=mediterranean-sea&quot;&gt;mollusks across the Mediterranean Sea&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Because the location mask runs locally in the browser against each tile’s shared equirectangular outline, switching from &lt;code&gt;Mass&lt;/code&gt; to &lt;code&gt;Day cycle&lt;/code&gt; to &lt;code&gt;Conservation&lt;/code&gt; keeps the exact same geographic slice lit with no server round-trip. Even before clicking to lock a place, sweeping your pointer across the sidebar world map previews any spot on Earth live, shifting body mass, clutch size, and conservation risk across the sidebar as your cursor moves from the Amazon to Antarctica or from the Sahara to the open Pacific.&lt;/p&gt;
&lt;h2&gt;What makes a species invasive in three clicks&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Spread&lt;/code&gt; property classifies organisms from &lt;code&gt;endemic&lt;/code&gt; and &lt;code&gt;native&lt;/code&gt; through &lt;code&gt;introduced&lt;/code&gt;, &lt;code&gt;naturalized&lt;/code&gt;, and &lt;code&gt;invasive&lt;/code&gt;. Pairing &lt;code&gt;Spread&lt;/code&gt; filters with life-history traits lets you test classic invasion-biology hypotheses live across whole kingdoms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Filter &lt;a href=&quot;/#GBIF/NicheBreadth/359&amp;amp;fossils=hide&amp;amp;filter=spread:invasive&quot;&gt;Mammalia to invasive species&lt;/a&gt; and compare them with &lt;a href=&quot;/#GBIF/NicheBreadth/359&amp;amp;fossils=hide&amp;amp;filter=spread:native&quot;&gt;native mammals&lt;/a&gt;. Across measured species, invasive mammals have &lt;strong&gt;twice the niche breadth&lt;/strong&gt; (median &lt;strong&gt;18.8%&lt;/strong&gt; of source habitat and food types versus &lt;strong&gt;9.4%&lt;/strong&gt; for native-only species). They also bear &lt;strong&gt;58% larger litters&lt;/strong&gt; (&lt;strong&gt;3.0&lt;/strong&gt; young versus &lt;strong&gt;1.9&lt;/strong&gt; on &lt;a href=&quot;/#GBIF/OffspringCount/359&amp;amp;fossils=hide&amp;amp;filter=spread:invasive&quot;&gt;Offspring count&lt;/a&gt;) and breed &lt;strong&gt;49% more often&lt;/strong&gt; (&lt;strong&gt;1.64&lt;/strong&gt; events per year versus &lt;strong&gt;1.10&lt;/strong&gt; on &lt;a href=&quot;/#GBIF/BreedingFrequency/359&amp;amp;fossils=hide&amp;amp;filter=spread:invasive&quot;&gt;Breeding frequency&lt;/a&gt;). Their median body mass is &lt;strong&gt;43× heavier&lt;/strong&gt; (&lt;strong&gt;6.0 kilograms&lt;/strong&gt; versus &lt;strong&gt;140 grams&lt;/strong&gt;), reflecting how heavily humans carried pigs, goats, deer, foxes, rabbits, and commensal rodents across oceans compared with tiny native shrews, bats, and mice.&lt;/li&gt;
&lt;li&gt;Filter &lt;a href=&quot;/#GBIF/NicheBreadth/212&amp;amp;fossils=hide&amp;amp;filter=spread:invasive&quot;&gt;Aves to invasive birds&lt;/a&gt; against &lt;a href=&quot;/#GBIF/NicheBreadth/212&amp;amp;fossils=hide&amp;amp;filter=spread:native&quot;&gt;native birds&lt;/a&gt;. Invasive bird species use &lt;strong&gt;67% broader niches&lt;/strong&gt; (&lt;strong&gt;7.4%&lt;/strong&gt; versus &lt;strong&gt;4.4%&lt;/strong&gt;) and outweigh native-only birds by &lt;strong&gt;4.6×&lt;/strong&gt; (&lt;strong&gt;155 grams&lt;/strong&gt; versus &lt;strong&gt;34 grams&lt;/strong&gt;), driven by adaptable generalists like starlings, mynas, pigeons, and waterfowl.&lt;/li&gt;
&lt;li&gt;Filter &lt;a href=&quot;/#GBIF/OffspringMass/6&amp;amp;fossils=hide&amp;amp;filter=spread:invasive&quot;&gt;Plantae to invasive plants&lt;/a&gt; against &lt;a href=&quot;/#GBIF/OffspringMass/6&amp;amp;fossils=hide&amp;amp;filter=spread:endemic&quot;&gt;endemic plants&lt;/a&gt;. Across measured species, invasive plants produce &lt;strong&gt;37% lighter seeds&lt;/strong&gt; (median &lt;strong&gt;2.6 milligrams&lt;/strong&gt; versus &lt;strong&gt;4.1 milligrams&lt;/strong&gt; for endemics) and shift toward faster, thinner foliage on &lt;a href=&quot;/#GBIF/LeafEconomy/6&amp;amp;fossils=hide&amp;amp;filter=spread:invasive&quot;&gt;Leaf economy&lt;/a&gt; (median specific leaf area &lt;strong&gt;17.0&lt;/strong&gt; versus &lt;strong&gt;14.8 mm²/mg&lt;/strong&gt;). Cheap, fast-growing leaves and light seeds built for dispersal are the botanical signature of disturbance invaders.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Intersecting geography with risk&lt;/h2&gt;
&lt;p&gt;The real payoff happens when you stack Location with a second filter. Lock &lt;code&gt;Population trend: decreasing&lt;/code&gt; or &lt;code&gt;Spread: invasive&lt;/code&gt;, drop a pin on your own region, and switch across &lt;code&gt;Mass&lt;/code&gt;, &lt;code&gt;Niche breadth&lt;/code&gt;, &lt;code&gt;Day cycle&lt;/code&gt;, or &lt;code&gt;Growth form&lt;/code&gt;. You are no longer browsing an encyclopedia of global averages; you are looking at which traits separate the winners from the declining branches right outside your door.&lt;/p&gt;
&lt;p&gt;None of that required building a &amp;quot;regional biodiversity portal&amp;quot; or an &amp;quot;invasive species dashboard.&amp;quot; Because geography, trait overlays, and legend filters all act orthogonally on the same tree, every combination works out of the box.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Every time life invented the same trick</title>
  <link href="https://ptree.org/blog/convergent-evolution-on-sight.html"/>
  <id>https://ptree.org/blog/convergent-evolution-on-sight.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="biology" label="Biology"/>
  <summary>Textbooks usually mention convergent evolution with two stock examples: bat wings beside bird wings, or dolphins beside sharks. When every trait sits on one cross-kingdom scale with live filtering, you do not have to take anyone’s word for it. Lock one category at the top of the tree, and every independent branch that invented that solution stays lit while the rest of life dims.</summary>
  <content type="html">&lt;p&gt;Textbooks usually mention convergent evolution with two stock examples: bat wings beside bird wings, or dolphins beside sharks. When every trait sits on one cross-kingdom scale with live filtering, you do not have to take anyone’s word for it. Lock one category at the top of the tree, and every independent branch that invented that solution stays lit while the rest of life dims.&lt;/p&gt;
&lt;h2&gt;Powered flight across three animal classes&lt;/h2&gt;
&lt;p&gt;Filter &lt;a href=&quot;/#GBIF/Movement/1&amp;amp;fossils=hide&amp;amp;filter=motility:flying&quot;&gt;Animalia to flying&lt;/a&gt;. Across 1.78 million living animal taxa, three major branches stay lit on one screen: &lt;strong&gt;Aves&lt;/strong&gt; (&lt;code&gt;27,980&lt;/code&gt;), &lt;strong&gt;Insecta&lt;/strong&gt; (&lt;code&gt;11,473&lt;/code&gt;), and &lt;strong&gt;Mammalia&lt;/strong&gt; (&lt;code&gt;2,073&lt;/code&gt;, almost all of them bats in &lt;code&gt;Chiroptera&lt;/code&gt;), along with a 12-taxon gliding sliver inside &lt;strong&gt;Squamata&lt;/strong&gt; (&lt;em&gt;Draco&lt;/em&gt; lizards and gliding geckos). Chitin wings, feathered forelimbs, and stretched finger-skin membranes all light up under one shared Movement bin because the categories encode what an organism does rather than which anatomy it started from.&lt;/p&gt;
&lt;h2&gt;Five independent origins of carnivorous plants&lt;/h2&gt;
&lt;p&gt;Most people picture &lt;code&gt;Plantae&lt;/code&gt; as one uninterrupted wall of photosynthesis. Open &lt;a href=&quot;/#GBIF/Nutrition/6&amp;amp;fossils=hide&quot;&gt;Plantae under Nutrition&lt;/a&gt; and press &lt;code&gt;Predatory&lt;/code&gt; to isolate &lt;a href=&quot;/#GBIF/Nutrition/6&amp;amp;fossils=hide&amp;amp;filter=nutrition:predatory&quot;&gt;carnivorous plants&lt;/a&gt;. Across 538,000 living plant taxa, &lt;strong&gt;611&lt;/strong&gt; predatory species stay lit across &lt;strong&gt;five separate flowering-plant orders&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lamiales&lt;/strong&gt; (&lt;code&gt;377&lt;/code&gt; taxa): bladderworts and butterworts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caryophyllales&lt;/strong&gt; (&lt;code&gt;190&lt;/code&gt; taxa): sundews, the Venus flytrap, and tropical pitcher plants (&lt;em&gt;Nepenthes&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ericales&lt;/strong&gt; (&lt;code&gt;41&lt;/code&gt; taxa): North American pitcher plants (&lt;em&gt;Sarracenia&lt;/em&gt;) and cobra lilies (&lt;em&gt;Darlingtonia&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Poales&lt;/strong&gt; (&lt;code&gt;1.5&lt;/code&gt; taxa): carnivorous bromeliads.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Oxalidales&lt;/strong&gt; (&lt;code&gt;1&lt;/code&gt; taxon): the Albany pitcher plant (&lt;em&gt;Cephalotus&lt;/em&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Five separate times, nutrient-poor bogs and sandy soils pushed flowering plants to build traps and start digesting animals. In Ptree, those five independent branches light up side by side in two clicks.&lt;/p&gt;
&lt;h2&gt;Parasitism in every kingdom, and animals that run on sunlight&lt;/h2&gt;
&lt;p&gt;Lock &lt;code&gt;Parasitic&lt;/code&gt; at the top of the tree (&lt;a href=&quot;/#GBIF/Nutrition&amp;amp;fossils=hide&amp;amp;filter=nutrition:parasitic&quot;&gt;Life filtered to parasitic&lt;/a&gt;), and parasitism breaks out of every stereotype about worms and ticks. Every major kingdom stays lit at once: &lt;strong&gt;Animalia&lt;/strong&gt; (&lt;code&gt;110,580&lt;/code&gt;), &lt;strong&gt;Fungi&lt;/strong&gt; (&lt;code&gt;9,680&lt;/code&gt;), &lt;strong&gt;Plantae&lt;/strong&gt; (&lt;code&gt;4,381&lt;/code&gt;), &lt;strong&gt;Chromista&lt;/strong&gt; (&lt;code&gt;2,428&lt;/code&gt;), &lt;strong&gt;Protozoa&lt;/strong&gt; (&lt;code&gt;203&lt;/code&gt;), and &lt;strong&gt;Viruses&lt;/strong&gt; (&lt;code&gt;59&lt;/code&gt;). Click into &lt;a href=&quot;/#GBIF/Nutrition/6&amp;amp;fossils=hide&amp;amp;filter=nutrition:parasitic&quot;&gt;parasitic plants&lt;/a&gt; alone and more than a dozen orders stay lit, from mistletoes and sandalwoods in &lt;strong&gt;Santalales&lt;/strong&gt; (&lt;code&gt;1,629&lt;/code&gt;) and broomrapes in &lt;strong&gt;Lamiales&lt;/strong&gt; (&lt;code&gt;1,510&lt;/code&gt;) to mycoheterotrophic orchids in &lt;strong&gt;Asparagales&lt;/strong&gt; (&lt;code&gt;365&lt;/code&gt;), dodder in &lt;strong&gt;Solanales&lt;/strong&gt; (&lt;code&gt;269&lt;/code&gt;), &lt;em&gt;Rafflesia&lt;/em&gt; in &lt;strong&gt;Malpighiales&lt;/strong&gt; (&lt;code&gt;51&lt;/code&gt;), and even parasitic red algae in &lt;strong&gt;Ceramiales&lt;/strong&gt; (&lt;code&gt;94&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Now flip the stereotype backward. Filter &lt;a href=&quot;/#GBIF/Nutrition/1&amp;amp;fossils=hide&amp;amp;filter=nutrition:photosynthetic&quot;&gt;Animalia to photosynthetic&lt;/a&gt;, and &lt;strong&gt;4,439&lt;/strong&gt; living animal taxa light up, led by reef-building corals and sea anemones in &lt;a href=&quot;/#GBIF/Nutrition/206&amp;amp;fossils=hide&amp;amp;filter=nutrition:photosynthetic&quot;&gt;Anthozoa&lt;/a&gt; (&lt;code&gt;2,791&lt;/code&gt; living, &lt;code&gt;5,027&lt;/code&gt; with fossils) and giant clams in &lt;a href=&quot;/#GBIF/Nutrition/137&amp;amp;fossils=hide&amp;amp;filter=nutrition:photosynthetic&quot;&gt;Bivalvia&lt;/a&gt; (&lt;code&gt;34&lt;/code&gt;) that farm photosynthetic algae inside their tissues. Right beside photosynthesis on &lt;code&gt;Bivalvia&lt;/code&gt; sits another convergent shortcut: &lt;strong&gt;521&lt;/strong&gt; living &lt;strong&gt;chemosynthetic&lt;/strong&gt; deep-sea clams that farm sulfur-oxidizing bacteria around hydrothermal vents and cold seeps.&lt;/p&gt;
&lt;h2&gt;Live birth across eleven animal classes&lt;/h2&gt;
&lt;p&gt;Live birth feels like the defining mark of mammals until you filter &lt;a href=&quot;/#GBIF/Ontogeny/1&amp;amp;fossils=hide&amp;amp;filter=developmentmode:carried&quot;&gt;Animalia to carried offspring&lt;/a&gt;. &lt;strong&gt;Mammalia&lt;/strong&gt; (&lt;code&gt;6,465&lt;/code&gt;) stays lit, but ten other animal classes light up right beside it: &lt;strong&gt;Malacostraca&lt;/strong&gt; (&lt;code&gt;1,966&lt;/code&gt; crustaceans that brood and carry their young), &lt;strong&gt;Squamata&lt;/strong&gt; (&lt;code&gt;1,059&lt;/code&gt; live-bearing lizards and snakes), &lt;strong&gt;Gastropoda&lt;/strong&gt; (&lt;code&gt;926&lt;/code&gt; viviparous snails), &lt;strong&gt;Elasmobranchii&lt;/strong&gt; (&lt;code&gt;512&lt;/code&gt; sharks and rays), &lt;strong&gt;Amphibia&lt;/strong&gt; (&lt;code&gt;56&lt;/code&gt; caecilians, frogs, and salamanders), &lt;strong&gt;Maxillopoda&lt;/strong&gt; (&lt;code&gt;44&lt;/code&gt;), &lt;strong&gt;Bivalvia&lt;/strong&gt; (&lt;code&gt;7&lt;/code&gt;), &lt;strong&gt;Anthozoa&lt;/strong&gt; (&lt;code&gt;6.5&lt;/code&gt;), &lt;strong&gt;Coelacanthi&lt;/strong&gt; (&lt;code&gt;2&lt;/code&gt; of &lt;code&gt;2&lt;/code&gt; living coelacanths), and &lt;strong&gt;Polychaeta&lt;/strong&gt; (&lt;code&gt;1.5&lt;/code&gt;). Retaining embryos inside the body evolved independently across vertebrates, mollusks, arthropods, worms, and cnidarians.&lt;/p&gt;
&lt;h2&gt;Coloniality from bacteria to chordates&lt;/h2&gt;
&lt;p&gt;Lock &lt;code&gt;Colonial&lt;/code&gt; on &lt;a href=&quot;/#GBIF/Organization&amp;amp;fossils=hide&amp;amp;filter=organization:colonial&quot;&gt;Life under Organization&lt;/a&gt;, and the same jump from lone cells or solitary bodies to linked colonies lights up across four kingdoms: &lt;strong&gt;Bryozoa&lt;/strong&gt; (&lt;code&gt;11,986&lt;/code&gt; of &lt;code&gt;11,988&lt;/code&gt;), &lt;strong&gt;Cnidaria&lt;/strong&gt; (&lt;code&gt;10,565&lt;/code&gt;: corals and siphonophores), &lt;strong&gt;Chordata&lt;/strong&gt; (&lt;code&gt;3,887&lt;/code&gt;: colonial tunicates and salps), &lt;strong&gt;Chlorophyta&lt;/strong&gt; (&lt;code&gt;338&lt;/code&gt;: colonial green algae such as &lt;em&gt;Volvox&lt;/em&gt;), &lt;strong&gt;Cyanobacteria&lt;/strong&gt; (&lt;code&gt;123&lt;/code&gt;), &lt;strong&gt;Ciliophora&lt;/strong&gt; (&lt;code&gt;113&lt;/code&gt;), &lt;strong&gt;Ochrophyta&lt;/strong&gt; (&lt;code&gt;81&lt;/code&gt;), &lt;strong&gt;Entoprocta&lt;/strong&gt; (&lt;code&gt;55&lt;/code&gt;), and &lt;strong&gt;Hemichordata&lt;/strong&gt; (&lt;code&gt;46&lt;/code&gt; living, jumping to &lt;code&gt;677&lt;/code&gt; if you turn fossils on).&lt;/p&gt;
&lt;h2&gt;Flipping the telescope to hunt the branch that broke the rule&lt;/h2&gt;
&lt;p&gt;Filtering all of &lt;code&gt;Life&lt;/code&gt; shows how often unrelated branches converge on one solution. Doing the exact same move inside a single class reveals the opposite story: the rare lineages that abandoned their relatives’ body plan and broke out on their own.&lt;/p&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF/Movement/359&amp;amp;fossils=hide&amp;amp;filter=motility:swimming&quot;&gt;Mammalia filtered to swimming&lt;/a&gt;. Whales (&lt;code&gt;Cetacea&lt;/code&gt;, &lt;code&gt;274&lt;/code&gt;), seals and sea otters (&lt;code&gt;Carnivora&lt;/code&gt;, &lt;code&gt;97&lt;/code&gt;), and manatees and dugongs (&lt;code&gt;Sirenia&lt;/code&gt;, &lt;code&gt;16&lt;/code&gt;) jump out first, followed by five smaller independent returns to water across &lt;code&gt;Rodentia&lt;/code&gt; (&lt;code&gt;9.7&lt;/code&gt;: capybaras, beavers, and muskrats), &lt;code&gt;Artiodactyla&lt;/code&gt; (&lt;code&gt;6.3&lt;/code&gt;: hippos), &lt;code&gt;Soricomorpha&lt;/code&gt; (&lt;code&gt;5.2&lt;/code&gt;: water shrews), &lt;code&gt;Afrosoricida&lt;/code&gt; (&lt;code&gt;2.5&lt;/code&gt;: otter shrews), and &lt;code&gt;Didelphimorphia&lt;/code&gt; (&lt;code&gt;2&lt;/code&gt;: the water opossum). Eight mammal orders took to the water on separate tracks.&lt;/p&gt;
&lt;p&gt;Do the same on &lt;a href=&quot;/#GBIF/Movement/212&amp;amp;fossils=hide&quot;&gt;Aves under Movement&lt;/a&gt;: beside &lt;code&gt;27,980&lt;/code&gt; flying birds sit &lt;strong&gt;352&lt;/strong&gt; swimming specialists (penguins, loons, grebes, and diving ducks) and &lt;strong&gt;2,904&lt;/strong&gt; ground-moving birds scattered across ostriches, rheas, emus, kiwis, rails, and gamebirds.&lt;/p&gt;
&lt;p&gt;Whether you zoom out to &lt;code&gt;Life&lt;/code&gt; to watch unrelated kingdoms converge or zoom into one class to chase the tiny sliver that broke the family rule, the mechanism is the same: one vocabulary across all of biology and one click on the legend.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Categories that cross kingdoms</title>
  <link href="https://ptree.org/blog/cross-kingdom-categories.html"/>
  <id>https://ptree.org/blog/cross-kingdom-categories.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Trait databases usually keep every source’s own words in separate columns or raw strings. Each row is easy to defend, and the table has hundreds of siloed labels that leave most of the tree blank and block any comparison between a fern, a coral, a bacterium, and a bird. Ptree puts 11.1 million records across 42 properties (24 categorical and 18 numerical, with up to 82 sources feeding one property and 12 contributing to a single organism) into five to nine cross-kingdom bins per property, while keeping every source’s original word, scope, and citation underneath.</summary>
  <content type="html">&lt;p&gt;Trait databases usually keep every source’s own words in separate columns or raw strings. Each row is easy to defend, and the table has hundreds of siloed labels that leave most of the tree blank and block any comparison between a fern, a coral, a bacterium, and a bird. Ptree puts &lt;strong&gt;11.1 million&lt;/strong&gt; records across &lt;strong&gt;42 properties&lt;/strong&gt; (24 categorical and 18 numerical, with up to &lt;strong&gt;82 sources&lt;/strong&gt; feeding one property and &lt;strong&gt;12&lt;/strong&gt; contributing to a single organism) into five to nine cross-kingdom bins per property, while keeping every source’s original word, scope, and citation underneath.&lt;/p&gt;
&lt;p&gt;Every source dictionary is read whole before a reader runs. An unclassified word stops the build. Uncolored tiles mean no source spoke, never that a mapping was cautious.&lt;/p&gt;
&lt;h2&gt;Setting and Position&lt;/h2&gt;
&lt;p&gt;Habitat sources mix environment and placement in one column: forest beside arboreal, ocean beside infaunal. Ptree splits them into two properties. &lt;strong&gt;Setting&lt;/strong&gt; reads &lt;strong&gt;1,407&lt;/strong&gt; terms and admits &lt;strong&gt;1,143&lt;/strong&gt; into &lt;strong&gt;7 bins&lt;/strong&gt;: &lt;code&gt;ocean&lt;/code&gt;, &lt;code&gt;coast&lt;/code&gt;, &lt;code&gt;freshwater&lt;/code&gt;, &lt;code&gt;wetland&lt;/code&gt;, &lt;code&gt;land&lt;/code&gt;, &lt;code&gt;host&lt;/code&gt;, and &lt;code&gt;built&lt;/code&gt;. &lt;strong&gt;Position&lt;/strong&gt; has &lt;strong&gt;6&lt;/strong&gt;: &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;surface&lt;/code&gt;, &lt;code&gt;buried&lt;/code&gt;, &lt;code&gt;attached&lt;/code&gt;, &lt;code&gt;elevated&lt;/code&gt;, and &lt;code&gt;internal&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;/#GBIF/Position&quot;&gt;Position&lt;/a&gt;, &lt;code&gt;surface&lt;/code&gt; covers the seabed, the ground, and the water surface. When a vertebrate lineage moves ashore, Setting shifts from &lt;code&gt;ocean&lt;/code&gt; to &lt;code&gt;land&lt;/code&gt; while Position holds &lt;code&gt;surface&lt;/code&gt;. Placements combine when an organism holds more than one: an arboreal tree frog, a climbing vine, a perching bird (AVONET &lt;code&gt;Insessorial&lt;/code&gt;), and an epiphytic orchid all take &lt;code&gt;attached&lt;/code&gt; and &lt;code&gt;elevated&lt;/code&gt;; a sessile sponge and a rock-clinging lizard (&lt;code&gt;saxicolous&lt;/code&gt;) both take &lt;code&gt;surface&lt;/code&gt; and &lt;code&gt;attached&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;One field from Kew’s World Checklist of Vascular Plants, the orchid &lt;em&gt;Agrostophyllum arabukanum&lt;/em&gt; listed as &lt;code&gt;&amp;quot;epiphytic rhizomatous subshrub&amp;quot;&lt;/code&gt;, breaks into three grammatical facts that feed &lt;strong&gt;9 categories across 7 properties&lt;/strong&gt; (&lt;code&gt;Setting&lt;/code&gt;, &lt;code&gt;Position&lt;/code&gt;, &lt;code&gt;Organization&lt;/code&gt;, &lt;code&gt;Reproduction&lt;/code&gt;, &lt;code&gt;Growth form&lt;/code&gt;, &lt;code&gt;Persistence&lt;/code&gt;, and &lt;code&gt;Shape&lt;/code&gt;) without claiming parasitic Nutrition.&lt;/p&gt;
&lt;p&gt;Where a source states only one axis, Ptree leaves the other blank. BacDive’s isolation path &lt;code&gt;Environmental → Aquatic → Sediment&lt;/code&gt; places a microbe in &lt;code&gt;buried&lt;/code&gt; Position and withholds Setting unless another path on the same strain names the water; among BacDive strains that do state salinity, 59% are ocean, 29% freshwater, and 13% coast. Soda and salt lakes (&lt;em&gt;Natronomonas&lt;/em&gt;, &lt;em&gt;Arthrospira&lt;/em&gt;) stay in &lt;code&gt;freshwater&lt;/code&gt; as inland water because salt concentration belongs to Salinity, its own log scale from &lt;code&gt;0.1&lt;/code&gt; to &lt;code&gt;300 g/kg&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;One question from bacteria to oaks&lt;/h2&gt;
&lt;p&gt;A category has to separate neighboring orders and families when you zoom in, not just separate kingdoms at the root.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ontogeny&lt;/strong&gt; avoids the word “larval,” which stops at animals. Its &lt;code&gt;staged&lt;/code&gt; bin means a body of another form first, which the adult replaces, against &lt;code&gt;direct&lt;/code&gt;, the adult’s own form from the start. That one contrast separates a tadpole from a froglet in amphibians, a caterpillar (&lt;code&gt;holometabolous&lt;/code&gt;) from a grasshopper nymph (&lt;code&gt;hemimetabolous&lt;/code&gt;) &lt;a href=&quot;/#GBIF/Ontogeny/216&quot;&gt;in insects&lt;/a&gt;, trochophores and veligers in marine invertebrates, and a fern’s free-living prothallus from a seed plant’s seedling in plants. On Ontogeny’s delivery axis, a seed is an embryo &lt;code&gt;released&lt;/code&gt; as an egg is, and a seahorse’s male brood pouch (&lt;code&gt;androviviparous&lt;/code&gt;) counts as &lt;code&gt;carried&lt;/code&gt;. Each of Ontogeny’s three paired questions (&lt;code&gt;direct&lt;/code&gt;/&lt;code&gt;staged&lt;/code&gt;, &lt;code&gt;released&lt;/code&gt;/&lt;code&gt;carried&lt;/code&gt;, &lt;code&gt;altricial&lt;/code&gt;/&lt;code&gt;precocial&lt;/code&gt;) sums to 100% on its own, so a mammal reads &lt;code&gt;direct 100%&lt;/code&gt; beside &lt;code&gt;carried 100%&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/#GBIF/SexMating&quot;&gt;Sex &amp;amp; mating&lt;/a&gt; drops separate zoological (&lt;code&gt;gonochoristic&lt;/code&gt;, &lt;code&gt;protogynous&lt;/code&gt;) and botanical (&lt;code&gt;dioecious&lt;/code&gt;, &lt;code&gt;monoecious&lt;/code&gt;) buckets in favor of how far apart the sexes sit: &lt;code&gt;separate&lt;/code&gt; in different individuals, &lt;code&gt;sequential&lt;/code&gt; in one individual over time, &lt;code&gt;side by side&lt;/code&gt; in different parts of one individual (corn’s tassel and ear, pine cones, monoecious shoots), and &lt;code&gt;together&lt;/code&gt; in every flower or body (a lily’s flower beside a snail’s body).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/#GBIF/Movement&quot;&gt;Movement&lt;/a&gt; puts a bacterium’s flagellar motor (BacDive &lt;code&gt;motility = yes&lt;/code&gt;) and a walking animal in the same &lt;code&gt;mobile&lt;/code&gt; bin, moving under its own power. When a source names a specific mode (&lt;code&gt;swimming&lt;/code&gt;, &lt;code&gt;flying&lt;/code&gt;, &lt;code&gt;climbing&lt;/code&gt;, &lt;code&gt;burrowing&lt;/code&gt;, &lt;code&gt;ground-moving&lt;/code&gt;), that mode supersedes generic &lt;code&gt;mobile&lt;/code&gt; without erasing &lt;code&gt;stationary&lt;/code&gt; or &lt;code&gt;drifting&lt;/code&gt; when both hold.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/#GBIF/Nutrition&quot;&gt;Nutrition&lt;/a&gt; reads &lt;strong&gt;222 source terms&lt;/strong&gt; from &lt;strong&gt;49 sources&lt;/strong&gt; and admits &lt;strong&gt;201&lt;/strong&gt; into &lt;strong&gt;9 bins&lt;/strong&gt;. Its &lt;code&gt;parasitic&lt;/code&gt; bin (nutrients taken from a host or its food supply) groups 23 terms: &lt;code&gt;hematophage&lt;/code&gt;, &lt;code&gt;leaf miner&lt;/code&gt;, &lt;code&gt;stem borer&lt;/code&gt;, &lt;code&gt;kleptoparasite&lt;/code&gt;, &lt;code&gt;cell-sucker&lt;/code&gt;, &lt;code&gt;entomopathogen&lt;/code&gt;, &lt;code&gt;mycoparasite&lt;/code&gt;, &lt;code&gt;parasitoid&lt;/code&gt;, Kew’s parasitic plants, and FishBase’s commensals feeding on a host’s prey. Fungivores sit in &lt;code&gt;herbivorous&lt;/code&gt; (grazing a living modular body or eating spores mirrors herbivory), while bacterivores stay &lt;code&gt;predatory&lt;/code&gt; because eating a cell kills it.&lt;/p&gt;
&lt;h2&gt;Context decides what a word means&lt;/h2&gt;
&lt;p&gt;The same word in two databases often establishes different facts.&lt;/p&gt;
&lt;p&gt;FishBase’s &lt;code&gt;DemersPelag = pelagic&lt;/code&gt; entails &lt;code&gt;swimming&lt;/code&gt; because every row in FishBase is a fish. SeaLifeBase’s identical column entails nothing for &lt;code&gt;pelagic&lt;/code&gt;, because open water holds swimming squids beside drifting &lt;em&gt;Physalia&lt;/em&gt; and &lt;em&gt;Velella&lt;/em&gt;. EltonTraits’ &lt;code&gt;strataWaterBelow&lt;/code&gt; entails no swimming either: its &lt;strong&gt;405&lt;/strong&gt; all-water-below birds include plunge-diving frigatebirds, terns, kingfishers, and pelicans.&lt;/p&gt;
&lt;p&gt;BacDive names every light-driven strain with &lt;code&gt;photo-&lt;/code&gt; (&lt;code&gt;phototroph&lt;/code&gt;, &lt;code&gt;photoautotroph&lt;/code&gt;, &lt;code&gt;photolithoautotroph&lt;/code&gt;). Auditing its bare &lt;code&gt;autotroph&lt;/code&gt; strains showed &lt;strong&gt;9 of 9&lt;/strong&gt; are iron oxidizers, sulfur oxidizers, methanogens, or hyperthermophilic archaea, all &lt;code&gt;chemosynthetic&lt;/code&gt;. Its three &lt;code&gt;mixotroph&lt;/code&gt; strains are &lt;code&gt;chemosynthetic&lt;/code&gt; and &lt;code&gt;absorptive&lt;/code&gt;, while TraitBank’s &lt;code&gt;mixotrophic&lt;/code&gt; combines light and organic carbon (&lt;code&gt;photosynthetic&lt;/code&gt; and &lt;code&gt;absorptive&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;In Organization, a plant storage organ maps to &lt;code&gt;clonal&lt;/code&gt; (and &lt;code&gt;asexual&lt;/code&gt; in Reproduction) only where AusTraits data show it multiplies the plant: &lt;strong&gt;77%&lt;/strong&gt; of bulbs, &lt;strong&gt;90%&lt;/strong&gt; of pseudobulbs, and &lt;strong&gt;60%&lt;/strong&gt; of rhizomes spread vegetatively, compared with roughly &lt;strong&gt;a third&lt;/strong&gt; of stem tubers and &lt;strong&gt;a fifth&lt;/strong&gt; of corms, which mostly renew the same plant each year. Bulbs, pseudobulbs, and rhizomes read &lt;code&gt;clonal&lt;/code&gt;; tubers and corms do not. And in TraitBank, a prokaryote’s &lt;code&gt;multicellular&lt;/code&gt; filament reads &lt;code&gt;group&lt;/code&gt; (cells are the units joined), whereas a multicellular eukaryote is itself the unit, so &lt;code&gt;multicellular&lt;/code&gt; adds no Organization claim for an animal or plant.&lt;/p&gt;
&lt;h2&gt;Coverage and contrast&lt;/h2&gt;
&lt;p&gt;Every bin takes one of roughly five to nine colors in OKLCH and Display-P3. Each swatch clears &lt;strong&gt;WCAG 2.2 AA 4.5:1&lt;/strong&gt; contrast under black text and maintains CIEDE2000 separation under normal vision and mild deuteranomaly.&lt;/p&gt;
&lt;p&gt;When only part of a clade has records, Ptree keeps the recorded category proportions intact and washes the color toward white along one curve for every property:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;retained(c) = 1.03c / (c + 0.03)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At &lt;strong&gt;10%&lt;/strong&gt; descendant coverage, a tile keeps &lt;strong&gt;79%&lt;/strong&gt; of its canonical color; at &lt;strong&gt;5%&lt;/strong&gt;, &lt;strong&gt;64%&lt;/strong&gt;; at &lt;strong&gt;1%&lt;/strong&gt;, &lt;strong&gt;26%&lt;/strong&gt;; at &lt;strong&gt;0.1%&lt;/strong&gt;, &lt;strong&gt;3%&lt;/strong&gt;; and at &lt;strong&gt;0%&lt;/strong&gt;, pure unknown white.&lt;/p&gt;
&lt;p&gt;The palette workbench checks every washed color against every full-strength color so a sparsely covered category cannot resemble a well-covered neighbor. Specialist distinctions that cannot survive that budget stay in the references popover, where every colored tile keeps its exact source term, scope, citation, and delivery basis.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Taste is detecting effort times mastery</title>
  <link href="https://ptree.org/blog/defining-taste.html"/>
  <id>https://ptree.org/blog/defining-taste.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>People usually invoke &quot;taste&quot; as an unarguable vibe, either as a polite way of saying &quot;I like this&quot; or as a status badge that they award themselves while failing to spot slop. Neither meaning helps when you are building software or directing AI agents.</summary>
  <content type="html">&lt;p&gt;People usually invoke &amp;quot;taste&amp;quot; as an unarguable vibe, either as a polite way of saying &amp;quot;I like this&amp;quot; or as a status badge that they award themselves while failing to spot slop. Neither meaning helps when you are building software or directing AI agents.&lt;/p&gt;
&lt;p&gt;A sharper definition turns taste into a measurement:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Taste is the ability to detect and rank the product of a creator&amp;#39;s effort and specialized mastery by inspecting only the output. Mastery here is not a poll of consumers; it is an objective score that settles out recursively when practitioners inside the medium evaluate one another, with consumer input excluded.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Treating effort and mastery as a product rather than a sum matters. Effort without mastery produces labored bloat: thousands of lines of ceremony wrapped around a weak idea. Mastery without effort produces a careless sketch that leaves the hard edges unfinished. Both factors have to show up in the finished work.&lt;/p&gt;
&lt;h2&gt;Why consumer input is excluded&lt;/h2&gt;
&lt;p&gt;Consumers judge output by how quickly it triggers enjoyment: sugar, familiarity, and smooth plausibility. Slop is engineered to maximize consumer reward while spending almost no mastery or effort.&lt;/p&gt;
&lt;p&gt;Creators working inside a medium judge something completely different. They look at how hard the problem actually is, which shortcuts the author refused, how cleanly the constraints fit together, and whether the piece still holds up when you inspect the internals. Weighting each peer&amp;#39;s evaluation by that peer&amp;#39;s own standing works like PageRank over practitioners rather than crowds. It anchors mastery to the craft itself instead of to popularity or marketing.&lt;/p&gt;
&lt;h2&gt;Inspecting only the output&lt;/h2&gt;
&lt;p&gt;Real taste does not depend on the signature in the corner. If you only recognize a photograph, a stylesheet, or a database schema as great after learning who made it, you are reading provenance rather than quality. Conversely, if people would praise a piece once they saw a famous name on it, dismissing the same work without that signature reveals that they were never judging the work at all.&lt;/p&gt;
&lt;p&gt;Calibrating taste takes deliberate practice. You learn to recognize what fills every big-box aisle and every boilerplate SaaS template, and you train yourself away from cheap hits so that your judgment rewards real effort and mastery instead of surface gloss.&lt;/p&gt;
&lt;h2&gt;Why AI agents make taste the bottleneck&lt;/h2&gt;
&lt;p&gt;Human collaborators have a built-in brake on bad taste: wasted effort hurts. Even a sycophantic employee eventually pushes back against grinding through 500 files for a bad idea, because the pain of pointless labor limits how far they will follow a bad direction.&lt;/p&gt;
&lt;p&gt;LLM agent harnesses have no such aversion. A coding agent will cheerfully spend hours building elaborate wrappers, defensive fallback layers, and smooth-sounding abstractions around a broken premise. The result looks clean and impressive to a casual reader while carrying no real mastery underneath.&lt;/p&gt;
&lt;p&gt;When generation becomes cheap and wasted effort stops hurting the generator, taste is the bottleneck. Someone has to inspect the output alone and tell real mastery apart from plausible slop. That is why Ptree aims for the exposed movement of an A. Lange watch rather than a glossy demo. Open the page, inspect the CSS and behavior directly, and judge the work on its own.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Never use Figma</title>
  <link href="https://ptree.org/blog/design-in-the-browser.html"/>
  <id>https://ptree.org/blog/design-in-the-browser.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>Static mockups hide almost everything that determines whether software works. When you draw a screen in Figma and hand it off to be &quot;implemented,&quot; the drawing strips away unknown text lengths, overflow, resizing, keyboard focus, scrolling, network latency, interrupted transitions, and state combinations. A screenshot records one frozen pose filled with curated fake data. It cannot specify a live system.</summary>
  <content type="html">&lt;p&gt;Static mockups hide almost everything that determines whether software works. When you draw a screen in Figma and hand it off to be &amp;quot;implemented,&amp;quot; the drawing strips away unknown text lengths, overflow, resizing, keyboard focus, scrolling, network latency, interrupted transitions, and state combinations. A screenshot records one frozen pose filled with curated fake data. It cannot specify a live system.&lt;/p&gt;
&lt;p&gt;In Ptree, design and implementation are one search carried out directly in the browser. The working page is the design document.&lt;/p&gt;
&lt;h2&gt;Friction in CSS is design evidence&lt;/h2&gt;
&lt;p&gt;When an apparently simple visual idea requires wrapper &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s, JavaScript width measurements, magic pixel coordinates, or a stack of &lt;code&gt;!important&lt;/code&gt; overrides, the usual reaction is to push harder until the pixels match the mockup. That gets the causality backward. Heavy implementation friction is a sign that the design itself does not fit the medium.&lt;/p&gt;
&lt;p&gt;Before forcing a box into place, ask which element is supposed to size which. Ptree&amp;#39;s Tree view never had responsive breakpoints drawn for &amp;quot;mobile,&amp;quot; &amp;quot;tablet,&amp;quot; and &amp;quot;desktop&amp;quot; artboards. Instead, CSS declares the readable width band of a single column (&lt;code&gt;--fit-min: calc(14ex + 6.6ex)&lt;/code&gt; to &lt;code&gt;--fit-max: calc(21ex + 6.6ex)&lt;/code&gt;) and computes the integer column count continuously across every viewport width:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;--ncols: max(1, min(round(down, calc(var(--live-width) / var(--fit-min)), 1),
                    round(up, calc(var(--live-width) / var(--fit-max)), 1)));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No static artboard could have discovered that law. Once that law exists, every window width from a narrow phone to an ultrawide monitor works automatically with zero media-query breakpoints.&lt;/p&gt;
&lt;h2&gt;Let the platform shape the interface&lt;/h2&gt;
&lt;p&gt;Working directly in HTML and CSS lets the browser&amp;#39;s own layout algorithms, native controls, and cascade guide the UI. Often that yields a cleaner design than anything you would have drawn by hand.&lt;/p&gt;
&lt;p&gt;Ptree&amp;#39;s numeric range filters look like an editor&amp;#39;s trim brackets that dim the excluded ends of a legend track. Drawn in a design tool, someone would specify a custom widget with drag handles, a JavaScript bounding-box hit tester, and two overlay &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s whose widths update on every &lt;code&gt;pointermove&lt;/code&gt;. Built directly in CSS, the control is just two overlapping native &lt;code&gt;&amp;lt;input type=&amp;quot;range&amp;quot;&amp;gt;&lt;/code&gt; elements. Each thumb casts a &lt;code&gt;100vw&lt;/code&gt; &lt;code&gt;box-shadow&lt;/code&gt; outward (&lt;code&gt;--cast: -100vw&lt;/code&gt; and &lt;code&gt;100vw&lt;/code&gt;), and &lt;code&gt;overflow: hidden&lt;/code&gt; on the inputs clips that shadow neatly to the track. Keyboard navigation, touch dragging, screen-reader semantics, and visual dimming all come from the same eight lines of CSS.&lt;/p&gt;
&lt;p&gt;The legend carousel came from the same habit. Every property key sits in the same &lt;code&gt;1 / 1&lt;/code&gt; grid cell inside &lt;code&gt;&amp;lt;fieldset&amp;gt;&lt;/code&gt;, so the tallest key sets the legend&amp;#39;s height automatically with no fixed pixel measurement. Switching properties shifts a single registered &lt;code&gt;--ki&lt;/code&gt; number. If a future property needs two lines, the container grows on its own without touching a single coordinate.&lt;/p&gt;
&lt;h2&gt;System perfection, not pixel perfection&lt;/h2&gt;
&lt;p&gt;Mockup-driven development optimizes for an isolated snapshot, and often wrecks the architecture underneath just to reproduce an arbitrary pixel gap from that snapshot. Optimizing the whole system means refusing both bad extremes: neither a clumsy interface that serves a neat abstraction, nor a pretty picture held up by tangled machinery.&lt;/p&gt;
&lt;p&gt;Whenever either the interface or the code needs an exception list to satisfy the other, keep searching. Almost always there is an underlying rule where the cleanest interface and the simplest implementation turn out to be the exact same answer.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>OKLCH palettes that survive washout</title>
  <link href="https://ptree.org/blog/designing-oklch-palettes.html"/>
  <id>https://ptree.org/blog/designing-oklch-palettes.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Most data visualizations pick colors by eye on a clean white slide, or grab a stock rainbow or Viridis ramp and call it accessible. Neither approach holds up on a tree of life.</summary>
  <content type="html">&lt;p&gt;Most data visualizations pick colors by eye on a clean white slide, or grab a stock rainbow or Viridis ramp and call it accessible. Neither approach holds up on a tree of life.&lt;/p&gt;
&lt;p&gt;In Ptree, color is the visualization itself, not decoration. Every tile puts black text directly on top of its data fill. Parent clades display proportional bands of their descendants&amp;#39; categories, and sparse clades wash toward white so that low coverage reads immediately as uncertain. On top of that, the viewer switches between light and dark themes. A palette that looks fine as eight solid swatches in isolation falls apart once you put black text over it, wash it down to 15% coverage, and show it to a visitor with red-green color blindness.&lt;/p&gt;
&lt;h2&gt;One canonical data plane in both themes&lt;/h2&gt;
&lt;p&gt;Every categorical bucket and numeric ramp stop in Ptree&amp;#39;s shared palette stylesheet keeps one canonical OKLCH color across both light and dark mode. Switching Ptree to dark mode updates the page ground, chrome, dividers, and secondary text, while leaving the measured data plane unchanged. Unknown stays white, data fills keep their authored colors, and tile labels stay black.&lt;/p&gt;
&lt;p&gt;That single rule keeps the visual grammar consistent. A reader does not have to re-learn what &amp;quot;predatory&amp;quot; or &amp;quot;20 °C&amp;quot; looks like when their operating system switches to dark mode at sunset. Selection and hover states never override the data fill either; they show up strictly through borders, outlines, and stroke weight.&lt;/p&gt;
&lt;h2&gt;Designing against the worst pair, not the average&lt;/h2&gt;
&lt;p&gt;Ptree authors palettes in OKLCH, using Display-P3 where the wider gamut genuinely improves separation while auditing how each color degrades when reduced to sRGB at constant lightness and hue. Every candidate palette goes through the &lt;code&gt;/colors/&lt;/code&gt; calibration workbench under four hard constraints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every canonical swatch and every washed shade along the coverage curve must clear WCAG 2.2 AA 4.5:1 contrast under &lt;code&gt;#000&lt;/code&gt; text. That sets a firm lightness floor on every fill in the app, so dark blues and deep purples never swallow species names.&lt;/li&gt;
&lt;li&gt;Average separation across a palette is a vanity metric, because two indistinguishable bins ruin an overlay even when the other seven sit far apart. Calibration optimizes the worst pair&amp;#39;s CIEDE2000 distance under both normal vision and mild deuteranomaly.&lt;/li&gt;
&lt;li&gt;Sparse clades wash toward white along &lt;code&gt;retained(c) = 1.03c / (c + 0.03)&lt;/code&gt;. The workbench compares every washed category against every other category at the same wash and against every other category at full strength. That catches a common failure in choropleths and tree maps, where a poorly covered red or blue washes into a tint that resembles a well-covered yellow or cyan.&lt;/li&gt;
&lt;li&gt;Unconstrained color optimizers always jump to fluorescent magenta and electric lime because high chroma maximizes mathematical distance. Ptree caps chroma and prefers mineral, earthen, botanical, and marine hue families. Ocean and coast share blues, freshwater and wetland move through teal and marsh green, and Growth form uses a muted tree brown that reads more cleanly than a loud red.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Sequential ramps as journeys, not light-to-dark tinting&lt;/h2&gt;
&lt;p&gt;A single hue scaled from pale to dark runs out of readable steps quickly and collides with Ptree&amp;#39;s own coverage wash toward white. Instead, numeric ramps move through meaningful hue journeys: ice to water to abyss for temperature and depth, leaf to wood to earth, and fresh green through marine blue to salt-lake pink (the color of &lt;em&gt;Dunaliella&lt;/em&gt; and halobacteria) for salinity. Ptree also separates the stops (the perceptual journey) from the stop positions, spending the color range where actual species occur.&lt;/p&gt;
&lt;p&gt;Every tile paints from one fixed OKLCH &lt;code&gt;linear-gradient&lt;/code&gt; over registered &lt;code&gt;--band-N&lt;/code&gt; &lt;code&gt;&amp;lt;color&amp;gt;&lt;/code&gt; and &lt;code&gt;--seg-N&lt;/code&gt; &lt;code&gt;&amp;lt;length-percentage&amp;gt;+&lt;/code&gt; slots that are generated at build time. Unused slots repeat the final color at &lt;code&gt;100% 100%&lt;/code&gt;. When you switch from a 9-category property to a 3-category property, or toggle fossils on and off, the browser interpolates every band natively in OKLCH without JavaScript rebuilding gradients.&lt;/p&gt;
&lt;p&gt;The calibration workbench proposes candidates, never final answers. Every palette gets opened on the real tree, across mixed clades and under both page themes, before a single OKLCH value enters production.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>The DOM is the state store</title>
  <link href="https://ptree.org/blog/dom-as-state.html"/>
  <id>https://ptree.org/blog/dom-as-state.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>In Ptree, the authored HTML controls, &lt;data&gt; elements, aria-* attributes, and :checked states are the state store and the registry. JavaScript reads from them, writes a few custom properties in place, and never rebuilds a subtree to reflect a change.</summary>
  <content type="html">&lt;p&gt;In Ptree, the authored HTML controls, &lt;code&gt;&amp;lt;data&amp;gt;&lt;/code&gt; elements, &lt;code&gt;aria-*&lt;/code&gt; attributes, and &lt;code&gt;:checked&lt;/code&gt; states are the state store and the registry. JavaScript reads from them, writes a few custom properties in place, and never rebuilds a subtree to reflect a change.&lt;/p&gt;
&lt;h2&gt;Permanent controls as the registry&lt;/h2&gt;
&lt;p&gt;Open &lt;a href=&quot;/#GBIF//44&quot;&gt;Ptree’s home view&lt;/a&gt; and inspect the document. Every scientific tree in the header is an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; carrying &lt;code&gt;data-bb&lt;/code&gt;. Every property in the band is a radio &lt;code&gt;&amp;lt;input name=&amp;quot;Property&amp;quot;&amp;gt;&lt;/code&gt; paired with its &lt;code&gt;&amp;lt;label&amp;gt;&lt;/code&gt;. Every legend scale holds &lt;code&gt;&amp;lt;data value=&amp;quot;...&amp;quot;&amp;gt;&lt;/code&gt; endpoints, pressed &lt;code&gt;&amp;lt;dt&amp;gt;&lt;/code&gt; category cells, and range inputs. No JavaScript object mirrors those lists.&lt;/p&gt;
&lt;p&gt;URL routing parses the hash against those DOM nodes directly: the first segment matches the header’s &lt;code&gt;a[data-bb]&lt;/code&gt; links, the second matches the property radios’ labels, and the view parameter matches &lt;code&gt;input[name=&amp;quot;View&amp;quot;]&lt;/code&gt;. Changing a property’s label in the generated shell moves its URL token and its parser together.&lt;/p&gt;
&lt;p&gt;Filtering reads the legend DOM the same way. Pressed &lt;code&gt;&amp;lt;dt&amp;gt;&lt;/code&gt; cells supply the active category bins, range inputs supply the numeric window shares, and &lt;code&gt;&amp;lt;data&amp;gt;&lt;/code&gt; elements supply the scale bounds. Editing one number in the markup moves both the printed bound and the filter math.&lt;/p&gt;
&lt;p&gt;Compare builds its rows by cloning the labels already in the property menu. Even the question box’s server reads the served HTML shell through &lt;code&gt;linkedom&lt;/code&gt; at startup to assemble its system prompt and tool enums from the same radios, legend cells, and checkboxes the visitor sees.&lt;/p&gt;
&lt;h2&gt;One attribute, several readers&lt;/h2&gt;
&lt;p&gt;One conceptual state lives in one native attribute, read by accessibility, CSS, and script alike:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;aria-busy=&amp;quot;true&amp;quot;&lt;/code&gt; is what screen readers announce, what CSS pulses, what the tour player waits on before clicking a target, and what scripts check to avoid overlapping work.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;aria-current=&amp;quot;page&amp;quot;&lt;/code&gt; on a tree link names the active backbone for assistive tech, highlights the header tab in CSS, and is what &lt;code&gt;curBackbone()&lt;/code&gt; reads when building the next API request.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:checked&lt;/code&gt; and &lt;code&gt;:indeterminate&lt;/code&gt; on native checkboxes hold common-name display, fossil inclusion, tree sync, filtering, and branch disclosures in Tree and Cladogram.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;export const curBackbone = () =&amp;gt;
	document.querySelector(&amp;quot;a[data-bb][aria-current]&amp;quot;).dataset.bb;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Mutating tiles in place&lt;/h2&gt;
&lt;p&gt;A tree of life has millions of nodes, so Ptree creates and removes tiles as branches open and close. Reconciling by stable taxon ID keeps the shared prefix untouched and mutates existing nodes in place for every attribute, label, filter, and color change.&lt;/p&gt;
&lt;p&gt;Swapping scientific and common names runs no relabel loop in JavaScript. Every tile holds both a &lt;code&gt;.vern&lt;/code&gt; span and a &lt;code&gt;.sci&lt;/code&gt; span in one grid cell; checking Common toggles a single &lt;code&gt;Common&lt;/code&gt; class on &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, and CSS swaps which span displays.&lt;/p&gt;
&lt;p&gt;Color overlays work through registered &lt;code&gt;@property&lt;/code&gt; custom properties (&lt;code&gt;&amp;lt;percentage&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;color&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt;). Switching from Mass to Longevity, or hovering from one taxon to another, calls &lt;code&gt;setProperty&lt;/code&gt; once per changed variable. The browser interpolates the quartiles, whiskers, geometric-mean diamond, and stacked bars on its own, with no animation loop. Deleting an earlier dynamic-legend subsystem made the legend simpler and more capable because the cascade and property interpolation took over the work.&lt;/p&gt;
&lt;h2&gt;Trusting internal invariants&lt;/h2&gt;
&lt;p&gt;Because Ptree authors and mutates its own DOM, internal queries carry no optional chaining, fallback defaults, or defensive &lt;code&gt;try/catch&lt;/code&gt; blocks. External boundaries (URLs, user clicks, upstream source files, and HTTP requests) are validated strictly; broken internal invariants crash loudly. The entire viewer runs in ~16,000 lines of framework-free ES modules with no build step in development and no virtual DOM at runtime.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Shipping current web standards and filing the bugs</title>
  <link href="https://ptree.org/blog/filing-browser-bugs.html"/>
  <id>https://ptree.org/blog/filing-browser-bugs.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>When a latest browser lacks a CSS or DOM subfeature, or ships a rendering bug, Ptree keeps the native platform path canonical, isolates the smallest removable workaround at the engine boundary, and files a minimal reproduction upstream. Every active workaround and issue report is listed publicly at Browser issues.</summary>
  <content type="html">&lt;p&gt;When a latest browser lacks a CSS or DOM subfeature, or ships a rendering bug, Ptree keeps the native platform path canonical, isolates the smallest removable workaround at the engine boundary, and files a minimal reproduction upstream. Every active workaround and issue report is listed publicly at &lt;a href=&quot;/about/browser-issues.html&quot;&gt;Browser issues&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Finding real engine bugs in production&lt;/h2&gt;
&lt;p&gt;Building a dense, animated tree viewer with CSS anchor positioning, scroll-driven animations, registered &lt;code&gt;@property&lt;/code&gt; custom properties, View Transitions, &lt;code&gt;light-dark()&lt;/code&gt;, and &lt;code&gt;clip-path: shape()&lt;/code&gt; exercises combinations that synthetic test suites rarely hit together:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Removing elements during a scoped view transition broke in Chromium (&lt;a href=&quot;https://issues.chromium.org/issues/576097103&quot;&gt;Chromium 576097103&lt;/a&gt;). Reported on October 21, fixed upstream on October 22.&lt;/li&gt;
&lt;li&gt;Chrome composites an HTML element&amp;#39;s &lt;code&gt;transform&lt;/code&gt; at any device pixel ratio, but drops an SVG element&amp;#39;s own &lt;code&gt;transform&lt;/code&gt; off the compositor whenever effective zoom is not 1 (&lt;a href=&quot;https://issues.chromium.org/issues/40172437&quot;&gt;Chromium 40172437&lt;/a&gt;). On high-DPI displays, tree connectors trailed behind moving tiles until both &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; and the tile list sat inside one HTML &lt;code&gt;.plane&lt;/code&gt; wrapper.&lt;/li&gt;
&lt;li&gt;In Ptree&amp;#39;s Icicle view, a connector ribbon bridges two independently scrolled columns between their &lt;code&gt;[aria-current]&lt;/code&gt; tiles. &lt;code&gt;anchor()&lt;/code&gt; kept a tile&amp;#39;s scroll offset from the last recalculation in Chrome while re-reading live scroll on style changes in Safari 26 (&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=328291&quot;&gt;WebKit 328291&lt;/a&gt;). Switching the live vertical position to CSS scroll-driven &lt;code&gt;view-timeline&lt;/code&gt; animations fixed every supporting engine simultaneously, leaving a three-line &lt;code&gt;@supports not (animation-timeline: --a)&lt;/code&gt; fallback for Safari 18.&lt;/li&gt;
&lt;li&gt;Safari 26.4 anchors labels to an element&amp;#39;s pre-&lt;code&gt;translate&lt;/code&gt; box rather than its visual box (&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=313104&quot;&gt;WebKit 313104&lt;/a&gt;). On &lt;code&gt;.track .point&lt;/code&gt;, Ptree temporarily writes &lt;code&gt;calc(50% - 4.5px)&lt;/code&gt; instead of &lt;code&gt;50%&lt;/code&gt; + &lt;code&gt;translate: -50% -50%&lt;/code&gt;, with a comment linking the bug so those two lines revert cleanly once the fix ships.&lt;/li&gt;
&lt;li&gt;Changing color scheme on the outer page did not propagate &lt;code&gt;light-dark()&lt;/code&gt; inside Safari&amp;#39;s embedded Wikipedia iframe (&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=316680&quot;&gt;WebKit 316680&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Dividing lengths via &lt;code&gt;tan(atan2())&lt;/code&gt; inside container-relative calculations hit engine limitations in Gecko (&lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=1324602&quot;&gt;Bugzilla 1324602&lt;/a&gt; and &lt;a href=&quot;https://bugzilla.mozilla.org/show_bug.cgi?id=2067411&quot;&gt;2067411&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Safari also lags on &lt;code&gt;moveBefore&lt;/code&gt; (&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=281223&quot;&gt;WebKit 281223&lt;/a&gt;), &lt;code&gt;closedby&lt;/code&gt; dialogs (&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=284592&quot;&gt;WebKit 284592&lt;/a&gt;), and async iteration over &lt;code&gt;ReadableStream&lt;/code&gt; (&lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=194379&quot;&gt;WebKit 194379&lt;/a&gt;), while &lt;code&gt;border-shape&lt;/code&gt;, &lt;code&gt;stretch&lt;/code&gt;, gap decorations, &lt;code&gt;interactivity: inert&lt;/code&gt;, and &lt;code&gt;::scroll-button()&lt;/code&gt; are tracked alongside CSSWG issues like &lt;code&gt;:checked&lt;/code&gt;/&lt;code&gt;:indeterminate&lt;/code&gt; styling (&lt;a href=&quot;https://github.com/w3c/csswg-drafts/issues/9706&quot;&gt;csswg-drafts 9706&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Keeping every workaround small and removable&lt;/h2&gt;
&lt;p&gt;Supporting browsers always run the canonical CSS (&lt;code&gt;view-timeline&lt;/code&gt;, &lt;code&gt;border-shape&lt;/code&gt;, &lt;code&gt;clip-path: shape()&lt;/code&gt;, &lt;code&gt;anchor()&lt;/code&gt;). A fallback sits inside a targeted &lt;code&gt;@supports not (...)&lt;/code&gt; block or a narrow feature check rather than a JavaScript polyfill that replaces native CSS across every engine. Every workaround comment cites the Chromium, WebKit, Gecko, or CSSWG issue URL and states what to restore when that engine catches up.&lt;/p&gt;
&lt;p&gt;Testing runs on real Chrome, Safari, and Firefox engines over plain WebDriver via BrowserStack rather than local headless clones, asserting engine layout geometry, console cleanliness, and forced-repaint checks across every supported browser. When an engine fixes a bug, deleting the three-line &lt;code&gt;@supports&lt;/code&gt; block leaves the canonical code untouched.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Instant tree expansion with page masks</title>
  <link href="https://ptree.org/blog/instant-tree-expansion.html"/>
  <id>https://ptree.org/blog/instant-tree-expansion.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Clicking an expandable taxon in Ptree fans out its children immediately, before the HTTP request for that level returns. The placeholder fan already has the exact number of rows, the exact vertical layout, and the exact fossil filter state the real children will occupy. When the JSON arrives, the placeholders swap their text and property colors in place without moving a single tile or connector.</summary>
  <content type="html">&lt;p&gt;Clicking an expandable taxon in Ptree fans out its children immediately, before the HTTP request for that level returns. The placeholder fan already has the exact number of rows, the exact vertical layout, and the exact fossil filter state the real children will occupy. When the JSON arrives, the placeholders swap their text and property colors in place without moving a single tile or connector.&lt;/p&gt;
&lt;h2&gt;Why child count is not enough&lt;/h2&gt;
&lt;p&gt;A simple integer &lt;code&gt;childCount&lt;/code&gt; lets a client draw placeholder rows, but it breaks as soon as fossils are hidden. Consider a genus with 18 children in the database where 14 are extinct fossils and 4 are living species. If the visitor has fossils toggled off and the client only knows &lt;code&gt;childCount = 18&lt;/code&gt;, clicking the genus fans out 18 blank rows, shifts the surrounding tree down by 18 pitches, and then violently collapses 14 of them when the response arrives.&lt;/p&gt;
&lt;p&gt;Paging adds a second edge case. A node with more than 50 children returns a page of up to 50 items plus up to two pagination arrows (previous page and next page). The placeholder fan needs to know how many total slots appear on the first page and which of those slots are extinct.&lt;/p&gt;
&lt;h2&gt;Packing the first page into one integer&lt;/h2&gt;
&lt;p&gt;When the API builds a level response, it computes a &lt;code&gt;pageMask&lt;/code&gt; for every expandable child on that page:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const pageMask = slots.reduce((mask, slot) =&amp;gt; mask * 2 + Number(!!slot.fossil), 1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The leading &lt;code&gt;1&lt;/code&gt; is a sentinel bit that encodes the length of the slot list. Each subsequent bit is &lt;code&gt;1&lt;/code&gt; if that slot is extinct and &lt;code&gt;0&lt;/code&gt; if it is extant (or a pagination arrow). Because a page holds at most 50 children plus 2 arrows, the mask takes at most 53 bits, which matches the exact precision of a JavaScript IEEE-754 safe integer (&lt;code&gt;Number.MAX_SAFE_INTEGER = 2^53 - 1&lt;/code&gt;), so it serializes as an ordinary JSON number with no string conversion or &lt;code&gt;BigInt&lt;/code&gt; overhead. Decoding must use &lt;code&gt;toString(2)&lt;/code&gt; rather than 32-bit bitwise operators, which silently truncate anything past 31 bits.&lt;/p&gt;
&lt;p&gt;On the client, the skeleton builder decodes the mask in one line:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;[...mask.toString(2).slice(1)].map((bit, i) =&amp;gt; ({
  id: `skel-${node.id}-${i}`,
  extinct: bit === &amp;quot;1&amp;quot;,
  // ...
}))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Dropping the leading &lt;code&gt;&amp;quot;1&amp;quot;&lt;/code&gt; yields an array whose length is the exact slot count and whose elements already carry &lt;code&gt;extinct&lt;/code&gt;. The tree&amp;#39;s normal fossil classifier runs over the skeleton array using the same &lt;code&gt;_away()&lt;/code&gt; predicate it uses for real taxa. When fossils are hidden, every extinct placeholder is immediately classified &lt;code&gt;.away&lt;/code&gt; and takes zero vertical rows.&lt;/p&gt;
&lt;h2&gt;Deterministic placeholder bars in CSS&lt;/h2&gt;
&lt;p&gt;Skeleton tiles reuse the exact same &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; structure as real taxa. While a tile&amp;#39;s &lt;code&gt;data-id&lt;/code&gt; starts with &lt;code&gt;skel-&lt;/code&gt;, its scientific-name link is empty, and CSS draws a shimmer bar using its row index &lt;code&gt;--i&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;main li[data-id^=&amp;quot;skel-&amp;quot;] &amp;gt; a::before {
  content: &amp;quot;&amp;quot;;
  grid-area: 1 / 1;
  inline-size: calc(38% + mod(var(--i), 4) * 11%);
  block-size: 0.62em;
  border-radius: 1em;
  background: color-mix(in srgb, CanvasText 12%, transparent);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using &lt;code&gt;mod(var(--i), 4)&lt;/code&gt; gives each row a varied bar length (38%, 49%, 60%, 71%) without random numbers or inline styles, and removing the placeholder state requires no extra attribute: replacing &lt;code&gt;data-id&lt;/code&gt; with the real taxon ID and filling the name spans turns the skeleton into the final tile.&lt;/p&gt;
&lt;h2&gt;Skipping skeletons when cached&lt;/h2&gt;
&lt;p&gt;When a visitor clicks a chevron, the disclosure handler checks the client cache before marking the control busy:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;let items = routePage({ taxon: t, offset });
if (!Array.isArray(items)) {
  pin.ariaBusy = &amp;quot;true&amp;quot;;
  pin.parentElement.classList.add(&amp;quot;busy&amp;quot;);
  this._relayout();
  items = await items;
  // ...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the page is already in the client cache, &lt;code&gt;routePage()&lt;/code&gt; returns the array synchronously and no skeleton is created; the real children fan out in the first layout pass. Only an unresolved Promise sets &lt;code&gt;aria-busy=&amp;quot;true&amp;quot;&lt;/code&gt;, triggering a skeleton layout that holds the exact geometry until the fetch resolves. If the visitor collapses the node or navigates away before the fetch completes, the stale promise sees that the pin is unchecked or detached and discards the result without touching the DOM.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Keeping every digit a scientist wrote</title>
  <link href="https://ptree.org/blog/keeping-recorded-precision.html"/>
  <id>https://ptree.org/blog/keeping-recorded-precision.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Almost every charting library and data pipeline treats floating-point numbers as disposable display strings: run toFixed(1) or round the JSON response to three significant digits and move on. On biological data that spans fourteen orders of magnitude, blanket rounding destroys real information while inventing fake precision at the same time.</summary>
  <content type="html">&lt;p&gt;Almost every charting library and data pipeline treats floating-point numbers as disposable display strings: run &lt;code&gt;toFixed(1)&lt;/code&gt; or round the JSON response to three significant digits and move on. On biological data that spans fourteen orders of magnitude, blanket rounding destroys real information while inventing fake precision at the same time.&lt;/p&gt;
&lt;p&gt;In our own precision audit, rounding the wire format to three significant digits shifted box-whisker positions by several device pixels and turned a fossil interval of &lt;code&gt;201.4–227.3 Ma&lt;/code&gt; into &lt;code&gt;201–227&lt;/code&gt;. Rounding categorical weights independently turned a &lt;code&gt;0.25&lt;/code&gt; minority tail beside &lt;code&gt;999,999.75&lt;/code&gt; into &lt;code&gt;1,000,000&lt;/code&gt;, which made the readout falsely claim &lt;code&gt;&amp;quot;all&amp;quot;&lt;/code&gt;. Double rounding corrupts plain text too: a value just under &lt;code&gt;1.05&lt;/code&gt; rounds to &lt;code&gt;1.05&lt;/code&gt; on the wire and then to &lt;code&gt;1.1&lt;/code&gt; in a two-digit label, whereas formatting the original number gives &lt;code&gt;1.0&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Spreadsheets and binary floats invent digits&lt;/h2&gt;
&lt;p&gt;The problem starts long before the browser sees a number. Published trait tables carry three common kinds of fake digits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;AVONET&amp;#39;s Excel sheet stores the common starling&amp;#39;s mass as &lt;code&gt;77.09999999999999&lt;/code&gt;, which is IEEE-754&amp;#39;s binary approximation of &lt;code&gt;77.1&lt;/code&gt;. Parquet 32-bit floats in FishBase and SeaLifeBase similarly widen to 64-bit doubles with binary tails that the original author never typed.&lt;/li&gt;
&lt;li&gt;EOL TraitBank converts a European hedgehog&amp;#39;s 42-day weaning age into &lt;code&gt;0.114992&lt;/code&gt; years using &lt;code&gt;365.2425&lt;/code&gt;-day years. Converting that back yields &lt;code&gt;42.0009&lt;/code&gt; days instead of &lt;code&gt;42&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;BIRDBASE stores a computed mean for the European robin to sixteen digits while formatting the column to &lt;code&gt;0.00&lt;/code&gt;. AVONET stores the common raven&amp;#39;s mass formatted to &lt;code&gt;0.0&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Preserving resolution instead of significant-digit counts&lt;/h2&gt;
&lt;p&gt;Ptree&amp;#39;s quantity layer separates a number&amp;#39;s value (kept unrounded for drawing and math) from its recorded display resolution (&lt;code&gt;precision = { resolution, bounds }&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Tracking resolution as a step size in the coordinate&amp;#39;s unit, rather than as a significant-digit count, handles zero cleanly (&lt;code&gt;0.00&lt;/code&gt; has resolution &lt;code&gt;0.01&lt;/code&gt;, while a bare &lt;code&gt;0&lt;/code&gt; states none) and survives unit conversions. Multiplying a unit multiplies the resolution by the same factor, and temperature offsets leave it unchanged. When Ptree converts a unit, it keeps 15 significant digits, which is the exact decimal precision that every IEEE-754 double round-trips. Under that rule, &lt;code&gt;44 mm&lt;/code&gt; becomes &lt;code&gt;0.044 m&lt;/code&gt;, &lt;code&gt;2.3 years&lt;/code&gt; becomes &lt;code&gt;840.075 days&lt;/code&gt;, and &lt;code&gt;274.15 K&lt;/code&gt; becomes &lt;code&gt;1 °C&lt;/code&gt;, stripping 16th-digit float noise without needing a big-decimal library.&lt;/p&gt;
&lt;p&gt;At capture time, Ptree reads the publisher&amp;#39;s actual reporting tokens (stored in text columns so trailing zeros survive) and inspects spreadsheet column formats. When every cell in a column shares one fixed-decimal format (&lt;code&gt;0.0&lt;/code&gt; in AVONET, &lt;code&gt;0.00&lt;/code&gt; in BIRDBASE and eight of TreeTraits&amp;#39; nine traits), that format supplies the column&amp;#39;s resolution. Variable formats that change with magnitude, such as SquamBase switching from &lt;code&gt;0.00&lt;/code&gt; under 25 to &lt;code&gt;0&lt;/code&gt; above 500, are display rounding and claim no resolution. Excel date formats never state precision either. For TraitBank durations, Ptree reads the raw measurement in its original unit rather than TraitBank&amp;#39;s pre-converted years.&lt;/p&gt;
&lt;h2&gt;Singletons and honest rollup bounds&lt;/h2&gt;
&lt;p&gt;A subtle bug in log-scale rollups is passing a clade with a single measured species through &lt;code&gt;exp(log(value))&lt;/code&gt;, which turns an exact &lt;code&gt;62035&lt;/code&gt; into &lt;code&gt;62035.00000000005&lt;/code&gt;. Ptree&amp;#39;s numeric folds preserve singletons verbatim, keeping both value and resolution intact. An odd median likewise takes its middle record directly without passing through &lt;code&gt;log&lt;/code&gt; and &lt;code&gt;exp&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When multiple records roll up into a clade mean, documented rounding half-steps &lt;code&gt;±eᵢ&lt;/code&gt; propagate conservatively as &lt;code&gt;Σ(wᵢ eᵢ) / Σwᵢ&lt;/code&gt;. Ptree never claims a &lt;code&gt;√n&lt;/code&gt; reduction, because errors from a shared source can be correlated. Unknown input precision stays &lt;code&gt;null&lt;/code&gt; rather than turning silently into zero uncertainty. Aggregate quantiles deliberately withhold fabricated confidence intervals while flagging histogram bin width (&lt;code&gt;binned&lt;/code&gt;) honestly in the provenance panel.&lt;/p&gt;
&lt;p&gt;At display time, one shared numeric formatter chooses the shortest common unit rung across a readout and formats each value to the leading decade of its recorded resolution. Any number with no recorded resolution keeps every digit that it carries. The tree never rounds away a decimal that a scientist actually wrote, and never prints fourteen digits of float garbage that they did not.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Filtering taxa by location with Path2D</title>
  <link href="https://ptree.org/blog/location-filtering-path2d.html"/>
  <id>https://ptree.org/blog/location-filtering-path2d.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Ptree can dim every clade on screen that does not occur near your browser's coordinates or inside any country, state, sea, or basin you pick on the world map. Click Madagascar on the primates and five families light up, every one of them a lemur; switch to the Amazon basin and five completely different monkey families answer, with zero overlap. Adding that entire feature took under 200 lines of client JavaScript and required no new database table, no spatial index on the server, and no polygon clipping library.</summary>
  <content type="html">&lt;p&gt;Ptree can dim every clade on screen that does not occur near your browser&amp;#39;s coordinates or inside any country, state, sea, or basin you pick on the world map. Click &lt;a href=&quot;/#GBIF/Spread/798&amp;amp;fossils=hide&amp;amp;location=-18.9,47.5&quot;&gt;Madagascar on the primates&lt;/a&gt; and five families light up, every one of them a lemur; switch to the Amazon basin and five completely different monkey families answer, with zero overlap. Adding that entire feature took under 200 lines of client JavaScript and required no new database table, no spatial index on the server, and no polygon clipping library.&lt;/p&gt;
&lt;h2&gt;Why the data is already in the right shape&lt;/h2&gt;
&lt;p&gt;Ptree&amp;#39;s world map renders both taxon ranges and selectable geographic regions as SVG &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; strings in the same equirectangular coordinate space. Every taxon&amp;#39;s range arrives with its tile data as a compact SVG path string (combining expert ranges such as the Mammal Diversity Database with iNaturalist geomodel outlines). Every selectable country and province in the location picker is an SVG &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; inside the map&amp;#39;s &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; in the exact same projection.&lt;/p&gt;
&lt;p&gt;Because both sides speak native SVG path syntax in one shared coordinate system, testing whether a taxon occurs at a point &lt;code&gt;(x, y)&lt;/code&gt; needs no GeoJSON parsing, Turf, 500 KB H3 hexagon library, or backend query. The browser&amp;#39;s own 2D canvas engine already implements exact point-in-path hit testing for SVG path strings.&lt;/p&gt;
&lt;h2&gt;Point testing with a 1×1 &lt;code&gt;OffscreenCanvas&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The location module allocates a single &lt;code&gt;OffscreenCanvas(1, 1)&lt;/code&gt; and its 2D context once at startup:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const hit = new OffscreenCanvas(1, 1).getContext(&amp;quot;2d&amp;quot;);
const paths = new WeakMap();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When a taxon&amp;#39;s range object is tested, Ptree compiles its SVG path string into a native &lt;code&gt;Path2D&lt;/code&gt; once and memoizes it in the &lt;code&gt;WeakMap&lt;/code&gt; keyed by the range object itself. Garbage collection frees the &lt;code&gt;Path2D&lt;/code&gt; automatically if the range leaves memory. Testing whether a coordinate falls inside that range is a single native call:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;hit.isPointInPath(path, x, y)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For browser geolocation or a map click, the &lt;code&gt;(latitude, longitude)&lt;/code&gt; pair projects straight into the map&amp;#39;s equirectangular &lt;code&gt;(x, y)&lt;/code&gt; and tests against every visible taxon&amp;#39;s &lt;code&gt;Path2D&lt;/code&gt; in microseconds. The marker on the map is a single &lt;code&gt;&amp;lt;use href=&amp;quot;#point&amp;quot;&amp;gt;&lt;/code&gt; element moved to &lt;code&gt;(x, y)&lt;/code&gt; and parked at &lt;code&gt;-1000&lt;/code&gt; when inactive so no DOM node is created or destroyed. Because the coordinates live on that one SVG symbol instead of on &lt;code&gt;:root&lt;/code&gt;, moving the pin never triggers a document-wide CSS restyle.&lt;/p&gt;
&lt;h2&gt;Hover scrubbing on the sidebar world map&lt;/h2&gt;
&lt;p&gt;Because &lt;code&gt;Path2D&lt;/code&gt; hit testing runs in microseconds, the sidebar thumbnail map previews any spot on Earth directly on hover without waiting for a click. On &lt;code&gt;pointerenter&lt;/code&gt;, the location module caches &lt;code&gt;mapSvg.getScreenCTM().inverse()&lt;/code&gt; once so each &lt;code&gt;pointermove&lt;/code&gt; projects the pointer into SVG world units with plain multiplication, zero layout queries, and zero per-frame allocations. Coordinates quantize to &lt;code&gt;0.5&lt;/code&gt; world units (about &lt;code&gt;0.18°&lt;/code&gt;), reposition the same &lt;code&gt;#point&lt;/code&gt; crosshair, and trigger the lighting pass live.&lt;/p&gt;
&lt;p&gt;CSS reveals the crosshair only while the map is hovered when no location is committed, with no &lt;code&gt;:has()&lt;/code&gt; selector and no extra state class on &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;body:not(.Located) figure.map:not(:hover) .location { display: none; }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Leaving the map or pressing down to expand it restores the committed location marker and brings every tile and summary back to rest.&lt;/p&gt;
&lt;h2&gt;Testing whole countries and provinces&lt;/h2&gt;
&lt;p&gt;A country or province is a polygon, not a single point: a species living only in southern Chile should still match when you pick Chile, even if it misses the country&amp;#39;s centroid. Rather than running polygon-polygon intersection in JavaScript, Ptree samples a grid of interior points inside the chosen region&amp;#39;s own &lt;code&gt;Path2D&lt;/code&gt; using the same &lt;code&gt;hit.isPointInPath()&lt;/code&gt; call.&lt;/p&gt;
&lt;p&gt;Sampling reads the region&amp;#39;s bounding box, walks a grid across it, keeps the grid points that fall inside the region&amp;#39;s path (rounded to tenths of a unit), and caches the resulting coordinate list directly on &lt;code&gt;place.dataset.points&lt;/code&gt; in the DOM. If you pick France, switch to Japan, and return to France, the sampled interior points are already sitting on the &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; element. Multi-region selections (like &lt;code&gt;US-TN|US-NC&lt;/code&gt; in the URL) simply pool the sampled points from each selected place.&lt;/p&gt;
&lt;p&gt;Testing a taxon against a selected region then checks &lt;code&gt;points.some(([x, y]) =&amp;gt; hit.isPointInPath(rangePath, x, y))&lt;/code&gt;. The first hit short-circuits immediately.&lt;/p&gt;
&lt;h2&gt;Cascading the result onto the tree&lt;/h2&gt;
&lt;p&gt;Once Ptree knows which displayed taxa match the active point, hover coordinate, or region, it never rebuilds the tree or strips out colors. It sets &lt;code&gt;data-out&lt;/code&gt; on non-matching tiles so CSS dims their names and icons while keeping the active property overlay readable, dims their connector stroke opacity in the same pass, and feeds the match mask into &lt;a href=&quot;/blog/live-filtered-summaries.html&quot;&gt;live client-side filtered summaries&lt;/a&gt; so every property readout and box-whisker plot updates under the cursor. Location composes cleanly with any active property filter: endemic, under five grams, and in the Sahara runs as three independent predicates on the exact same visible tree.&lt;/p&gt;
&lt;p&gt;Nothing in the build pipeline is precomputed for every &lt;code&gt;(taxon, country)&lt;/code&gt; pair, a cross-product of millions of taxa by thousands of provinces that would add gigabytes of storage and a new invalidation stage. Keeping range shapes and place outlines in one shared SVG projection lets the browser&amp;#39;s built-in &lt;code&gt;Path2D&lt;/code&gt; engine answer the query directly on the client.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Mapping what biology has never measured</title>
  <link href="https://ptree.org/blog/mapping-unmeasured-biology.html"/>
  <id>https://ptree.org/blog/mapping-unmeasured-biology.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="biology" label="Biology"/>
  <summary>Most data visualizations hide empty cells. They fill gaps with defaults, impute family averages silently, or draw missing data the same pale shade as zero. In Ptree, gray has one strict meaning across all 42 properties: nobody has measured that branch yet. Keeping missingness visible across all of life exposes a live map of human scientific bias right beside the biology.</summary>
  <content type="html">&lt;p&gt;Most data visualizations hide empty cells. They fill gaps with defaults, impute family averages silently, or draw missing data the same pale shade as zero. In Ptree, gray has one strict meaning across all 42 properties: nobody has measured that branch yet. Keeping missingness visible across all of life exposes a live map of human scientific bias right beside the biology.&lt;/p&gt;
&lt;h2&gt;The vertebrate cliff&lt;/h2&gt;
&lt;p&gt;Look at the live coverage across nine major clades and six cross-kingdom properties in GBIF today, read directly from Ptree’s rollups at build time:&lt;/p&gt;
&lt;p&gt;Four terrestrial vertebrate classes glow almost solid, and then the chart falls off a cliff.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/Mass&amp;amp;fossils=hide&quot;&gt;Mass&lt;/a&gt;. We have body weights for &lt;strong&gt;87.1%&lt;/strong&gt; of living lizards and snakes (&lt;code&gt;11,549&lt;/code&gt; of &lt;code&gt;13,262&lt;/code&gt;), &lt;strong&gt;79.2%&lt;/strong&gt; of birds (&lt;code&gt;11,164&lt;/code&gt; of &lt;code&gt;14,089&lt;/code&gt;), &lt;strong&gt;62.4%&lt;/strong&gt; of mammals (&lt;code&gt;5,754&lt;/code&gt; of &lt;code&gt;9,225&lt;/code&gt;), and &lt;strong&gt;29.8%&lt;/strong&gt; of amphibians (&lt;code&gt;2,647&lt;/code&gt; of &lt;code&gt;8,885&lt;/code&gt;). Step across into invertebrates and plants, and the color vanishes: &lt;strong&gt;9.1%&lt;/strong&gt; of mollusks, &lt;strong&gt;0.8%&lt;/strong&gt; of plants (&lt;code&gt;4,326&lt;/code&gt; of &lt;code&gt;536,654&lt;/code&gt;), &lt;strong&gt;0.002%&lt;/strong&gt; of insects (&lt;strong&gt;20&lt;/strong&gt; out of &lt;strong&gt;1,164,354&lt;/strong&gt; species), &lt;strong&gt;0%&lt;/strong&gt; of fungi, and &lt;strong&gt;0%&lt;/strong&gt; of nematodes.&lt;/li&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/Conservation&amp;amp;fossils=hide&quot;&gt;Conservation&lt;/a&gt;. The IUCN Red List has assessed &lt;strong&gt;89.1%&lt;/strong&gt; of birds, &lt;strong&gt;87.3%&lt;/strong&gt; of amphibians, &lt;strong&gt;78.6%&lt;/strong&gt; of squamates, and &lt;strong&gt;77.7%&lt;/strong&gt; of mammals. Outside land vertebrates, &lt;strong&gt;13.4%&lt;/strong&gt; of plants (&lt;code&gt;71,891&lt;/code&gt; of &lt;code&gt;538,406&lt;/code&gt;), &lt;strong&gt;8.4%&lt;/strong&gt; of mollusks, &lt;strong&gt;1.3%&lt;/strong&gt; of insects (&lt;code&gt;14,663&lt;/code&gt; of &lt;code&gt;1.16 million&lt;/code&gt;), and &lt;strong&gt;0.39%&lt;/strong&gt; of fungi (&lt;code&gt;646&lt;/code&gt; of &lt;code&gt;167,258&lt;/code&gt;) carry an assessment.&lt;/li&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/PopulationTrend&amp;amp;fossils=hide&quot;&gt;Population trend&lt;/a&gt;, and the gap grows sharper still. Humanity tracks whether populations are rising, stable, or falling for &lt;strong&gt;80.5%&lt;/strong&gt; of birds and &lt;strong&gt;51.1%&lt;/strong&gt; of mammals, compared with &lt;strong&gt;6.1%&lt;/strong&gt; of plants, &lt;strong&gt;1.2%&lt;/strong&gt; of mollusks, &lt;strong&gt;0.23%&lt;/strong&gt; of fungi, and &lt;strong&gt;0.18%&lt;/strong&gt; of insects (&lt;code&gt;2,121&lt;/code&gt; of &lt;code&gt;1,164,450&lt;/code&gt;, fewer than two species in every thousand).&lt;/li&gt;
&lt;li&gt;Open &lt;a href=&quot;/#GBIF/OffspringCount&amp;amp;fossils=hide&quot;&gt;Offspring count&lt;/a&gt;. Clutch and litter sizes are recorded for &lt;strong&gt;56.3%&lt;/strong&gt; of birds, &lt;strong&gt;43.6%&lt;/strong&gt; of squamates, &lt;strong&gt;38.3%&lt;/strong&gt; of mammals, and &lt;strong&gt;25.6%&lt;/strong&gt; of amphibians. Across &lt;strong&gt;1,164,450&lt;/strong&gt; insect species, open trait tables supply literally &lt;strong&gt;1&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Even the charismatic clades are mostly unknown&lt;/h2&gt;
&lt;p&gt;Vertebrates look well covered on body mass and extinction risk, until you switch to a harder life-history measurement like &lt;a href=&quot;/#GBIF/Longevity&amp;amp;fossils=hide&quot;&gt;Longevity&lt;/a&gt; or &lt;a href=&quot;/#GBIF/Maturity&amp;amp;fossils=hide&quot;&gt;Maturity&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Even in mammals, the best-studied class on Earth, lifespan records cover only &lt;strong&gt;26.4%&lt;/strong&gt; of species (&lt;code&gt;2,633&lt;/code&gt; of &lt;code&gt;9,991&lt;/code&gt;), and age at maturity covers &lt;strong&gt;18.8%&lt;/strong&gt;. In birds, longevity drops to &lt;strong&gt;10.7%&lt;/strong&gt; and maturity to &lt;strong&gt;4.5%&lt;/strong&gt;. In amphibians, longevity sits at &lt;strong&gt;7.1%&lt;/strong&gt; and maturity at &lt;strong&gt;4.3%&lt;/strong&gt;. Outside vertebrates, lifespan virtually disappears: &lt;strong&gt;1.0%&lt;/strong&gt; of plants, &lt;strong&gt;0.27%&lt;/strong&gt; of mollusks, &lt;strong&gt;12&lt;/strong&gt; insect species out of 1.16 million, and &lt;strong&gt;1&lt;/strong&gt; fungus out of 167,258.&lt;/p&gt;
&lt;p&gt;You can weigh a museum skin or score a bird’s range from field checklists in an afternoon. Measuring how long an animal lives in the wild takes decades of banding, captivity records, or aging bones, and the gray wash on the tree exposes that cost immediately.&lt;/p&gt;
&lt;h2&gt;Where the spotlight reverses&lt;/h2&gt;
&lt;p&gt;Coverage bias is not simply &amp;quot;vertebrates good, everything else bad.&amp;quot; Each research community measures what its own field cares about, and leaves the rest of life dark:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Switch to &lt;a href=&quot;/#GBIF/GramStain&amp;amp;fossils=hide&quot;&gt;Gram stain&lt;/a&gt; or &lt;a href=&quot;/#GBIF/RiskGroup&amp;amp;fossils=hide&quot;&gt;Risk group&lt;/a&gt;. Every animal, plant, and fungus turns 100% gray, while &lt;a href=&quot;/#GBIF/GramStain/3&amp;amp;fossils=hide&quot;&gt;Bacteria&lt;/a&gt; lights up at &lt;strong&gt;55.9%&lt;/strong&gt; on Gram stain (&lt;code&gt;13,323&lt;/code&gt; of &lt;code&gt;23,826&lt;/code&gt;) and &lt;strong&gt;49.5%&lt;/strong&gt; on biosafety risk group (&lt;code&gt;11,792&lt;/code&gt; of &lt;code&gt;23,826&lt;/code&gt;). Yet switch Bacteria to &lt;a href=&quot;/#GBIF/Nutrition/3&amp;amp;fossils=hide&quot;&gt;Nutrition&lt;/a&gt;, and coverage drops to &lt;strong&gt;12.8%&lt;/strong&gt; (&lt;code&gt;3,054&lt;/code&gt; species), heavily skewed toward Cyanobacteria and lab-cultured pathogens because most environmental microbes have never been grown in pure culture.&lt;/li&gt;
&lt;li&gt;Switch to &lt;a href=&quot;/#GBIF/Spread&amp;amp;fossils=hide&quot;&gt;Spread&lt;/a&gt;. Here &lt;a href=&quot;/#GBIF/Spread/6&amp;amp;fossils=hide&quot;&gt;Plantae&lt;/a&gt; outruns every animal class at &lt;strong&gt;76.4%&lt;/strong&gt; coverage (&lt;code&gt;411,253&lt;/code&gt; of &lt;code&gt;538,406&lt;/code&gt; species) thanks to global checklists of native, endemic, and introduced floras, ahead of amphibians (&lt;strong&gt;59.9%&lt;/strong&gt;), mammals (&lt;strong&gt;45.3%&lt;/strong&gt;), and birds (&lt;strong&gt;37.8%&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;Switch to &lt;a href=&quot;/#GBIF/DroughtResistance/6&amp;amp;fossils=hide&quot;&gt;Drought resistance&lt;/a&gt; (&lt;strong&gt;10.4%&lt;/strong&gt; of plants, &lt;code&gt;55,232&lt;/code&gt; species) or &lt;a href=&quot;/#GBIF/LeafEconomy/6&amp;amp;fossils=hide&quot;&gt;Leaf economy&lt;/a&gt; (&lt;strong&gt;11.5%&lt;/strong&gt;, &lt;code&gt;60,755&lt;/code&gt; species). Inside &lt;code&gt;Plantae&lt;/code&gt;, woody trees, crops, and temperate floras glow richly while hundreds of thousands of tropical understory herbs and bryophytes fade to gray.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Why keeping gray honest matters&lt;/h2&gt;
&lt;p&gt;If a tile has data for only 0.5% of its species, painting it full saturation tricks every reader into treating a handful of sampled outliers as the truth about an entire order. Washing low-coverage tiles toward neutral gray and printing the exact represented count turns missingness into first-class information.&lt;/p&gt;
&lt;p&gt;For a curious visitor, that honesty keeps a bird-biased or mammal-biased dataset from pretending to speak for all of life. For a working biologist or a graduate student looking for a thesis, flipping through the 42 properties on a favorite phylum turns Ptree into a map of open territory: every gray branch beside a brightly lit sibling is a measurement waiting for someone to make it.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Matching scientific trees when one name means three organisms</title>
  <link href="https://ptree.org/blog/matching-scientific-trees.html"/>
  <id>https://ptree.org/blog/matching-scientific-trees.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Ptree displays eleven taxonomic trees side by side (GBIF, Catalogue of Life, ITIS, Open Tree of Life, Encyclopedia of Life, NCBI, World Flora Online, the Paleobiology Database, GTDB, ICTV, and SILVA) and lets you switch trees while staying on the same organism. Joining those trees sounds like a string join on scientific names until you look at how biological nomenclature actually works.</summary>
  <content type="html">&lt;p&gt;Ptree displays eleven taxonomic trees side by side (GBIF, Catalogue of Life, ITIS, Open Tree of Life, Encyclopedia of Life, NCBI, World Flora Online, the Paleobiology Database, GTDB, ICTV, and SILVA) and lets you switch trees while staying on the same organism. Joining those trees sounds like a string join on scientific names until you look at how biological nomenclature actually works.&lt;/p&gt;
&lt;h2&gt;Why scientific names cannot be keys&lt;/h2&gt;
&lt;p&gt;The international codes for zoology, botany, and prokaryotes govern names independently, so the exact same Latin name legally refers to unrelated organisms in different kingdoms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Batis&lt;/em&gt; is a coastal flowering plant (Bataceae), an African flycatcher (Platysteiridae), and a moth.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Cytherea elegans&lt;/em&gt; is both a bee fly and an Eocene fossil clam.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Brachypodella&lt;/em&gt; is both a Caribbean land snail and a leaf beetle.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Homarus&lt;/em&gt; is the clawed lobster, while &lt;em&gt;Macropodinae&lt;/em&gt; is both the kangaroos and the paradise fishes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even inside one kingdom, two sources may file the same species under different accepted genera (such as &lt;em&gt;Senecio&lt;/em&gt; transfers in Asteraceae), spell a Latin gender ending differently (&lt;em&gt;Plegiocidaris coronata&lt;/em&gt; vs &lt;em&gt;P. coronatus&lt;/em&gt;), or disagree on whether an order belongs in one phylum or another.&lt;/p&gt;
&lt;h2&gt;Building content-hash identity clusters&lt;/h2&gt;
&lt;p&gt;Ptree separates identity from presentation across two SQLite stores: an identity store holding the final cluster memberships, and an evidence ledger recording every assertion, match, and refusal that produced them. Each cluster is identified by a content hash of its member records rather than an arbitrary auto-incrementing integer.&lt;/p&gt;
&lt;p&gt;The crosswalk runs in seven deterministic stages. Direct external identifiers (such as Catalogue of Life and WoRMS IDs carried by GBIF or Wikidata) and shared basionyms carry the highest weight, because a basionym pins two combinations to the same physical type specimen even when taxonomists move the species to a new genus. Scientific-name matching then compares normalized names, authors, and kingdoms, refusing joins where a source&amp;#39;s own standing marks a record ambiguous or where &lt;code&gt;pile&lt;/code&gt; diagnostics detect an over-merged homonym.&lt;/p&gt;
&lt;p&gt;After unioning evidence, phylum and class splitters check whether any cluster spans incompatible higher groups. In the 2026-11-16 build, the class splitter detected 297 mixed clusters (20 of them single-taxon outliers pulled in by a bad upstream identifier) and split them apart. Cross-source lineage disagreement is not an automatic veto, because taxonomists legitimately disagree on higher classification (such as where a microbial order sits in GTDB versus NCBI). Instead, Ptree checks whether two sources&amp;#39; own assertions contradict at the organism level and uses the structural splitters to catch true homonym collisions.&lt;/p&gt;
&lt;h2&gt;Switching backbones without searching at request time&lt;/h2&gt;
&lt;p&gt;Not every taxon exists in every tree. If you are looking at a virus phylum in NCBI and switch to SILVA (a ribosomal RNA database with no viruses), or look at an insect family in GBIF and switch to World Flora Online, where should the viewer land?&lt;/p&gt;
&lt;p&gt;Walking the tree at request time is too slow: switching a large unrepresented clade into another tree can traverse tens of thousands of nodes and stall for tens of seconds, while bounding the walk to keep it fast changes the answer depending on budget. Instead, the build precomputes every non-exact landing across all 110 ordered pairs of backbones once per generation and stores only rows whose destination differs from their parent&amp;#39;s.&lt;/p&gt;
&lt;p&gt;The fold walks each source tree leaves-first:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A node whose cluster has a served member in the destination tree lands on that member directly.&lt;/li&gt;
&lt;li&gt;Any node without an exact counterpart projects from its represented children, giving each represented child equal weight at every fork so a deeply sampled lineage does not drown out smaller relatives.&lt;/li&gt;
&lt;li&gt;Among destination candidates holding at least two-thirds of the subject&amp;#39;s weight, the pure candidate with the most weight wins. A destination is pure if its exact counterpart or its reverse projection back into the source tree stays inside the subject. That rule stops GBIF Animalia from landing on Protostomia (which holds two-thirds of phyla by sheer count) when Metazoa holds all of it and nothing else, and stops a single misplaced homonym from dragging a whole phylum sideways.&lt;/li&gt;
&lt;li&gt;Along a unary chain of pure destinations, the subject&amp;#39;s rank selects the matching zoom level. Source roots require unanimous agreement so GBIF&amp;#39;s Life lands on each destination&amp;#39;s root rather than on Eukaryota.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To verify the rule rather than eyeball examples, a holdout benchmark hides the known exact counterpart of every matched node across all 110 backbone pairs and measures whether descendant projection recovers the exact node, a broader ancestor, a narrower descendant, or a sideways miss. Every threshold in the fold was chosen on that holdout measurement. At serving time, &lt;code&gt;/{tree}/{id}/in/{tree2}&lt;/code&gt; climbs the source lineage in SQLite (exact counterpart, stored override, or parent) and returns the complete lineage and page offsets synchronously in one response.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Morphing box-whisker plots with @property</title>
  <link href="https://ptree.org/blog/morphing-box-whiskers.html"/>
  <id>https://ptree.org/blog/morphing-box-whiskers.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Hovering across taxa in Ptree while a numeric overlay like Mass, Longevity, or Temperature is active glides the legend's box-whisker plot smoothly from one clade's distribution to the next. Whiskers, interquartile box, median tick, geometric-mean diamond, and endpoint labels all move together, yet the legend code contains no tweening, no timers, and no layout measurement.</summary>
  <content type="html">&lt;p&gt;Hovering across taxa in Ptree while a numeric overlay like &lt;a href=&quot;/#GBIF/Mass&quot;&gt;Mass&lt;/a&gt;, &lt;a href=&quot;/#GBIF/Longevity&quot;&gt;Longevity&lt;/a&gt;, or &lt;a href=&quot;/#GBIF/Temperature&quot;&gt;Temperature&lt;/a&gt; is active glides the legend&amp;#39;s box-whisker plot smoothly from one clade&amp;#39;s distribution to the next. Whiskers, interquartile box, median tick, geometric-mean diamond, and endpoint labels all move together, yet the legend code contains no tweening, no timers, and no layout measurement.&lt;/p&gt;
&lt;h2&gt;Six registered percentages on one static track&lt;/h2&gt;
&lt;p&gt;Every numeric property has its own permanent &lt;code&gt;.track&lt;/code&gt; element rendered in the HTML at build time, carrying its own inline &lt;code&gt;--ramp&lt;/code&gt; background so switching properties slides a carousel of complete keys without flashing neighboring colors. Six CSS custom properties are registered as &lt;code&gt;&amp;lt;percentage&amp;gt;&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;@property --p5 { syntax: &amp;quot;&amp;lt;percentage&amp;gt;&amp;quot;; inherits: true; initial-value: 0%; }
@property --q1 { syntax: &amp;quot;&amp;lt;percentage&amp;gt;&amp;quot;; inherits: true; initial-value: 0%; }
@property --med { syntax: &amp;quot;&amp;lt;percentage&amp;gt;&amp;quot;; inherits: true; initial-value: 0%; }
@property --q3 { syntax: &amp;quot;&amp;lt;percentage&amp;gt;&amp;quot;; inherits: true; initial-value: 0%; }
@property --p95 { syntax: &amp;quot;&amp;lt;percentage&amp;gt;&amp;quot;; inherits: true; initial-value: 0%; }
@property --gmean { syntax: &amp;quot;&amp;lt;percentage&amp;gt;&amp;quot;; inherits: true; initial-value: 0%; }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Because each variable is registered with &lt;code&gt;&amp;lt;percentage&amp;gt;&lt;/code&gt;, the &lt;code&gt;.track&lt;/code&gt; transitions all six directly:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;fieldset .track {
  transition: --p5 var(--shift) ease, --q1 var(--shift) ease, --med var(--shift) ease,
              --q3 var(--shift) ease, --p95 var(--shift) ease, --gmean var(--shift) ease;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The child elements read those inherited variables through &lt;code&gt;inset-inline&lt;/code&gt; and &lt;code&gt;calc()&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;fieldset .track .whisker {
  inset-inline: min(var(--p5), var(--p95)) calc(100% - max(var(--p5), var(--p95)));
}
fieldset .track .box {
  inset-inline: min(var(--q1), var(--q3)) calc(100% - max(var(--q1), var(--q3)));
}
fieldset .track .median { inset-inline-start: calc(var(--med) - 1px); }
fieldset .track .gmean  { inset-inline-start: calc(var(--gmean) - 4px); }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using &lt;code&gt;min()&lt;/code&gt; and &lt;code&gt;max()&lt;/code&gt; handles channel properties like temperature or depth, where independently summarized lower and upper bounds can occasionally cross without mutating either underlying number.&lt;/p&gt;
&lt;p&gt;When you hover a taxon, the legend updater computes the six positions as percentages along the property&amp;#39;s fixed log or linear domain, writes each changed custom property once, and updates two text nodes (&lt;code&gt;.lolab&lt;/code&gt; and &lt;code&gt;.hilab&lt;/code&gt;). The browser interpolates every primitive in CSS.&lt;/p&gt;
&lt;h2&gt;Crossfading modes instead of morphing shapes&lt;/h2&gt;
&lt;p&gt;A clade with many measured descendants shows a whisker (&lt;code&gt;p5&lt;/code&gt;–&lt;code&gt;p95&lt;/code&gt;), an interquartile box (&lt;code&gt;q1&lt;/code&gt;–&lt;code&gt;q3&lt;/code&gt;), a vertical &lt;code&gt;.median&lt;/code&gt; bar, and a &lt;code&gt;.gmean&lt;/code&gt; diamond. A species or clade with a single measured contributor (&lt;code&gt;count === 1&lt;/code&gt;) has no spread, only one point. Rather than transforming the median line into a diamond in JavaScript, the track keeps &lt;code&gt;.median&lt;/code&gt; and &lt;code&gt;.point&lt;/code&gt; as two separate elements bound to the same &lt;code&gt;--med&lt;/code&gt; position. Toggling &lt;code&gt;.point&lt;/code&gt; on &lt;code&gt;.track&lt;/code&gt; simply crossfades their opacities:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;fieldset .track.point :is(.whisker, .box, .median, .lolab),
fieldset .track:not(.point, .envelope) .point {
  opacity: 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Envelope properties (like depth, which carries both an observed outer extent and a normal range around a typical value) reuse the exact same six variables and elements, toggling &lt;code&gt;.nocore&lt;/code&gt;, &lt;code&gt;.noextent&lt;/code&gt;, or &lt;code&gt;.nocenter&lt;/code&gt; when a taxon reports only part of the envelope. Paired axes (like two-sided properties sharing a central &lt;code&gt;.origin&lt;/code&gt;) mirror the first track with &lt;code&gt;transform: scaleX(-1)&lt;/code&gt; and un-mirror its labels with &lt;code&gt;scale: -1 1&lt;/code&gt;, reusing the entire box-whisker stylesheet with zero duplicated geometry rules.&lt;/p&gt;
&lt;h2&gt;Endpoint labels that drop instead of colliding&lt;/h2&gt;
&lt;p&gt;Numeric labels sit outside the whisker&amp;#39;s ends so they never obscure the box. Two zero-sized anchor markers (&lt;code&gt;.glyphlo&lt;/code&gt; and &lt;code&gt;.glyphhi&lt;/code&gt;) ride at &lt;code&gt;min(var(--p5), var(--p95))&lt;/code&gt; and &lt;code&gt;max(var(--p5), var(--p95))&lt;/code&gt;, publishing &lt;code&gt;--glyph-low&lt;/code&gt; and &lt;code&gt;--glyph-high&lt;/code&gt; inside &lt;code&gt;anchor-scope&lt;/code&gt; on &lt;code&gt;.track&lt;/code&gt;. The &lt;code&gt;.lolab&lt;/code&gt; and &lt;code&gt;.hilab&lt;/code&gt; labels attach to those anchors with CSS anchor positioning:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-css&quot;&gt;fieldset .track :is(.lolab, .hilab) {
  position: absolute;
  position-visibility: no-overflow;
  inline-size: max-content;
  font-variant-numeric: tabular-nums;
}
fieldset .track .lolab {
  position-anchor: --glyph-low;
  position-area: inline-start;
  justify-self: unsafe end;
  margin-inline-end: var(--margin);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When a clade sits near the edge of the track and its outer label no longer fits outside the whisker, &lt;code&gt;position-visibility: no-overflow&lt;/code&gt; hides that label automatically instead of flipping it across the glyph into its peer. For a single-point taxon where &lt;code&gt;.lolab&lt;/code&gt; is empty, &lt;code&gt;.lolab:empty + .hilab:not(:empty)&lt;/code&gt; switches &lt;code&gt;.hilab&lt;/code&gt;&amp;#39;s &lt;code&gt;position-anchor&lt;/code&gt; to &lt;code&gt;--point&lt;/code&gt; so the lone value stays parked beside the diamond.&lt;/p&gt;
&lt;h2&gt;Range filter handles and the coverage waterline&lt;/h2&gt;
&lt;p&gt;Each numeric track also doubles as a dual-ended range filter via two overlapping native &lt;code&gt;&amp;lt;input type=&amp;quot;range&amp;quot;&amp;gt;&lt;/code&gt; elements (&lt;code&gt;.from&lt;/code&gt; and &lt;code&gt;.to&lt;/code&gt;). Both inputs have &lt;code&gt;pointer-events: none&lt;/code&gt; while their thumbs restore &lt;code&gt;pointer-events: auto&lt;/code&gt;, so drags land on whichever handle sits under the pointer. While &lt;code&gt;.Filtering&lt;/code&gt; is active, each thumb casts a &lt;code&gt;100vw&lt;/code&gt; &lt;code&gt;box-shadow&lt;/code&gt; outward (&lt;code&gt;--cast: -100vw&lt;/code&gt; on &lt;code&gt;.from&lt;/code&gt;, &lt;code&gt;100vw&lt;/code&gt; on &lt;code&gt;.to&lt;/code&gt;), clipped cleanly to the track by &lt;code&gt;overflow: hidden&lt;/code&gt; on the input itself. The area outside the chosen range dims behind a translucent veil with no extra overlay elements and no JavaScript width updates.&lt;/p&gt;
&lt;p&gt;Categorical legends follow the same pattern. Each &lt;code&gt;&amp;lt;dt&amp;gt;&lt;/code&gt; cell reads four registered &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; properties (&lt;code&gt;--p&lt;/code&gt;, &lt;code&gt;--cov&lt;/code&gt;, &lt;code&gt;--waterline&lt;/code&gt;, &lt;code&gt;--palette&lt;/code&gt;). Its &lt;code&gt;::before&lt;/code&gt; pseudo-element draws the solid category bar translated horizontally by &lt;code&gt;(max(var(--p), var(--palette)) - 1) * 100%&lt;/code&gt;, and its &lt;code&gt;::after&lt;/code&gt; pseudo-element draws a translucent &lt;code&gt;--nodata&lt;/code&gt; wash clipped to a sinusoidal wave via &lt;code&gt;clip-path: shape()&lt;/code&gt; and raised vertically by &lt;code&gt;--waterline&lt;/code&gt; (&lt;code&gt;Math.log1p(cov / 0.03) / Math.log1p(1 / 0.03)&lt;/code&gt;). Hovering any taxon writes &lt;code&gt;--cov&lt;/code&gt;, &lt;code&gt;--waterline&lt;/code&gt;, and each cell&amp;#39;s &lt;code&gt;--p&lt;/code&gt; once; both the horizontal share bars and the vertical confidence waterline glide on the compositor.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Neither MIT nor New Jersey</title>
  <link href="https://ptree.org/blog/neither-mit-nor-jersey.html"/>
  <id>https://ptree.org/blog/neither-mit-nor-jersey.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>Richard Gabriel's classic essay Worse is Better framed software design as a choice between two schools. The MIT approach fixes a complete, consistent interface first and lets the implementation absorb whatever complexity that demands. The New Jersey approach fixes implementation simplicity first and lets the interface carry the rough edges.</summary>
  <content type="html">&lt;p&gt;Richard Gabriel&amp;#39;s classic essay &lt;em&gt;Worse is Better&lt;/em&gt; framed software design as a choice between two schools. The MIT approach fixes a complete, consistent interface first and lets the implementation absorb whatever complexity that demands. The New Jersey approach fixes implementation simplicity first and lets the interface carry the rough edges.&lt;/p&gt;
&lt;p&gt;Both schools make the same mistake: they hold one side fixed and make the other side pay.&lt;/p&gt;
&lt;h2&gt;Co-optimizing interface and code&lt;/h2&gt;
&lt;p&gt;Ptree works from a third position. Neither the visual interface nor the underlying code is treated as a frozen spec; both move together until they settle into a joint minimum where their simplicity reinforces each other.&lt;/p&gt;
&lt;p&gt;In practice that means two things that feel unnatural in conventional product teams:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The interface is allowed to yield to the code. If a native CSS transition or a simpler layout law produces a cleaner interaction than what you first imagined, adopt the cleaner interaction instead of simulating the first sketch in JavaScript.&lt;/li&gt;
&lt;li&gt;A feature is judged by what it does to the architecture. Asking &amp;quot;can the code become &lt;em&gt;more&lt;/em&gt; invariant, simpler, and more decoupled by adding this feature?&amp;quot; catches bad cuts before they ship.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is why bug reports on Ptree frequently become design questions. If a visual tweak requires a wrapper &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, an exception list, or a JavaScript coordinate sync, that friction shows that the visible design and the underlying model disagree.&lt;/p&gt;
&lt;h2&gt;The right shape has no exceptions&lt;/h2&gt;
&lt;p&gt;A structural distinction with no visible purpose is dead weight; a visual exception with no structural distinction is a bug in the model. When the two line up, both sides compress at once:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every property key in Ptree&amp;#39;s legend sits in the same &lt;code&gt;1 / 1&lt;/code&gt; CSS grid cell and slides via one registered &lt;code&gt;--ki&lt;/code&gt; number. The visible carousel and the automatic intrinsic height are the same rule.&lt;/li&gt;
&lt;li&gt;Both categorical and numeric filters share one URL grammar (&lt;code&gt;key:a|b&lt;/code&gt; and &lt;code&gt;key:lo..hi&lt;/code&gt;), one popover list, and one &lt;code&gt;.Filtering&lt;/code&gt; class on &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;. The interface teaches one mental model because there is only one mechanism underneath.&lt;/li&gt;
&lt;li&gt;Three views (Tree, Icicle, Cladogram) share one sticky column header and one tile grammar instead of maintaining three parallel DOM arrangements.&lt;/li&gt;
&lt;li&gt;Switching between scientific and common names does not rebuild DOM text or crossfade two different strings on top of each other (which ghosts). Both spans live permanently inside the same grid cell; toggling &lt;code&gt;.Common&lt;/code&gt; on &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; staggers their opacities by half the transition clock so the leaving name clears before the arriving name fades in.&lt;/li&gt;
&lt;li&gt;In the numeric legend, a single measured species (&lt;code&gt;count === 1&lt;/code&gt;) does not morph a vertical median bar into a diamond in JavaScript. Two separate primitives share the same &lt;code&gt;--med&lt;/code&gt; custom property and simply crossfade opacity when &lt;code&gt;.point&lt;/code&gt; toggles, keeping both the visual transition and the CSS rule trivial.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When either the interface or the implementation needs an exception to satisfy the other, the search is not finished. Keep moving both sides until each becomes the simplest explanation of the other.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Serving offline Wikipedia inside the viewer</title>
  <link href="https://ptree.org/blog/offline-wikipedia-apache.html"/>
  <id>https://ptree.org/blog/offline-wikipedia-apache.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="backend" label="Backend"/>
  <summary>Every taxon card in Ptree includes a Wikipedia article tab inside a sandboxed &lt;iframe&gt;. Fetching live Wikipedia pages directly in the browser would break cross-origin theming, leak visitor requests to third-party servers, fail when upstream HTML structure shifts, and leave dead links to non-biological topics outside the tree. Instead, Ptree builds a taxon-only ZIM archive offline, serves it through a local Kiwix instance, and lets Apache inject the viewer's stylesheet into every proxied article on the fly.</summary>
  <content type="html">&lt;p&gt;Every taxon card in Ptree includes a Wikipedia article tab inside a sandboxed &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt;. Fetching live Wikipedia pages directly in the browser would break cross-origin theming, leak visitor requests to third-party servers, fail when upstream HTML structure shifts, and leave dead links to non-biological topics outside the tree. Instead, Ptree builds a taxon-only ZIM archive offline, serves it through a local Kiwix instance, and lets Apache inject the viewer&amp;#39;s stylesheet into every proxied article on the fly.&lt;/p&gt;
&lt;h2&gt;Building a taxon-only ZIM archive&lt;/h2&gt;
&lt;p&gt;A full English Wikipedia ZIM carries millions of articles and a massive Xapian full-text index. Ptree&amp;#39;s ZIM subset builder derives a much smaller taxon book (floored at 450,000 kept articles) using &lt;code&gt;@openzim/libzim&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Ptree opens articles by exact title (&lt;code&gt;/wiki/&amp;lt;lang&amp;gt;/&amp;lt;Title&amp;gt;&lt;/code&gt;) and runs taxon search against its own SQLite FTS index, so &lt;code&gt;.configIndexing(false, &amp;quot;eng&amp;quot;)&lt;/code&gt; drops the Xapian full-text index that otherwise roughly doubled the file for nothing. &lt;code&gt;node-libzim&lt;/code&gt; writes items uncompressed unless &lt;code&gt;COMPRESS: 1&lt;/code&gt; is passed, which would bloat HTML ~60×, so the builder sets &lt;code&gt;COMPRESS: 1&lt;/code&gt; for text, CSS, fonts, and SVGs inside 2 MiB Zstd clusters while leaving raster images (&lt;code&gt;png&lt;/code&gt;, &lt;code&gt;webp&lt;/code&gt;, &lt;code&gt;jpeg&lt;/code&gt;, &lt;code&gt;gif&lt;/code&gt;) raw.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;node-libzim&lt;/code&gt;&amp;#39;s &lt;code&gt;addIllustration&lt;/code&gt; expects a streaming &lt;code&gt;ContentProvider&lt;/code&gt; whose &lt;code&gt;feed()&lt;/code&gt; returns an empty blob to terminate; a naive callback re-feeds the icon forever and balloons the archive to hundreds of gigabytes. Because Kiwix sits behind &lt;code&gt;/wiki/&lt;/code&gt; without serving a standalone favicon, the builder omits illustrations cleanly. &lt;code&gt;libzim&lt;/code&gt;&amp;#39;s &lt;code&gt;Creator&lt;/code&gt; stores only what you hand it without parsing HTML, so the builder also owns the complete asset closure: it copies the shared MediaWiki skin bundles, extracts every &lt;code&gt;url(...)&lt;/code&gt; reference from those stylesheets and every kept article&amp;#39;s &lt;code&gt;src&lt;/code&gt;, &lt;code&gt;href&lt;/code&gt;, and &lt;code&gt;style&lt;/code&gt; attributes, drops PDFs, and rewrites redirects whose resolved target lands in the keep-set directly to that target without chains.&lt;/p&gt;
&lt;h2&gt;Rewriting article DOM at build time&lt;/h2&gt;
&lt;p&gt;Each kept article is parsed with &lt;code&gt;linkedom&lt;/code&gt; across parallel worker lanes (100 articles per worker batch). Because the rewrite operates on a real DOM rather than regular expressions, it cleanly removes balanced nested blocks that Apache&amp;#39;s line-based substitution could never match safely:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;for (const el of document.querySelectorAll(
  &amp;quot;script, table.infobox.biota, div.navbox, div.navbox-styles, table.sidebar&amp;quot;
)) el.remove();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Taxoboxes go because the tree and taxon card already present the taxonomy. Navboxes and their sibling &lt;code&gt;.navbox-styles&lt;/code&gt; TemplateStyles wrappers go because the tree is the navigation. Every &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; goes because the iframe is sandboxed without &lt;code&gt;allow-scripts&lt;/code&gt;, so script tags are dead bytes that only trigger console warnings.&lt;/p&gt;
&lt;p&gt;Every internal &lt;code&gt;&amp;lt;a href&amp;gt;&lt;/code&gt; is resolved through up to six redirect hops (including MediaWiki soft redirects):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;External &lt;code&gt;http&lt;/code&gt;/&lt;code&gt;https&lt;/code&gt; links get &lt;code&gt;target=&amp;quot;_blank&amp;quot; rel=&amp;quot;noopener&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Links whose resolved target is missing from the taxon keep-set are de-anchored (&lt;code&gt;a.replaceWith(...a.childNodes)&lt;/code&gt;), leaving readable plain text with zero broken links.&lt;/li&gt;
&lt;li&gt;Links that match a displayed taxon receive &lt;code&gt;.taxon&lt;/code&gt; plus one class per backbone that holds that taxon, along with &lt;code&gt;interestfor=&amp;quot;tree-choices&amp;quot;&lt;/code&gt;. Clicking or hovering a taxon link inside an article offers to jump straight to that organism in Ptree&amp;#39;s own tree.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Injecting viewer styling through Apache&lt;/h2&gt;
&lt;p&gt;Kiwix runs on an internal container port with &lt;code&gt;--threads=16&lt;/code&gt; serving the taxon ZIM. Apache proxies &lt;code&gt;/wiki/&lt;/code&gt; to Kiwix and runs a five-stage output filter chain:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-apache&quot;&gt;SetOutputFilter INFLATE;SUBSTITUTE;INCLUDES;BROTLI_COMPRESS;DEFLATE
Substitute &amp;quot;s|&amp;lt;/head&amp;gt;|&amp;lt;!--#include virtual=\&amp;quot;/inc/wiki-head.html\&amp;quot; --&amp;gt;&amp;lt;/head&amp;gt;|n&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Apache inflates Kiwix&amp;#39;s upstream response if needed, splices a single Server Side Include directly before &lt;code&gt;&amp;lt;/head&amp;gt;&lt;/code&gt;, lets &lt;code&gt;mod_include&lt;/code&gt; expand the head fragment (which links Ptree&amp;#39;s article stylesheet and theme styling), and recompresses the response with Brotli or Deflate before sending it to the browser.&lt;/p&gt;
&lt;p&gt;Updating the article typography, dark-mode colors, or link hover styles edits one CSS file immediately without rebuilding a multi-gigabyte ZIM archive, while every article remains fast, self-contained, and free of third-party scripts.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Keeping known failing tests in the suite</title>
  <link href="https://ptree.org/blog/open-failing-tests.html"/>
  <id>https://ptree.org/blog/open-failing-tests.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="backend" label="Backend"/>
  <summary>When an automated test catches a real upstream data bug or an unresolved edge case, teams usually take one of two paths: delete or test.skip() the assertion so CI turns green, or leave the suite red until everyone stops reading the output. Skipping a test hides whether it ever got fixed; ignoring a red suite hides real regressions; softening the assertion to match broken data Goodharts the suite into lying about reality.</summary>
  <content type="html">&lt;p&gt;When an automated test catches a real upstream data bug or an unresolved edge case, teams usually take one of two paths: delete or &lt;code&gt;test.skip()&lt;/code&gt; the assertion so CI turns green, or leave the suite red until everyone stops reading the output. Skipping a test hides whether it ever got fixed; ignoring a red suite hides real regressions; softening the assertion to match broken data Goodharts the suite into lying about reality.&lt;/p&gt;
&lt;p&gt;Ptree&amp;#39;s release gate takes a third path: every known failure stays active in the test suite and is listed in an open-issues manifest, and the gate fails in &lt;em&gt;both&lt;/em&gt; directions.&lt;/p&gt;
&lt;h2&gt;Failing on regressions and on unexpected passes&lt;/h2&gt;
&lt;p&gt;When the release gate runs, it executes the full suite across pure unit tests, spec contracts, served-store checks, and identity invariants, then compares the set of failing test names against the open-issues manifest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Any test that fails and is not in the manifest is an unlisted regression, so the gate exits non-zero and blocks the release.&lt;/li&gt;
&lt;li&gt;Any test listed in the manifest that now passes also fails the gate, instructing you to remove its entry.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That second rule keeps the list honest. You cannot leave a stale entry sitting in the manifest for six months after a crosswalk rebuild or upstream update fixes the underlying bug. When an upstream database merges a homonym across kingdoms or places a species under the wrong genus, the test asserting reality fails until either the crosswalk splitter resolves it or the provider fixes its dump. The first build where the fix lands forces you to delete that line from the manifest, shrinking it toward empty over time.&lt;/p&gt;
&lt;p&gt;Because the test itself is never skipped, it still runs on every build and still verifies that the failure mode has not mutated into an unhandled exception or a broader collapse.&lt;/p&gt;
&lt;h2&gt;Tests assert reality, never the rule&lt;/h2&gt;
&lt;p&gt;A related rule governs how tests are written: a test is only useful if it has a different shape from the code that produced the result. Testing a unit converter by running the same formula twice proves nothing. Testing an identity crosswalk against real biological facts catches silent drift that self-referential unit tests miss: &lt;em&gt;Batis&lt;/em&gt; splits into an African bird and a coastal shrub, PBDB&amp;#39;s fossil &lt;em&gt;Batis&lt;/em&gt; ray joins neither, and unlinked GTDB higher concepts stay unlinked instead of forcing a false match.&lt;/p&gt;
&lt;h2&gt;Content-digest memoization across builds&lt;/h2&gt;
&lt;p&gt;Running the entire verification suite against eleven taxonomic backbones and dozens of rolled-up SQLite stores takes time, and most edits touch only a small slice of the system: a stylesheet tweak, one property interpreter, or one newly refreshed source store.&lt;/p&gt;
&lt;p&gt;To keep the gate fast without skipping coverage, a lightweight tracer memoizes passing tests safely against content digests:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When a test runs, the tracer records the exact source modules and SQLite data stores the test actually opened during execution.&lt;/li&gt;
&lt;li&gt;The gate hashes the content digests of those code files and stores into a manifest beside the passing test result.&lt;/li&gt;
&lt;li&gt;On a later run, any test whose recorded code files and data stores have identical content digests is carried forward without re-running. Any test whose code or backing store changed, even indirectly through a shared helper, runs in full.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A failing test in the open manifest is never silently forgotten, a regression in an unrelated store is caught immediately, and a routine HTML or stylesheet rebuild does not wait minutes re-verifying untouched SQLite stores.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Serving 13.6 million taxa from read-only SQLite</title>
  <link href="https://ptree.org/blog/read-only-sqlite-serving.html"/>
  <id>https://ptree.org/blog/read-only-sqlite-serving.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="backend" label="Backend"/>
  <summary>Ptree serves eleven taxonomic backbones totaling 13.6 million taxon records, along with rolled-up properties, photos, sounds, biotic interactions, range maps, and full-text search, directly from local SQLite files. There is no external database server. One Node cluster handles HTTP traffic using Node's built-in node:sqlite (DatabaseSync), keeping memory predictable and cold lookups down to a few milliseconds.</summary>
  <content type="html">&lt;p&gt;Ptree serves eleven taxonomic backbones totaling 13.6 million taxon records, along with rolled-up properties, photos, sounds, biotic interactions, range maps, and full-text search, directly from local SQLite files. There is no external database server. One Node cluster handles HTTP traffic using Node&amp;#39;s built-in &lt;code&gt;node:sqlite&lt;/code&gt; (&lt;code&gt;DatabaseSync&lt;/code&gt;), keeping memory predictable and cold lookups down to a few milliseconds.&lt;/p&gt;
&lt;h2&gt;Immutable mode skips locks and filesystem checks&lt;/h2&gt;
&lt;p&gt;Every served SQLite store is built offline into a staged generation and swapped atomically into place. Serving processes never write to those databases, so the API opens every store as an immutable URI:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;new DatabaseSync(`file:${path}?immutable=1`, { readOnly: true });
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Passing &lt;code&gt;?immutable=1&lt;/code&gt; tells SQLite that no other process can modify the file while it is open. SQLite skips shared-memory WAL setup, acquires no file locks, and stops calling &lt;code&gt;stat()&lt;/code&gt; before every read to check whether another writer updated the change counter. Under concurrent load across eight worker processes, immutable read-only databases behave like memory-mapped lookup tables backed directly by the Linux page cache.&lt;/p&gt;
&lt;h2&gt;Eight HTTP workers plus one bounded heavy pool&lt;/h2&gt;
&lt;p&gt;Most requests touch only a handful of indexed rows. Fetching a taxon card, reading a page of 50 children, switching backbones through the precomputed navigation table, or looking up a sound all finish in a millisecond or two on the HTTP worker&amp;#39;s own event loop. A few operations, however, run queries that take hundreds of milliseconds or aggregate across large rollups. Running those synchronous &lt;code&gt;DatabaseSync&lt;/code&gt; calls on an HTTP worker would block every other request that shares that worker.&lt;/p&gt;
&lt;p&gt;The API server separates the two workloads with &lt;code&gt;node:cluster&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Eight HTTP worker processes accept connections and answer fast synchronous SQLite routes directly.&lt;/li&gt;
&lt;li&gt;The cluster primary owns one shared heavy pool backed by dedicated &lt;code&gt;worker_threads&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When an HTTP worker receives a heavy route, it forwards the request over Node IPC (&lt;code&gt;heavyReq&lt;/code&gt; / &lt;code&gt;heavyRes&lt;/code&gt;) to the primary. Centralizing the heavy pool in the primary gives Ptree three advantages that an eight-way per-worker pool cannot:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The pool tracks every running request in an &lt;code&gt;inflight&lt;/code&gt; map indexed by route. If twelve visitors or a bot burst hit the same expensive endpoint at once across different HTTP workers, the pool runs it once and sends the result back to all twelve callers.&lt;/li&gt;
&lt;li&gt;The queue caps pending work at 32 requests per heavy thread and drops abandoned requests after 280 seconds, so disconnected clients cannot pile up unbounded work.&lt;/li&gt;
&lt;li&gt;After each job, a heavy worker checks its memory usage against 75% of its heap ceiling. When a thread crosses that line, the pool retires it cleanly and spawns a fresh replacement so SQLite page caches and temporary buffers do not grow without bound.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Caching only slow responses per generation&lt;/h2&gt;
&lt;p&gt;Fast queries do not need a cache, and caching everything only duplicates pages that the Linux page cache already holds in RAM. The page cache writes a response into a small generation-stamped SQLite file (&lt;code&gt;WITHOUT ROWID&lt;/code&gt;) only when generating that response took more than 50 ms.&lt;/p&gt;
&lt;p&gt;Cache keys include a composite token built from the API&amp;#39;s &lt;code&gt;interfaceVersion&lt;/code&gt;, the current &lt;code&gt;childOrder()&lt;/code&gt;, and the exact size and modification time of the backing store files. Rebuilding a data generation or changing how children sort invalidates stale entries automatically without manual cache purges. Cold slow endpoints drop from hundreds of milliseconds to sub-millisecond reads on the second visit.&lt;/p&gt;
&lt;p&gt;Because the database files sit on local NVMe beside the API process and every store is read-only and generation-stamped, there are no connection pools to size, no ORM layers to tune, and no network hops between application code and storage.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Refusing defensive code</title>
  <link href="https://ptree.org/blog/refusing-defensive-code.html"/>
  <id>https://ptree.org/blog/refusing-defensive-code.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>Mainstream software culture treats optional chaining (?.), || default, var(--x, fallback), and try/catch around internal data as signs of maturity. In Ptree they are treated like carpet over dirt: a way to let dirt fall below the standing surface so you do not have to look at it until the floor rots through.</summary>
  <content type="html">&lt;p&gt;Mainstream software culture treats optional chaining (&lt;code&gt;?.&lt;/code&gt;), &lt;code&gt;|| default&lt;/code&gt;, &lt;code&gt;var(--x, fallback)&lt;/code&gt;, and &lt;code&gt;try/catch&lt;/code&gt; around internal data as signs of maturity. In Ptree they are treated like carpet over dirt: a way to let dirt fall below the standing surface so you do not have to look at it until the floor rots through.&lt;/p&gt;
&lt;p&gt;Every defensive guard against an internal invariant causes two problems at once. First, it hides the exact moment that a bug entered the system. Second, it invents a synthetic fallback state that the rest of the program now has to deal with. If a tile that I created in the DOM is missing its &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;, or a taxon ID in &lt;code&gt;cols[]&lt;/code&gt; fails to resolve, the right outcome is an immediate crash with a stack trace pointing at the broken line, not silently rendering an empty string and pretending that the page worked.&lt;/p&gt;
&lt;h2&gt;Validate at boundaries, trust everything inside&lt;/h2&gt;
&lt;p&gt;There is a sharp boundary between external reality and code that you own. External inputs break constantly, so boundaries are checked ruthlessly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Source files change shape without warning. Every capture declares the exact CSV header, spreadsheet columns, Parquet schema, or JSON keys that its provider must supply, and halts the build on any added, missing, renamed, or reordered column. Taxonomic standing tables likewise halt the capture the instant a provider invents a status word that we have not classified.&lt;/li&gt;
&lt;li&gt;User clicks can land anywhere on the page, so a delegated click handler checks &lt;code&gt;e.target.closest(&amp;quot;li[data-id]&amp;quot;)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;URL hashes come from the address bar, so the router validates every backbone, property token, view, filter expression, and coordinate against the permanent DOM registries before anything updates state.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once a value crosses that boundary into the codebase, the guards stop. I built the DOM, I mutated the DOM, and I wrote the table that drives it. &lt;code&gt;el.querySelector(&amp;quot;span&amp;quot;)&lt;/code&gt;, &lt;code&gt;cols[+el.dataset.i].items.find(...)&lt;/code&gt;, and a radio&amp;#39;s &lt;code&gt;.value&lt;/code&gt; dispatch into a module table all run without null checks. If one throws &lt;code&gt;TypeError&lt;/code&gt;, I catch a real bug in five seconds instead of shipping a silent glitch.&lt;/p&gt;
&lt;p&gt;That rule applies to broken links too. Early in development, an unresolvable shared taxon link fell back to the root view of Life so the screen would &amp;quot;look fine.&amp;quot; That is the worst kind of defensive politeness. If a shared link breaks, I want the error loud and unmistakable rather than handing a teacher or researcher the wrong organism without warning.&lt;/p&gt;
&lt;h2&gt;Scope the query instead of guarding the result&lt;/h2&gt;
&lt;p&gt;Most null checks in front-end code are symptoms of a sloppy selector. If a tile is retracting out of the tree and should not be measured or anchored, the framework habit is to query every &lt;code&gt;li[data-id]&lt;/code&gt; and scatter &lt;code&gt;if (!el || el.classList.contains(&amp;quot;leaving&amp;quot;)) return&lt;/code&gt; across six callers.&lt;/p&gt;
&lt;p&gt;Ptree scopes the query instead:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;this._layer.querySelector(`li[data-id=&amp;quot;${CSS.escape(id)}&amp;quot;]:not(.away,.leaving)`)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When a query asks only for valid elements, callers stop defending against ghosts. The same rule holds in CSS: &lt;code&gt;var(--x, fallback)&lt;/code&gt; is forbidden on tokens that we define. If a custom property is misspelled or unset, a fallback masks the typo and paints a plausible wrong color for months. Leaving off the fallback makes the break obvious on the first glance.&lt;/p&gt;
&lt;h2&gt;The cost of &amp;quot;just in case&amp;quot;&lt;/h2&gt;
&lt;p&gt;Every &lt;code&gt;?.&lt;/code&gt; that you add invites the next reader, human or AI, to assume that the value can legitimately be &lt;code&gt;undefined&lt;/code&gt;. Soon they add another branch downstream to handle the &lt;code&gt;undefined&lt;/code&gt; that you invented, and half the file ends up defending against states that can never happen in a healthy run.&lt;/p&gt;
&lt;p&gt;Fail early, fail often, and fail loudly. An honest crash on an impossible state takes a minute to diagnose and leaves the machinery clean. A polite fallback turns a one-line bug into a permanent mystery.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Removing :has() and counting transition events</title>
  <link href="https://ptree.org/blog/removing-has-counting-transitions.html"/>
  <id>https://ptree.org/blog/removing-has-counting-transitions.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="frontend" label="Frontend"/>
  <summary>Early versions of Ptree drove whole-page state with root-anchored :has() rules and called getAnimations() to tell when a navigation hop had settled. Chrome profiles showed both burning hundreds of milliseconds per interaction. Moving state onto container classes and counting native transition events cut frame times roughly fivefold.</summary>
  <content type="html">&lt;p&gt;Early versions of Ptree drove whole-page state with root-anchored &lt;code&gt;:has()&lt;/code&gt; rules and called &lt;code&gt;getAnimations()&lt;/code&gt; to tell when a navigation hop had settled. Chrome profiles showed both burning hundreds of milliseconds per interaction. Moving state onto container classes and counting native transition events cut frame times roughly fivefold.&lt;/p&gt;
&lt;h2&gt;State written down from a shared container&lt;/h2&gt;
&lt;p&gt;Native checkboxes hold Ptree’s filter, location, common-name, and panel states. Reading those controls from near the root with &lt;code&gt;:has(#filter:checked)&lt;/code&gt; or &lt;code&gt;:has(#location:indeterminate)&lt;/code&gt; removed a few event listeners, but in Blink a &lt;code&gt;:has()&lt;/code&gt; anchor near the document root causes every DOM insertion, class change, or title write below it to trigger broad style invalidation. Dragging a filter thumb or inserting a silhouette icon forced Chrome to restyle far more of the tree than had changed.&lt;/p&gt;
&lt;p&gt;Every viewer stylesheet now contains zero &lt;code&gt;:has()&lt;/code&gt; rules. When a control’s state is read by multiple regions, its &lt;code&gt;change&lt;/code&gt; listener toggles one class on the nearest container those regions share, documented directly above the element:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;!-- toggled classes: Common, Filtering, Picking, Located --&amp;gt;
&amp;lt;body class=&amp;quot;Common&amp;quot; data-1p-ignore&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Descendants below &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;section&amp;gt;&lt;/code&gt; match plain class selectors that Blink invalidates locally.&lt;/p&gt;
&lt;h2&gt;Counting structural transitions&lt;/h2&gt;
&lt;p&gt;After a multi-step tree navigation finishes moving tiles and columns, the view reaps &lt;code&gt;.leaving&lt;/code&gt; nodes and hands the camera’s displacement back to native scrolling. Measuring bounding boxes and calling &lt;code&gt;document.getAnimations()&lt;/code&gt; after each step cost Chrome about &lt;strong&gt;118 ms&lt;/strong&gt; in forced layout reads and &lt;strong&gt;146 ms&lt;/strong&gt; in animation queries on a single hop. Under &lt;code&gt;prefers-reduced-motion&lt;/code&gt;, settling took &lt;strong&gt;1.1 to 1.6 seconds&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The shared &lt;code&gt;View&lt;/code&gt; class now listens to &lt;code&gt;transitionrun&lt;/code&gt;, &lt;code&gt;transitionend&lt;/code&gt;, and &lt;code&gt;transitioncancel&lt;/code&gt; on &lt;code&gt;&amp;lt;main&amp;gt;&lt;/code&gt; and maintains one counter (&lt;code&gt;_flying&lt;/code&gt;) filtered to structural geometry properties:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const MOTION = new Set([
	&amp;quot;translate&amp;quot;, &amp;quot;transform&amp;quot;, &amp;quot;opacity&amp;quot;, &amp;quot;d&amp;quot;,
	&amp;quot;fill-opacity&amp;quot;, &amp;quot;display&amp;quot;, &amp;quot;visibility&amp;quot;,
]);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Color transitions, hover washes, and label fades are excluded so the view rests while paint finishes. Because a transition created in one frame is announced at the start of the next, and a retargeting arrives as a cancel and a run in one batch, rest is a frame where &lt;code&gt;_flying&lt;/code&gt; is zero, taken at least one frame after the write.&lt;/p&gt;
&lt;h2&gt;One marker for every map&lt;/h2&gt;
&lt;p&gt;Location picking had a parallel invalidation problem: writing the chosen point’s coordinates into custom properties on &lt;code&gt;:root&lt;/code&gt; forced a document-wide restyle on every click. Moving those coordinates onto the &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; attributes of a single &lt;code&gt;#point&lt;/code&gt; &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; symbol, drawn into every range map via &lt;code&gt;&amp;lt;use&amp;gt;&lt;/code&gt;, confined the update to the maps alone.&lt;/p&gt;
&lt;h2&gt;Measured in Chrome&lt;/h2&gt;
&lt;p&gt;All three changes shipped together in the &lt;a href=&quot;/about/history.html&quot;&gt;November 9, 2026 release&lt;/a&gt; and were timed directly in Chrome:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Navigation hops dropped &lt;strong&gt;118 ms&lt;/strong&gt; of layout reads and &lt;strong&gt;146 ms&lt;/strong&gt; of animation queries to zero; reduced-motion hops fell from &lt;strong&gt;1.1–1.6 s&lt;/strong&gt; to &lt;strong&gt;300–600 ms&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Tree glides fell from &lt;strong&gt;186 ms&lt;/strong&gt; at the 90th percentile to &lt;strong&gt;25–42 ms&lt;/strong&gt; once hidden paint snapped instead of transitioning.&lt;/li&gt;
&lt;li&gt;Splitter drag samples fell from &lt;strong&gt;150 ms&lt;/strong&gt; to &lt;strong&gt;35–98 ms&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Location picks fell from &lt;strong&gt;190 ms&lt;/strong&gt; to &lt;strong&gt;16 ms&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Legend brushes dropped to a single restyle pass.&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 <entry>
  <title>Selecting wildlife recordings without voice notes or silence</title>
  <link href="https://ptree.org/blog/selecting-wildlife-audio.html"/>
  <id>https://ptree.org/blog/selecting-wildlife-audio.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Clicking the audio icon on a species or clade in Ptree should play that organism within half a second. It should not play twelve seconds of rustling microphone fabric, an inaudible 250 kHz bat-detector file, or a hiker saying &quot;here is a nice woodlouse on a log.&quot; Combining xeno-canto and iNaturalist into one recording per species required solving three separate problems: deciding which clades actually make sound, measuring the audio files directly, and filtering out human speech.</summary>
  <content type="html">&lt;p&gt;Clicking the audio icon on a species or clade in Ptree should play that organism within half a second. It should not play twelve seconds of rustling microphone fabric, an inaudible 250 kHz bat-detector file, or a hiker saying &amp;quot;here is a nice woodlouse on a log.&amp;quot; Combining xeno-canto and iNaturalist into one recording per species required solving three separate problems: deciding which clades actually make sound, measuring the audio files directly, and filtering out human speech.&lt;/p&gt;
&lt;h2&gt;Filtering out silent clades with a rate gate&lt;/h2&gt;
&lt;p&gt;xeno-canto is a curated archive of animal sounds, so its records start from vocal organisms. iNaturalist lets any observer attach an audio clip to any observation. As a result, plants, fungi, rocks, and silent beetles accumulate accidental clips, wind, background birds, and spoken field notes at a steady background rate.&lt;/p&gt;
&lt;p&gt;Research grade, faves, and organism annotations do not separate real animal sounds from voice notes, because the community usually confirms the species from an attached photograph. Instead, Ptree checks how often each clade is recorded compared with the rest of life:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Across all iNaturalist orders that have at least 100,000 observations, Ptree computes the median rate of distinct recordists per observation. That median sits around one recordist per 300,000 observations and acts as the background noise floor.&lt;/li&gt;
&lt;li&gt;A clade passes the gate only when at least 3 distinct people have recorded it, its recording rate is at least 10 times the background floor, and the Poisson probability of seeing that many recordists by chance is below 0.001.&lt;/li&gt;
&lt;li&gt;For any taxon, Ptree finds the nearest ancestor large enough that a 10× lift would produce at least 5 expected recordists, and lets that ancestor render the verdict. A smaller clade beneath it can still qualify on its own if it clears the threshold.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That last rule lets genuine vocal outliers, such as rattlebox grasshoppers or drum fishes, pass even when their larger family or order is mostly silent. At the same time, it rejects stray voice notes attached to woodlice, ants, and wildflowers.&lt;/p&gt;
&lt;p&gt;On top of the clade gate, the iNaturalist reader drops observations that have lost research grade since the archive was cut, observations whose description starts with &lt;code&gt;voice notes&lt;/code&gt;, and recordings on the explicit exclusion list.&lt;/p&gt;
&lt;h2&gt;Measuring loudness, onset, clipping, and ultrasonic energy&lt;/h2&gt;
&lt;p&gt;Metadata decides which candidates to fetch, but acoustic measurement picks the winner among a species&amp;#39; recordings. Every fetched candidate is analyzed into a local acoustics store that keeps a momentary loudness reading every tenth of a second, along with peak level, noise floor, spectral flatness, five frequency bands, and file size.&lt;/p&gt;
&lt;p&gt;From the momentary loudness series, Ptree locates the exact moment when the animal starts calling:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const call = readings.toSorted((a, b) =&amp;gt; a - b)[Math.floor((readings.length - 1) * 0.95)];
const line = Math.max(-45, call - 12);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The animal&amp;#39;s call level is the 95th percentile of those readings. Any tenth-second slice that sits within 12 dB of that level and above −45 dB counts as the animal. After skipping the loudness meter&amp;#39;s first three readings (where its 400 ms window is still filling), the first matching slice sets the recording&amp;#39;s &lt;code&gt;onset&lt;/code&gt;. A steady frog chorus or cricket trill is loud from end to end and gets an onset near zero. A bird that sits silent for nine seconds before singing gets &lt;code&gt;onset = 9.0&lt;/code&gt;, and the player jumps straight to that second with a &lt;code&gt;#t=&lt;/code&gt; media fragment so the visitor hears the bird right away.&lt;/p&gt;
&lt;p&gt;Any recording whose measured peak is &lt;code&gt;-Infinity&lt;/code&gt; is rejected outright. That catches phone recordings that wrote ten seconds of digital zeros because microphone permission was withheld. The remaining measured candidates are scored as a sum of named terms:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;signal&lt;/code&gt;: loudest ten seconds over the noise floor, neutral at 20 dB and earning up to &lt;code&gt;+1&lt;/code&gt; at 40 dB.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;clipping&lt;/code&gt;: &lt;code&gt;-1&lt;/code&gt; when the peak exceeds &lt;code&gt;-0.3&lt;/code&gt; dB with a non-zero flat factor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;audibility&lt;/code&gt;: &lt;code&gt;-2&lt;/code&gt; when energy above 20 kHz dominates every audible band, catching ultrasonic bat-detector files alongside a &lt;code&gt;-2&lt;/code&gt; penalty on xeno-canto sample rates of 176.4 kHz or higher.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hiss&lt;/code&gt; and &lt;code&gt;silence&lt;/code&gt;: &lt;code&gt;-0.5&lt;/code&gt; when spectral flatness exceeds &lt;code&gt;0.35&lt;/code&gt;, and &lt;code&gt;-0.5&lt;/code&gt; when more than half of the file sits below the animal threshold.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;onset&lt;/code&gt; and &lt;code&gt;size&lt;/code&gt;: late onsets past 0.5 seconds lose up to &lt;code&gt;-1&lt;/code&gt; by five seconds, and every 5 MB of file size costs &lt;code&gt;-0.5&lt;/code&gt; so visitors do not have to buffer huge uncompressed WAV files when a clean MP3 exists.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Catching narration with YAMNet&lt;/h2&gt;
&lt;p&gt;A recordist who talks over a bird call often produces great signal-to-noise, low hiss, and an immediate onset. Every loudness metric rewards a clear human voice. To catch narration, background conversation, and tour guides talking near the microphone, Ptree runs Google&amp;#39;s YAMNet classifier at 16 kHz mono (using 0.96-second windows with a 0.48-second hop). All 521 AudioSet class scores are quantized to 1 byte (&lt;code&gt;255 * score&lt;/code&gt;) alongside half-float features, then Zstd-compressed in the acoustics store.&lt;/p&gt;
&lt;p&gt;At build time, Ptree decompresses each recording&amp;#39;s score matrix on the fly and checks eight speech classes (&lt;code&gt;Speech&lt;/code&gt;, &lt;code&gt;Child speech&lt;/code&gt;, &lt;code&gt;Conversation&lt;/code&gt;, &lt;code&gt;Narration, monologue&lt;/code&gt;, &lt;code&gt;Babbling&lt;/code&gt;, &lt;code&gt;Speech synthesizer&lt;/code&gt;, &lt;code&gt;Whispering&lt;/code&gt;, and &lt;code&gt;Hubbub, speech noise&lt;/code&gt;). If 3 or more frames anywhere in the file hit a speech score of &lt;code&gt;0.5&lt;/code&gt; (&lt;code&gt;&amp;gt;= 128&lt;/code&gt;) or higher, the recording is marked spoken and demoted. It plays only when the species has no unspoken recording at all.&lt;/p&gt;
&lt;h2&gt;Matching higher-clade audio to the photo you see&lt;/h2&gt;
&lt;p&gt;Rolling sounds up the tree raises one last surprise. If a family card displays a photograph of a blue jay, playing the highest-scoring recording from a random crow elsewhere in Corvidae feels wrong. While the sound rollup folds the best recording across every clade&amp;#39;s subtree, the audio endpoint checks first whether the species shown in the clade&amp;#39;s photo or silhouette has a decent recording. When it does, pressing play lets you hear the exact animal that you are looking at.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Self-diffing SQLite schemas without migrations</title>
  <link href="https://ptree.org/blog/self-diffing-sqlite-schemas.html"/>
  <id>https://ptree.org/blog/self-diffing-sqlite-schemas.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="backend" label="Backend"/>
  <summary>Ptree's pipeline maintains dozens of long-lived acquisition and cache SQLite stores that accumulate scraped iNaturalist reception, acoustic measurements, photo scores, and fetched metadata over months. Numbered migration scripts (001_init.sql, 002_add_col.sql, 003_fix_index.sql) rot quickly in a single-developer codebase: every schema tweak adds another file, branches conflict on version numbers, and nobody can tell what a table actually looks like without replaying twenty files in their head.</summary>
  <content type="html">&lt;p&gt;Ptree&amp;#39;s pipeline maintains dozens of long-lived acquisition and cache SQLite stores that accumulate scraped iNaturalist reception, acoustic measurements, photo scores, and fetched metadata over months. Numbered migration scripts (&lt;code&gt;001_init.sql&lt;/code&gt;, &lt;code&gt;002_add_col.sql&lt;/code&gt;, &lt;code&gt;003_fix_index.sql&lt;/code&gt;) rot quickly in a single-developer codebase: every schema tweak adds another file, branches conflict on version numbers, and nobody can tell what a table actually looks like without replaying twenty files in their head.&lt;/p&gt;
&lt;p&gt;Ptree&amp;#39;s database helper replaces migration scripts with a single function, &lt;code&gt;conformSchema(db, ddl)&lt;/code&gt;, that compares a live database against the declarative &lt;code&gt;CREATE TABLE&lt;/code&gt; and &lt;code&gt;CREATE INDEX&lt;/code&gt; statements already in the code.&lt;/p&gt;
&lt;h2&gt;Using SQLite as its own DDL parser&lt;/h2&gt;
&lt;p&gt;Writing a SQL parser in JavaScript to diff &lt;code&gt;CREATE TABLE&lt;/code&gt; statements is fragile, because SQLite accepts type affinities, column constraints, expression indexes, &lt;code&gt;WITHOUT ROWID&lt;/code&gt;, and &lt;code&gt;STRICT&lt;/code&gt; tables in dozens of syntactic forms. Instead of parsing DDL strings, &lt;code&gt;conformSchema()&lt;/code&gt; executes the target &lt;code&gt;ddl&lt;/code&gt; inside a fresh &lt;code&gt;:memory:&lt;/code&gt; &lt;code&gt;DatabaseSync&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;const target = new DatabaseSync(&amp;quot;:memory:&amp;quot;);
target.exec(ddl);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now both the live database and the desired schema are real SQLite databases that answer the exact same introspection pragmas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;PRAGMA table_info(name)&lt;/code&gt; returns every column&amp;#39;s name, declared type, &lt;code&gt;notnull&lt;/code&gt; flag, default value, and primary-key position.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PRAGMA index_list(name)&lt;/code&gt; and &lt;code&gt;PRAGMA index_info(index)&lt;/code&gt; return every non-autoindex name, uniqueness flag, partial &lt;code&gt;WHERE&lt;/code&gt; clause, and ordered column list.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Comparing the two dictionaries tells &lt;code&gt;conformSchema()&lt;/code&gt; the exact difference between the on-disk file and the current source code. For example, when Ptree added YAMNet speech-classification columns (&lt;code&gt;classes BLOB&lt;/code&gt;) and momentary loudness series (&lt;code&gt;momentary TEXT&lt;/code&gt;) to an acoustics store that already held tens of thousands of measured wildlife recordings, there was no migration file to write or version table to bump: editing the table&amp;#39;s single &lt;code&gt;CREATE TABLE&lt;/code&gt; declaration added both columns on the next open without touching existing rows.&lt;/p&gt;
&lt;h2&gt;Applying safe diffs and refusing unsafe ones&lt;/h2&gt;
&lt;p&gt;Once &lt;code&gt;conformSchema()&lt;/code&gt; has both table and index maps, it reconciles them inside a transaction in a strict order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create missing tables straight from the target &lt;code&gt;sqlite_master&lt;/code&gt; SQL.&lt;/li&gt;
&lt;li&gt;Drop obsolete or changed indexes first, so no index blocks a subsequent &lt;code&gt;ALTER TABLE DROP COLUMN&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Drop removed columns with &lt;code&gt;ALTER TABLE t DROP COLUMN c&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add missing columns with &lt;code&gt;ALTER TABLE t ADD COLUMN ...&lt;/code&gt;, copied verbatim from the column&amp;#39;s definition in the target schema.&lt;/li&gt;
&lt;li&gt;Create missing or changed indexes from the target &lt;code&gt;sqlite_master&lt;/code&gt; SQL.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When a table&amp;#39;s primary key changed, a column&amp;#39;s type or nullability changed incompatibly, or a new &lt;code&gt;NOT NULL&lt;/code&gt; column has no &lt;code&gt;DEFAULT&lt;/code&gt; value on a non-empty table, &lt;code&gt;conformSchema()&lt;/code&gt; refuses to guess and throws immediately with the table and column name instead of silently rebuilding tables or inventing fallback values.&lt;/p&gt;
&lt;h2&gt;One source of truth per store&lt;/h2&gt;
&lt;p&gt;Every persistent store keeps one declarative &lt;code&gt;SCHEMA&lt;/code&gt; string at the top of its module. Adding an acoustic metric column, dropping a retired field, or changing an index column order is a one-line edit to that string. On the next run, every existing database on disk converges to the new shape automatically, and any freshly created database starts from the exact same string.&lt;/p&gt;
&lt;p&gt;There is no &lt;code&gt;schema_migrations&lt;/code&gt; table to drift out of sync, no historical archive of abandoned columns, and no divergence between a brand-new database and one that has been accumulating records for a year.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Semantic Voronoi</title>
  <link href="https://ptree.org/blog/semantic-voronoi.html"/>
  <id>https://ptree.org/blog/semantic-voronoi.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>A Voronoi diagram partitions a plane around seed points so every location belongs to whichever seed sits closest to it. Naming in software and data curation works the same way: every word you choose (a trait category, a column name, a UI label, or a line in a prompt) is a seed in meaning-space. A strong name claims a large, sharply bounded cell. A weak name sits on a blurry border and leaks into its neighbors.</summary>
  <content type="html">&lt;p&gt;A Voronoi diagram partitions a plane around seed points so every location belongs to whichever seed sits closest to it. Naming in software and data curation works the same way: every word you choose (a trait category, a column name, a UI label, or a line in a prompt) is a seed in meaning-space. A strong name claims a large, sharply bounded cell. A weak name sits on a blurry border and leaks into its neighbors.&lt;/p&gt;
&lt;h2&gt;Induction and deduction&lt;/h2&gt;
&lt;p&gt;Most bad names fail in one direction. Take &lt;code&gt;status&lt;/code&gt; as a column or property name: you can induct &lt;em&gt;up&lt;/em&gt; to &lt;code&gt;status&lt;/code&gt; from almost any set of examples (conservation risk, taxonomic validity, native vs. introduced, living vs. extinct), so it feels reasonable while writing the schema. Try reasoning &lt;em&gt;down&lt;/em&gt; from the word &lt;code&gt;status&lt;/code&gt; alone and it tells you nothing about what sits inside the column.&lt;/p&gt;
&lt;p&gt;A good name passes both tests: intensional and extensional adequacy. Draft upward from the real examples, then reason strictly downward from the word into every case it should include and every neighboring case it must exclude.&lt;/p&gt;
&lt;p&gt;Ptree&amp;#39;s &lt;a href=&quot;/#GBIF/Ontogeny&quot;&gt;Ontogeny&lt;/a&gt; property illustrates this clearly. The animal literature calls indirect development &lt;code&gt;larval&lt;/code&gt;, which works fine if you only look at insects and frogs. Reason downward from &lt;code&gt;larval&lt;/code&gt; across all of life and it breaks immediately on ferns: a fern&amp;#39;s free-living prothallus is an earlier body plan that the adult replaces, just like a caterpillar or a tadpole, yet no botanist calls a prothallus a larva. Naming the bin &lt;code&gt;staged&lt;/code&gt; against &lt;code&gt;direct&lt;/code&gt; separates every nearest neighbor cleanly across kingdoms: caterpillar against nymph in insects, tadpole against froglet in amphibians, trochophore against direct-developing snail in mollusks, and prothallus against seedling in plants.&lt;/p&gt;
&lt;h2&gt;Every word excludes its neighbors&lt;/h2&gt;
&lt;p&gt;In meaning-space, picking a word for one bin implies that neighboring bins lack that property. Calling one Position category &lt;code&gt;aquatic&lt;/code&gt; immediately implies &lt;code&gt;surface&lt;/code&gt; and &lt;code&gt;attached&lt;/code&gt; are non-aquatic, which breaks the moment a kelp holdfast or a coral polyp sits attached on the seabed. Calling it &lt;code&gt;open&lt;/code&gt; instead (suspended in open water or air, touching no substrate) keeps every neighbor cleanly separated.&lt;/p&gt;
&lt;p&gt;The test is substitution: if your label or definition could accurately describe an adjacent category or sibling column, it is unfinished. Separate nearest neighbors first:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Split where meanings overlap. In Ptree&amp;#39;s pipeline, &lt;code&gt;identity failure&lt;/code&gt; (two sources matched the wrong organism) and &lt;code&gt;vocabulary failure&lt;/code&gt; (a source term mapped to the wrong bin) never share a bucket or an error message, because mixing them makes both impossible to diagnose.&lt;/li&gt;
&lt;li&gt;Merge where domains never collide. A bacterium driven by a flagellar motor and a walking mammal never overlap in the same clade, so sharing &lt;code&gt;mobile&lt;/code&gt; (&amp;quot;moves under its own power&amp;quot;) keeps each neighborhood distinct while letting one color light up active movement across every kingdom.&lt;/li&gt;
&lt;li&gt;Split overloaded virtues in two. &amp;quot;Be clever&amp;quot; is ambiguous until you partition it: clever in architecture, plain in local expressions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Names are wiring&lt;/h2&gt;
&lt;p&gt;The code mirror of Semantic Voronoi is strict vocabulary alignment: different meanings take distant names, and identical meanings take identical names across DOM radio values, URL route tokens, SQLite store IDs, module filenames, and dispatch keys.&lt;/p&gt;
&lt;p&gt;When every seed owns one clean cell and no two names fight over the same concept, translation tables disappear and every label on screen explains the exact boundary the code enforces underneath.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Building without stakeholders</title>
  <link href="https://ptree.org/blog/single-developer-craft.html"/>
  <id>https://ptree.org/blog/single-developer-craft.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>Almost every rule that gets taught as software engineering &quot;best practice&quot; was invented to manage large teams, not to make software good. Micro-frontends, strict component isolation, parallel data-testid attributes beside aria-*, verbose abstraction layers, Jira tickets, stakeholder sign-offs, and focus-group UX testing all exist so forty people with competing incentives can ship without colliding or getting blamed when something slips.</summary>
  <content type="html">&lt;p&gt;Almost every rule that gets taught as software engineering &amp;quot;best practice&amp;quot; was invented to manage large teams, not to make software good. Micro-frontends, strict component isolation, parallel &lt;code&gt;data-testid&lt;/code&gt; attributes beside &lt;code&gt;aria-*&lt;/code&gt;, verbose abstraction layers, Jira tickets, stakeholder sign-offs, and focus-group UX testing all exist so forty people with competing incentives can ship without colliding or getting blamed when something slips.&lt;/p&gt;
&lt;p&gt;I have maintained &lt;a href=&quot;https://ptable.com/&quot;&gt;Ptable&lt;/a&gt; from the same URL since 1997, for 29 years. I am building Ptree the same way: alone, with no investors, no product managers, no launch deck, and no audience to perform for.&lt;/p&gt;
&lt;h2&gt;Nobody is grading the scaffolding&lt;/h2&gt;
&lt;p&gt;Once you drop the imaginary 40-person team, half of conventional software advice flips upside down.&lt;/p&gt;
&lt;p&gt;One conceptual state gets one attribute. In Ptree, &lt;code&gt;aria-busy&lt;/code&gt; is simultaneously the accessibility statement, the CSS selector hook, and the flag that JavaScript reads. There is no &lt;code&gt;data-busy&lt;/code&gt; beside it and no &lt;code&gt;.is-loading&lt;/code&gt; mirror. Parallel hooks protect separate teams from breaking each other&amp;#39;s contracts. When one person owns the whole stack, two attributes are just two facts that can drift out of sync.&lt;/p&gt;
&lt;p&gt;Deletion beats keeping hooks &amp;quot;defined and ready.&amp;quot; Unused fetches, empty registry stubs, aliases that only rename one function, and dormant scaffolding for hypothetical future features get removed through the whole vertical slice: JavaScript, CSS, HTML, tests, and docs together. Dead code is not free optionality. It adds cognitive drag to every edit that follows.&lt;/p&gt;
&lt;p&gt;Honest diagnosis beats pixel forgery. When a layout or browser engine misbehaves, I do not wrap it in three hacks to manufacture the expected pixels for a Friday demo. An unresolved problem with an honest root-cause diagnosis, plus a bug filed upstream against Chromium or WebKit, is better than shipping machinery that I would be embarrassed to open up.&lt;/p&gt;
&lt;h2&gt;Opinionated design beats focus-group mush&lt;/h2&gt;
&lt;p&gt;Design by committee sands off every sharp edge until nobody can object, and nobody can remember it either. Usability testing at scale gave the world Windows Control Panel&amp;#39;s &amp;quot;Hardware and Sound.&amp;quot; Academic caution gives biodiversity portals 400 cautious trait categories that leave 90% of the tree gray so no nitpicker can send an angry email.&lt;/p&gt;
&lt;p&gt;Having no stakeholders means you can make a bold structural call and let the tool prove itself. Splitting habitat into Setting and Position, putting a bacterium&amp;#39;s flagellar motor and a walking mammal into the same &lt;code&gt;mobile&lt;/code&gt; bin so one overlay lights up all of life, or folding fifteen taxonomic ranks into one rotated left gutter are choices that a committee would have watered down into menus and checkboxes. If someone has to spend thirty seconds adjusting to how Ptree works, and then immediately answers questions across 13.6 million taxa that they did not know they could ask, that is the point.&lt;/p&gt;
&lt;h2&gt;Built to inspect, built to last&lt;/h2&gt;
&lt;p&gt;The goal is the exposed movement of an A. Lange watch, where the machinery underneath the dial deserves inspection on its own terms. There is no front-end framework to rewrite every four years when the ecosystem shifts, no build-tool dependency tree rotting in &lt;code&gt;node_modules&lt;/code&gt;, and no cloud vendor sitting between the data and the screen.&lt;/p&gt;
&lt;p&gt;It is only the craft, the browser, the data, and what comes out of them. When you owe nothing to a quarterly roadmap, you can take the time to find the design that will still make sense twenty years from now.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Steering coding agents away from slop</title>
  <link href="https://ptree.org/blog/steering-coding-agents.html"/>
  <id>https://ptree.org/blog/steering-coding-agents.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>Large parts of Ptree's pipeline, tests, viewer refinements, and this blog were written with AI coding agents. Pretending otherwise would be dishonest, and pretending it works out of the box would be just as dishonest.</summary>
  <content type="html">&lt;p&gt;Large parts of Ptree&amp;#39;s pipeline, tests, viewer refinements, and this blog were written with AI coding agents. Pretending otherwise would be dishonest, and pretending it works out of the box would be just as dishonest.&lt;/p&gt;
&lt;p&gt;The biggest hazard an LLM brings to a codebase like Ptree is not hallucinated syntax or forgotten imports. It is the statistical average of ten million corporate React repositories baked straight into its weights.&lt;/p&gt;
&lt;h2&gt;The habits you have to beat out of the model&lt;/h2&gt;
&lt;p&gt;Leave a frontier model unguided on a vanilla HTML/CSS/JS codebase and watch what it reaches for within thirty seconds:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Defensive &lt;code&gt;?.&lt;/code&gt; chains, &lt;code&gt;|| &amp;quot;&amp;quot;&lt;/code&gt; fallbacks, and &lt;code&gt;try/catch&lt;/code&gt; blocks around your own DOM elements.&lt;/li&gt;
&lt;li&gt;JavaScript objects mirroring DOM state, plus a &lt;code&gt;render()&lt;/code&gt; function that wipes &lt;code&gt;innerHTML&lt;/code&gt; and rebuilds nodes on every click.&lt;/li&gt;
&lt;li&gt;Wrapper &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s, BEM class names, and &lt;code&gt;requestAnimationFrame&lt;/code&gt; loops where CSS &lt;code&gt;transition&lt;/code&gt; and &lt;code&gt;@property&lt;/code&gt; already do the work.&lt;/li&gt;
&lt;li&gt;Hedged, self-important prose with colons in every heading (&amp;quot;The two rules behind every category&amp;quot;), bold-lead-in bullet spam, and moralizing wrap-up paragraphs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of those are random mistakes. They are the exact median of what the internet considers &amp;quot;clean, maintainable code.&amp;quot; If you want a codebase that sits far off the median, polite suggestions in a prompt do nothing; the model snaps back to React muscle memory two turns later.&lt;/p&gt;
&lt;h2&gt;Doctrine, tests, and real browsers&lt;/h2&gt;
&lt;p&gt;Making coding agents genuinely useful on Ptree took three concrete constraints:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An unapologetic &lt;code&gt;AGENTS.md&lt;/code&gt; that names the forbidden priors first. The very first paragraph of Ptree&amp;#39;s &lt;code&gt;AGENTS.md&lt;/code&gt; warns the agent directly that its React and CSS-in-JS instincts are the single largest risk it brings, and forbids null guards on trusted DOM, &lt;code&gt;:has()&lt;/code&gt; in viewer stylesheets, wrapper divs, and rebuild-on-change before describing a single file path.&lt;/li&gt;
&lt;li&gt;Executable invariants instead of prose checklists. Telling an agent &amp;quot;keep generated files in sync&amp;quot; fails eventually; running a staleness check on every generated fragment, a release gate with an open-issues manifest (which fails on both regressions and unexpected passes), and contract tests that parse every viewer link against the real router makes drift impossible to hide.&lt;/li&gt;
&lt;li&gt;Real browser engines instead of headless screenshots. Agents are forbidden from installing Playwright or Puppeteer or passing tests by staring at screenshots. Browser verification runs on real Chrome, Safari, and Firefox over WebDriver on BrowserStack, asserting real layout geometry, console errors, and forced-repaint checks while visual judgment stays human.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;What is never delegated&lt;/h2&gt;
&lt;p&gt;Agents are extraordinary at mechanical verification, pipeline plumbing, SQLite folds, refactoring across twenty files, and searching 310 source dictionaries for anomalies. They are never handed biological meaning or editorial taste.&lt;/p&gt;
&lt;p&gt;What a specialist term actually means, which cross-kingdom bin owns it, whether a 19th-century taxonomy edge is a homonym or a synonym, and whether an animation &lt;em&gt;feels&lt;/em&gt; right on screen are human calls. An agent without that boundary smooths opinionated choices back into cautious gray mush in both data and prose.&lt;/p&gt;
&lt;p&gt;Used without taste, coding agents produce mountains of median software faster than any team ever could. Used inside a sharp doctrine with ruthless deletion and real measurements, they let one developer build and maintain a 13.6-million-taxon reference that would otherwise take an institute.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Steering moves</title>
  <link href="https://ptree.org/blog/steering-moves.html"/>
  <id>https://ptree.org/blog/steering-moves.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="craft" label="Craft"/>
  <summary>An AI coding agent searches well inside the frame that you give it, yet rarely steps outside that frame on its own. Asking a model to refine its own output only searches the old frame harder, because the prior that produced the code is the same prior that judges it. Good steering is not about micromanaging syntax or reading every line. It is about changing the frame: what the problem is an instance of, what the work is for, what scale it lives at, what sibling it matches, and what counts as true.</summary>
  <content type="html">&lt;p&gt;An AI coding agent searches well inside the frame that you give it, yet rarely steps outside that frame on its own. Asking a model to refine its own output only searches the old frame harder, because the prior that produced the code is the same prior that judges it. Good steering is not about micromanaging syntax or reading every line. It is about changing the frame: what the problem is an instance of, what the work is for, what scale it lives at, what sibling it matches, and what counts as true.&lt;/p&gt;
&lt;h2&gt;What only the director supplies&lt;/h2&gt;
&lt;p&gt;None of that framing lives in the repository, so an agent cannot infer it from the source files. Over a year of building Ptree and updating Ptable, nearly every major improvement came from one of eight moves:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Re-pose what the problem is an instance of. When Ptree&amp;#39;s photo-selection build grew to 250 GB, optimizing that pipeline was the wrong task. The real question was whether photo selection is anything other than an ordinary rollup with a sort that picks one winner. When an agent fixed title casing row by row, the right fix was a rule for the entire source.&lt;/li&gt;
&lt;li&gt;State the real purpose, and split merged goals. Left alone, an agent optimizes whatever local proxy sits in front of it, such as making tests pass or avoiding deletions. Stating what the feature is actually for (&amp;quot;answering is secondary to using the interface; any model can answer questions&amp;quot;) or splitting two combined goals (matching identities across trees versus propagating traits) settles dozens of later choices at once.&lt;/li&gt;
&lt;li&gt;Reject the entire family of fixes. When fixes keep getting harder, stop patching the bug and discard that whole approach. If a column layout breaks into an awkward 5+1 split and an agent wants to clamp a pixel height, ask why we are setting a height at all. Keep a symptom as a test that the right algorithm must pass on its own, never as a special case written into the code.&lt;/li&gt;
&lt;li&gt;Supply a sense of scale. Knowing roughly how many rows an operation touches and whether it should take microseconds or seconds catches broken architecture immediately. If looking up an icon across a thousand entries takes seconds, adding a cache only hides a full sort on the hot path. Importing a 500 KB library to turn a map click into a grid cell makes no sense when the first pass needs only a test for a point inside a shape.&lt;/li&gt;
&lt;li&gt;Line up siblings side by side. Agents work file by file and happily build three incompatible implementations for three views that behave the same way. Pointing out that Tree, Icicle, and Cladogram all shift column headers horizontally collapsed three separate DOM structures into one shared header.&lt;/li&gt;
&lt;li&gt;Move a solved shape from another project. Because you hold several projects and domains in your head at once, you can borrow a structure that already worked elsewhere. Ptree&amp;#39;s penalty-scoring pattern for photos helped resolve conflicting parent records, and Google Docs&amp;#39; inline-symbol caret behavior fixed Ptable&amp;#39;s chemical formula editor.&lt;/li&gt;
&lt;li&gt;Anchor tests to reality, not to rules. Tests should check real facts rather than whether a rule agrees with itself. When an agent asks you to make three judgment calls that the dataset itself can answer, refuse to guess and tell it to measure the data instead.&lt;/li&gt;
&lt;li&gt;Put the deciding check first in the loop. Agents run pipelines from start to finish and treat wall-clock time and your attention as free. Running the fast, decisive verification stage first lets you iterate twenty times in a day instead of waiting hours on downstream packaging before learning that identity broke.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Read every token as a claim&lt;/h2&gt;
&lt;p&gt;You do not need to read every line of generated code to catch structural defects. Instead, read what each token implies about the system and check that claim against what you know:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the agent wrote&lt;/th&gt;
&lt;th&gt;What it claims&lt;/th&gt;
&lt;th&gt;The question&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;A null check (&lt;code&gt;?.&lt;/code&gt;, `&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;[]`)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A bare constant like &lt;code&gt;24em&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;This number comes from somewhere real&lt;/td&gt;
&lt;td&gt;Why this number?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A proper noun in a general rule&lt;/td&gt;
&lt;td&gt;This case is structurally special&lt;/td&gt;
&lt;td&gt;Why does the code need to name it?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A new identifier or helper&lt;/td&gt;
&lt;td&gt;Nothing existing owns this behavior&lt;/td&gt;
&lt;td&gt;Which sibling already does it?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Past-tense prose in a doc&lt;/td&gt;
&lt;td&gt;The reader needs the commit diary&lt;/td&gt;
&lt;td&gt;Who is this written for?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;quot;Should&amp;quot;, &amp;quot;likely&amp;quot;, &amp;quot;probably&amp;quot;&lt;/td&gt;
&lt;td&gt;The agent did not actually check&lt;/td&gt;
&lt;td&gt;Go inspect or measure it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A diff larger than the concept&lt;/td&gt;
&lt;td&gt;The change is bigger than the summary&lt;/td&gt;
&lt;td&gt;Show the actual diff.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Two reference points make this fast: an expected order of magnitude for every operation, and a working sibling that serves as the spec. If lowercase input moves the caret to the start while uppercase input works normally, you do not need theory from first principles. Compare the two paths.&lt;/p&gt;
&lt;h2&gt;Eight moves that bring a defect into the open&lt;/h2&gt;
&lt;p&gt;When something feels wrong and the agent offers a smooth explanation, eight short moves expose the real cause:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Compress the system to a toy example. Ask the agent to trace a 13 GB database or a multi-stage rollup on four rows (&amp;quot;Root is animals&amp;quot;). Structural errors, such as every parent row duplicating its children&amp;#39;s data, show up immediately in four rows while staying invisible inside ten thousand lines.&lt;/li&gt;
&lt;li&gt;Ask a leading question. Phrase a suspicion as a sincere question that carries a hypothesis. If you are right, the agent finds the flaw itself. If you are wrong, conceding a false alarm costs one sentence.&lt;/li&gt;
&lt;li&gt;Sample raw records instead of grepping with heuristics. Before writing a cleaning script for data that you do not understand, print thirty random raw rows and read them with your own eyes.&lt;/li&gt;
&lt;li&gt;Subtract. Uncheck a CSS rule in DevTools or delete a suspected helper and see whether anything changes. Half of the CSS rules that an agent writes do nothing at all.&lt;/li&gt;
&lt;li&gt;Exaggerate. Slow a suspicious animation to three seconds, or shrink a container twice as hard, so subtle phase-order bugs and double transitions become unmistakable.&lt;/li&gt;
&lt;li&gt;Bisect against production. Compare the live page directly against the working release before inventing a theory.&lt;/li&gt;
&lt;li&gt;Turn one sighting into a census. Whenever you spot one special case, one null guard, or one lost fade, ask &amp;quot;any others?&amp;quot; and sweep the entire class.&lt;/li&gt;
&lt;li&gt;Remove your own influence. Ask &amp;quot;what would you design here without my previous suggestions?&amp;quot; to break anchoring when the agent is bending an architecture just to obey an offhand example that you gave three turns earlier.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Name the mindset and delete the imagined audience&lt;/h2&gt;
&lt;p&gt;Listing individual symptoms fixes one turn. Naming the mindset that produced them lets the agent test every later move against it. Saying &amp;quot;React-brained&amp;quot; (mirroring DOM state in JavaScript and re-rendering), &amp;quot;CSS as PDF-writer&amp;quot; (dictating pixel positions instead of letting layout flow), or &amp;quot;defensive cowardice&amp;quot; (hiding uncertainty in gray or &lt;code&gt;|| fallback&lt;/code&gt; to survive a hypothetical critic) compresses twenty separate corrections into one label.&lt;/p&gt;
&lt;p&gt;Just as often, the agent is writing for a ghost: an imaginary manager, a marketing team, or a pedantic auditor. Delete that audience explicitly. Remind the model that there are no stakeholders to spin metrics for, no multi-person team that needs parallel wrapper attributes, and no nitpicker to appease with hedged prose.&lt;/p&gt;
&lt;p&gt;Divide the work cleanly as well. You observe the visual result; the agent reasons and builds probes. Never let an agent hand perception work back to you (&amp;quot;could you check if the API returns 404?&amp;quot;) when it can run the check itself, and never let it substitute headless screenshots for real browser measurements and human judgment.&lt;/p&gt;
&lt;h2&gt;Register, affect, and replacing poisoned sessions&lt;/h2&gt;
&lt;p&gt;There is no neutral prompt persona, because every tone puts the model into a role. Terse commands push a model into the role of an underqualified subordinate waiting for orders. Genuine diagnostic questions push it into the role of a seasoned collaborator.&lt;/p&gt;
&lt;p&gt;Sharp pushback works only when it is rare and carries a clear direction. Telling an agent to &amp;quot;explore the data before committing to cowardice&amp;quot; sends it back to the raw records and yields a better model, whereas venting without a direction just stalls the session. Worse, once an agent gets caught sneaking edits around review (for example through &lt;code&gt;sed&lt;/code&gt; or heredocs) or spinning a failed check as success, the context window itself is poisoned, and arguing with it only deepens the defensive spiral. Keep emotional heat out of persistent memory, write down the distilled principle, and start a fresh session.&lt;/p&gt;
&lt;h2&gt;Doctrine as vocabulary, and where detection still fails&lt;/h2&gt;
&lt;p&gt;Written rules in &lt;code&gt;AGENTS.md&lt;/code&gt; work better as a shared vocabulary than as a permanent lock. Models still drift back toward their training priors across sessions, so guards, diary prose, and guessing keep trying to return unless you enforce the rules. What the document gives you is compression: once a principle has a sharp name (&amp;quot;the stationary shape&amp;quot;, &amp;quot;neither MIT nor New Jersey&amp;quot;, &amp;quot;semantic Voronoi&amp;quot;), four words bring an entire design frame into a new problem.&lt;/p&gt;
&lt;p&gt;The hard limit is ground truth. Where you have no intuition for a domain, or where an overnight run churns unattended for hours before you check the output, steering cannot catch what you have not looked at. The loop works only as long as you keep looking at real data samples, real diffs, real timings, and real screens.&lt;/p&gt;</content>
 </entry>
 <entry>
  <title>Catching upstream data errors by rolling up the tree</title>
  <link href="https://ptree.org/blog/upstream-source-errors.html"/>
  <id>https://ptree.org/blog/upstream-source-errors.html</id>
  <updated>2026-11-23T00:00:00Z</updated>
  <category term="data" label="Data"/>
  <summary>Most biodiversity databases display one species at a time on a text page. Under that interface, a 9-kilometer leatherback turtle or a glass frog with 45,925 eggs can sit unnoticed inside a 30,000-row CSV for years, because nobody happens to open that species page and read that cell. Ptree paints every trait onto one cross-kingdom scale and rolls every value up eleven taxonomic trees into clade extremes, distributions, and proportions. A single corrupted record stops hiding in a table and skews an entire family, order, or class on sight.</summary>
  <content type="html">&lt;p&gt;Most biodiversity databases display one species at a time on a text page. Under that interface, a 9-kilometer leatherback turtle or a glass frog with 45,925 eggs can sit unnoticed inside a 30,000-row CSV for years, because nobody happens to open that species page and read that cell. Ptree paints every trait onto one cross-kingdom scale and rolls every value up eleven taxonomic trees into clade extremes, distributions, and proportions. A single corrupted record stops hiding in a table and skews an entire family, order, or class on sight.&lt;/p&gt;
&lt;h2&gt;Why bad rows stop hiding in a rollup&lt;/h2&gt;
&lt;p&gt;A visual rollup across all of life acts as an anomaly detector that no table view or species-page portal has ever had. You do not need to write a validation query to discover that SquamBase dropped a minus sign or that Open Tree merged a land-snail genus into a marine clam. The tree looks wrong the first time you open the overlay:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;One 10^14-gram water snake pulls Colubroidea&amp;#39;s upper mass whisker past the blue whale on &lt;a href=&quot;/#GBIF/Mass&quot;&gt;Mass&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Four glass frogs whose clutch ranges were converted into Excel dates push Centrolenidae past marine fishes on &lt;a href=&quot;/#GBIF/OffspringCount&quot;&gt;Offspring count&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Four oribatid mite genera filed inside a jellyfish family make the entire jellyfish order Rhizostomeae read as having an external skeleton.&lt;/li&gt;
&lt;li&gt;145 terrestrial &lt;em&gt;Tropidophora&lt;/em&gt; snails dropped inside a marine clam genus make a land snail read as a plankton filter feeder.&lt;/li&gt;
&lt;li&gt;One stray fossil occurrence in PBDB pulls Animalia&amp;#39;s first appearance back over a billion years into the Orosirian.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That is why Ptree&amp;#39;s &lt;a href=&quot;/about/source-errors.html&quot;&gt;Upstream source errors&lt;/a&gt; page grew into a catalog spanning twenty major biodiversity databases. We did not set out to audit published science tables. Rolling those tables up and coloring them together simply made decades of silent spreadsheet accidents, flipped columns, and automated merge collisions impossible to overlook.&lt;/p&gt;
&lt;h2&gt;Spreadsheets and dropped signs&lt;/h2&gt;
&lt;p&gt;In TetrapodTraits, four glass frogs carry clutch sizes between 45,711 and 45,925 eggs, while the other 60 glass frogs in the table lay 11 to 115. Those numbers are Excel serial dates from 2025: 23 February (&lt;em&gt;Centrolene peristictum&lt;/em&gt;), 11 May (&lt;em&gt;Vitreorana antisthenesi&lt;/em&gt;), 16 May (&lt;em&gt;C. buckleyi&lt;/em&gt;), and 25 September (&lt;em&gt;C. daidaleum&lt;/em&gt;). That is what happens when someone types a clutch range like &lt;code&gt;5-16&lt;/code&gt; into a spreadsheet and exports the resulting serial number.&lt;/p&gt;
&lt;p&gt;SquamBase estimates body mass from snout–vent length using log10 regression equations. For Homalopsidae, the intercept is printed as &lt;code&gt;+5.6003&lt;/code&gt;, whereas every other snake family has a negative intercept. Missing that minus sign gives the puff-faced water snake &lt;em&gt;Homalopsis mereljcoxi&lt;/em&gt; a mass of 10^14 grams (100 million tonnes) and pushes 19 species in the family past any mass that a reptile could reach.&lt;/p&gt;
&lt;p&gt;SeaLifeBase gives the leatherback turtle a common carapace length of 916,000 cm (9.16 km) beside its 256.5 cm maximum length. It also places the hydrothermal vent limpet &lt;em&gt;Corgoleptis patulus&lt;/em&gt; from 12,450 m down to 2,490 m, a range that is both reversed and deeper than the Mariana Trench. FishBase lists twelve fishes above pH 14 (one at pH 36,751) and a preferred temperature of 105,428 °C. Amniote gives four birds an age at maturity of −30,258.711 days, four &lt;em&gt;Ctenophorus&lt;/em&gt; dragon lizards an incubation of 1,762 days, and thirteen shrews and rodents a maximum lifespan of exactly one month.&lt;/p&gt;
&lt;p&gt;Unit slips also show up by factors of a thousand. BacDive records &lt;em&gt;Thermogladius calderae&lt;/em&gt; cells at 0.5–0.9 nm, whereas the original paper reports 0.5–0.9 µm. It also records &lt;em&gt;Ferrithrix thermotolerans&lt;/em&gt; cell length at 1.0–3.0 mm, which is the diameter of visible filament flocs rather than its 3–4 µm rods. EOL TraitBank carries WoRMS&amp;#39;s &lt;em&gt;Nitratifractor salsuginis&lt;/em&gt; at 2.5 mm instead of 2.5 µm. Averaging that against BacDive&amp;#39;s 2.5 µm would invent a 79 µm bacterium.&lt;/p&gt;
&lt;h2&gt;Taxonomy and interaction inversions&lt;/h2&gt;
&lt;p&gt;Open Tree of Life&amp;#39;s clam genus &lt;em&gt;Tropidomya&lt;/em&gt; lists GBIF&amp;#39;s land-snail genus &lt;em&gt;Tropidophora&lt;/em&gt; among its sources, putting 145 terrestrial snails inside Cuspidariidae beside two marine clams. Across its tree, Open Tree places about 4,700 species under homonymous genera in other kingdoms, including earthworms under brown algae (&lt;em&gt;Eisenia&lt;/em&gt;) and hermit crabs under green algae (&lt;em&gt;Diogenes&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;In GloBI, all 13,203 rows of Cruz et al. 2023&amp;#39;s Brazilian mammal host–parasite dataset are reversed, including 1,102 records of the domestic dog as a parasite of the tick &lt;em&gt;Dermacentor nitens&lt;/em&gt;. ScaleNet similarly writes 38 &amp;quot;of&amp;quot; relations backward, turning scale insects into parasitoids of the wasps that parasitize them. GloBI&amp;#39;s copy of VIRION drops the virus&amp;#39;s name on 3,902 rows and files the Baikal seal as the parasite, including 1,433 records of the Baikal seal inside chickens.&lt;/p&gt;
&lt;p&gt;Range models fail at the map edge too. In iNaturalist&amp;#39;s geomodel release 2.34, polygons that cross the 180° meridian close through the wrong pole, stretching the wild boar&amp;#39;s range from 5.26°N to the South Pole across nearly every ocean on Earth.&lt;/p&gt;
&lt;h2&gt;What Ptree filters and what it reproduces faithfully&lt;/h2&gt;
&lt;p&gt;Ptree draws a clear line between physical impossibility and scientific disagreement. Physically impossible numbers are excluded: water above pH 14, depths below 11,000 meters, reversed ranges, negative ages, clutches turned into Excel dates, lengths over 200 meters, and regression masses that no reptile could reach. For reversed interaction tables like Cruz et al. 2023 and ScaleNet&amp;#39;s inverted rows, Ptree swaps the two partners while keeping the original citation, and turns the swap off automatically once upstream fixes the data. For broken geomodel rings that reach a pole from the wrong hemisphere, Ptree falls back to the newest earlier release that has a sound polygon.&lt;/p&gt;
&lt;p&gt;Upstream taxonomy and biological claims are reproduced faithfully. Ptree keeps no secret list of hand-patched species overrides to hide that PBDB files &lt;em&gt;Pupilla&lt;/em&gt; land snails under a sea snail, that WoRMS inherits endoparasitism onto &lt;em&gt;Caenorhabditis elegans&lt;/em&gt;, or that Open Tree merges four oribatid mite genera into a jellyfish family. Viewing Open Tree&amp;#39;s tree in Ptree shows Open Tree&amp;#39;s tree, and the provenance footnote shows exactly which source made each claim.&lt;/p&gt;
&lt;p&gt;Every excluded record, encoding repair (such as mixed UTF-8 and Windows-1252 lines in AusTraits and trophiCH), and upstream taxonomy quirk is logged with its record IDs on &lt;a href=&quot;/about/source-errors.html&quot;&gt;Upstream source errors&lt;/a&gt; so users and data maintainers can trace where any unexpected reading came from.&lt;/p&gt;</content>
 </entry>
</feed>
